Skip to content

Commit ce46682

Browse files
committed
drm/i915/dp: Simplify computing DSC BPPs for DP-SST
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> Link: https://patch.msgid.link/20251222153547.713360-17-imre.deak@intel.com
1 parent 8193ce9 commit ce46682

1 file changed

Lines changed: 8 additions & 21 deletions

File tree

drivers/gpu/drm/i915/display/intel_dp.c

Lines changed: 8 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2295,11 +2295,8 @@ static int intel_dp_dsc_compute_pipe_bpp(struct intel_dp *intel_dp,
22952295
struct drm_connector_state *conn_state,
22962296
const struct link_config_limits *limits)
22972297
{
2298-
const struct intel_connector *connector =
2299-
to_intel_connector(conn_state->connector);
2300-
u8 dsc_bpc[3] = {};
23012298
int forced_bpp, pipe_bpp;
2302-
int num_bpc, i, ret;
2299+
int ret;
23032300

23042301
forced_bpp = intel_dp_force_dsc_pipe_bpp(intel_dp, limits);
23052302

@@ -2312,25 +2309,15 @@ static int intel_dp_dsc_compute_pipe_bpp(struct intel_dp *intel_dp,
23122309
}
23132310
}
23142311

2315-
/*
2316-
* Get the maximum DSC bpc that will be supported by any valid
2317-
* link configuration and compressed bpp.
2318-
*/
2319-
num_bpc = drm_dp_dsc_sink_supported_input_bpcs(connector->dp.dsc_dpcd, dsc_bpc);
2320-
for (i = 0; i < num_bpc; i++) {
2321-
pipe_bpp = dsc_bpc[i] * 3;
2322-
if (pipe_bpp < limits->pipe.min_bpp || pipe_bpp > limits->pipe.max_bpp)
2323-
continue;
2312+
pipe_bpp = limits->pipe.max_bpp;
2313+
ret = dsc_compute_compressed_bpp(intel_dp, pipe_config, conn_state,
2314+
limits, pipe_bpp);
2315+
if (ret)
2316+
return -EINVAL;
23242317

2325-
ret = dsc_compute_compressed_bpp(intel_dp, pipe_config, conn_state,
2326-
limits, pipe_bpp);
2327-
if (ret == 0) {
2328-
pipe_config->pipe_bpp = pipe_bpp;
2329-
return 0;
2330-
}
2331-
}
2318+
pipe_config->pipe_bpp = pipe_bpp;
23322319

2333-
return -EINVAL;
2320+
return 0;
23342321
}
23352322

23362323
static int intel_edp_dsc_compute_pipe_bpp(struct intel_dp *intel_dp,

0 commit comments

Comments
 (0)