* [PATCH 1/7] drm/i915/hdmi: Split the intel_hdmi_dsc_get_bpp()
2026-11-25 5:02 [PATCH 0/7] drm/i915/dp: Fix FRL/TMDS bandwidth checks for HDMI2.1 PCON Ankit Nautiyal
@ 2026-11-25 5:02 ` Ankit Nautiyal
2026-11-25 5:02 ` [PATCH 2/7] drm/i915/dp: Fix FRL BW check for HDMI2.1 DFP Ankit Nautiyal
` (5 subsequent siblings)
6 siblings, 0 replies; 9+ messages in thread
From: Ankit Nautiyal @ 2026-11-25 5:02 UTC (permalink / raw)
To: intel-gfx, intel-xe; +Cc: alexander.kaplan, Ankit Nautiyal, Suraj Kandpal
Split the intel_hdmi_dsc_get_bpp() into two helper functions
that can be called independently.
While at it, improve the comments in the helper.
Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Reviewed-by: Suraj Kandpal <suraj.kandpal@intel.com>
---
drivers/gpu/drm/i915/display/intel_hdmi.c | 97 ++++++++++++++---------
1 file changed, 59 insertions(+), 38 deletions(-)
diff --git a/drivers/gpu/drm/i915/display/intel_hdmi.c b/drivers/gpu/drm/i915/display/intel_hdmi.c
index 4ec0db8d93fb..a67bcc8ef691 100644
--- a/drivers/gpu/drm/i915/display/intel_hdmi.c
+++ b/drivers/gpu/drm/i915/display/intel_hdmi.c
@@ -3325,61 +3325,49 @@ intel_hdmi_dsc_get_num_slices(const struct drm_display_mode *mode,
return target_slices;
}
-/*
- * intel_hdmi_dsc_get_bpp - get the appropriate compressed bits_per_pixel based on
- * source and sink capabilities.
- *
- * @src_fraction_bpp: fractional bpp supported by the source
- * @slice_width: dsc slice width supported by the source and sink
- * @num_slices: num of slices supported by the source and sink
- * @output_format: video output format
- * @bpc: bits per color
- * @hdmi_all_bpp: sink supports decoding of 1/16th bpp setting
- * @hdmi_max_chunk_bytes: max bytes in a line of chunks supported by sink
- *
- * @return: compressed bits_per_pixel in step of 1/16 of bits_per_pixel
- */
-int
-intel_hdmi_dsc_get_bpp(int src_fractional_bpp, int slice_width, int num_slices,
- enum intel_output_format output_format, int bpc,
- bool hdmi_all_bpp, int hdmi_max_chunk_bytes)
+static void
+get_dsc_min_max_bpp(enum intel_output_format output_format, u8 bpc,
+ bool hdmi_all_bpp, int *min_dsc_bpp, int *max_dsc_bpp)
{
- int max_dsc_bpp, min_dsc_bpp;
- int target_bytes;
- bool bpp_found = false;
- int bpp_decrement_x16;
- int bpp_target;
- int bpp_target_x16;
-
/*
- * Get min bpp and max bpp as per Table 7.23, in HDMI2.1 spec
+ * Get min bpp and max bpp that can be supported for a
+ * given bpc and output format.
* Start with the max bpp and keep on decrementing with
- * fractional bpp, if supported by PCON DSC encoder
+ * fractional bpp, if supported by the DSC encoder
*
* for each bpp we check if no of bytes can be supported by HDMI sink
*/
if (output_format == INTEL_OUTPUT_FORMAT_YCBCR420) {
- min_dsc_bpp = 6;
- max_dsc_bpp = 3 * bpc / 2;
+ *min_dsc_bpp = 6;
+ *max_dsc_bpp = 3 * bpc / 2;
} else if (output_format == INTEL_OUTPUT_FORMAT_YCBCR444 ||
output_format == INTEL_OUTPUT_FORMAT_RGB) {
- min_dsc_bpp = 8;
- max_dsc_bpp = 3 * bpc;
+ *min_dsc_bpp = 8;
+ *max_dsc_bpp = 3 * bpc;
} else {
/* Assuming 4:2:2 encoding */
- min_dsc_bpp = 7;
- max_dsc_bpp = 2 * bpc;
+ *min_dsc_bpp = 7;
+ *max_dsc_bpp = 2 * bpc;
}
/*
- * Taking into account if all dsc_all_bpp supported by HDMI2.1 sink
- * Section 7.7.34 : Source shall not enable compressed Video
- * Transport with bpp_target settings above 12 bpp unless
- * DSC_all_bpp is set to 1.
+ * Don't enable DSC bpp_target settings above 12 bpp,
+ * unless DSC_all_bpp is set to 1.
*/
if (!hdmi_all_bpp)
- max_dsc_bpp = min(max_dsc_bpp, 12);
+ *max_dsc_bpp = min(*max_dsc_bpp, 12);
+}
+
+static int
+get_dsc_compressed_bpp(int num_slices, int slice_width, int hdmi_max_chunk_bytes,
+ int src_fractional_bpp, int min_dsc_bpp, int max_dsc_bpp)
+{
+ int target_bytes;
+ bool bpp_found = false;
+ int bpp_decrement_x16;
+ int bpp_target;
+ int bpp_target_x16;
/*
* The Sink has a limit of compressed data in bytes for a scanline,
@@ -3423,6 +3411,39 @@ intel_hdmi_dsc_get_bpp(int src_fractional_bpp, int slice_width, int num_slices,
return 0;
}
+/*
+ * intel_hdmi_dsc_get_bpp - get the appropriate compressed bits_per_pixel based on
+ * source and sink capabilities.
+ *
+ * @src_fraction_bpp: fractional bpp supported by the source
+ * @slice_width: dsc slice width supported by the source and sink
+ * @num_slices: num of slices supported by the source and sink
+ * @output_format: video output format
+ * @bpc: bits per color
+ * @hdmi_all_bpp: sink supports decoding of 1/16th bpp setting
+ * @hdmi_max_chunk_bytes: max bytes in a line of chunks supported by sink
+ *
+ * @return: compressed bits_per_pixel in step of 1/16 of bits_per_pixel
+ */
+int
+intel_hdmi_dsc_get_bpp(int src_fractional_bpp, int slice_width, int num_slices,
+ enum intel_output_format output_format, int bpc,
+ bool hdmi_all_bpp, int hdmi_max_chunk_bytes)
+{
+ int max_dsc_bpp, min_dsc_bpp;
+ int dsc_bpp_x16;
+
+ get_dsc_min_max_bpp(output_format, bpc, hdmi_all_bpp,
+ &min_dsc_bpp, &max_dsc_bpp);
+
+ dsc_bpp_x16 = get_dsc_compressed_bpp(num_slices, slice_width,
+ hdmi_max_chunk_bytes,
+ src_fractional_bpp,
+ min_dsc_bpp, max_dsc_bpp);
+
+ return dsc_bpp_x16;
+}
+
int intel_hdmi_sink_max_frl_rate(struct drm_connector *connector)
{
int max_lanes = connector->display_info.hdmi.max_lanes;
--
2.50.1
^ permalink raw reply related [flat|nested] 9+ messages in thread* [PATCH 2/7] drm/i915/dp: Fix FRL BW check for HDMI2.1 DFP
2026-11-25 5:02 [PATCH 0/7] drm/i915/dp: Fix FRL/TMDS bandwidth checks for HDMI2.1 PCON Ankit Nautiyal
2026-11-25 5:02 ` [PATCH 1/7] drm/i915/hdmi: Split the intel_hdmi_dsc_get_bpp() Ankit Nautiyal
@ 2026-11-25 5:02 ` Ankit Nautiyal
2026-11-25 5:25 ` sashiko-bot
2026-11-25 5:02 ` [PATCH 3/7] drm/i915/dp: Add a wrapper to check frl/tmds downstream constraints Ankit Nautiyal
` (4 subsequent siblings)
6 siblings, 1 reply; 9+ messages in thread
From: Ankit Nautiyal @ 2026-11-25 5:02 UTC (permalink / raw)
To: intel-gfx, intel-xe; +Cc: alexander.kaplan, Ankit Nautiyal, Suraj Kandpal
The FRL bandwidth check considers only the PCON's max FRL rate, ignoring
the HDMI2.1 sink's own max FRL rate. Cap the available bandwidth by the
minimum of the two, similar to the TMDS case.
Move the check into a helper intel_dp_frl_bw_valid() so it can also be
used in the compute_config phase in a subsequent change.
The DSC case, where both the PCON and HDMI sink support DSC, is left
as a FIXME and handled later.
v2: Remove extra braces and re-format comment. (Suraj)
Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Reviewed-by: Suraj Kandpal <suraj.kandpal@intel.com>
---
drivers/gpu/drm/i915/display/intel_dp.c | 51 ++++++++++++++++---------
1 file changed, 34 insertions(+), 17 deletions(-)
diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
index ef164a797618..05d78763c716 100644
--- a/drivers/gpu/drm/i915/display/intel_dp.c
+++ b/drivers/gpu/drm/i915/display/intel_dp.c
@@ -128,6 +128,7 @@ bool intel_dp_is_edp(struct intel_dp *intel_dp)
}
static void intel_dp_unset_edid(struct intel_dp *intel_dp);
+static int intel_dp_hdmi_sink_max_frl(struct intel_dp *intel_dp);
/* Is link rate UHBR and thus 128b/132b? */
bool intel_dp_is_uhbr(const struct intel_crtc_state *crtc_state)
@@ -1189,30 +1190,46 @@ static int frl_required_bw(int clock, int bpc,
}
static enum drm_mode_status
-intel_dp_mode_valid_downstream(struct intel_connector *connector,
- const struct drm_display_mode *mode,
- int target_clock,
- enum intel_output_format sink_format)
+intel_dp_frl_bw_valid(struct intel_dp *intel_dp, int target_clock,
+ int bpc, enum intel_output_format sink_format,
+ bool respect_downstream_limits)
{
- struct intel_dp *intel_dp = intel_attached_dp(connector);
+ int target_bw;
+ int max_frl_bw;
- /* If PCON supports FRL MODE, check FRL bandwidth constraints */
- if (intel_dp->dfp.pcon_max_frl_bw) {
- int target_bw, max_frl_bw;
+ if (!respect_downstream_limits)
+ return MODE_OK;
- /* Assume 8bpc for the FRL bandwidth check */
- target_bw = frl_required_bw(target_clock, 8, sink_format);
+ target_bw = frl_required_bw(target_clock, bpc, sink_format);
- max_frl_bw = intel_dp->dfp.pcon_max_frl_bw;
+ /* check for MAX FRL BW for both PCON and HDMI2.1 sink */
+ max_frl_bw = min(intel_dp->dfp.pcon_max_frl_bw,
+ intel_dp_hdmi_sink_max_frl(intel_dp));
- /* converting bw from Gbps to Kbps*/
- max_frl_bw = max_frl_bw * 1000000;
+ /* converting bw from Gbps to Kbps*/
+ max_frl_bw = max_frl_bw * 1000000;
- if (target_bw > max_frl_bw)
- return MODE_CLOCK_HIGH;
+ /* #FIXME check bandwidth with DSC if both PCON and HDMI sink support DSC */
+ if (target_bw > max_frl_bw)
+ return MODE_CLOCK_HIGH;
- return MODE_OK;
- }
+ return MODE_OK;
+}
+
+static enum drm_mode_status
+intel_dp_mode_valid_downstream(struct intel_connector *connector,
+ const struct drm_display_mode *mode,
+ int target_clock,
+ enum intel_output_format sink_format)
+{
+ struct intel_dp *intel_dp = intel_attached_dp(connector);
+
+ /*
+ * If PCON supports FRL MODE, check FRL bandwidth constraints.
+ * Assume 8bpc for the HDMI2.1 FRL BW check
+ */
+ if (intel_dp->dfp.pcon_max_frl_bw && intel_dp_hdmi_sink_max_frl(intel_dp))
+ return intel_dp_frl_bw_valid(intel_dp, target_clock, 8, sink_format, true);
if (intel_dp->dfp.max_dotclock &&
target_clock > intel_dp->dfp.max_dotclock)
--
2.50.1
^ permalink raw reply related [flat|nested] 9+ messages in thread* Re: [PATCH 2/7] drm/i915/dp: Fix FRL BW check for HDMI2.1 DFP
2026-11-25 5:02 ` [PATCH 2/7] drm/i915/dp: Fix FRL BW check for HDMI2.1 DFP Ankit Nautiyal
@ 2026-11-25 5:25 ` sashiko-bot
0 siblings, 0 replies; 9+ messages in thread
From: sashiko-bot @ 2026-11-25 5:25 UTC (permalink / raw)
To: Ankit Nautiyal, intel-gfx, intel-xe
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] drm/i915/dp: missing Fixes trailer for HDMI2.1 DFP FRL bandwidth
check fix
--
commit 0c2bfa849e9515e660404bbd423461b2721c4bbc
Author: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
> drm/i915/dp: Fix FRL BW check for HDMI2.1 DFP
>
> The FRL bandwidth check considers only the PCON's max FRL rate, ignoring
> the HDMI2.1 sink's own max FRL rate. Cap the available bandwidth by the
> minimum of the two, similar to the TMDS case.
>
> Move the check into a helper intel_dp_frl_bw_valid() so it can also be
> used in the compute_config phase in a subsequent change.
>
> The DSC case, where both the PCON and HDMI sink support DSC, is left
> as a FIXME and handled later.
>
> v2: Remove extra braces and re-format comment. (Suraj)
>
> Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
> Reviewed-by: Suraj Kandpal <suraj.kandpal@intel.com>
[Severity: Low]
This fixes the FRL bandwidth check introduced in commit 2f78347e3634
("drm/i915: Capture max frl rate for PCON in dfp cap structure"). Should
the commit message include:
Fixes: 2f78347e3634 ("drm/i915: Capture max frl rate for PCON in dfp cap structure")
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261125050231.1942380-1-ankit.k.nautiyal@intel.com?part=2
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH 3/7] drm/i915/dp: Add a wrapper to check frl/tmds downstream constraints
2026-11-25 5:02 [PATCH 0/7] drm/i915/dp: Fix FRL/TMDS bandwidth checks for HDMI2.1 PCON Ankit Nautiyal
2026-11-25 5:02 ` [PATCH 1/7] drm/i915/hdmi: Split the intel_hdmi_dsc_get_bpp() Ankit Nautiyal
2026-11-25 5:02 ` [PATCH 2/7] drm/i915/dp: Fix FRL BW check for HDMI2.1 DFP Ankit Nautiyal
@ 2026-11-25 5:02 ` Ankit Nautiyal
2026-11-25 5:02 ` [PATCH 4/7] drm/i915/dp: Use the common downstream bw check in compute_bpc Ankit Nautiyal
` (3 subsequent siblings)
6 siblings, 0 replies; 9+ messages in thread
From: Ankit Nautiyal @ 2026-11-25 5:02 UTC (permalink / raw)
To: intel-gfx, intel-xe; +Cc: alexander.kaplan, Ankit Nautiyal, Suraj Kandpal
Add a wrapper function to check dp_downstream clock/bandwidth
constraints. Based on whether the sink supports FRL/TMDS the wrapper
calls the appropriate FRL/TMDS functions.
v2: Don't modify the dfp.maxdotclock check which deals with VGA.
Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Reviewed-by: Suraj Kandpal <suraj.kandpal@intel.com>
---
drivers/gpu/drm/i915/display/intel_dp.c | 34 +++++++++++++++++--------
1 file changed, 24 insertions(+), 10 deletions(-)
diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
index 05d78763c716..82a4e3abf4ae 100644
--- a/drivers/gpu/drm/i915/display/intel_dp.c
+++ b/drivers/gpu/drm/i915/display/intel_dp.c
@@ -1216,6 +1216,28 @@ intel_dp_frl_bw_valid(struct intel_dp *intel_dp, int target_clock,
return MODE_OK;
}
+static bool
+intel_dp_pcon_sink_support_frl(struct intel_dp *intel_dp)
+{
+ return intel_dp->dfp.pcon_max_frl_bw &&
+ intel_dp_hdmi_sink_max_frl(intel_dp);
+}
+
+static enum drm_mode_status
+intel_dp_hdmi_bw_valid(struct intel_dp *intel_dp,
+ int target_clock, int bpc,
+ enum intel_output_format sink_format,
+ bool respect_downstream_limits)
+{
+ if (intel_dp_pcon_sink_support_frl(intel_dp))
+ return intel_dp_frl_bw_valid(intel_dp, target_clock, bpc,
+ sink_format,
+ respect_downstream_limits);
+
+ return intel_dp_tmds_clock_valid(intel_dp, target_clock, bpc, sink_format,
+ respect_downstream_limits);
+}
+
static enum drm_mode_status
intel_dp_mode_valid_downstream(struct intel_connector *connector,
const struct drm_display_mode *mode,
@@ -1223,21 +1245,13 @@ intel_dp_mode_valid_downstream(struct intel_connector *connector,
enum intel_output_format sink_format)
{
struct intel_dp *intel_dp = intel_attached_dp(connector);
-
- /*
- * If PCON supports FRL MODE, check FRL bandwidth constraints.
- * Assume 8bpc for the HDMI2.1 FRL BW check
- */
- if (intel_dp->dfp.pcon_max_frl_bw && intel_dp_hdmi_sink_max_frl(intel_dp))
- return intel_dp_frl_bw_valid(intel_dp, target_clock, 8, sink_format, true);
+ int bpc = 8; /* Assume 8bpc for the DP++/HDMI/DVI TMDS/FRL bw check */
if (intel_dp->dfp.max_dotclock &&
target_clock > intel_dp->dfp.max_dotclock)
return MODE_CLOCK_HIGH;
- /* Assume 8bpc for the DP++/HDMI/DVI TMDS clock check */
- return intel_dp_tmds_clock_valid(intel_dp, target_clock,
- 8, sink_format, true);
+ return intel_dp_hdmi_bw_valid(intel_dp, target_clock, bpc, sink_format, true);
}
static enum drm_mode_status
--
2.50.1
^ permalink raw reply related [flat|nested] 9+ messages in thread* [PATCH 4/7] drm/i915/dp: Use the common downstream bw check in compute_bpc
2026-11-25 5:02 [PATCH 0/7] drm/i915/dp: Fix FRL/TMDS bandwidth checks for HDMI2.1 PCON Ankit Nautiyal
` (2 preceding siblings ...)
2026-11-25 5:02 ` [PATCH 3/7] drm/i915/dp: Add a wrapper to check frl/tmds downstream constraints Ankit Nautiyal
@ 2026-11-25 5:02 ` Ankit Nautiyal
2026-11-25 5:02 ` [PATCH 5/7] drm/i915/hdmi: Expose DSC min/max bpp helpers Ankit Nautiyal
` (2 subsequent siblings)
6 siblings, 0 replies; 9+ messages in thread
From: Ankit Nautiyal @ 2026-11-25 5:02 UTC (permalink / raw)
To: intel-gfx, intel-xe; +Cc: alexander.kaplan, Ankit Nautiyal, Suraj Kandpal
Currently the FRL bandwidth check is only added for the mode_valid phase.
Add the check in the compute_config phase also, replacing the TMDS-only
check with the common function that checks for both TMDS and FRL.
Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Reviewed-by: Suraj Kandpal <suraj.kandpal@intel.com>
---
drivers/gpu/drm/i915/display/intel_dp.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
index 82a4e3abf4ae..657bb56237f0 100644
--- a/drivers/gpu/drm/i915/display/intel_dp.c
+++ b/drivers/gpu/drm/i915/display/intel_dp.c
@@ -1778,8 +1778,8 @@ static int intel_dp_hdmi_compute_bpc(struct intel_dp *intel_dp,
for (; bpc >= 8; bpc -= 2) {
if (intel_hdmi_bpc_possible(crtc_state, bpc,
intel_dp_has_hdmi_sink(intel_dp)) &&
- intel_dp_tmds_clock_valid(intel_dp, clock, bpc, crtc_state->sink_format,
- respect_downstream_limits) == MODE_OK)
+ intel_dp_hdmi_bw_valid(intel_dp, clock, bpc, crtc_state->sink_format,
+ respect_downstream_limits) == MODE_OK)
return bpc;
}
--
2.50.1
^ permalink raw reply related [flat|nested] 9+ messages in thread* [PATCH 5/7] drm/i915/hdmi: Expose DSC min/max bpp helpers
2026-11-25 5:02 [PATCH 0/7] drm/i915/dp: Fix FRL/TMDS bandwidth checks for HDMI2.1 PCON Ankit Nautiyal
` (3 preceding siblings ...)
2026-11-25 5:02 ` [PATCH 4/7] drm/i915/dp: Use the common downstream bw check in compute_bpc Ankit Nautiyal
@ 2026-11-25 5:02 ` Ankit Nautiyal
2026-11-25 5:02 ` [PATCH 6/7] drm/i915/hdmi: Add helper to check if DSC chunksize fits the sink limits Ankit Nautiyal
2026-11-25 5:02 ` [PATCH 7/7] drm/i915/hdmi: Pass pixel clock to DSC slice helper Ankit Nautiyal
6 siblings, 0 replies; 9+ messages in thread
From: Ankit Nautiyal @ 2026-11-25 5:02 UTC (permalink / raw)
To: intel-gfx, intel-xe; +Cc: alexander.kaplan, Ankit Nautiyal, Suraj Kandpal
Expose intel_hdmi_dsc_get_min_max_bpp() to query the allowed compressed
bpp range.
This will be used in the subsequent change to compute the compressed bpp
range in mode_valid() for an HDMI with DSC connected to a DP DFP.
Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Reviewed-by: Suraj Kandpal <suraj.kandpal@intel.com>
---
drivers/gpu/drm/i915/display/intel_hdmi.c | 20 +++++++++++++++-----
drivers/gpu/drm/i915/display/intel_hdmi.h | 2 ++
2 files changed, 17 insertions(+), 5 deletions(-)
diff --git a/drivers/gpu/drm/i915/display/intel_hdmi.c b/drivers/gpu/drm/i915/display/intel_hdmi.c
index a67bcc8ef691..3321b673b3b6 100644
--- a/drivers/gpu/drm/i915/display/intel_hdmi.c
+++ b/drivers/gpu/drm/i915/display/intel_hdmi.c
@@ -3325,9 +3325,19 @@ intel_hdmi_dsc_get_num_slices(const struct drm_display_mode *mode,
return target_slices;
}
-static void
-get_dsc_min_max_bpp(enum intel_output_format output_format, u8 bpc,
- bool hdmi_all_bpp, int *min_dsc_bpp, int *max_dsc_bpp)
+/*
+ * intel_hdmi_dsc_get_min_max_bpp - get the min and max compressed bpp range
+ * allowed for a given output format and bpc.
+ *
+ * @output_format: video output format
+ * @bpc: bits per color
+ * @hdmi_all_bpp: sink supports decoding of 1/16th bpp setting
+ * @min_dsc_bpp: returns the minimum allowed compressed bpp
+ * @max_dsc_bpp: returns the maximum allowed compressed bpp
+ */
+void
+intel_hdmi_dsc_get_min_max_bpp(enum intel_output_format output_format, u8 bpc,
+ bool hdmi_all_bpp, int *min_dsc_bpp, int *max_dsc_bpp)
{
/*
* Get min bpp and max bpp that can be supported for a
@@ -3433,8 +3443,8 @@ intel_hdmi_dsc_get_bpp(int src_fractional_bpp, int slice_width, int num_slices,
int max_dsc_bpp, min_dsc_bpp;
int dsc_bpp_x16;
- get_dsc_min_max_bpp(output_format, bpc, hdmi_all_bpp,
- &min_dsc_bpp, &max_dsc_bpp);
+ intel_hdmi_dsc_get_min_max_bpp(output_format, bpc, hdmi_all_bpp,
+ &min_dsc_bpp, &max_dsc_bpp);
dsc_bpp_x16 = get_dsc_compressed_bpp(num_slices, slice_width,
hdmi_max_chunk_bytes,
diff --git a/drivers/gpu/drm/i915/display/intel_hdmi.h b/drivers/gpu/drm/i915/display/intel_hdmi.h
index c95ed37bcc0c..3ab75ef4836e 100644
--- a/drivers/gpu/drm/i915/display/intel_hdmi.h
+++ b/drivers/gpu/drm/i915/display/intel_hdmi.h
@@ -57,6 +57,8 @@ int intel_hdmi_tmds_clock(int clock, int bpc, enum intel_output_format sink_form
int intel_hdmi_dsc_get_bpp(int src_fractional_bpp, int slice_width,
int num_slices, enum intel_output_format output_format,
int bpc, bool hdmi_all_bpp, int hdmi_max_chunk_bytes);
+void intel_hdmi_dsc_get_min_max_bpp(enum intel_output_format output_format, u8 bpc,
+ bool hdmi_all_bpp, int *min_dsc_bpp, int *max_dsc_bpp);
int intel_hdmi_dsc_get_num_slices(const struct drm_display_mode *mode,
enum intel_output_format output_format,
int src_max_slices, int src_max_slice_width,
--
2.50.1
^ permalink raw reply related [flat|nested] 9+ messages in thread* [PATCH 6/7] drm/i915/hdmi: Add helper to check if DSC chunksize fits the sink limits
2026-11-25 5:02 [PATCH 0/7] drm/i915/dp: Fix FRL/TMDS bandwidth checks for HDMI2.1 PCON Ankit Nautiyal
` (4 preceding siblings ...)
2026-11-25 5:02 ` [PATCH 5/7] drm/i915/hdmi: Expose DSC min/max bpp helpers Ankit Nautiyal
@ 2026-11-25 5:02 ` Ankit Nautiyal
2026-11-25 5:02 ` [PATCH 7/7] drm/i915/hdmi: Pass pixel clock to DSC slice helper Ankit Nautiyal
6 siblings, 0 replies; 9+ messages in thread
From: Ankit Nautiyal @ 2026-11-25 5:02 UTC (permalink / raw)
To: intel-gfx, intel-xe; +Cc: alexander.kaplan, Ankit Nautiyal, Suraj Kandpal
Introduce the helper intel_hdmi_dsc_bpp_fits_chunk_bytes() to check
whether the chunksize computed for the given slice configuration is with
in the sink's max chunksize limits.
Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Reviewed-by: Suraj Kandpal <suraj.kandpal@intel.com>
---
drivers/gpu/drm/i915/display/intel_hdmi.c | 25 ++++++++++++++++++++---
drivers/gpu/drm/i915/display/intel_hdmi.h | 2 ++
2 files changed, 24 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/i915/display/intel_hdmi.c b/drivers/gpu/drm/i915/display/intel_hdmi.c
index 3321b673b3b6..027a337ad8b8 100644
--- a/drivers/gpu/drm/i915/display/intel_hdmi.c
+++ b/drivers/gpu/drm/i915/display/intel_hdmi.c
@@ -3369,11 +3369,30 @@ intel_hdmi_dsc_get_min_max_bpp(enum intel_output_format output_format, u8 bpc,
*max_dsc_bpp = min(*max_dsc_bpp, 12);
}
+/*
+ * intel_hdmi_dsc_bpp_fits_chunk_bytes - check if a given compressed bpp keeps
+ * the per-scanline chunk size within the sink's max_chunk_bytes limit.
+ *
+ * @bpp: compressed bits per pixel to test
+ * @num_slices: num of slices supported by the source and sink
+ * @slice_width: dsc slice width supported by the source and sink
+ * @hdmi_max_chunk_bytes: max bytes in a line of chunks supported by sink
+ *
+ * @return: true if the resulting chunk size fits the sink limit
+ */
+bool
+intel_hdmi_dsc_bpp_fits_chunk_bytes(int bpp, int num_slices, int slice_width,
+ int hdmi_max_chunk_bytes)
+{
+ int target_bytes = DIV_ROUND_UP((num_slices * slice_width * bpp), 8);
+
+ return target_bytes <= hdmi_max_chunk_bytes;
+}
+
static int
get_dsc_compressed_bpp(int num_slices, int slice_width, int hdmi_max_chunk_bytes,
int src_fractional_bpp, int min_dsc_bpp, int max_dsc_bpp)
{
- int target_bytes;
bool bpp_found = false;
int bpp_decrement_x16;
int bpp_target;
@@ -3408,8 +3427,8 @@ get_dsc_compressed_bpp(int num_slices, int slice_width, int hdmi_max_chunk_bytes
int bpp;
bpp = DIV_ROUND_UP(bpp_target_x16, 16);
- target_bytes = DIV_ROUND_UP((num_slices * slice_width * bpp), 8);
- if (target_bytes <= hdmi_max_chunk_bytes) {
+ if (intel_hdmi_dsc_bpp_fits_chunk_bytes(bpp, num_slices, slice_width,
+ hdmi_max_chunk_bytes)) {
bpp_found = true;
break;
}
diff --git a/drivers/gpu/drm/i915/display/intel_hdmi.h b/drivers/gpu/drm/i915/display/intel_hdmi.h
index 3ab75ef4836e..db87656eb27f 100644
--- a/drivers/gpu/drm/i915/display/intel_hdmi.h
+++ b/drivers/gpu/drm/i915/display/intel_hdmi.h
@@ -59,6 +59,8 @@ int intel_hdmi_dsc_get_bpp(int src_fractional_bpp, int slice_width,
int bpc, bool hdmi_all_bpp, int hdmi_max_chunk_bytes);
void intel_hdmi_dsc_get_min_max_bpp(enum intel_output_format output_format, u8 bpc,
bool hdmi_all_bpp, int *min_dsc_bpp, int *max_dsc_bpp);
+bool intel_hdmi_dsc_bpp_fits_chunk_bytes(int bpp, int num_slices, int slice_width,
+ int hdmi_max_chunk_bytes);
int intel_hdmi_dsc_get_num_slices(const struct drm_display_mode *mode,
enum intel_output_format output_format,
int src_max_slices, int src_max_slice_width,
--
2.50.1
^ permalink raw reply related [flat|nested] 9+ messages in thread* [PATCH 7/7] drm/i915/hdmi: Pass pixel clock to DSC slice helper
2026-11-25 5:02 [PATCH 0/7] drm/i915/dp: Fix FRL/TMDS bandwidth checks for HDMI2.1 PCON Ankit Nautiyal
` (5 preceding siblings ...)
2026-11-25 5:02 ` [PATCH 6/7] drm/i915/hdmi: Add helper to check if DSC chunksize fits the sink limits Ankit Nautiyal
@ 2026-11-25 5:02 ` Ankit Nautiyal
6 siblings, 0 replies; 9+ messages in thread
From: Ankit Nautiyal @ 2026-11-25 5:02 UTC (permalink / raw)
To: intel-gfx, intel-xe; +Cc: alexander.kaplan, Ankit Nautiyal, Suraj Kandpal
Pass the pixel clock explicitly to the DSC slice-count helper so callers
can use the effective clock for throughput validation.
Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Reviewed-by: Suraj Kandpal <suraj.kandpal@intel.com>
---
drivers/gpu/drm/i915/display/intel_dp.c | 1 +
drivers/gpu/drm/i915/display/intel_hdmi.c | 3 ++-
drivers/gpu/drm/i915/display/intel_hdmi.h | 1 +
3 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
index 657bb56237f0..45e4812777cb 100644
--- a/drivers/gpu/drm/i915/display/intel_dp.c
+++ b/drivers/gpu/drm/i915/display/intel_dp.c
@@ -4533,6 +4533,7 @@ intel_dp_pcon_dsc_enc_slices(struct intel_dp *intel_dp,
int pcon_max_slice_width = drm_dp_pcon_dsc_max_slice_width(intel_dp->pcon_dsc_dpcd);
return intel_hdmi_dsc_get_num_slices(&crtc_state->hw.adjusted_mode,
+ crtc_state->hw.adjusted_mode.crtc_clock,
crtc_state->output_format,
pcon_max_slices,
pcon_max_slice_width,
diff --git a/drivers/gpu/drm/i915/display/intel_hdmi.c b/drivers/gpu/drm/i915/display/intel_hdmi.c
index 027a337ad8b8..ac2172a5a320 100644
--- a/drivers/gpu/drm/i915/display/intel_hdmi.c
+++ b/drivers/gpu/drm/i915/display/intel_hdmi.c
@@ -3217,6 +3217,7 @@ int intel_hdmi_dsc_get_slice_height(int vactive)
* and dsc decoder capabilities
*
* @mode: drm_display_mode for which num of slices are needed
+ * @pixel_clock: pixel clock in kHz used for DSC throughput calculation
* @output_format : pipe output format
* @src_max_slices: maximum slices supported by the DSC encoder
* @src_max_slice_width: maximum slice width supported by DSC encoder
@@ -3228,6 +3229,7 @@ int intel_hdmi_dsc_get_slice_height(int vactive)
*/
int
intel_hdmi_dsc_get_num_slices(const struct drm_display_mode *mode,
+ int pixel_clock,
enum intel_output_format output_format,
int src_max_slices, int src_max_slice_width,
int hdmi_max_slices, int hdmi_throughput)
@@ -3250,7 +3252,6 @@ intel_hdmi_dsc_get_num_slices(const struct drm_display_mode *mode,
int max_throughput; /* max clock freq. in khz per slice */
int max_slice_width;
int slice_width;
- int pixel_clock = mode->crtc_clock;
if (!hdmi_throughput)
return 0;
diff --git a/drivers/gpu/drm/i915/display/intel_hdmi.h b/drivers/gpu/drm/i915/display/intel_hdmi.h
index db87656eb27f..375f1b4decfb 100644
--- a/drivers/gpu/drm/i915/display/intel_hdmi.h
+++ b/drivers/gpu/drm/i915/display/intel_hdmi.h
@@ -62,6 +62,7 @@ void intel_hdmi_dsc_get_min_max_bpp(enum intel_output_format output_format, u8 b
bool intel_hdmi_dsc_bpp_fits_chunk_bytes(int bpp, int num_slices, int slice_width,
int hdmi_max_chunk_bytes);
int intel_hdmi_dsc_get_num_slices(const struct drm_display_mode *mode,
+ int pixel_clock,
enum intel_output_format output_format,
int src_max_slices, int src_max_slice_width,
int hdmi_max_slices, int hdmi_throughput);
--
2.50.1
^ permalink raw reply related [flat|nested] 9+ messages in thread