drm/i915/dp: Use connector DSC DPCD in intel_dp_dsc_get_slice_count()
authorImre Deak <imre.deak@intel.com>
Fri, 6 Oct 2023 13:37:23 +0000 (16:37 +0300)
committerImre Deak <imre.deak@intel.com>
Mon, 16 Oct 2023 14:01:38 +0000 (17:01 +0300)
Use the connector's DSC DPCD capabilities in
intel_dp_dsc_get_slice_count().

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Imre Deak <imre.deak@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20231006133727.1822579-16-imre.deak@intel.com
drivers/gpu/drm/i915/display/intel_dp.c
drivers/gpu/drm/i915/display/intel_dp.h
drivers/gpu/drm/i915/display/intel_dp_mst.c

index 8e42950bbd4bda13da1bede37ffb4319500556b1..c6f0f959b4ad3b274c987c960fc20fa45508ad48 100644 (file)
@@ -823,11 +823,11 @@ u16 intel_dp_dsc_get_max_compressed_bpp(struct drm_i915_private *i915,
        return bits_per_pixel;
 }
 
-u8 intel_dp_dsc_get_slice_count(struct intel_dp *intel_dp,
+u8 intel_dp_dsc_get_slice_count(const struct intel_connector *connector,
                                int mode_clock, int mode_hdisplay,
                                bool bigjoiner)
 {
-       struct drm_i915_private *i915 = dp_to_i915(intel_dp);
+       struct drm_i915_private *i915 = to_i915(connector->base.dev);
        u8 min_slice_count, i;
        int max_slice_width;
 
@@ -845,7 +845,7 @@ u8 intel_dp_dsc_get_slice_count(struct intel_dp *intel_dp,
        if (mode_clock >= ((i915->display.cdclk.max_cdclk_freq * 85) / 100))
                min_slice_count = max_t(u8, min_slice_count, 2);
 
-       max_slice_width = drm_dp_dsc_sink_max_slice_width(intel_dp->dsc_dpcd);
+       max_slice_width = drm_dp_dsc_sink_max_slice_width(connector->dp.dsc_dpcd);
        if (max_slice_width < DP_DSC_MIN_SLICE_WIDTH_VALUE) {
                drm_dbg_kms(&i915->drm,
                            "Unsupported slice width %d by DP DSC Sink device\n",
@@ -862,7 +862,7 @@ u8 intel_dp_dsc_get_slice_count(struct intel_dp *intel_dp,
                u8 test_slice_count = valid_dsc_slicecount[i] << bigjoiner;
 
                if (test_slice_count >
-                   drm_dp_dsc_sink_max_slice_count(intel_dp->dsc_dpcd, false))
+                   drm_dp_dsc_sink_max_slice_count(connector->dp.dsc_dpcd, false))
                        break;
 
                /* big joiner needs small joiner to be enabled */
@@ -1238,7 +1238,7 @@ intel_dp_mode_valid(struct drm_connector *_connector,
                                                                    output_format,
                                                                    pipe_bpp, 64);
                        dsc_slice_count =
-                               intel_dp_dsc_get_slice_count(intel_dp,
+                               intel_dp_dsc_get_slice_count(connector,
                                                             target_clock,
                                                             mode->hdisplay,
                                                             bigjoiner);
@@ -2161,7 +2161,7 @@ int intel_dp_dsc_compute_config(struct intel_dp *intel_dp,
                u8 dsc_dp_slice_count;
 
                dsc_dp_slice_count =
-                       intel_dp_dsc_get_slice_count(intel_dp,
+                       intel_dp_dsc_get_slice_count(connector,
                                                     adjusted_mode->crtc_clock,
                                                     adjusted_mode->crtc_hdisplay,
                                                     pipe_config->bigjoiner_pipes);
index af87aa2a5ed6786a20a138c8ccfe2280fa2aa8bd..51edb587e4d247a1f74afc776d77802abf413ca0 100644 (file)
@@ -125,7 +125,7 @@ u16 intel_dp_dsc_get_max_compressed_bpp(struct drm_i915_private *i915,
                                        enum intel_output_format output_format,
                                        u32 pipe_bpp,
                                        u32 timeslots);
-u8 intel_dp_dsc_get_slice_count(struct intel_dp *intel_dp,
+u8 intel_dp_dsc_get_slice_count(const struct intel_connector *connector,
                                int mode_clock, int mode_hdisplay,
                                bool bigjoiner);
 bool intel_dp_need_bigjoiner(struct intel_dp *intel_dp,
index 303734ab7ef4e637b89cf472f06b7989b0ddaa3a..115d4d8870b03144f31fc376812dbfc127900093 100644 (file)
@@ -1014,7 +1014,7 @@ intel_dp_mst_mode_valid_ctx(struct drm_connector *connector,
                                                                    INTEL_OUTPUT_FORMAT_RGB,
                                                                    pipe_bpp, 64);
                        dsc_slice_count =
-                               intel_dp_dsc_get_slice_count(intel_dp,
+                               intel_dp_dsc_get_slice_count(intel_connector,
                                                             target_clock,
                                                             mode->hdisplay,
                                                             bigjoiner);