]> xenbits.xensource.com Git - qemu-xen.git/commitdiff
edid: use dta extension block descriptors
authorGerd Hoffmann <kraxel@redhat.com>
Tue, 27 Apr 2021 15:08:20 +0000 (17:08 +0200)
committerGerd Hoffmann <kraxel@redhat.com>
Mon, 10 May 2021 09:41:02 +0000 (11:41 +0200)
When the 4 descriptors in the base edid block are filled, jump to the
dta extension block.  This allows for more than four descriptors.
Happens for example when generating an edid blob with a serial number
(qemu-edid -s $serial).

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-id: 20210427150824.638359-1-kraxel@redhat.com
Message-Id: <20210427150824.638359-5-kraxel@redhat.com>

hw/display/edid-generate.c

index 25f790c7bd851c1f888ab7610a4d9652c58098f0..42a130f0ff5c0ea815069659f2b827b5098587c6 100644 (file)
@@ -152,6 +152,14 @@ static uint8_t *edid_desc_next(uint8_t *edid, uint8_t *dta, uint8_t *desc)
     if (desc + 18 + 18 < edid + 127) {
         return desc + 18;
     }
+    if (dta) {
+        if (desc < edid + 127) {
+            return dta + dta[2];
+        }
+        if (desc + 18 + 18 < dta + 127) {
+            return desc + 18;
+        }
+    }
     return NULL;
 }