Re: [PATCH v4 5/5] drm: bridge: Detach all bridges in a chain at encoder cleanup time

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Dec 14, 2016 at 11:59:10AM +0200, Laurent Pinchart wrote:
> Instead of detaching only the bridge directly connected to the encoder,
> detach all bridges in the chain.
> 
> Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@xxxxxxxxxxxxxxxx>
> ---
>  drivers/gpu/drm/drm_encoder.c | 12 ++++++++++--
>  1 file changed, 10 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/drm_encoder.c b/drivers/gpu/drm/drm_encoder.c
> index 0944f08abf58..5dde3c6b1467 100644
> --- a/drivers/gpu/drm/drm_encoder.c
> +++ b/drivers/gpu/drm/drm_encoder.c
> @@ -159,8 +159,16 @@ void drm_encoder_cleanup(struct drm_encoder *encoder)
>  	 * the indices on the drm_encoder after us in the encoder_list.
>  	 */
>  
> -	if (encoder->bridge)
> -		drm_bridge_detach(encoder->bridge);
> +	if (encoder->bridge) {
> +		struct drm_bridge *bridge = encoder->bridge;
> +		struct drm_bridge *next;
> +
> +		while (bridge) {
> +			next = bridge->next;
> +			drm_bridge_detach(bridge);
> +			bridge = next;
> +		}
> +	}

I wonder whether we should detach inside-out here. But I guess that can be
fixed once someone stumbles over this ;-)

Reviewed-by: Daniel Vetter <daniel.vetter@xxxxxxxx>

Please push to drm-misc yourself, you haz commit rights and all that ;-)
-Daniel

>  
>  	drm_mode_object_unregister(dev, &encoder->base);
>  	kfree(encoder->name);
> -- 
> Regards,
> 
> Laurent Pinchart
> 
> _______________________________________________
> dri-devel mailing list
> dri-devel@xxxxxxxxxxxxxxxxxxxxx
> https://lists.freedesktop.org/mailman/listinfo/dri-devel

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/dri-devel




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux