summaryrefslogtreecommitdiff
path: root/sys/dev/pci/drm
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2023-02-02 04:00:21 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2023-02-02 04:00:21 +0000
commit4fa952caa946168c3df6a8bf6cfac15f41498470 (patch)
tree24337f540cbc6161770be3ee4a5b565dbf8d3c2f /sys/dev/pci/drm
parentf22183a124476ecf34f0f5a4d36da0c2931a838b (diff)
drm/i915: Allow panel fixed modes to have differing sync polarities
From Ville Syrjala 7fa092a05791b17414e8888a07b1e3ef3f86633e in linux-6.1.y/6.1.9 2bd0db4b3f0bd529f75b32538fc5a3775e3591c0 in mainline linux
Diffstat (limited to 'sys/dev/pci/drm')
-rw-r--r--sys/dev/pci/drm/i915/display/intel_panel.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/dev/pci/drm/i915/display/intel_panel.c b/sys/dev/pci/drm/i915/display/intel_panel.c
index 41cec9dc422..f72f4646c0d 100644
--- a/sys/dev/pci/drm/i915/display/intel_panel.c
+++ b/sys/dev/pci/drm/i915/display/intel_panel.c
@@ -85,9 +85,10 @@ static bool is_alt_drrs_mode(const struct drm_display_mode *mode,
static bool is_alt_fixed_mode(const struct drm_display_mode *mode,
const struct drm_display_mode *preferred_mode)
{
- return drm_mode_match(mode, preferred_mode,
- DRM_MODE_MATCH_FLAGS |
- DRM_MODE_MATCH_3D_FLAGS) &&
+ u32 sync_flags = DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_NHSYNC |
+ DRM_MODE_FLAG_PVSYNC | DRM_MODE_FLAG_NVSYNC;
+
+ return (mode->flags & ~sync_flags) == (preferred_mode->flags & ~sync_flags) &&
mode->hdisplay == preferred_mode->hdisplay &&
mode->vdisplay == preferred_mode->vdisplay;
}