[Intel-gfx] [PATCH 3/4] drm/i915: Disable all crtcs during driver unload.

Daniel Vetter daniel at ffwll.ch
Wed Jan 11 16:15:00 UTC 2017


On Thu, Dec 15, 2016 at 03:29:44PM +0100, Maarten Lankhorst wrote:
> We may keep the crtc's enabled when userspace unsets all framebuffers but
> keeps the crtc active. This exposes a WARN in fbc_global disable, and
> a lot of bugs in our hardware readout code. Solve this by disabling
> all crtc's for now.
> 
> Signed-off-by: Maarten Lankhorst <maarten.lankhorst at linux.intel.com>
> ---
>  drivers/gpu/drm/i915/i915_drv.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
> index 6428588518aa..bb0d7517b678 100644
> --- a/drivers/gpu/drm/i915/i915_drv.c
> +++ b/drivers/gpu/drm/i915/i915_drv.c
> @@ -43,6 +43,7 @@
>  
>  #include <drm/drmP.h>
>  #include <drm/drm_crtc_helper.h>
> +#include <drm/drm_atomic_helper.h>
>  #include <drm/i915_drm.h>
>  
>  #include "i915_drv.h"
> @@ -1282,6 +1283,10 @@ void i915_driver_unload(struct drm_device *dev)
>  
>  	intel_display_power_get(dev_priv, POWER_DOMAIN_INIT);
>  
> +	drm_modeset_lock_all(dev);
> +	drm_atomic_helper_disable_all(dev, dev->mode_config.acquire_ctx);
> +	drm_modeset_unlock_all(dev);

Bikeshed: I think we should phase out lock_all and do an explicit acquire
context here. And maybe get a bit better at refactoring the boilerplate
that brings along. But also as-is:

Reviewed-by: Daniel Vetter <daniel.vetter at ffwll.ch>

> +
>  	i915_driver_unregister(dev_priv);
>  
>  	drm_vblank_cleanup(dev);
> -- 
> 2.7.4
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch


More information about the Intel-gfx mailing list