Merge tag 'drm-misc-next-2023-09-27' of git://anongit.freedesktop.org/drm/drm-misc...
[linux-2.6-microblaze.git] / drivers / gpu / drm / drm_edid.c
index 340da82..6e587f5 100644 (file)
@@ -3496,11 +3496,19 @@ static struct drm_display_mode *drm_mode_detailed(struct drm_connector *connecto
        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;
+       /* Some EDIDs have bogus h/vsync_end values */
+       if (mode->hsync_end > mode->htotal) {
+               drm_dbg_kms(dev, "[CONNECTOR:%d:%s] reducing hsync_end %d->%d\n",
+                           connector->base.id, connector->name,
+                           mode->hsync_end, mode->htotal);
+               mode->hsync_end = mode->htotal;
+       }
+       if (mode->vsync_end > mode->vtotal) {
+               drm_dbg_kms(dev, "[CONNECTOR:%d:%s] reducing vsync_end %d->%d\n",
+                           connector->base.id, connector->name,
+                           mode->vsync_end, mode->vtotal);
+               mode->vsync_end = mode->vtotal;
+       }
 
        drm_mode_do_interlace_quirk(mode, pt);