]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
drm: work around EDIDs with bad htotal/vtotal values
authorJesse Barnes <jbarnes@virtuousgeek.org>
Thu, 5 Nov 2009 18:12:54 +0000 (10:12 -0800)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 8 Dec 2009 18:21:56 +0000 (10:21 -0800)
commit 7064fef56369c9e2c6e35ff6d6b4b63d42a859ce upstream.

We did this on the userspace side, but we need a similar fix for the
kernel.

Fixes LP #460664.

Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/gpu/drm/drm_edid.c

index 7f2728bbc16c7078e7e249d54f68743c228d4f55..55fb98d179ef9f74db4b023cc72984a649626d07 100644 (file)
@@ -333,6 +333,12 @@ static struct drm_display_mode *drm_mode_detailed(struct drm_device *dev,
        mode->vsync_end = mode->vsync_start + vsync_pulse_width;
        mode->vtotal = mode->vdisplay + vblank;
 
+       /* 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)