Skip to content

Commit 2b60146

Browse files
committed
drm/i915/dp: Unify computing compressed BPP for DP-SST and eDP
Move computing the eDP compressed BPP value to the function computing this for DP, allowing further simplifications later. Reviewed-by: Vinod Govindapillai <vinod.govindapillai@intel.com> Signed-off-by: Imre Deak <imre.deak@intel.com> Link: https://patch.msgid.link/20251222153547.713360-19-imre.deak@intel.com
1 parent 2b68b9b commit 2b60146

1 file changed

Lines changed: 13 additions & 8 deletions

File tree

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

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2227,6 +2227,14 @@ static int dsc_compute_compressed_bpp(struct intel_dp *intel_dp,
22272227

22282228
max_bpp_x16 = align_max_compressed_bpp_x16(connector, pipe_config->output_format,
22292229
pipe_bpp, max_bpp_x16);
2230+
if (intel_dp_is_edp(intel_dp)) {
2231+
pipe_config->port_clock = limits->max_rate;
2232+
pipe_config->lane_count = limits->max_lane_count;
2233+
2234+
pipe_config->dsc.compressed_bpp_x16 = max_bpp_x16;
2235+
2236+
return 0;
2237+
}
22302238

22312239
for (bpp_x16 = max_bpp_x16; bpp_x16 >= min_bpp_x16; bpp_x16 -= bpp_step_x16) {
22322240
if (!intel_dp_dsc_valid_compressed_bpp(intel_dp, bpp_x16))
@@ -2319,22 +2327,19 @@ static int intel_edp_dsc_compute_pipe_bpp(struct intel_dp *intel_dp,
23192327
struct drm_connector_state *conn_state,
23202328
const struct link_config_limits *limits)
23212329
{
2322-
struct intel_connector *connector =
2323-
to_intel_connector(conn_state->connector);
23242330
int pipe_bpp, forced_bpp;
2331+
int ret;
23252332

23262333
forced_bpp = intel_dp_force_dsc_pipe_bpp(intel_dp, limits);
23272334
if (forced_bpp)
23282335
pipe_bpp = forced_bpp;
23292336
else
23302337
pipe_bpp = limits->pipe.max_bpp;
23312338

2332-
pipe_config->port_clock = limits->max_rate;
2333-
pipe_config->lane_count = limits->max_lane_count;
2334-
2335-
pipe_config->dsc.compressed_bpp_x16 =
2336-
align_max_compressed_bpp_x16(connector, pipe_config->output_format,
2337-
pipe_bpp, limits->link.max_bpp_x16);
2339+
ret = dsc_compute_compressed_bpp(intel_dp, pipe_config, conn_state,
2340+
limits, pipe_bpp);
2341+
if (ret)
2342+
return -EINVAL;
23382343

23392344
pipe_config->pipe_bpp = pipe_bpp;
23402345

0 commit comments

Comments
 (0)