drm/vc4: crtc: Switch to DRM-managed CRTC initialization
authorMaxime Ripard <maxime@cerno.tech>
Mon, 11 Jul 2022 17:38:52 +0000 (19:38 +0200)
committerMaxime Ripard <maxime@cerno.tech>
Wed, 13 Jul 2022 08:46:07 +0000 (10:46 +0200)
commit77ef4c1702fb370da126ff39b94e80a74ce9f095
tree63bed00afbe9b5e75cadbf9771e5643bad774cba
parent7cc4214c27cf8d664358db402a179bf6ab2db862
drm/vc4: crtc: Switch to DRM-managed CRTC initialization

The current code will call drm_crtc_cleanup() when the device is
unbound. However, by then, there might still be some references held to
that CRTC, including by the userspace that might still have the DRM
device open.

Let's switch to a DRM-managed initialization to clean up after ourselves
only once the DRM device has been last closed.

Acked-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
Link: https://lore.kernel.org/r/20220711173939.1132294-23-maxime@cerno.tech
drivers/gpu/drm/vc4/vc4_crtc.c
drivers/gpu/drm/vc4/vc4_drv.h
drivers/gpu/drm/vc4/vc4_txp.c