Expose intel_hdmi_dsc_get_min_max_bpp() to query the allowed compressed
bpp range.
This will be used in the subsequent change to compute the compressed bpp
range in mode_valid() for an HDMI with DSC connected to a DP DFP.

Signed-off-by: Ankit Nautiyal <[email protected]>
---
 drivers/gpu/drm/i915/display/intel_hdmi.c | 20 +++++++++++++++-----
 drivers/gpu/drm/i915/display/intel_hdmi.h |  2 ++
 2 files changed, 17 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_hdmi.c 
b/drivers/gpu/drm/i915/display/intel_hdmi.c
index 428631abca74..c58c9202fc10 100644
--- a/drivers/gpu/drm/i915/display/intel_hdmi.c
+++ b/drivers/gpu/drm/i915/display/intel_hdmi.c
@@ -3325,9 +3325,19 @@ intel_hdmi_dsc_get_num_slices(const struct 
drm_display_mode *mode,
        return target_slices;
 }
 
-static void
-get_dsc_min_max_bpp(enum intel_output_format output_format, u8 bpc,
-                   bool hdmi_all_bpp, int *min_dsc_bpp, int *max_dsc_bpp)
+/*
+ * intel_hdmi_dsc_get_min_max_bpp - get the min and max compressed bpp range
+ * allowed for a given output format and bpc.
+ *
+ * @output_format: video output format
+ * @bpc: bits per color
+ * @hdmi_all_bpp: sink supports decoding of 1/16th bpp setting
+ * @min_dsc_bpp: returns the minimum allowed compressed bpp
+ * @max_dsc_bpp: returns the maximum allowed compressed bpp
+ */
+void
+intel_hdmi_dsc_get_min_max_bpp(enum intel_output_format output_format, u8 bpc,
+                              bool hdmi_all_bpp, int *min_dsc_bpp, int 
*max_dsc_bpp)
 {
        /*
         * Get min bpp and max bpp as per Table 7.23, in HDMI2.1 spec
@@ -3434,8 +3444,8 @@ intel_hdmi_dsc_get_bpp(int src_fractional_bpp, int 
slice_width, int num_slices,
        int max_dsc_bpp, min_dsc_bpp;
        int dsc_bpp_x16;
 
-       get_dsc_min_max_bpp(output_format, bpc, hdmi_all_bpp,
-                           &min_dsc_bpp, &max_dsc_bpp);
+       intel_hdmi_dsc_get_min_max_bpp(output_format, bpc, hdmi_all_bpp,
+                                      &min_dsc_bpp, &max_dsc_bpp);
 
        dsc_bpp_x16 = get_dsc_compressed_bpp(num_slices, slice_width,
                                             hdmi_max_chunk_bytes,
diff --git a/drivers/gpu/drm/i915/display/intel_hdmi.h 
b/drivers/gpu/drm/i915/display/intel_hdmi.h
index c3a0e81615e4..dc81a62aac5e 100644
--- a/drivers/gpu/drm/i915/display/intel_hdmi.h
+++ b/drivers/gpu/drm/i915/display/intel_hdmi.h
@@ -57,6 +57,8 @@ int intel_hdmi_tmds_clock(int clock, int bpc, enum 
intel_output_format sink_form
 int intel_hdmi_dsc_get_bpp(int src_fractional_bpp, int slice_width,
                           int num_slices, enum intel_output_format 
output_format,
                           int bpc, bool hdmi_all_bpp, int 
hdmi_max_chunk_bytes);
+void intel_hdmi_dsc_get_min_max_bpp(enum intel_output_format output_format, u8 
bpc,
+                                   bool hdmi_all_bpp, int *min_dsc_bpp, int 
*max_dsc_bpp);
 int intel_hdmi_dsc_get_num_slices(const struct drm_display_mode *mode,
                                  enum intel_output_format output_format,
                                  int src_max_slices, int src_max_slice_width,
-- 
2.50.1

Reply via email to