[Intel-gfx] [PATCH 04/44] drm: Automatically unregister the connector during cleanup

Daniel Vetter daniel at ffwll.ch
Fri Jun 17 07:44:40 UTC 2016


On Wed, Jun 15, 2016 at 01:17:49PM +0100, Chris Wilson wrote:
> As we now can call drm_connector_unregister() multiple times, provide a
> failsafe unregister for a connector when cleaning it up.
> 
> v2: Add a WARN to catch any connectors that are still visible to
> userspace when we come to destoy them.
> 
> Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
> Cc: Dave Airlie <airlied at redhat.com>
> Cc: dri-devel at lists.freedesktop.org
> Reviewed-by: Daniel Vetter <daniel.vetter at ffwll.ch>

Ok, merged up to this one to drm-misc. Please resend the other core/driver
patches, preferrably as a stand-alone series.

Thanks, Daniel

> ---
>  drivers/gpu/drm/drm_crtc.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c
> index ea5ec641eacc..316dea9bea08 100644
> --- a/drivers/gpu/drm/drm_crtc.c
> +++ b/drivers/gpu/drm/drm_crtc.c
> @@ -938,6 +938,12 @@ void drm_connector_cleanup(struct drm_connector *connector)
>  	struct drm_device *dev = connector->dev;
>  	struct drm_display_mode *mode, *t;
>  
> +	/* The connector should have been removed from userspace long before
> +	 * it is finally destroyed.
> +	 */
> +	if (WARN_ON(connector->registered))
> +		drm_connector_unregister(connector);
> +
>  	if (connector->tile_group) {
>  		drm_mode_put_tile_group(dev, connector->tile_group);
>  		connector->tile_group = NULL;
> -- 
> 2.8.1
> 

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


More information about the Intel-gfx mailing list