]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
drm/i915/dp: Make dsc helpers accept const crtc_state pointers
authorAnkit Nautiyal <ankit.k.nautiyal@intel.com>
Tue, 17 Dec 2024 09:32:42 +0000 (15:02 +0530)
committerAnkit Nautiyal <ankit.k.nautiyal@intel.com>
Tue, 24 Dec 2024 09:50:02 +0000 (15:20 +0530)
Modify the dsc helpers to get max/min compressed bpp to accept
`const struct intel_crtc_state *` pointers instead of
`struct intel_crtc_state *`.

These helpers are not supposed to modify `crtc_state`.
Accepting const pointers will allow these helpers to be called from
functions that have const pointer to crtc_state.

Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Reviewed-by: Suraj Kandpal <suraj.kandpal@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20241217093244.3938132-13-ankit.k.nautiyal@intel.com
drivers/gpu/drm/i915/display/intel_dp.c
drivers/gpu/drm/i915/display/intel_dp.h

index 3760dcff50d3165a2f8ec91dc9d6b93355439c5e..f694895d223ebc96f5c08c785c663ff79627ec5b 100644 (file)
@@ -1975,7 +1975,7 @@ static int dsc_compute_link_config(struct intel_dp *intel_dp,
 
 static
 u16 intel_dp_dsc_max_sink_compressed_bppx16(const struct intel_connector *connector,
-                                           struct intel_crtc_state *pipe_config,
+                                           const struct intel_crtc_state *pipe_config,
                                            int bpc)
 {
        u16 max_bppx16 = drm_edp_dsc_sink_output_bpp(connector->dp.dsc_dpcd);
@@ -2000,7 +2000,7 @@ u16 intel_dp_dsc_max_sink_compressed_bppx16(const struct intel_connector *connec
        return 0;
 }
 
-int intel_dp_dsc_sink_min_compressed_bpp(struct intel_crtc_state *pipe_config)
+int intel_dp_dsc_sink_min_compressed_bpp(const struct intel_crtc_state *pipe_config)
 {
        /* From Mandatory bit rate range Support Table 2-157 (DP v2.0) */
        switch (pipe_config->output_format) {
@@ -2018,7 +2018,7 @@ int intel_dp_dsc_sink_min_compressed_bpp(struct intel_crtc_state *pipe_config)
 }
 
 int intel_dp_dsc_sink_max_compressed_bpp(const struct intel_connector *connector,
-                                        struct intel_crtc_state *pipe_config,
+                                        const struct intel_crtc_state *pipe_config,
                                         int bpc)
 {
        return intel_dp_dsc_max_sink_compressed_bppx16(connector,
index 07e8e6cba94d18ff93edfd5b62113f03426744b6..ca49f0a05da5987752a3b745be260d267def9355 100644 (file)
@@ -144,9 +144,9 @@ u16 intel_dp_dsc_get_max_compressed_bpp(struct intel_display *display,
                                        enum intel_output_format output_format,
                                        u32 pipe_bpp,
                                        u32 timeslots);
-int intel_dp_dsc_sink_min_compressed_bpp(struct intel_crtc_state *pipe_config);
+int intel_dp_dsc_sink_min_compressed_bpp(const struct intel_crtc_state *pipe_config);
 int intel_dp_dsc_sink_max_compressed_bpp(const struct intel_connector *connector,
-                                        struct intel_crtc_state *pipe_config,
+                                        const struct intel_crtc_state *pipe_config,
                                         int bpc);
 u8 intel_dp_dsc_get_slice_count(const struct intel_connector *connector,
                                int mode_clock, int mode_hdisplay,