From: Suraj Kandpal <suraj.kandpal@intel.com>
To: intel-xe@lists.freedesktop.org, intel-gfx@lists.freedesktop.org
Cc: jani.nikula@intel.com, ankit.k.nautiyal@intel.com,
Suraj Kandpal <suraj.kandpal@intel.com>
Subject: [PATCH v3 3/3] drm/i915/edp: eDP Data Overrride
Date: Thu, 31 Jul 2025 10:46:46 +0530 [thread overview]
Message-ID: <20250731051646.3009255-4-suraj.kandpal@intel.com> (raw)
In-Reply-To: <20250731051646.3009255-1-suraj.kandpal@intel.com>
We need override certain link rates in favour of the next available
higher link rate. The Link rates that need to be overridden are
indicated by a mask in VBT. To make sure these modes are skipped we
don't add them in them in the sink rates array.
--v2
-Update the link rates after we have a final set of link rates [Ankit]
-Break this patch up [Ankit]
-Optimize the assingment during loop [Ankit]
--v3
-Add protection against broken VBTs [Jani]
Signed-off-by: Suraj Kandpal <suraj.kandpal@intel.com>
---
drivers/gpu/drm/i915/display/intel_dp.c | 29 +++++++++++++++++++++++++
1 file changed, 29 insertions(+)
diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
index 54d88f24b689..ca5c49ff4b29 100644
--- a/drivers/gpu/drm/i915/display/intel_dp.c
+++ b/drivers/gpu/drm/i915/display/intel_dp.c
@@ -4277,6 +4277,33 @@ static void intel_edp_mso_init(struct intel_dp *intel_dp)
intel_dp->mso_pixel_overlap = mso ? info->mso_pixel_overlap : 0;
}
+static void
+intel_edp_set_data_override_rates(struct intel_dp *intel_dp)
+{
+ struct intel_encoder *encoder = &dp_to_dig_port(intel_dp)->base;
+ int *sink_rates = intel_dp->sink_rates;
+ int i, j = 0;
+
+ if (!encoder->devdata || encoder->devdata->display->vbt.version < 263)
+ return;
+
+ /*
+ * This means the VBT ends up asking us to override every possible rate
+ * indicating the VBT is broken so skip this
+ */
+ if (hweight32(devdata->child.edp_data_rate_override) >= 11)
+ return;
+
+ for (i = 0; i < intel_dp->num_sink_rates; i++) {
+ if (intel_bios_encoder_supports_edp_rate(encoder->devdata,
+ intel_dp->sink_rates[i]))
+ continue;
+
+ sink_rates[j++] = intel_dp->sink_rates[i];
+ }
+ intel_dp->num_sink_rates = j;
+}
+
static void
intel_edp_set_sink_rates(struct intel_dp *intel_dp)
{
@@ -4327,6 +4354,8 @@ intel_edp_set_sink_rates(struct intel_dp *intel_dp)
intel_dp->use_rate_select = true;
else
intel_dp_set_sink_rates(intel_dp);
+
+ intel_edp_set_data_override_rates(intel_dp);
}
static bool
--
2.34.1
next prev parent reply other threads:[~2025-07-31 5:17 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-31 5:16 [PATCH v3 0/3] eDP Data Override Suraj Kandpal
2025-07-31 5:16 ` [PATCH v3 1/3] drm/i915/vbt: Add eDP Data rate overrride field in VBT Suraj Kandpal
2025-07-31 5:16 ` [PATCH v3 2/3] drm/i915/bios: Add function to check if edp data override is needed Suraj Kandpal
2025-08-19 4:39 ` Nautiyal, Ankit K
2025-07-31 5:16 ` Suraj Kandpal [this message]
2025-07-31 7:47 ` [PATCH v3 3/3] drm/i915/edp: eDP Data Overrride kernel test robot
2025-07-31 9:50 ` [PATCH v4 " Suraj Kandpal
2025-08-19 4:55 ` Nautiyal, Ankit K
2025-07-31 5:24 ` ✓ CI.KUnit: success for eDP Data Override (rev4) Patchwork
2025-07-31 11:59 ` ✓ CI.KUnit: success for eDP Data Override (rev5) Patchwork
2025-07-31 12:37 ` ✓ Xe.CI.BAT: " Patchwork
2025-07-31 13:49 ` ✗ Xe.CI.Full: failure " 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=20250731051646.3009255-4-suraj.kandpal@intel.com \
--to=suraj.kandpal@intel.com \
--cc=ankit.k.nautiyal@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=intel-xe@lists.freedesktop.org \
--cc=jani.nikula@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