dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/edid: add support for min horizontal rate equal to max horizontal rate
@ 2020-06-08 19:57 Cyrus Lien
  2020-06-09 14:57 ` Ville Syrjälä
  0 siblings, 1 reply; 4+ messages in thread
From: Cyrus Lien @ 2020-06-08 19:57 UTC (permalink / raw)
  To: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
	David Airlie, Daniel Vetter, dri-devel, linux-kernel

According to EDID spec, table 3.26, byte #6 and #8, which said "Minimum
rate value shall be less than or equal to maximum rate value". The minimum
horizontal/vertical rate value is able to be equal to maximum horizontal/
veritcal rate value.

This change check if h/v-sync excess maximum horizontal/vertical rate if
hmin equal to hmax or vmin equal to vmax.

Signed-off-by: Cyrus Lien <cyrus.lien@canonical.com>
---
 drivers/gpu/drm/drm_edid.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
index fed653f13c26..23878320eabd 100644
--- a/drivers/gpu/drm/drm_edid.c
+++ b/drivers/gpu/drm/drm_edid.c
@@ -2674,6 +2674,9 @@ mode_in_hsync_range(const struct drm_display_mode *mode,
 	    hmax += ((t[4] & 0x08) ? 255 : 0);
 	hsync = drm_mode_hsync(mode);
 
+	if (hmax == hmin)
+		return (hsync <= hmax);
+
 	return (hsync <= hmax && hsync >= hmin);
 }
 
@@ -2691,6 +2694,9 @@ mode_in_vsync_range(const struct drm_display_mode *mode,
 	    vmax += ((t[4] & 0x02) ? 255 : 0);
 	vsync = drm_mode_vrefresh(mode);
 
+	if (vmax == vmin)
+		return (vsync <= vmax);
+
 	return (vsync <= vmax && vsync >= vmin);
 }
 
-- 
2.25.1

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-06-17 17:56 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-08 19:57 [PATCH] drm/edid: add support for min horizontal rate equal to max horizontal rate Cyrus Lien
2020-06-09 14:57 ` Ville Syrjälä
2020-06-17 16:58   ` Cyrus Lien
2020-06-17 17:56     ` Ville Syrjälä

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).