]> git.baikalelectronics.ru Git - kernel.git/commitdiff
drm/i915/display/psr: Set partial frame enable when forcing full frame fetch
authorJosé Roberto de Souza <jose.souza@intel.com>
Tue, 5 Apr 2022 15:53:42 +0000 (08:53 -0700)
committerJosé Roberto de Souza <jose.souza@intel.com>
Wed, 6 Apr 2022 15:42:58 +0000 (08:42 -0700)
Following up what was done in commit b7abdba6a228 ("drm/i915/psr: Set
"SF Partial Frame Enable" also on full update") and also setting
partial frame enable when psr_force_hw_tracking_exit() is called.

Also as PSR2_MAN_TRK_CTL is a double buffered registers do a RMW
is not a good idea so here also setting the man_trk_ctl_enable_bit()
that is required in TGL and only doing a register write.

v2:
- not doing a rmw

v3:
- removing the inline from functions that return PSR2_MAN_TRK_CTL
bits

Reviewed-by: Jouni Högander <jouni.hogander@intel.com>
Cc: Jouni Högander <jouni.hogander@intel.com>
Cc: Mika Kahola <mika.kahola@intel.com>
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220405155344.47219-1-jose.souza@intel.com
drivers/gpu/drm/i915/display/intel_psr.c

index 80002ca6a6ebeb16c3e4cf099b0e290a6147fa81..6e3ae2c4430c730a45575ede3a62ead5327dcdb1 100644 (file)
@@ -1436,14 +1436,19 @@ unlock:
        mutex_unlock(&psr->lock);
 }
 
-static inline u32 man_trk_ctl_single_full_frame_bit_get(struct drm_i915_private *dev_priv)
+static u32 man_trk_ctl_enable_bit_get(struct drm_i915_private *dev_priv)
+{
+       return IS_ALDERLAKE_P(dev_priv) ? 0 : PSR2_MAN_TRK_CTL_ENABLE;
+}
+
+static u32 man_trk_ctl_single_full_frame_bit_get(struct drm_i915_private *dev_priv)
 {
        return IS_ALDERLAKE_P(dev_priv) ?
               ADLP_PSR2_MAN_TRK_CTL_SF_SINGLE_FULL_FRAME :
               PSR2_MAN_TRK_CTL_SF_SINGLE_FULL_FRAME;
 }
 
-static inline u32 man_trk_ctl_partial_frame_bit_get(struct drm_i915_private *dev_priv)
+static u32 man_trk_ctl_partial_frame_bit_get(struct drm_i915_private *dev_priv)
 {
        return IS_ALDERLAKE_P(dev_priv) ?
               ADLP_PSR2_MAN_TRK_CTL_SF_PARTIAL_FRAME_UPDATE :
@@ -1455,9 +1460,11 @@ static void psr_force_hw_tracking_exit(struct intel_dp *intel_dp)
        struct drm_i915_private *dev_priv = dp_to_i915(intel_dp);
 
        if (intel_dp->psr.psr2_sel_fetch_enabled)
-               intel_de_rmw(dev_priv,
-                            PSR2_MAN_TRK_CTL(intel_dp->psr.transcoder), 0,
-                            man_trk_ctl_single_full_frame_bit_get(dev_priv));
+               intel_de_write(dev_priv,
+                              PSR2_MAN_TRK_CTL(intel_dp->psr.transcoder),
+                              man_trk_ctl_enable_bit_get(dev_priv) |
+                              man_trk_ctl_partial_frame_bit_get(dev_priv) |
+                              man_trk_ctl_single_full_frame_bit_get(dev_priv));
 
        /*
         * Display WA #0884: skl+
@@ -1554,10 +1561,7 @@ static void psr2_man_trk_ctl_calc(struct intel_crtc_state *crtc_state,
 {
        struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
        struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
-       u32 val = 0;
-
-       if (!IS_ALDERLAKE_P(dev_priv))
-               val = PSR2_MAN_TRK_CTL_ENABLE;
+       u32 val = man_trk_ctl_enable_bit_get(dev_priv);
 
        /* SF partial frame enable has to be set even on full update */
        val |= man_trk_ctl_partial_frame_bit_get(dev_priv);