summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorImre Deak <imre.deak@intel.com>2026-01-14 18:22:30 +0200
committerImre Deak <imre.deak@intel.com>2026-01-15 20:20:21 +0200
commit088d06bb17b024866401a20484017cd172ead3d8 (patch)
tree1e408569c3b9350719bcd6bf5c2da317ef09357a
parentba9f0bbecdc462ebf361f65f62842a1e85c8baa8 (diff)
drm/i915/dp: Unify DP and eDP slice count computation
Unify the DP and eDP slices-per-line computation. Atm eDP simply returns the maximum slices-per-line value supported by the sink, but using the same helper function for both cases still makes sense, since a follow-up change will compute the detailed slice config for both cases. Reviewed-by: Jouni Högander <jouni.hogander@intel.com> Signed-off-by: Imre Deak <imre.deak@intel.com> Link: https://patch.msgid.link/20260114162232.92731-14-imre.deak@intel.com
-rw-r--r--drivers/gpu/drm/i915/display/intel_dp.c50
1 files changed, 25 insertions, 25 deletions
diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
index 1d6009b99497..2c50e380fb39 100644
--- a/drivers/gpu/drm/i915/display/intel_dp.c
+++ b/drivers/gpu/drm/i915/display/intel_dp.c
@@ -949,12 +949,21 @@ static int intel_dp_dsc_min_slice_count(const struct intel_connector *connector,
int mode_clock, int mode_hdisplay)
{
struct intel_display *display = to_intel_display(connector);
+ bool is_edp =
+ connector->base.connector_type == DRM_MODE_CONNECTOR_eDP;
int min_slice_count;
int max_slice_width;
int tp_rgb_yuv444;
int tp_yuv422_420;
/*
+ * TODO: allow using less than the maximum number of slices
+ * supported by the eDP sink, to allow using fewer DSC engines.
+ */
+ if (is_edp)
+ return drm_dp_dsc_sink_max_slice_count(connector->dp.dsc_dpcd, true);
+
+ /*
* TODO: Use the throughput value specific to the actual RGB/YUV
* format of the output.
* The RGB/YUV444 throughput value should be always either equal
@@ -1017,8 +1026,10 @@ u8 intel_dp_dsc_get_slice_count(const struct intel_connector *connector,
struct intel_display *display = to_intel_display(connector);
int min_slice_count =
intel_dp_dsc_min_slice_count(connector, mode_clock, mode_hdisplay);
+ bool is_edp =
+ connector->base.connector_type == DRM_MODE_CONNECTOR_eDP;
u32 sink_slice_count_mask =
- drm_dp_dsc_sink_slice_count_mask(connector->dp.dsc_dpcd, false);
+ drm_dp_dsc_sink_slice_count_mask(connector->dp.dsc_dpcd, is_edp);
int slices_per_pipe;
/*
@@ -1471,9 +1482,13 @@ intel_dp_mode_valid(struct drm_connector *_connector,
if (intel_dp_is_edp(intel_dp)) {
dsc_max_compressed_bpp =
drm_edp_dsc_sink_output_bpp(connector->dp.dsc_dpcd) >> 4;
+
dsc_slice_count =
- drm_dp_dsc_sink_max_slice_count(connector->dp.dsc_dpcd,
- true);
+ intel_dp_dsc_get_slice_count(connector,
+ target_clock,
+ mode->hdisplay,
+ num_joined_pipes);
+
dsc = dsc_max_compressed_bpp && dsc_slice_count;
} else if (drm_dp_sink_supports_fec(connector->dp.fec_capability)) {
unsigned long bw_overhead_flags = 0;
@@ -2381,28 +2396,13 @@ int intel_dp_dsc_compute_config(struct intel_dp *intel_dp,
}
/* Calculate Slice count */
- if (intel_dp_is_edp(intel_dp)) {
- slices_per_line =
- drm_dp_dsc_sink_max_slice_count(connector->dp.dsc_dpcd,
- true);
- if (!slices_per_line) {
- drm_dbg_kms(display->drm,
- "Unsupported Slice Count %d\n",
- slices_per_line);
- return -EINVAL;
- }
- } else {
- slices_per_line =
- intel_dp_dsc_get_slice_count(connector,
- adjusted_mode->crtc_clock,
- adjusted_mode->crtc_hdisplay,
- num_joined_pipes);
- if (!slices_per_line) {
- drm_dbg_kms(display->drm,
- "Compressed Slice Count not supported\n");
- return -EINVAL;
- }
- }
+ slices_per_line = intel_dp_dsc_get_slice_count(connector,
+ adjusted_mode->crtc_clock,
+ adjusted_mode->crtc_hdisplay,
+ num_joined_pipes);
+ if (!slices_per_line)
+ return -EINVAL;
+
/*
* VDSC engine operates at 1 Pixel per clock, so if peak pixel rate
* is greater than the maximum Cdclock and if slice count is even