Commit 7064fef5 authored by Jesse Barnes's avatar Jesse Barnes Committed by Dave Airlie

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: default avatarJesse Barnes <jbarnes@virtuousgeek.org>
Cc: stable@kernel.org
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
parent 0ebf1717
...@@ -662,6 +662,12 @@ static struct drm_display_mode *drm_mode_detailed(struct drm_device *dev, ...@@ -662,6 +662,12 @@ static struct drm_display_mode *drm_mode_detailed(struct drm_device *dev,
return NULL; 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); drm_mode_set_name(mode);
if (pt->misc & DRM_EDID_PT_INTERLACED) if (pt->misc & DRM_EDID_PT_INTERLACED)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment