di-edid-decode: only print serial number if non-zero

Upstream edid-decode hides the serial number in this case.

The spec says that it's optional, and set to zero when unused.

Signed-off-by: Simon Ser <contact@emersion.fr>
This commit is contained in:
Simon Ser 2022-06-06 17:36:34 +02:00
parent 10435a83e8
commit 742697cb98
2 changed files with 4 additions and 2 deletions

View file

@ -168,7 +168,9 @@ main(void)
printf(" Vendor & Product Identification:\n");
printf(" Manufacturer: %.3s\n", vendor_product->manufacturer);
printf(" Model: %" PRIu16 "\n", vendor_product->product);
printf(" Serial Number: %" PRIu32 "\n", vendor_product->serial);
if (vendor_product->serial != 0) {
printf(" Serial Number: %" PRIu32 "\n", vendor_product->serial);
}
if (vendor_product->model_year != 0) {
printf(" Model year: %d\n", vendor_product->model_year);
} else {

View file

@ -36,7 +36,7 @@ di_edid_get_revision(const struct di_edid *edid);
struct di_edid_vendor_product {
char manufacturer[3];
uint16_t product;
uint32_t serial;
uint32_t serial; /* zero if unset */
/* These fields are zero if unset */
int manufacture_week;