diff mbox series

drm/i915/vdsc: Use the DSC config tables for DSI panels

Message ID 20250228051041.397020-1-suraj.kandpal@intel.com (mailing list archive)
State New
Headers show
Series drm/i915/vdsc: Use the DSC config tables for DSI panels | expand

Commit Message

Kandpal, Suraj Feb. 28, 2025, 5:10 a.m. UTC
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]

--v3
-Add Signed-off-by from William too [Ankit]

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

Closes: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/13719
Signed-off-by: Suraj Kandpal <suraj.kandpal@intel.com>
Signed-off-by: William Tseng <william.tseng@intel.com>
---
 drivers/gpu/drm/i915/display/intel_vdsc.c | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

Comments

Jani Nikula Feb. 28, 2025, 9:15 a.m. UTC | #1
On Fri, 28 Feb 2025, Suraj Kandpal <suraj.kandpal@intel.com> wrote:
> 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]
>
> --v3
> -Add Signed-off-by from William too [Ankit]

Why?

People seem to assign all sorts of meanings to Signed-off-by, but it's
really about certifying [1]. It's certainly not about giving credits.

[1] https://developercertificate.org/

>
> --v4
> -Use a function to check Mipi dsi dsc 1.1 condition [Ankit]
> -Add documentation for using this condition [Ankit]
> -Rebase
>
> Closes: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/13719
> Signed-off-by: Suraj Kandpal <suraj.kandpal@intel.com>
> Signed-off-by: William Tseng <william.tseng@intel.com>

If William was indeed involved in writing the patch, his Signed-off-by,
possibly with a Co-developed-by, needs to come first. The subsequent
handlers add their Signed-off-by at the end. For instance, if I applied
the patch, my Signed-off-by would be added at the end.

> ---
>  drivers/gpu/drm/i915/display/intel_vdsc.c | 15 ++++++++++++++-
>  1 file changed, 14 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_vdsc.c b/drivers/gpu/drm/i915/display/intel_vdsc.c
> index 3ed64c17bdff..2a6706517cfa 100644
> --- a/drivers/gpu/drm/i915/display/intel_vdsc.c
> +++ b/drivers/gpu/drm/i915/display/intel_vdsc.c
> @@ -259,6 +259,13 @@ static int intel_dsc_slice_dimensions_valid(struct intel_crtc_state *pipe_config
>  	return 0;
>  }
>  
> +static bool is_mipi_dsi_dsc_1_1(struct drm_dsc_config *vdsc_cfg,
> +				struct intel_crtc_state *crtc_state)

We don't really use "mipi_dsi" naming, just like we don't use
"vesa_dp". It's just DSI, and it's clear enough.

There's no need to pass vdsc_cfg separately. You can figure it out from
crtc_state.

> +{
> +	return vdsc_cfg->dsc_version_minor == 1 &&

I wonder how many places would blow up with the addition of DSC 2.1...

This isn't the only place that gets this wrong, but we really need to be
more careful about the DSC version checks. Might as well start with new
code being added.

> +		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 +324,14 @@ 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

Add a blank comment line here to separate paragraphs.

> +	 * We also 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 to be ignore. This causes a
> +	 * noise in the display.
>  	 */
> -	if (DISPLAY_VER(display) >= 13) {
> +	if (DISPLAY_VER(display) >= 13 &&
> +	    !is_mipi_dsi_dsc_1_1(vdsc_cfg, pipe_config)) {

With the parameter removed, this'll probably fit on one line.

BR,
Jani.

>  		calculate_rc_params(vdsc_cfg);
>  	} else {
>  		if ((compressed_bpp == 8 ||
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/display/intel_vdsc.c b/drivers/gpu/drm/i915/display/intel_vdsc.c
index 3ed64c17bdff..2a6706517cfa 100644
--- a/drivers/gpu/drm/i915/display/intel_vdsc.c
+++ b/drivers/gpu/drm/i915/display/intel_vdsc.c
@@ -259,6 +259,13 @@  static int intel_dsc_slice_dimensions_valid(struct intel_crtc_state *pipe_config
 	return 0;
 }
 
+static bool is_mipi_dsi_dsc_1_1(struct drm_dsc_config *vdsc_cfg,
+				struct intel_crtc_state *crtc_state)
+{
+	return 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 +324,14 @@  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 also 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 to be ignore. This causes a
+	 * noise in the display.
 	 */
-	if (DISPLAY_VER(display) >= 13) {
+	if (DISPLAY_VER(display) >= 13 &&
+	    !is_mipi_dsi_dsc_1_1(vdsc_cfg, pipe_config)) {
 		calculate_rc_params(vdsc_cfg);
 	} else {
 		if ((compressed_bpp == 8 ||