[PATCH] drm/edid : calculate vsync and hsync from range limits block according to the EDID 1.4

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Do calculation of vsync and hsync from range limits
EDID block according to the spec. EDID 1.4.

Signed-off-by: Vitaly Prosyak <vitaly.prosyak@xxxxxxx>
---
 drivers/gpu/drm/drm_edid.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
index 7e49962..601152b 100644
--- a/drivers/gpu/drm/drm_edid.c
+++ b/drivers/gpu/drm/drm_edid.c
@@ -1977,11 +1977,11 @@ mode_in_hsync_range(const struct drm_display_mode *mode,
 	int hsync, hmin, hmax;
 
 	hmin = t[7];
-	if (edid->revision >= 4)
-	    hmin += ((t[4] & 0x04) ? 255 : 0);
+	if (edid->revision >= 4 && ((t[4] & 0x0c) == 0x0c))
+	    hmin += 255 ;
 	hmax = t[8];
-	if (edid->revision >= 4)
-	    hmax += ((t[4] & 0x08) ? 255 : 0);
+	if (edid->revision >= 4 && (t[4] & 0x08))
+	    hmax += 255;
 	hsync = drm_mode_hsync(mode);
 
 	return (hsync <= hmax && hsync >= hmin);
@@ -1994,11 +1994,11 @@ mode_in_vsync_range(const struct drm_display_mode *mode,
 	int vsync, vmin, vmax;
 
 	vmin = t[5];
-	if (edid->revision >= 4)
-	    vmin += ((t[4] & 0x01) ? 255 : 0);
+	if (edid->revision >= 4 && ((t[4] & 0x03) == 0x03))
+	    vmin += 255;
 	vmax = t[6];
-	if (edid->revision >= 4)
-	    vmax += ((t[4] & 0x02) ? 255 : 0);
+	if (edid->revision >= 4 && (t[4] & 0x02))
+	    vmax += 255;
 	vsync = drm_mode_vrefresh(mode);
 
 	return (vsync <= vmax && vsync >= vmin);
-- 
1.9.1

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




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux