VESA DMT defines 1920x1080@60Hz (DMT ID 0x52) as the CTA-861 1080p
timing (VIC 16), with positive horizontal and vertical sync. The DMT
mode table has both polarities negative instead.

Since drm_match_cea_mode() also compares sync flags, a 1920x1080@60Hz
mode created from an EDID standard timing doesn't match VIC 16 and ends
up as a separate mode next to the one from the CTA Video Data Block. When
userspace picks it, the sink receives the wrong sync polarities, and
because the mode isn't recognized as a CTA format, the AVI InfoFrame
carries no VIC and RGB output uses full instead of limited quantization
range.

Use positive sync polarities, as defined by VESA DMT.

Fixes: bfcd74d2aeda ("drm/edid: Add DMT modes with ID > 0x50")
Signed-off-by: Jernej Skrabec <[email protected]>
---
 drivers/gpu/drm/drm_edid.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
index b8f882a17c8f..7adaa428163f 100644
--- a/drivers/gpu/drm/drm_edid.c
+++ b/drivers/gpu/drm/drm_edid.c
@@ -607,7 +607,7 @@ static const struct drm_display_mode drm_dmt_modes[] = {
        /* 0x52 - 1920x1080@60Hz */
        { DRM_MODE("1920x1080", DRM_MODE_TYPE_DRIVER, 148500, 1920, 2008,
                   2052, 2200, 0, 1080, 1084, 1089, 1125, 0,
-                  DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC) },
+                  DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC) },
        /* 0x44 - 1920x1200@60Hz RB */
        { DRM_MODE("1920x1200", DRM_MODE_TYPE_DRIVER, 154000, 1920, 1968,
                   2000, 2080, 0, 1200, 1203, 1209, 1235, 0,
-- 
2.43.0

Reply via email to