From: "Nautiyal, Ankit K" <ankit.k.nautiyal@intel.com>
To: Suraj Kandpal <suraj.kandpal@intel.com>,
<intel-xe@lists.freedesktop.org>,
<intel-gfx@lists.freedesktop.org>
Cc: <jani.nikula@intel.com>
Subject: Re: [PATCH v4 3/3] drm/i915/edp: eDP Data Overrride
Date: Tue, 19 Aug 2025 10:25:24 +0530 [thread overview]
Message-ID: <972b6cf2-fd9e-45dd-b319-efbf11b81ed8@intel.com> (raw)
In-Reply-To: <20250731095049.3026988-1-suraj.kandpal@intel.com>
On 7/31/2025 3:20 PM, Suraj Kandpal wrote:
> 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]
>
> --v4
> -Fix build errors
> -Create a seprate function to check if edp data override is selected
> and using the correct vbt
>
> Signed-off-by: Suraj Kandpal <suraj.kandpal@intel.com>
> ---
> drivers/gpu/drm/i915/display/intel_bios.c | 17 +++++++++++++++--
> drivers/gpu/drm/i915/display/intel_bios.h | 2 ++
> drivers/gpu/drm/i915/display/intel_dp.c | 22 ++++++++++++++++++++++
> 3 files changed, 39 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_bios.c b/drivers/gpu/drm/i915/display/intel_bios.c
> index 7adb7c4b0432..5d9126a0219e 100644
> --- a/drivers/gpu/drm/i915/display/intel_bios.c
> +++ b/drivers/gpu/drm/i915/display/intel_bios.c
> @@ -2519,12 +2519,25 @@ int intel_bios_dp_max_lane_count(const struct intel_bios_encoder_data *devdata)
> }
>
> bool
> -intel_bios_encoder_supports_edp_rate(const struct intel_bios_encoder_data *devdata,
> - int rate)
> +intel_bios_vbt_supports_edp_data_override(const struct intel_bios_encoder_data *devdata)
> {
> if (!devdata || devdata->display->vbt.version < 263)
> return false;
>
> + /*
> + * 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)
This should be 12.
I think it would be better to define a macro for this
BDB_263_EDP_NUM_LINK_RATES or something similar and use that.
This can be part of 1st patch.
Regards,
Ankit
> + return false;
> +
> + return true;
> +}
> +
> +bool
> +intel_bios_encoder_supports_edp_rate(const struct intel_bios_encoder_data *devdata,
> + int rate)
> +{
> return devdata->child.edp_data_rate_override & edp_rate_override_mask(rate);
> }
>
> diff --git a/drivers/gpu/drm/i915/display/intel_bios.h b/drivers/gpu/drm/i915/display/intel_bios.h
> index a4abaa89a682..d244caef2275 100644
> --- a/drivers/gpu/drm/i915/display/intel_bios.h
> +++ b/drivers/gpu/drm/i915/display/intel_bios.h
> @@ -276,5 +276,7 @@ void intel_bios_for_each_encoder(struct intel_display *display,
> const struct intel_bios_encoder_data *devdata));
>
> void intel_bios_debugfs_register(struct intel_display *display);
> +bool
> +intel_bios_vbt_supports_edp_data_override(const struct intel_bios_encoder_data *devdata);
>
> #endif /* _INTEL_BIOS_H_ */
> diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
> index 54d88f24b689..7e905e912aef 100644
> --- a/drivers/gpu/drm/i915/display/intel_dp.c
> +++ b/drivers/gpu/drm/i915/display/intel_dp.c
> @@ -4277,6 +4277,26 @@ 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 (!intel_bios_vbt_supports_edp_data_override(encoder->devdata))
> + 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 +4347,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
next prev parent reply other threads:[~2025-08-19 4:55 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 ` [PATCH v3 3/3] drm/i915/edp: eDP Data Overrride Suraj Kandpal
2025-07-31 7:47 ` kernel test robot
2025-07-31 9:50 ` [PATCH v4 " Suraj Kandpal
2025-08-19 4:55 ` Nautiyal, Ankit K [this message]
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=972b6cf2-fd9e-45dd-b319-efbf11b81ed8@intel.com \
--to=ankit.k.nautiyal@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=intel-xe@lists.freedesktop.org \
--cc=jani.nikula@intel.com \
--cc=suraj.kandpal@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