From: Jani Nikula <jani.nikula@linux.intel.com>
To: Lee Shawn C <shawn.c.lee@intel.com>, intel-gfx@lists.freedesktop.org
Cc: "Lee Shawn C" <shawn.c.lee@intel.com>,
"Shankar Uma" <uma.shankar@intel.com>,
"Ville Syrjälä" <ville.syrjala@linux.intel.com>
Subject: Re: [PATCH] drm/i915/dp: Enable DSC on external DP display if VBT allows
Date: Tue, 27 May 2025 11:20:57 +0300 [thread overview]
Message-ID: <3ece87d79ad1414be4777d3b252e8e8b74f8cb96@intel.com> (raw)
In-Reply-To: <20250527075906.65542-1-shawn.c.lee@intel.com>
On Tue, 27 May 2025, Lee Shawn C <shawn.c.lee@intel.com> wrote:
> A DSC setting has been available in VBT since version 251, which allows
> users to enable or disable the DSC feature based on their system design.
> With this in mind, DP driver should reference this setting and avoid
> enabling DSC if this value is not allowed.
>
> Cc: Shankar Uma <uma.shankar@intel.com>
> Cc: Jani Nikula <jani.nikula@linux.intel.com>
> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Signed-off-by: Lee Shawn C <shawn.c.lee@intel.com>
> ---
> drivers/gpu/drm/i915/display/intel_bios.c | 8 ++++++++
> drivers/gpu/drm/i915/display/intel_bios.h | 1 +
> drivers/gpu/drm/i915/display/intel_dp.c | 12 +++++++++---
> drivers/gpu/drm/i915/display/intel_dp.h | 2 +-
> drivers/gpu/drm/i915/display/intel_dp_mst.c | 2 +-
> 5 files changed, 20 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_bios.c b/drivers/gpu/drm/i915/display/intel_bios.c
> index ba7b8938b17c..f08dd54fe4d4 100644
> --- a/drivers/gpu/drm/i915/display/intel_bios.c
> +++ b/drivers/gpu/drm/i915/display/intel_bios.c
> @@ -3548,6 +3548,14 @@ bool intel_bios_get_dsc_params(struct intel_encoder *encoder,
> return false;
> }
>
> +bool intel_bios_encoder_ext_display_dsc_disabled(const struct intel_bios_encoder_data *devdata)
Prefer positive instead of negative, and follow naming conventions.
intel_bios_encoder_supports_dsc().
> +{
> + if (!devdata || devdata->display->vbt.version < 251)
> + return false;
> +
> + return devdata->child.disable_compression_for_ext_disp;
> +}
> +
> static const u8 adlp_aux_ch_map[] = {
> [AUX_CH_A] = DP_AUX_A,
> [AUX_CH_B] = DP_AUX_B,
> diff --git a/drivers/gpu/drm/i915/display/intel_bios.h b/drivers/gpu/drm/i915/display/intel_bios.h
> index 6cd7a011b8c4..901ba63e205d 100644
> --- a/drivers/gpu/drm/i915/display/intel_bios.h
> +++ b/drivers/gpu/drm/i915/display/intel_bios.h
> @@ -258,6 +258,7 @@ bool intel_bios_encoder_supports_dp_dual_mode(const struct intel_bios_encoder_da
> bool intel_bios_encoder_is_lspcon(const struct intel_bios_encoder_data *devdata);
> bool intel_bios_encoder_lane_reversal(const struct intel_bios_encoder_data *devdata);
> bool intel_bios_encoder_hpd_invert(const struct intel_bios_encoder_data *devdata);
> +bool intel_bios_encoder_ext_display_dsc_disabled(const struct intel_bios_encoder_data *devdata);
> enum port intel_bios_encoder_port(const struct intel_bios_encoder_data *devdata);
> enum aux_ch intel_bios_dp_aux_ch(const struct intel_bios_encoder_data *devdata);
> int intel_bios_dp_boost_level(const struct intel_bios_encoder_data *devdata);
> diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
> index 640c43bf62d4..eb1e6de0148a 100644
> --- a/drivers/gpu/drm/i915/display/intel_dp.c
> +++ b/drivers/gpu/drm/i915/display/intel_dp.c
> @@ -1389,9 +1389,11 @@ int intel_dp_num_joined_pipes(struct intel_dp *intel_dp,
> return 1;
> }
>
> -bool intel_dp_has_dsc(const struct intel_connector *connector)
> +bool intel_dp_has_dsc(struct intel_dp *intel_dp,
There's no need to pass that in.
> + const struct intel_connector *connector)
> {
> struct intel_display *display = to_intel_display(connector);
> + struct intel_encoder *encoder = &dp_to_dig_port(intel_dp)->base;
>
> if (!HAS_DSC(display))
> return false;
> @@ -1403,6 +1405,10 @@ bool intel_dp_has_dsc(const struct intel_connector *connector)
> connector->panel.vbt.edp.dsc_disable)
> return false;
>
> + if (connector->base.connector_type == DRM_MODE_CONNECTOR_DisplayPort &&
It's just absolutely bonkers that the field is for external HDMI/DP,
there's a separate field for eDP DSC disable, and there's a separate
field for DSI DSC.
Anyway, I am wondering if the output type check should be in
intel_bios_encoder_supports_dsc() instead.
(intel_bios_encoder_supports_dp() && !intel_bios_encoder_supports_edp()) ||
intel_bios_encoder_supports_hdmi().
BR,
Jani.
> + intel_bios_encoder_ext_display_dsc_disabled(encoder->devdata))
> + return false;
> +
> if (!drm_dp_sink_supports_dsc(connector->dp.dsc_dpcd))
> return false;
>
> @@ -1463,7 +1469,7 @@ intel_dp_mode_valid(struct drm_connector *_connector,
> mode_rate = intel_dp_link_required(target_clock,
> intel_dp_mode_min_output_bpp(connector, mode));
>
> - if (intel_dp_has_dsc(connector)) {
> + if (intel_dp_has_dsc(intel_dp, connector)) {
> enum intel_output_format sink_format, output_format;
> int pipe_bpp;
>
> @@ -1650,7 +1656,7 @@ bool intel_dp_supports_dsc(struct intel_dp *intel_dp,
> const struct intel_connector *connector,
> const struct intel_crtc_state *crtc_state)
> {
> - if (!intel_dp_has_dsc(connector))
> + if (!intel_dp_has_dsc(intel_dp, connector))
> return false;
>
> if (intel_crtc_has_type(crtc_state, INTEL_OUTPUT_DP) &&
> diff --git a/drivers/gpu/drm/i915/display/intel_dp.h b/drivers/gpu/drm/i915/display/intel_dp.h
> index 742ae26ac4a9..309dad5b1b47 100644
> --- a/drivers/gpu/drm/i915/display/intel_dp.h
> +++ b/drivers/gpu/drm/i915/display/intel_dp.h
> @@ -83,7 +83,7 @@ void intel_dp_audio_compute_config(struct intel_encoder *encoder,
> bool intel_dp_has_hdmi_sink(struct intel_dp *intel_dp);
> bool intel_dp_is_edp(struct intel_dp *intel_dp);
> bool intel_dp_is_uhbr(const struct intel_crtc_state *crtc_state);
> -bool intel_dp_has_dsc(const struct intel_connector *connector);
> +bool intel_dp_has_dsc(struct intel_dp *intel_dp, const struct intel_connector *connector);
> int intel_dp_link_symbol_size(int rate);
> int intel_dp_link_symbol_clock(int rate);
> bool intel_dp_is_port_edp(struct intel_display *display, enum port port);
> diff --git a/drivers/gpu/drm/i915/display/intel_dp_mst.c b/drivers/gpu/drm/i915/display/intel_dp_mst.c
> index c1fd6aceec2c..4f18059d9913 100644
> --- a/drivers/gpu/drm/i915/display/intel_dp_mst.c
> +++ b/drivers/gpu/drm/i915/display/intel_dp_mst.c
> @@ -1508,7 +1508,7 @@ mst_connector_mode_valid_ctx(struct drm_connector *_connector,
> return 0;
> }
>
> - if (intel_dp_has_dsc(connector)) {
> + if (intel_dp_has_dsc(intel_dp, connector)) {
> /*
> * TBD pass the connector BPC,
> * for now U8_MAX so that max BPC on that platform would be picked
--
Jani Nikula, Intel
next prev parent reply other threads:[~2025-05-27 8:21 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-27 7:59 [PATCH] drm/i915/dp: Enable DSC on external DP display if VBT allows Lee Shawn C
2025-05-27 8:20 ` Jani Nikula [this message]
2025-05-27 8:46 ` Lee, Shawn C
2025-05-27 9:04 ` Jani Nikula
2025-05-27 10:37 ` ✗ Fi.CI.BUILD: failure for " Patchwork
2025-05-27 15:18 ` [v2] " Lee Shawn C
2025-05-27 16:57 ` ✗ Fi.CI.CHECKPATCH: warning for drm/i915/dp: Enable DSC on external DP display if VBT allows (rev2) Patchwork
2025-05-27 17:21 ` ✓ i915.CI.BAT: success " Patchwork
2025-05-27 19:59 ` ✗ i915.CI.Full: failure " Patchwork
2025-05-28 10:59 ` [PATCH] drm/i915/dp: Enable DSC on external DP display if VBT allows Ville Syrjälä
2025-05-28 13:24 ` Lee, Shawn C
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=3ece87d79ad1414be4777d3b252e8e8b74f8cb96@intel.com \
--to=jani.nikula@linux.intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=shawn.c.lee@intel.com \
--cc=uma.shankar@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