Message ID | 20210427150824.638359-5-kraxel@redhat.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | edid: windows fixes | expand |
On Tue, Apr 27, 2021 at 7:23 PM Gerd Hoffmann <kraxel@redhat.com> wrote: > 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> --- > hw/display/edid-generate.c | 8 ++++++++ > 1 file changed, 8 insertions(+) > > diff --git a/hw/display/edid-generate.c b/hw/display/edid-generate.c > index 25f790c7bd85..42a130f0ff5c 100644 > --- a/hw/display/edid-generate.c > +++ b/hw/display/edid-generate.c > @@ -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; > } > > -- > 2.30.2 > > >
diff --git a/hw/display/edid-generate.c b/hw/display/edid-generate.c index 25f790c7bd85..42a130f0ff5c 100644 --- a/hw/display/edid-generate.c +++ b/hw/display/edid-generate.c @@ -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; }
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> --- hw/display/edid-generate.c | 8 ++++++++ 1 file changed, 8 insertions(+)