|
@@ -5142,6 +5142,22 @@ static bool hsw_post_update_enable_ips(const struct intel_crtc_state *old_crtc_s
|
|
return !old_crtc_state->ips_enabled;
|
|
return !old_crtc_state->ips_enabled;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+static bool needs_nv12_wa(struct drm_i915_private *dev_priv,
|
|
|
|
+ const struct intel_crtc_state *crtc_state)
|
|
|
|
+{
|
|
|
|
+ if (!crtc_state->nv12_planes)
|
|
|
|
+ return false;
|
|
|
|
+
|
|
|
|
+ if (IS_SKYLAKE(dev_priv) || IS_BROXTON(dev_priv))
|
|
|
|
+ return false;
|
|
|
|
+
|
|
|
|
+ if ((INTEL_GEN(dev_priv) == 9 && !IS_GEMINILAKE(dev_priv)) ||
|
|
|
|
+ IS_CANNONLAKE(dev_priv))
|
|
|
|
+ return true;
|
|
|
|
+
|
|
|
|
+ return false;
|
|
|
|
+}
|
|
|
|
+
|
|
static void intel_post_plane_update(struct intel_crtc_state *old_crtc_state)
|
|
static void intel_post_plane_update(struct intel_crtc_state *old_crtc_state)
|
|
{
|
|
{
|
|
struct intel_crtc *crtc = to_intel_crtc(old_crtc_state->base.crtc);
|
|
struct intel_crtc *crtc = to_intel_crtc(old_crtc_state->base.crtc);
|
|
@@ -5166,7 +5182,6 @@ static void intel_post_plane_update(struct intel_crtc_state *old_crtc_state)
|
|
if (old_primary_state) {
|
|
if (old_primary_state) {
|
|
struct drm_plane_state *new_primary_state =
|
|
struct drm_plane_state *new_primary_state =
|
|
drm_atomic_get_new_plane_state(old_state, primary);
|
|
drm_atomic_get_new_plane_state(old_state, primary);
|
|
- struct drm_framebuffer *fb = new_primary_state->fb;
|
|
|
|
|
|
|
|
intel_fbc_post_update(crtc);
|
|
intel_fbc_post_update(crtc);
|
|
|
|
|
|
@@ -5174,15 +5189,12 @@ static void intel_post_plane_update(struct intel_crtc_state *old_crtc_state)
|
|
(needs_modeset(&pipe_config->base) ||
|
|
(needs_modeset(&pipe_config->base) ||
|
|
!old_primary_state->visible))
|
|
!old_primary_state->visible))
|
|
intel_post_enable_primary(&crtc->base, pipe_config);
|
|
intel_post_enable_primary(&crtc->base, pipe_config);
|
|
-
|
|
|
|
- /* Display WA 827 */
|
|
|
|
- if ((INTEL_GEN(dev_priv) == 9 && !IS_GEMINILAKE(dev_priv)) ||
|
|
|
|
- IS_CANNONLAKE(dev_priv)) {
|
|
|
|
- if (fb && fb->format->format == DRM_FORMAT_NV12)
|
|
|
|
- skl_wa_clkgate(dev_priv, crtc->pipe, false);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ /* Display WA 827 */
|
|
|
|
+ if (needs_nv12_wa(dev_priv, old_crtc_state) &&
|
|
|
|
+ !needs_nv12_wa(dev_priv, pipe_config))
|
|
|
|
+ skl_wa_clkgate(dev_priv, crtc->pipe, false);
|
|
}
|
|
}
|
|
|
|
|
|
static void intel_pre_plane_update(struct intel_crtc_state *old_crtc_state,
|
|
static void intel_pre_plane_update(struct intel_crtc_state *old_crtc_state,
|
|
@@ -5206,14 +5218,6 @@ static void intel_pre_plane_update(struct intel_crtc_state *old_crtc_state,
|
|
struct intel_plane_state *new_primary_state =
|
|
struct intel_plane_state *new_primary_state =
|
|
intel_atomic_get_new_plane_state(old_intel_state,
|
|
intel_atomic_get_new_plane_state(old_intel_state,
|
|
to_intel_plane(primary));
|
|
to_intel_plane(primary));
|
|
- struct drm_framebuffer *fb = new_primary_state->base.fb;
|
|
|
|
-
|
|
|
|
- /* Display WA 827 */
|
|
|
|
- if ((INTEL_GEN(dev_priv) == 9 && !IS_GEMINILAKE(dev_priv)) ||
|
|
|
|
- IS_CANNONLAKE(dev_priv)) {
|
|
|
|
- if (fb && fb->format->format == DRM_FORMAT_NV12)
|
|
|
|
- skl_wa_clkgate(dev_priv, crtc->pipe, true);
|
|
|
|
- }
|
|
|
|
|
|
|
|
intel_fbc_pre_update(crtc, pipe_config, new_primary_state);
|
|
intel_fbc_pre_update(crtc, pipe_config, new_primary_state);
|
|
/*
|
|
/*
|
|
@@ -5225,6 +5229,11 @@ static void intel_pre_plane_update(struct intel_crtc_state *old_crtc_state,
|
|
intel_set_cpu_fifo_underrun_reporting(dev_priv, crtc->pipe, false);
|
|
intel_set_cpu_fifo_underrun_reporting(dev_priv, crtc->pipe, false);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /* Display WA 827 */
|
|
|
|
+ if (!needs_nv12_wa(dev_priv, old_crtc_state) &&
|
|
|
|
+ needs_nv12_wa(dev_priv, pipe_config))
|
|
|
|
+ skl_wa_clkgate(dev_priv, crtc->pipe, true);
|
|
|
|
+
|
|
/*
|
|
/*
|
|
* Vblank time updates from the shadow to live plane control register
|
|
* Vblank time updates from the shadow to live plane control register
|
|
* are blocked if the memory self-refresh mode is active at that
|
|
* are blocked if the memory self-refresh mode is active at that
|