Commit b24df93f authored by Ville Syrjälä's avatar Ville Syrjälä Committed by Greg Kroah-Hartman
Browse files

drm/i915: Restore vblank interrupts earlier

commit 7cada4d0


Plane sanitation needs vblank interrupts (on account of CxSR disable).
So let's restore vblank interrupts earlier.

v2: Make it actually build
v3: Add comment to explain why we need this (Daniel)

Cc: Dennis <>
Tested-by: default avatarDennis <>
Tested-by: default avatarPeter Nowee <>
Fixes: b1e01595

 ("drm/i915: Redo plane sanitation during readout")
Signed-off-by: default avatarVille Syrjälä <>
Reviewed-by: default avatarDaniel Vetter <>
(cherry picked from commit 68bc30de

Signed-off-by: default avatarRodrigo Vivi <>
Signed-off-by: default avatarGreg Kroah-Hartman <>
parent b1fd8f59
...@@ -14829,13 +14829,9 @@ static void intel_sanitize_crtc(struct intel_crtc *crtc, ...@@ -14829,13 +14829,9 @@ static void intel_sanitize_crtc(struct intel_crtc *crtc,
} }
/* restore vblank interrupts to correct state */
if (crtc->active) { if (crtc->active) {
struct intel_plane *plane; struct intel_plane *plane;
/* Disable everything but the primary plane */ /* Disable everything but the primary plane */
for_each_intel_plane_on_crtc(dev, crtc, plane) { for_each_intel_plane_on_crtc(dev, crtc, plane) {
const struct intel_plane_state *plane_state = const struct intel_plane_state *plane_state =
...@@ -15148,7 +15144,6 @@ intel_modeset_setup_hw_state(struct drm_device *dev, ...@@ -15148,7 +15144,6 @@ intel_modeset_setup_hw_state(struct drm_device *dev,
struct drm_modeset_acquire_ctx *ctx) struct drm_modeset_acquire_ctx *ctx)
{ {
struct drm_i915_private *dev_priv = to_i915(dev); struct drm_i915_private *dev_priv = to_i915(dev);
enum pipe pipe;
struct intel_crtc *crtc; struct intel_crtc *crtc;
struct intel_encoder *encoder; struct intel_encoder *encoder;
int i; int i;
...@@ -15167,15 +15162,23 @@ intel_modeset_setup_hw_state(struct drm_device *dev, ...@@ -15167,15 +15162,23 @@ intel_modeset_setup_hw_state(struct drm_device *dev,
/* HW state is read out, now we need to sanitize this mess. */ /* HW state is read out, now we need to sanitize this mess. */
get_encoder_power_domains(dev_priv); get_encoder_power_domains(dev_priv);
intel_sanitize_plane_mapping(dev_priv); /*
* intel_sanitize_plane_mapping() may need to do vblank
* waits, so we need vblank interrupts restored beforehand.
for_each_intel_crtc(&dev_priv->drm, crtc) {
for_each_intel_encoder(dev, encoder) { if (crtc->active)
intel_sanitize_encoder(encoder); drm_crtc_vblank_on(&crtc->base);
} }
for_each_pipe(dev_priv, pipe) { intel_sanitize_plane_mapping(dev_priv);
crtc = intel_get_crtc_for_pipe(dev_priv, pipe);
for_each_intel_encoder(dev, encoder)
for_each_intel_crtc(&dev_priv->drm, crtc) {
intel_sanitize_crtc(crtc, ctx); intel_sanitize_crtc(crtc, ctx);
intel_dump_pipe_config(crtc, crtc->config, intel_dump_pipe_config(crtc, crtc->config,
"[setup_hw_state]"); "[setup_hw_state]");
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment