Skip to content

Commit ca62297

Browse files
committed
drm/edid: Fix csync detailed mode parsing
Remove the bogus csync check and replace it with something that: - triggers for all forms of csync, not just the basic analog variant - actually populates the mode csync flags so that drivers can decide what to do with the mode Originally the code tried to outright reject csync, but that apparently broke some bogus LCD monitor that claimed to have a detailed mode that uses analog csync, despite also claiming the monitor only support separate sync: https://bugzilla.redhat.com/show_bug.cgi?id=540024 Potentially that monitor should just be quirked or something. Anyways, what we are dealing with now is some kind of funny i915 JSL machine with eDP where the panel claims to support a sensible 60Hz separate sync mode, and a 50Hz mode with bipolar analog csync. The 50Hz mode does not work so we want to not use it. Easiest way is to just correctly flag it as csync and the driver will reject it. TODO: or should we just reject any form of csync (or at least the analog variants) for digital display interfaces? v2: Grab digital csync polarity from hsync polarity bit (Jani) Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/8146 Reviewed-by: Jani Nikula <[email protected]> Signed-off-by: Ville Syrjälä <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 5abaa68 commit ca62297

File tree

2 files changed

+30
-11
lines changed

2 files changed

+30
-11
lines changed

drivers/gpu/drm/drm_edid.c

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3424,10 +3424,6 @@ static struct drm_display_mode *drm_mode_detailed(struct drm_connector *connecto
34243424
connector->base.id, connector->name);
34253425
return NULL;
34263426
}
3427-
if (!(pt->misc & DRM_EDID_PT_SEPARATE_SYNC)) {
3428-
drm_dbg_kms(dev, "[CONNECTOR:%d:%s] Composite sync not supported\n",
3429-
connector->base.id, connector->name);
3430-
}
34313427

34323428
/* it is incorrect if hsync/vsync width is zero */
34333429
if (!hsync_pulse_width || !vsync_pulse_width) {
@@ -3474,10 +3470,27 @@ static struct drm_display_mode *drm_mode_detailed(struct drm_connector *connecto
34743470
if (info->quirks & EDID_QUIRK_DETAILED_SYNC_PP) {
34753471
mode->flags |= DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC;
34763472
} else {
3477-
mode->flags |= (pt->misc & DRM_EDID_PT_HSYNC_POSITIVE) ?
3478-
DRM_MODE_FLAG_PHSYNC : DRM_MODE_FLAG_NHSYNC;
3479-
mode->flags |= (pt->misc & DRM_EDID_PT_VSYNC_POSITIVE) ?
3480-
DRM_MODE_FLAG_PVSYNC : DRM_MODE_FLAG_NVSYNC;
3473+
switch (pt->misc & DRM_EDID_PT_SYNC_MASK) {
3474+
case DRM_EDID_PT_ANALOG_CSYNC:
3475+
case DRM_EDID_PT_BIPOLAR_ANALOG_CSYNC:
3476+
drm_dbg_kms(dev, "[CONNECTOR:%d:%s] Analog composite sync!\n",
3477+
connector->base.id, connector->name);
3478+
mode->flags |= DRM_MODE_FLAG_CSYNC | DRM_MODE_FLAG_NCSYNC;
3479+
break;
3480+
case DRM_EDID_PT_DIGITAL_CSYNC:
3481+
drm_dbg_kms(dev, "[CONNECTOR:%d:%s] Digital composite sync!\n",
3482+
connector->base.id, connector->name);
3483+
mode->flags |= DRM_MODE_FLAG_CSYNC;
3484+
mode->flags |= (pt->misc & DRM_EDID_PT_HSYNC_POSITIVE) ?
3485+
DRM_MODE_FLAG_PCSYNC : DRM_MODE_FLAG_NCSYNC;
3486+
break;
3487+
case DRM_EDID_PT_DIGITAL_SEPARATE_SYNC:
3488+
mode->flags |= (pt->misc & DRM_EDID_PT_HSYNC_POSITIVE) ?
3489+
DRM_MODE_FLAG_PHSYNC : DRM_MODE_FLAG_NHSYNC;
3490+
mode->flags |= (pt->misc & DRM_EDID_PT_VSYNC_POSITIVE) ?
3491+
DRM_MODE_FLAG_PVSYNC : DRM_MODE_FLAG_NVSYNC;
3492+
break;
3493+
}
34813494
}
34823495

34833496
set_size:

include/drm/drm_edid.h

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,15 @@ struct std_timing {
6161
u8 vfreq_aspect;
6262
} __attribute__((packed));
6363

64-
#define DRM_EDID_PT_HSYNC_POSITIVE (1 << 1)
65-
#define DRM_EDID_PT_VSYNC_POSITIVE (1 << 2)
66-
#define DRM_EDID_PT_SEPARATE_SYNC (3 << 3)
64+
#define DRM_EDID_PT_SYNC_MASK (3 << 3)
65+
# define DRM_EDID_PT_ANALOG_CSYNC (0 << 3)
66+
# define DRM_EDID_PT_BIPOLAR_ANALOG_CSYNC (1 << 3)
67+
# define DRM_EDID_PT_DIGITAL_CSYNC (2 << 3)
68+
# define DRM_EDID_PT_CSYNC_ON_RGB (1 << 1) /* analog csync only */
69+
# define DRM_EDID_PT_CSYNC_SERRATE (1 << 2)
70+
# define DRM_EDID_PT_DIGITAL_SEPARATE_SYNC (3 << 3)
71+
# define DRM_EDID_PT_HSYNC_POSITIVE (1 << 1) /* also digital csync */
72+
# define DRM_EDID_PT_VSYNC_POSITIVE (1 << 2)
6773
#define DRM_EDID_PT_STEREO (1 << 5)
6874
#define DRM_EDID_PT_INTERLACED (1 << 7)
6975

0 commit comments

Comments
 (0)