[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250116155507.3491-1-jose.exposito89@gmail.com>
Date: Thu, 16 Jan 2025 16:55:06 +0100
From: José Expósito <jose.exposito89@...il.com>
To: louis.chauvet@...tlin.com
Cc: airlied@...il.com,
arthurgrillo@...eup.net,
dri-devel@...ts.freedesktop.org,
hamohammed.sa@...il.com,
jeremie.dautheribes@...tlin.com,
linux-kernel@...r.kernel.org,
maarten.lankhorst@...ux.intel.com,
mairacanal@...eup.net,
melissa.srw@...il.com,
miquel.raynal@...tlin.com,
mripard@...nel.org,
nicolejadeyee@...gle.com,
rodrigosiqueiramelo@...il.com,
seanpaul@...gle.com,
simona.vetter@...ll.ch,
simona@...ll.ch,
thomas.petazzoni@...tlin.com,
tzimmermann@...e.de,
José Expósito <jose.exposito89@...il.com>
Subject: [PATCH v8 4/8] 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.
>
> Signed-off-by: Louis Chauvet <louis.chauvet@...tlin.com>
> Acked-by: Maxime Ripard <mripard@...nel.org>
Reviewed-by: José Expósito <jose.exposito89@...il.com>
Thanks!
> ---
> drivers/gpu/drm/vkms/vkms_crtc.c | 5 ++++-
> drivers/gpu/drm/vkms/vkms_drv.c | 9 ---------
> 2 files changed, 4 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/gpu/drm/vkms/vkms_crtc.c b/drivers/gpu/drm/vkms/vkms_crtc.c
> index 28a57ae109fcc05af3fe74f94518c462c09119e3..434c35d5e9477d2961826262591db8ab43838e09 100644
> --- a/drivers/gpu/drm/vkms/vkms_crtc.c
> +++ b/drivers/gpu/drm/vkms/vkms_crtc.c
> @@ -4,6 +4,7 @@
>
> #include <drm/drm_atomic.h>
> #include <drm/drm_atomic_helper.h>
> +#include <drm/drm_managed.h>
> #include <drm/drm_probe_helper.h>
> #include <drm/drm_vblank.h>
>
> @@ -296,7 +297,9 @@ int vkms_crtc_init(struct drm_device *dev, struct drm_crtc *crtc,
> spin_lock_init(&vkms_out->lock);
> spin_lock_init(&vkms_out->composer_lock);
>
> - vkms_out->composer_workq = alloc_ordered_workqueue("vkms_composer", 0);
> + vkms_out->composer_workq = drmm_alloc_ordered_workqueue(dev, "vkms_composer", 0);
> + if (IS_ERR(vkms_out->composer_workq))
> + return PTR_ERR(vkms_out->composer_workq);
> if (!vkms_out->composer_workq)
> return -ENOMEM;
>
> diff --git a/drivers/gpu/drm/vkms/vkms_drv.c b/drivers/gpu/drm/vkms/vkms_drv.c
> index e0409aba93496932b32a130ebb608ee53b1a9c59..7c142bfc3bd9de9556621db3e7f570dc0a4fab3a 100644
> --- a/drivers/gpu/drm/vkms/vkms_drv.c
> +++ b/drivers/gpu/drm/vkms/vkms_drv.c
> @@ -53,14 +53,6 @@ MODULE_PARM_DESC(enable_overlay, "Enable/Disable overlay support");
>
> DEFINE_DRM_GEM_FOPS(vkms_driver_fops);
>
> -static void vkms_release(struct drm_device *dev)
> -{
> - struct vkms_device *vkms = drm_device_to_vkms_device(dev);
> -
> - if (vkms->output.composer_workq)
> - destroy_workqueue(vkms->output.composer_workq);
> -}
> -
> static void vkms_atomic_commit_tail(struct drm_atomic_state *old_state)
> {
> struct drm_device *dev = old_state->dev;
> @@ -108,7 +100,6 @@ static const struct drm_debugfs_info vkms_config_debugfs_list[] = {
>
> static const struct drm_driver vkms_driver = {
> .driver_features = DRIVER_MODESET | DRIVER_ATOMIC | DRIVER_GEM,
> - .release = vkms_release,
> .fops = &vkms_driver_fops,
> DRM_GEM_SHMEM_DRIVER_OPS,
> DRM_FBDEV_SHMEM_DRIVER_OPS,
>
Powered by blists - more mailing lists