Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Imre Deak <imre.deak@intel.com>
To: <intel-gfx@lists.freedesktop.org>,
	<intel-xe@lists.freedesktop.org>,
	<dri-devel@lists.freedesktop.org>
Cc: "Ville Syrjälä" <ville.syrjala@linux.intel.com>,
	"Jani Nikula" <jani.nikula@linux.intel.com>
Subject: [PATCH v3 3/5] drm/edid: Add support for quirks visible to DRM core and drivers
Date: Thu, 5 Jun 2025 11:28:48 +0300	[thread overview]
Message-ID: <20250605082850.65136-4-imre.deak@intel.com> (raw)
In-Reply-To: <20250605082850.65136-1-imre.deak@intel.com>

Add support for EDID based quirks which can be queried outside of the
EDID parser iteself by DRM core and drivers. There are at least two such
quirks applicable to all drivers: the DPCD register access probe quirk
and the 128b/132b DPRX Lane Count Conversion quirk (see 3.5.2.16.3 in
the v2.1a DP Standard). The latter quirk applies to panels with specific
EDID panel names, support for defining a quirk this way will be added as
a follow-up.

v2: Reset global_quirks in drm_reset_display_info().
v3: (Jani)
- Use one list for both the global and internal quirks.
- Drop change for panel name specific quirks.
- Add comment about the way quirks should be queried.

Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Cc: Jani Nikula <jani.nikula@linux.intel.com>
Signed-off-by: Imre Deak <imre.deak@intel.com>
---
 drivers/gpu/drm/drm_edid.c  | 8 +++++++-
 include/drm/drm_connector.h | 4 +++-
 include/drm/drm_edid.h      | 5 +++++
 3 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
index 857ae0c47a1c3..9cca1e6e4736c 100644
--- a/drivers/gpu/drm/drm_edid.c
+++ b/drivers/gpu/drm/drm_edid.c
@@ -68,7 +68,7 @@ static int oui(u8 first, u8 second, u8 third)
 
 enum drm_edid_internal_quirk {
 	/* First detailed mode wrong, use largest 60Hz mode */
-	EDID_QUIRK_PREFER_LARGE_60,
+	EDID_QUIRK_PREFER_LARGE_60 = DRM_EDID_QUIRK_NUM,
 	/* Reported 135MHz pixel clock is too high, needs adjustment */
 	EDID_QUIRK_135_CLOCK_TOO_HIGH,
 	/* Prefer the largest mode at 75 Hz */
@@ -2959,6 +2959,12 @@ static bool drm_edid_has_internal_quirk(struct drm_connector *connector,
 	return connector->display_info.quirks & BIT(quirk);
 }
 
+bool drm_edid_has_quirk(struct drm_connector *connector, enum drm_edid_quirk quirk)
+{
+	return connector->display_info.quirks & BIT(quirk);
+}
+EXPORT_SYMBOL(drm_edid_has_quirk);
+
 #define MODE_SIZE(m) ((m)->hdisplay * (m)->vdisplay)
 #define MODE_REFRESH_DIFF(c,t) (abs((c) - (t)))
 
diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h
index 73903c3c842f3..137773dd138ea 100644
--- a/include/drm/drm_connector.h
+++ b/include/drm/drm_connector.h
@@ -843,7 +843,9 @@ struct drm_display_info {
 	int vics_len;
 
 	/**
-	 * @quirks: EDID based quirks. Internal to EDID parsing.
+	 * @quirks: EDID based quirks. DRM core and drivers can query the
+	 * @drm_edid_quirk quirks using drm_edid_has_quirk(), the rest of
+	 * the quirks also tracked here are internal to EDID parsing.
 	 */
 	u32 quirks;
 
diff --git a/include/drm/drm_edid.h b/include/drm/drm_edid.h
index b38409670868d..77fd42608e706 100644
--- a/include/drm/drm_edid.h
+++ b/include/drm/drm_edid.h
@@ -109,6 +109,10 @@ struct detailed_data_string {
 #define DRM_EDID_CVT_FLAGS_STANDARD_BLANKING (1 << 3)
 #define DRM_EDID_CVT_FLAGS_REDUCED_BLANKING  (1 << 4)
 
+enum drm_edid_quirk {
+	DRM_EDID_QUIRK_NUM,
+};
+
 struct detailed_data_monitor_range {
 	u8 min_vfreq;
 	u8 max_vfreq;
@@ -476,5 +480,6 @@ void drm_edid_print_product_id(struct drm_printer *p,
 u32 drm_edid_get_panel_id(const struct drm_edid *drm_edid);
 bool drm_edid_match(const struct drm_edid *drm_edid,
 		    const struct drm_edid_ident *ident);
+bool drm_edid_has_quirk(struct drm_connector *connector, enum drm_edid_quirk quirk);
 
 #endif /* __DRM_EDID_H__ */
-- 
2.44.2


  parent reply	other threads:[~2025-06-05  8:29 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-05  8:28 [PATCH v3 0/5] drm/dp: Limit the DPCD probe quirk to the affected monitor Imre Deak
2025-06-05  8:28 ` [PATCH v3 1/5] drm/dp: Change AUX DPCD probe address from DPCD_REV to LANE0_1_STATUS Imre Deak
2025-06-05  8:28 ` [PATCH v3 2/5] drm/edid: Define the quirks in an enum list Imre Deak
2025-06-05 13:05   ` Jani Nikula
2025-06-05 13:06   ` Jani Nikula
2025-06-05  8:28 ` Imre Deak [this message]
2025-06-05 13:07   ` [PATCH v3 3/5] drm/edid: Add support for quirks visible to DRM core and drivers Jani Nikula
2025-06-05 13:23     ` Imre Deak
2025-06-05  8:28 ` [PATCH v3 4/5] drm/dp: Add an EDID quirk for the DPCD register access probe Imre Deak
2025-06-05 13:11   ` Jani Nikula
2025-06-05 13:33     ` Imre Deak
2025-06-09 12:55   ` [PATCH v4 " Imre Deak
2025-06-05  8:28 ` [PATCH v3 5/5] drm/i915/dp: Disable the AUX DPCD probe quirk if it's not required Imre Deak
2025-06-05 13:13   ` Jani Nikula
2025-06-06 13:44   ` Jani Nikula
2025-06-06 13:50     ` Imre Deak
2025-06-06 13:55       ` Imre Deak
2025-06-06 14:04         ` Jani Nikula
2025-06-06 14:34           ` Imre Deak
2025-06-09 12:55   ` [PATCH v4 " Imre Deak
2025-06-10 13:39     ` Kahola, Mika
2025-06-11 13:06       ` Jani Nikula
2025-06-05 10:36 ` ✓ CI.Patch_applied: success for drm/dp: Limit the DPCD probe quirk to the affected monitor (rev4) Patchwork
2025-06-05 10:36 ` ✗ CI.checkpatch: warning " Patchwork
2025-06-05 10:38 ` ✓ CI.KUnit: success " Patchwork
2025-06-05 10:48 ` ✓ CI.Build: " Patchwork
2025-06-05 10:51 ` ✓ CI.Hooks: " Patchwork
2025-06-05 10:52 ` ✗ CI.checksparse: warning " Patchwork
2025-06-05 11:43 ` ✓ Xe.CI.BAT: success " Patchwork
2025-06-06 20:13 ` ✗ Xe.CI.Full: failure " Patchwork
2025-06-09 17:12 ` ✓ CI.Patch_applied: success for drm/dp: Limit the DPCD probe quirk to the affected monitor (rev6) Patchwork
2025-06-09 17:12 ` ✗ CI.checkpatch: warning " Patchwork
2025-06-09 17:13 ` ✓ CI.KUnit: success " Patchwork
2025-06-09 17:24 ` ✓ CI.Build: " Patchwork
2025-06-09 17:27 ` ✓ CI.Hooks: " Patchwork
2025-06-09 17:28 ` ✗ CI.checksparse: warning " Patchwork
2025-06-09 18:05 ` ✓ Xe.CI.BAT: success " Patchwork
2025-06-09 19:44 ` ✗ Xe.CI.Full: failure " Patchwork
2025-06-10 15:42 ` [PATCH v3 0/5] drm/dp: Limit the DPCD probe quirk to the affected monitor Imre Deak
2025-06-12 13:29   ` Imre Deak
2025-06-12 13:54     ` Thomas Zimmermann
2025-06-12 17:56       ` Imre Deak

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=20250605082850.65136-4-imre.deak@intel.com \
    --to=imre.deak@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=jani.nikula@linux.intel.com \
    --cc=ville.syrjala@linux.intel.com \
    /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