From: Imre Deak <imre.deak@intel.com>
To: <intel-gfx@lists.freedesktop.org>, <intel-xe@lists.freedesktop.org>
Cc: Vinod Govindapillai <vinod.govindapillai@intel.com>
Subject: [PATCH 15/19] drm/i915/dp: Simplify computing DSC BPPs for DP-SST
Date: Mon, 22 Dec 2025 17:35:43 +0200 [thread overview]
Message-ID: <20251222153547.713360-17-imre.deak@intel.com> (raw)
In-Reply-To: <20251222153547.713360-1-imre.deak@intel.com>
The maximum pipe BPP value (used as the DSC input BPP) has been aligned
already to the corresponding source/sink input BPP capabilities in
intel_dp_compute_config_limits(). So it isn't needed to perform the same
alignment again in intel_dp_dsc_compute_pipe_bpp() called later, this
function can simply use the already aligned maximum pipe BPP value, do
that.
Also, there is no point in trying pipe BPP values lower than the
maximum: this would only make dsc_compute_compressed_bpp() start with a
lower _compressed_ BPP value, but this lower compressed BPP value has
been tried already when dsc_compute_compressed_bpp() was called with the
higher pipe BPP value (i.e. the first dsc_compute_compressed_bpp() call
tries already all the possible compressed BPP values which are all below
the pipe BPP value passed to it). Simplify the function accordingly
trying only the maximum pipe BPP value.
Reviewed-by: Vinod Govindapillai <vinod.govindapillai@intel.com>
Signed-off-by: Imre Deak <imre.deak@intel.com>
---
drivers/gpu/drm/i915/display/intel_dp.c | 29 +++++++------------------
1 file changed, 8 insertions(+), 21 deletions(-)
diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
index e38e307bddfff..4603745dee379 100644
--- a/drivers/gpu/drm/i915/display/intel_dp.c
+++ b/drivers/gpu/drm/i915/display/intel_dp.c
@@ -2295,11 +2295,8 @@ static int intel_dp_dsc_compute_pipe_bpp(struct intel_dp *intel_dp,
struct drm_connector_state *conn_state,
const struct link_config_limits *limits)
{
- const struct intel_connector *connector =
- to_intel_connector(conn_state->connector);
- u8 dsc_bpc[3] = {};
int forced_bpp, pipe_bpp;
- int num_bpc, i, ret;
+ int ret;
forced_bpp = intel_dp_force_dsc_pipe_bpp(intel_dp, limits);
@@ -2312,25 +2309,15 @@ static int intel_dp_dsc_compute_pipe_bpp(struct intel_dp *intel_dp,
}
}
- /*
- * Get the maximum DSC bpc that will be supported by any valid
- * link configuration and compressed bpp.
- */
- num_bpc = drm_dp_dsc_sink_supported_input_bpcs(connector->dp.dsc_dpcd, dsc_bpc);
- for (i = 0; i < num_bpc; i++) {
- pipe_bpp = dsc_bpc[i] * 3;
- if (pipe_bpp < limits->pipe.min_bpp || pipe_bpp > limits->pipe.max_bpp)
- continue;
+ pipe_bpp = limits->pipe.max_bpp;
+ ret = dsc_compute_compressed_bpp(intel_dp, pipe_config, conn_state,
+ limits, pipe_bpp);
+ if (ret)
+ return -EINVAL;
- ret = dsc_compute_compressed_bpp(intel_dp, pipe_config, conn_state,
- limits, pipe_bpp);
- if (ret == 0) {
- pipe_config->pipe_bpp = pipe_bpp;
- return 0;
- }
- }
+ pipe_config->pipe_bpp = pipe_bpp;
- return -EINVAL;
+ return 0;
}
static int intel_edp_dsc_compute_pipe_bpp(struct intel_dp *intel_dp,
--
2.49.1
next prev parent reply other threads:[~2025-12-22 15:36 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-22 15:35 [PATCH 00/19] rm/i915/dp: Clean up link BW/DSC slice config computation (link BW) Imre Deak
2025-12-22 15:35 ` [PATCH 01/19] drm/i915/dp: Drop unused timeslots param from dsc_compute_link_config() Imre Deak
2025-12-22 15:35 ` [PATCH] drm/i915/dp: Fail state computation for invalid DSC source input BPP values Imre Deak
2025-12-22 15:35 ` [PATCH 02/19] drm/i915/dp: Factor out align_max_sink_dsc_input_bpp() Imre Deak
2025-12-22 15:35 ` [PATCH 03/19] drm/i915/dp: Factor out align_max_vesa_compressed_bpp_x16() Imre Deak
2025-12-22 15:35 ` [PATCH 04/19] drm/i915/dp: Align min/max DSC input BPPs to sink caps Imre Deak
2025-12-22 15:35 ` [PATCH 05/19] drm/i915/dp: Align min/max compressed BPPs when calculating BPP limits Imre Deak
2025-12-22 15:35 ` [PATCH 06/19] drm/i915/dp: Drop intel_dp parameter from intel_dp_compute_config_link_bpp_limits() Imre Deak
2025-12-22 15:35 ` [PATCH 07/19] drm/i915/dp: Pass intel_output_format to intel_dp_dsc_sink_{min_max}_compressed_bpp() Imre Deak
2025-12-22 15:35 ` [PATCH 08/19] drm/i915/dp: Pass mode clock to dsc_throughput_quirk_max_bpp_x16() Imre Deak
2025-12-22 15:35 ` [PATCH 09/19] drm/i915/dp: Factor out compute_min_compressed_bpp_x16() Imre Deak
2025-12-22 15:35 ` [PATCH 10/19] drm/i915/dp: Factor out compute_max_compressed_bpp_x16() Imre Deak
2025-12-22 15:35 ` [PATCH 11/19] drm/i915/dp: Add intel_dp_mode_valid_with_dsc() Imre Deak
2025-12-22 15:35 ` [PATCH 12/19] drm/i915/dp: Unify detect and compute time DSC mode BW validation Imre Deak
2025-12-22 15:35 ` [PATCH 13/19] drm/i915/dp: Use helpers to align min/max compressed BPPs Imre Deak
2025-12-22 15:35 ` [PATCH 14/19] drm/i915/dp: Simplify computing DSC BPPs for eDP Imre Deak
2025-12-22 15:35 ` Imre Deak [this message]
2025-12-22 15:35 ` [PATCH 16/19] drm/i915/dp: Simplify computing forced DSC BPP for DP-SST Imre Deak
2025-12-22 15:35 ` [PATCH 17/19] drm/i915/dp: Unify computing compressed BPP for DP-SST and eDP Imre Deak
2025-12-22 15:35 ` [PATCH 18/19] drm/i915/dp: Simplify eDP vs. DP compressed BPP computation Imre Deak
2025-12-22 15:35 ` [PATCH 19/19] drm/i915/dp: Simplify computing the DSC compressed BPP for DP-MST Imre Deak
2025-12-22 16:55 ` ✗ i915.CI.BAT: failure for drm/i915/dp: Fail state computation for invalid DSC source input BPP values Patchwork
2025-12-22 18:46 ` ✗ i915.CI.BAT: failure for drm/i915/dp: Fail state computation for invalid DSC source input BPP values (rev2) Patchwork
2025-12-22 20:09 ` ✓ i915.CI.BAT: success for drm/i915/dp: Fail state computation for invalid DSC source input BPP values (rev3) Patchwork
2025-12-24 2:24 ` ✓ i915.CI.Full: " Patchwork
2026-01-13 17:33 ` 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=20251222153547.713360-17-imre.deak@intel.com \
--to=imre.deak@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=intel-xe@lists.freedesktop.org \
--cc=vinod.govindapillai@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