Skip to content

Commit 109c4d1

Browse files
ayahal01dliviu
authored andcommitted
drm/arm/malidp: Ensure that the crtcs are shutdown before removing any encoder/connector
One needs to ensure that the crtcs are shutdown so that the drm_crtc_state->connector_mask reflects that no connectors are currently active. Further, it reduces the reference count for each connector. This ensures that the connectors and encoders can be cleanly removed either when _unbind is called for the corresponding drivers or by drm_mode_config_cleanup(). We need drm_atomic_helper_shutdown() to be called before component_unbind_all() otherwise the connectors attached to the component device will have the wrong reference count value and will not be cleanly removed. Signed-off-by: Ayan Kumar Halder <[email protected]> Acked-by: Liviu Dudau <[email protected]> Signed-off-by: Liviu Dudau <[email protected]>
1 parent ce397d2 commit 109c4d1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/gpu/drm/arm/malidp_drv.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,6 @@ static int malidp_init(struct drm_device *drm)
278278

279279
static void malidp_fini(struct drm_device *drm)
280280
{
281-
drm_atomic_helper_shutdown(drm);
282281
drm_mode_config_cleanup(drm);
283282
}
284283

@@ -646,6 +645,7 @@ static int malidp_bind(struct device *dev)
646645
malidp_de_irq_fini(drm);
647646
drm->irq_enabled = false;
648647
irq_init_fail:
648+
drm_atomic_helper_shutdown(drm);
649649
component_unbind_all(dev, drm);
650650
bind_fail:
651651
of_node_put(malidp->crtc.port);
@@ -681,6 +681,7 @@ static void malidp_unbind(struct device *dev)
681681
malidp_se_irq_fini(drm);
682682
malidp_de_irq_fini(drm);
683683
drm->irq_enabled = false;
684+
drm_atomic_helper_shutdown(drm);
684685
component_unbind_all(dev, drm);
685686
of_node_put(malidp->crtc.port);
686687
malidp->crtc.port = NULL;

0 commit comments

Comments
 (0)