[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20181218073339.12160-1-kraxel@redhat.com>
Date: Tue, 18 Dec 2018 08:33:39 +0100
From: Gerd Hoffmann <kraxel@...hat.com>
To: dri-devel@...ts.freedesktop.org
Cc: Gerd Hoffmann <kraxel@...hat.com>, David Airlie <airlied@...ux.ie>,
virtualization@...ts.linux-foundation.org (open list:DRM DRIVER FOR
BOCHS VIRTUAL GPU), linux-kernel@...r.kernel.org (open list)
Subject: [PATCH] drm/bochs: add edid present check
Check first two header bytes before trying to read the edid blob,
to avoid the log being spammed in case qemu has no edid support (old
qemu or edid turned off).
Fixes: 01f23459cf drm/bochs: add edid support.
Signed-off-by: Gerd Hoffmann <kraxel@...hat.com>
---
drivers/gpu/drm/bochs/bochs_hw.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/gpu/drm/bochs/bochs_hw.c b/drivers/gpu/drm/bochs/bochs_hw.c
index c90a0d492f..f91e049625 100644
--- a/drivers/gpu/drm/bochs/bochs_hw.c
+++ b/drivers/gpu/drm/bochs/bochs_hw.c
@@ -89,6 +89,10 @@ int bochs_hw_load_edid(struct bochs_device *bochs)
if (!bochs->mmio)
return -1;
+ if (readb(bochs->mmio + 0) != 0x00 ||
+ readb(bochs->mmio + 1) != 0xff)
+ return -1;
+
kfree(bochs->edid);
bochs->edid = drm_do_get_edid(&bochs->connector,
bochs_get_edid_block, bochs);
--
2.9.3
Powered by blists - more mailing lists