[PATCH] drm: bridge: Detach all bridges in a chain at encoder cleanup time
Laurent Pinchart
laurent.pinchart+renesas at ideasonboard.com
Tue Nov 29 21:54:29 UTC 2016
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 at ideasonboard.com>
---
drivers/gpu/drm/drm_encoder.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
Hi Daniel,
As requested, here's a patch that makes bridge detach recursive. It's based on
top of "[PATCH v3 04/13] drm: bridge: Detach bridge from encoder at encoder
cleanup time".
diff --git a/drivers/gpu/drm/drm_encoder.c b/drivers/gpu/drm/drm_encoder.c
index 9c1f99646e0d..33d3e6ec83be 100644
--- a/drivers/gpu/drm/drm_encoder.c
+++ b/drivers/gpu/drm/drm_encoder.c
@@ -164,8 +164,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;
+ }
+ }
drm_modeset_lock_all(dev);
drm_mode_object_unregister(dev, &encoder->base);
--
Regards,
Laurent Pinchart
More information about the dri-devel
mailing list