drm/i915/display: Fix vsc_sdp computation
authorJouni Högander <jouni.hogander@intel.com>
Wed, 20 Dec 2023 10:36:06 +0000 (12:36 +0200)
committerJouni Högander <jouni.hogander@intel.com>
Fri, 22 Dec 2023 06:14:57 +0000 (08:14 +0200)
Currently colorimetry data is not added for psr1 or non-psr case.
Fix this by adding it as needed.

Signed-off-by: Jouni Högander <jouni.hogander@intel.com>
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Tested-by: Shawn Lee <shawn.c.lee@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20231220103609.1384523-5-jouni.hogander@intel.com
drivers/gpu/drm/i915/display/intel_dp.c

index 6607dba8049eb5b1b277ddc277bc88a7254afe46..173562f4ec457a0b3de7d9af90f974d9c0e68dfc 100644 (file)
@@ -2628,36 +2628,26 @@ static void intel_dp_compute_vsc_sdp(struct intel_dp *intel_dp,
        crtc_state->infoframes.enable |= intel_hdmi_infoframe_enable(DP_SDP_VSC);
        vsc->sdp_type = DP_SDP_VSC;
 
-       if (crtc_state->has_psr2) {
-               if (intel_dp->colorimetry_support &&
-                   intel_dp_needs_vsc_sdp(crtc_state, conn_state)) {
-                       /* [PSR2, +Colorimetry] */
-                       intel_dp_compute_vsc_colorimetry(crtc_state, conn_state,
-                                                        vsc);
-               } else {
-                       /*
-                        * [PSR2, -Colorimetry]
-                        * Prepare VSC Header for SU as per eDP 1.4 spec, Table 6-11
-                        * 3D stereo + PSR/PSR2 + Y-coordinate.
-                        */
-                       vsc->revision = 0x4;
-                       vsc->length = 0xe;
-               }
+       /* Needs colorimetry */
+       if (intel_dp_needs_vsc_sdp(crtc_state, conn_state)) {
+               intel_dp_compute_vsc_colorimetry(crtc_state, conn_state,
+                                                vsc);
+       } else if (crtc_state->has_psr2) {
+               /*
+                * [PSR2 without colorimetry]
+                * Prepare VSC Header for SU as per eDP 1.4 spec, Table 6-11
+                * 3D stereo + PSR/PSR2 + Y-coordinate.
+                */
+               vsc->revision = 0x4;
+               vsc->length = 0xe;
        } else if (crtc_state->has_panel_replay) {
-               if (intel_dp->colorimetry_support &&
-                   intel_dp_needs_vsc_sdp(crtc_state, conn_state)) {
-                       /* [Panel Replay with colorimetry info] */
-                       intel_dp_compute_vsc_colorimetry(crtc_state, conn_state,
-                                                        vsc);
-               } else {
-                       /*
-                        * [Panel Replay without colorimetry info]
-                        * Prepare VSC Header for SU as per DP 2.0 spec, Table 2-223
-                        * VSC SDP supporting 3D stereo + Panel Replay.
-                        */
-                       vsc->revision = 0x6;
-                       vsc->length = 0x10;
-               }
+               /*
+                * [Panel Replay without colorimetry info]
+                * Prepare VSC Header for SU as per DP 2.0 spec, Table 2-223
+                * VSC SDP supporting 3D stereo + Panel Replay.
+                */
+               vsc->revision = 0x6;
+               vsc->length = 0x10;
        } else {
                /*
                 * [PSR1]