From: Jesse Barnes Date: Thu, 5 Nov 2009 18:12:54 +0000 (-0800) Subject: drm: work around EDIDs with bad htotal/vtotal values X-Git-Tag: v2.6.32~51^2~7 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7064fef56369c9e2c6e35ff6d6b4b63d42a859ce;p=profile%2Fcommon%2Fkernel-common.git drm: work around EDIDs with bad htotal/vtotal values We did this on the userspace side, but we need a similar fix for the kernel. Fixes LP #460664. Signed-off-by: Jesse Barnes Cc: stable@kernel.org Signed-off-by: Dave Airlie --- diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c index cea665d..b54ba63 100644 --- a/drivers/gpu/drm/drm_edid.c +++ b/drivers/gpu/drm/drm_edid.c @@ -662,6 +662,12 @@ static struct drm_display_mode *drm_mode_detailed(struct drm_device *dev, return NULL; } + /* Some EDIDs have bogus h/vtotal values */ + if (mode->hsync_end > mode->htotal) + mode->htotal = mode->hsync_end + 1; + if (mode->vsync_end > mode->vtotal) + mode->vtotal = mode->vsync_end + 1; + drm_mode_set_name(mode); if (pt->misc & DRM_EDID_PT_INTERLACED)