From: Imre Deak <imre.deak@intel.com>
To: <intel-gfx@lists.freedesktop.org>, <intel-xe@lists.freedesktop.org>
Cc: "Jouni Högander" <jouni.hogander@intel.com>
Subject: [PATCH 10/15] drm/i915/dp: Simplify the DSC slice config loop's slices-per-pipe iteration
Date: Wed, 14 Jan 2026 18:22:27 +0200 [thread overview]
Message-ID: <20260114162232.92731-11-imre.deak@intel.com> (raw)
In-Reply-To: <20260114162232.92731-1-imre.deak@intel.com>
Simplify the slice config loop in intel_dp_dsc_get_slice_count(), using
the loop iterator as the slices-per-pipe value directly, instead of
looking up the same value from an array.
While at it move the code comment about the slice configuration closer
to where the configuration is determined and clarify it a bit.
Reviewed-by: Jouni Högander <jouni.hogander@intel.com>
Signed-off-by: Imre Deak <imre.deak@intel.com>
---
drivers/gpu/drm/i915/display/intel_dp.c | 33 ++++++++++---------------
1 file changed, 13 insertions(+), 20 deletions(-)
diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
index 57abc13a02d2d..eff4ea998a948 100644
--- a/drivers/gpu/drm/i915/display/intel_dp.c
+++ b/drivers/gpu/drm/i915/display/intel_dp.c
@@ -107,20 +107,6 @@
/* Constants for DP DSC configurations */
static const u8 valid_dsc_bpp[] = {6, 8, 10, 12, 15};
-/*
- * With Single pipe configuration, HW is capable of supporting maximum of:
- * 2 slices per line for ICL, BMG
- * 4 slices per line for other platforms.
- * For now consider a max of 2 slices per line, which works for all platforms.
- * With this we can have max of 4 DSC Slices per pipe.
- *
- * For higher resolutions where 12 slice support is required with
- * ultrajoiner, only then each pipe can support 3 slices.
- *
- * #TODO Split this better to use 4 slices/dsc engine where supported.
- */
-static const u8 valid_dsc_slicecount[] = {1, 2, 3, 4};
-
/**
* intel_dp_is_edp - is the given port attached to an eDP panel (either CPU or PCH)
* @intel_dp: DP struct
@@ -1033,17 +1019,24 @@ u8 intel_dp_dsc_get_slice_count(const struct intel_connector *connector,
intel_dp_dsc_min_slice_count(connector, mode_clock, mode_hdisplay);
u32 sink_slice_count_mask =
drm_dp_dsc_sink_slice_count_mask(connector->dp.dsc_dpcd, false);
- int i;
+ int slices_per_pipe;
- /* Find the closest match to the valid slice count values */
- for (i = 0; i < ARRAY_SIZE(valid_dsc_slicecount); i++) {
- int slices_per_line = valid_dsc_slicecount[i] * num_joined_pipes;
+ /*
+ * Find the closest match to the valid slice count values
+ *
+ * Max HW DSC-per-pipe x slice-per-DSC (= slice-per-pipe) capability:
+ * ICL: 2x2
+ * BMG: 2x2, or for ultrajoined 4 pipes: 3x1
+ * TGL+: 2x4 (TODO: Add support for this)
+ */
+ for (slices_per_pipe = 1; slices_per_pipe <= 4; slices_per_pipe++) {
+ int slices_per_line = slices_per_pipe * num_joined_pipes;
/*
* 3 DSC Slices per pipe need 3 DSC engines, which is supported only
* with Ultrajoiner only for some platforms.
*/
- if (valid_dsc_slicecount[i] == 3 &&
+ if (slices_per_pipe == 3 &&
(!HAS_DSC_3ENGINES(display) || num_joined_pipes != 4))
continue;
@@ -1056,7 +1049,7 @@ u8 intel_dp_dsc_get_slice_count(const struct intel_connector *connector,
* So there should be at least 2 dsc slices per pipe,
* whenever bigjoiner is enabled.
*/
- if (num_joined_pipes > 1 && valid_dsc_slicecount[i] < 2)
+ if (num_joined_pipes > 1 && slices_per_pipe < 2)
continue;
if (mode_hdisplay % slices_per_line)
--
2.49.1
next prev parent reply other threads:[~2026-01-14 16:23 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-14 16:22 [PATCH 00/15] drm/i915/dp: Clean up link BW/DSC slice config computation (DSC slice) Imre Deak
2026-01-14 16:22 ` [PATCH 01/15] drm/i915/dsc: Track the detaild DSC slice configuration Imre Deak
2026-01-14 16:22 ` [PATCH 02/15] drm/i915/dsc: Track the DSC stream count in the DSC slice config state Imre Deak
2026-01-14 16:22 ` [PATCH 03/15] drm/i915/dsi: Move initialization of DSI DSC streams-per-pipe to fill_dsc() Imre Deak
2026-01-14 16:22 ` [PATCH 04/15] drm/i915/dsi: Track the detailed DSC slice configuration Imre Deak
2026-01-14 16:22 ` [PATCH 05/15] drm/i915/dp: " Imre Deak
2026-01-14 16:22 ` [PATCH 06/15] drm/i915/dsc: Switch to using intel_dsc_line_slice_count() Imre Deak
2026-01-14 16:22 ` [PATCH 07/15] drm/i915/dp: Factor out intel_dp_dsc_min_slice_count() Imre Deak
2026-01-14 16:22 ` [PATCH 08/15] drm/i915/dp: Use int for DSC slice count variables Imre Deak
2026-01-14 16:22 ` [PATCH 09/15] drm/i915/dp: Rename test_slice_count to slices_per_line Imre Deak
2026-01-14 16:22 ` Imre Deak [this message]
2026-01-14 16:22 ` [PATCH 11/15] drm/i915/dsc: Add intel_dsc_get_slice_config() Imre Deak
2026-01-14 16:22 ` [PATCH 12/15] drm/i915/dsi: Use intel_dsc_get_slice_config() Imre Deak
2026-01-14 16:22 ` [PATCH 13/15] drm/i915/dp: Unify DP and eDP slice count computation Imre Deak
2026-01-14 16:22 ` [PATCH 14/15] drm/i915/dp: Add intel_dp_dsc_get_slice_config() Imre Deak
2026-01-14 16:22 ` [PATCH 15/15] drm/i915/dp: Use intel_dp_dsc_get_slice_config() Imre Deak
2026-01-14 16:33 ` ✗ CI.checkpatch: warning for drm/i915/dp: Clean up link BW/DSC slice config computation (DSC slice) Patchwork
2026-01-14 16:35 ` ✓ CI.KUnit: success " Patchwork
2026-01-14 16:52 ` ✗ CI.checksparse: warning " Patchwork
2026-01-14 17:21 ` ✓ Xe.CI.BAT: success " Patchwork
2026-01-14 19:08 ` ✓ i915.CI.BAT: " Patchwork
2026-01-14 23:26 ` ✗ Xe.CI.Full: failure " Patchwork
2026-01-14 23:56 ` ✗ i915.CI.Full: " Patchwork
2026-01-15 18:36 ` 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=20260114162232.92731-11-imre.deak@intel.com \
--to=imre.deak@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=intel-xe@lists.freedesktop.org \
--cc=jouni.hogander@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.