]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
drm/i915/vdsc: Use the DSC config tables for DSI panels
authorSuraj Kandpal <suraj.kandpal@intel.com>
Fri, 28 Feb 2025 15:25:32 +0000 (20:55 +0530)
committerSuraj Kandpal <suraj.kandpal@intel.com>
Mon, 24 Mar 2025 05:47:06 +0000 (11:17 +0530)
Some DSI panel vendors end up hardcoding PPS params because of which
it does not listen to the params sent from the source. We use the
default config tables for DSI panels when using DSC 1.1 rather than
calculate our own rc parameters.

--v2
-Use intel_crtc_has_type [Jani]

--v4
-Use a function to check Mipi dsi dsc 1.1 condition [Ankit]
-Add documentation for using this condition [Ankit]
-Rebase

--v5
-Pass only the crtc_state [Jani]
-Fixup the comment [Jani]
-Check for dsc major version [Jani]
-Use co-developed-by tag [Jani]

--v6
-Add more definition of the issue and solution in the comment [Ankit]

Closes: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/13719
Co-developed-by: William Tseng <william.tseng@intel.com>
Signed-off-by: Suraj Kandpal <suraj.kandpal@intel.com>
Reviewed-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250228152531.403026-1-suraj.kandpal@intel.com
drivers/gpu/drm/i915/display/intel_vdsc.c

index 3ed64c17bdff48f1e98f29b4474315f2aa0b666f..470c170897e5f415782cbab78773e98df2cf540a 100644 (file)
@@ -259,6 +259,15 @@ static int intel_dsc_slice_dimensions_valid(struct intel_crtc_state *pipe_config
        return 0;
 }
 
+static bool is_dsi_dsc_1_1(struct intel_crtc_state *crtc_state)
+{
+       struct drm_dsc_config *vdsc_cfg = &crtc_state->dsc.config;
+
+       return vdsc_cfg->dsc_version_major == 1 &&
+               vdsc_cfg->dsc_version_minor == 1 &&
+               intel_crtc_has_type(crtc_state, INTEL_OUTPUT_DSI);
+}
+
 int intel_dsc_compute_params(struct intel_crtc_state *pipe_config)
 {
        struct intel_display *display = to_intel_display(pipe_config);
@@ -317,8 +326,19 @@ int intel_dsc_compute_params(struct intel_crtc_state *pipe_config)
         * From XE_LPD onwards we supports compression bpps in steps of 1
         * upto uncompressed bpp-1, hence add calculations for all the rc
         * parameters
+        *
+        * We don't want to calculate all rc parameters when the panel
+        * is MIPI DSI and it's using DSC 1.1. The reason being that some
+        * DSI panels vendors have hardcoded PPS params in the VBT causing
+        * the parameters sent from the source which are derived through
+        * interpolation to differ from the params the panel expects.
+        * This causes a noise in the display.
+        * Furthermore for DSI panels we are currently using  bits_per_pixel
+        * (compressed bpp) hardcoded from VBT, (unlike other encoders where we
+        * find the optimum compressed bpp) so dont need to rely on interpolation,
+        * as we can get the required rc parameters from the tables.
         */
-       if (DISPLAY_VER(display) >= 13) {
+       if (DISPLAY_VER(display) >= 13 && !is_dsi_dsc_1_1(pipe_config)) {
                calculate_rc_params(vdsc_cfg);
        } else {
                if ((compressed_bpp == 8 ||