diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2018-12-20 11:11:21 +0100 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2018-12-20 13:25:28 +0100 |
commit | 70bce993a7aa57c00798d8f13ebbbddd81cbbef9 (patch) | |
tree | 0a64132be82aadd5e7b86971c1c078ffe00a5fef | |
parent | db999538fdb0679629d90652f8a1437df1e85a7d (diff) | |
download | linux-70bce993a7aa57c00798d8f13ebbbddd81cbbef9.tar.bz2 |
drm/bochs: add edid present check
Check header before trying to read the complete edid blob, to avoid the
log being spammed in case qemu has no edid support (old qemu or edid
support turned off).
Fixes: 01f23459cf drm/bochs: add edid support.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20181220101122.16153-1-kraxel@redhat.com
-rw-r--r-- | drivers/gpu/drm/bochs/bochs_hw.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/gpu/drm/bochs/bochs_hw.c b/drivers/gpu/drm/bochs/bochs_hw.c index c90a0d492fd5..d0b4e1cee83e 100644 --- a/drivers/gpu/drm/bochs/bochs_hw.c +++ b/drivers/gpu/drm/bochs/bochs_hw.c @@ -86,9 +86,16 @@ static int bochs_get_edid_block(void *data, u8 *buf, int bochs_hw_load_edid(struct bochs_device *bochs) { + u8 header[8]; + if (!bochs->mmio) return -1; + /* check header to detect whenever edid support is enabled in qemu */ + bochs_get_edid_block(bochs, header, 0, ARRAY_SIZE(header)); + if (drm_edid_header_is_valid(header) != 8) + return -1; + kfree(bochs->edid); bochs->edid = drm_do_get_edid(&bochs->connector, bochs_get_edid_block, bochs); |