Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Ville Syrjala <ville.syrjala@linux.intel.com>
To: intel-gfx@lists.freedesktop.org
Subject: [Intel-gfx] [PATCH] drm/i915: Allow panel fixed modes to have differing sync polarities
Date: Fri,  7 Oct 2022 01:54:13 +0300	[thread overview]
Message-ID: <20221006225413.27731-1-ville.syrjala@linux.intel.com> (raw)

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

Apparently some panels declare multiple modes with random
sync polarities. Seems a bit weird, but looks like Windows/GOP
doesn't care, so let follow suit and accept alternate fixed
modes regardless of their sync polarities.

Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/6968
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/i915/display/intel_panel.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_panel.c b/drivers/gpu/drm/i915/display/intel_panel.c
index 2b4b359b8342..fdeb1cd608c3 100644
--- a/drivers/gpu/drm/i915/display/intel_panel.c
+++ b/drivers/gpu/drm/i915/display/intel_panel.c
@@ -82,12 +82,16 @@ static bool is_alt_drrs_mode(const struct drm_display_mode *mode,
 		mode->clock != preferred_mode->clock;
 }
 
+#define DRM_MODE_FLAG_SYNC_MASK (DRM_MODE_FLAG_PHSYNC | \
+				 DRM_MODE_FLAG_NHSYNC | \
+				 DRM_MODE_FLAG_PVSYNC | \
+				 DRM_MODE_FLAG_NVSYNC)
+
 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) &&
+	return (mode->flags & ~DRM_MODE_FLAG_SYNC_MASK) ==
+		(preferred_mode->flags & ~DRM_MODE_FLAG_SYNC_MASK) &&
 		mode->hdisplay == preferred_mode->hdisplay &&
 		mode->vdisplay == preferred_mode->vdisplay;
 }
-- 
2.35.1


             reply	other threads:[~2022-10-06 22:54 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-06 22:54 Ville Syrjala [this message]
2022-10-07  0:28 ` [Intel-gfx] ✓ Fi.CI.BAT: success for drm/i915: Allow panel fixed modes to have differing sync polarities Patchwork
2022-10-07 10:43 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork
2022-10-13  6:46 ` [Intel-gfx] [PATCH] " Jani Nikula
2022-10-20  8:33   ` Ville Syrjälä
2022-10-20  9:39 ` [Intel-gfx] [PATCH v2] " Ville Syrjala
2022-10-20 11:48 ` [Intel-gfx] ✓ Fi.CI.BAT: success for drm/i915: Allow panel fixed modes to have differing sync polarities (rev2) Patchwork
2022-10-20 13:57 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221006225413.27731-1-ville.syrjala@linux.intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox