diff mbox series

drm/i915: Wait for scanout to stop when sanitizing planes

Message ID 20210217162050.13803-1-ville.syrjala@linux.intel.com (mailing list archive)
State New, archived
Headers show
Series drm/i915: Wait for scanout to stop when sanitizing planes | expand

Commit Message

Ville Syrjälä Feb. 17, 2021, 4:20 p.m. UTC
From: Ville Syrjälä <ville.syrjala@linux.intel.com>

When we sanitize planes let's wait for the scanout to stop
before we let the subsequent code tear down the ggtt mappings
and whatnot. Cures an underrun on my ivb when I boot with
VT-d enabled and the BIOS fb gets thrown out due to stolen
being considered unusable with VT-d active.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/i915/display/intel_display.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Chris Wilson Feb. 17, 2021, 5:49 p.m. UTC | #1
Quoting Ville Syrjala (2021-02-17 16:20:50)
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> When we sanitize planes let's wait for the scanout to stop
> before we let the subsequent code tear down the ggtt mappings
> and whatnot. Cures an underrun on my ivb when I boot with
> VT-d enabled and the BIOS fb gets thrown out due to stolen
> being considered unusable with VT-d active.
> 
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
>  drivers/gpu/drm/i915/display/intel_display.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
> index acade004e8b1..3e2c192ec708 100644
> --- a/drivers/gpu/drm/i915/display/intel_display.c
> +++ b/drivers/gpu/drm/i915/display/intel_display.c
> @@ -2403,6 +2403,7 @@ static void intel_plane_disable_noatomic(struct intel_crtc *crtc,
>                 intel_set_cpu_fifo_underrun_reporting(dev_priv, crtc->pipe, false);
>  
>         intel_disable_plane(plane, crtc_state);
> +       intel_wait_for_vblank(dev_priv, crtc->pipe);

I could only find paths here from sanitize, so it looks safe from the
prospect of adding random delays to userspace.

Makes sense so,
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
-Chris
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
index acade004e8b1..3e2c192ec708 100644
--- a/drivers/gpu/drm/i915/display/intel_display.c
+++ b/drivers/gpu/drm/i915/display/intel_display.c
@@ -2403,6 +2403,7 @@  static void intel_plane_disable_noatomic(struct intel_crtc *crtc,
 		intel_set_cpu_fifo_underrun_reporting(dev_priv, crtc->pipe, false);
 
 	intel_disable_plane(plane, crtc_state);
+	intel_wait_for_vblank(dev_priv, crtc->pipe);
 }
 
 static void