]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/i915/dp: Unify computing compressed BPP for DP-SST and eDP
authorImre Deak <imre.deak@intel.com>
Mon, 22 Dec 2025 15:35:45 +0000 (17:35 +0200)
committerImre Deak <imre.deak@intel.com>
Tue, 13 Jan 2026 16:42:20 +0000 (18:42 +0200)
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
drivers/gpu/drm/i915/display/intel_dp.c

index 75ae8811442a003637cdd9b35193e0426afd8278..96fddb8c54c3b9d4106e703a0af6979d538eecd1 100644 (file)
@@ -2227,6 +2227,14 @@ static int dsc_compute_compressed_bpp(struct intel_dp *intel_dp,
 
        max_bpp_x16 = align_max_compressed_bpp_x16(connector, pipe_config->output_format,
                                                   pipe_bpp, max_bpp_x16);
+       if (intel_dp_is_edp(intel_dp)) {
+               pipe_config->port_clock = limits->max_rate;
+               pipe_config->lane_count = limits->max_lane_count;
+
+               pipe_config->dsc.compressed_bpp_x16 = max_bpp_x16;
+
+               return 0;
+       }
 
        for (bpp_x16 = max_bpp_x16; bpp_x16 >= min_bpp_x16; bpp_x16 -= bpp_step_x16) {
                if (!intel_dp_dsc_valid_compressed_bpp(intel_dp, bpp_x16))
@@ -2319,9 +2327,8 @@ static int intel_edp_dsc_compute_pipe_bpp(struct intel_dp *intel_dp,
                                          struct drm_connector_state *conn_state,
                                          const struct link_config_limits *limits)
 {
-       struct intel_connector *connector =
-               to_intel_connector(conn_state->connector);
        int pipe_bpp, forced_bpp;
+       int ret;
 
        forced_bpp = intel_dp_force_dsc_pipe_bpp(intel_dp, limits);
        if (forced_bpp)
@@ -2329,12 +2336,10 @@ static int intel_edp_dsc_compute_pipe_bpp(struct intel_dp *intel_dp,
        else
                pipe_bpp = limits->pipe.max_bpp;
 
-       pipe_config->port_clock = limits->max_rate;
-       pipe_config->lane_count = limits->max_lane_count;
-
-       pipe_config->dsc.compressed_bpp_x16 =
-               align_max_compressed_bpp_x16(connector, pipe_config->output_format,
-                                            pipe_bpp, limits->link.max_bpp_x16);
+       ret = dsc_compute_compressed_bpp(intel_dp, pipe_config, conn_state,
+                                        limits, pipe_bpp);
+       if (ret)
+               return -EINVAL;
 
        pipe_config->pipe_bpp = pipe_bpp;