Skip to content

Commit 8dd92e6

Browse files
committed
drm/vkms: Switch to managed for crtc
The current VKMS driver uses managed function to create crtc, but don't use it to properly clean the crtc workqueue. It is not an issue yet, but in order to support multiple devices easily, convert this code to use drm and device managed helpers. Acked-by: Maxime Ripard <[email protected]> Reviewed-by: José Expósito <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Signed-off-by: Louis Chauvet <[email protected]>
1 parent c367b77 commit 8dd92e6

File tree

2 files changed

+4
-10
lines changed

2 files changed

+4
-10
lines changed

drivers/gpu/drm/vkms/vkms_crtc.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
#include <drm/drm_atomic.h>
66
#include <drm/drm_atomic_helper.h>
7+
#include <drm/drm_managed.h>
78
#include <drm/drm_probe_helper.h>
89
#include <drm/drm_vblank.h>
910

@@ -296,7 +297,9 @@ int vkms_crtc_init(struct drm_device *dev, struct drm_crtc *crtc,
296297
spin_lock_init(&vkms_out->lock);
297298
spin_lock_init(&vkms_out->composer_lock);
298299

299-
vkms_out->composer_workq = alloc_ordered_workqueue("vkms_composer", 0);
300+
vkms_out->composer_workq = drmm_alloc_ordered_workqueue(dev, "vkms_composer", 0);
301+
if (IS_ERR(vkms_out->composer_workq))
302+
return PTR_ERR(vkms_out->composer_workq);
300303
if (!vkms_out->composer_workq)
301304
return -ENOMEM;
302305

drivers/gpu/drm/vkms/vkms_drv.c

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,6 @@ MODULE_PARM_DESC(enable_overlay, "Enable/Disable overlay support");
5353

5454
DEFINE_DRM_GEM_FOPS(vkms_driver_fops);
5555

56-
static void vkms_release(struct drm_device *dev)
57-
{
58-
struct vkms_device *vkms = drm_device_to_vkms_device(dev);
59-
60-
if (vkms->output.composer_workq)
61-
destroy_workqueue(vkms->output.composer_workq);
62-
}
63-
6456
static void vkms_atomic_commit_tail(struct drm_atomic_state *old_state)
6557
{
6658
struct drm_device *dev = old_state->dev;
@@ -108,7 +100,6 @@ static const struct drm_debugfs_info vkms_config_debugfs_list[] = {
108100

109101
static const struct drm_driver vkms_driver = {
110102
.driver_features = DRIVER_MODESET | DRIVER_ATOMIC | DRIVER_GEM,
111-
.release = vkms_release,
112103
.fops = &vkms_driver_fops,
113104
DRM_GEM_SHMEM_DRIVER_OPS,
114105
DRM_FBDEV_SHMEM_DRIVER_OPS,

0 commit comments

Comments
 (0)