From: Thomas Zimmermann <tzimmermann@suse.de>
To: "Louis Chauvet" <louis.chauvet@bootlin.com>,
"Rodrigo Siqueira" <rodrigosiqueiramelo@gmail.com>,
"Melissa Wen" <melissa.srw@gmail.com>,
"Maíra Canal" <mairacanal@riseup.net>,
"Haneen Mohammed" <hamohammed.sa@gmail.com>,
"Maarten Lankhorst" <maarten.lankhorst@linux.intel.com>,
"Maxime Ripard" <mripard@kernel.org>,
"David Airlie" <airlied@gmail.com>,
"Simona Vetter" <simona@ffwll.ch>,
"Simona Vetter" <simona.vetter@ffwll.ch>
Cc: dri-devel@lists.freedesktop.org, arthurgrillo@riseup.net,
linux-kernel@vger.kernel.org, jeremie.dautheribes@bootlin.com,
miquel.raynal@bootlin.com, thomas.petazzoni@bootlin.com,
seanpaul@google.com, nicolejadeyee@google.com
Subject: Re: [PATCH v8 3/8] drm/managed: Add DRM-managed alloc_ordered_workqueue
Date: Tue, 14 Jan 2025 15:25:02 +0100 [thread overview]
Message-ID: <fd940912-44b1-4009-988b-8b6d3e52f88f@suse.de> (raw)
In-Reply-To: <20250114-google-vkms-managed-v8-3-da4254aa3dd5@bootlin.com>
Hi
Am 14.01.25 um 15:05 schrieb Louis Chauvet:
> Add drmm_alloc_ordered_workqueue(), a helper that provides managed ordered
> workqueue cleanup. The workqueue will be destroyed with the final
> reference of the DRM device.
>
> Signed-off-by: Louis Chauvet <louis.chauvet@bootlin.com>
>
> ---
>
> Hi Thomas,
>
> I noted that you wanted to mark this as Reviewed, but as this was not
> the complete patch, I prefered to have a confirmation before merging the
> patch.
>
> Thanks for your time,
> Louis Chauvet
> ---
> drivers/gpu/drm/drm_managed.c | 8 ++++++++
> include/drm/drm_managed.h | 12 ++++++++++++
> 2 files changed, 20 insertions(+)
>
> diff --git a/drivers/gpu/drm/drm_managed.c b/drivers/gpu/drm/drm_managed.c
> index 79ce86a5bd67a7201f5d60550a12364f2628e0ec..1589c28410f23b5a1e93dd1638420b3ae5c4b854 100644
> --- a/drivers/gpu/drm/drm_managed.c
> +++ b/drivers/gpu/drm/drm_managed.c
> @@ -310,3 +310,11 @@ void __drmm_mutex_release(struct drm_device *dev, void *res)
> mutex_destroy(lock);
> }
> EXPORT_SYMBOL(__drmm_mutex_release);
> +
> +void __drmm_destroy_workqueue(struct drm_device *device, void *res)
> +{
> + struct workqueue_struct *wq = res;
> +
> + destroy_workqueue(wq);
> +}
> +EXPORT_SYMBOL(__drmm_destroy_workqueue);
> diff --git a/include/drm/drm_managed.h b/include/drm/drm_managed.h
> index f547b09ca0239dd7c4fb734038bae4438321395c..96d9b0e811675fe66d5d48f02b17bc7de2ac437e 100644
> --- a/include/drm/drm_managed.h
> +++ b/include/drm/drm_managed.h
> @@ -127,4 +127,16 @@ void __drmm_mutex_release(struct drm_device *dev, void *res);
> drmm_add_action_or_reset(dev, __drmm_mutex_release, lock); \
> }) \
>
> +void __drmm_destroy_workqueue(struct drm_device *device, void *wq);
A comment on the naming. This is the release helper for the workqueue.
Rather call it __drm_workqueue_release(). The current name sounds like
it is a drmm wrapper around destroy_workqueue(), which it isn't.
Apart from that,
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
Best regards
Thomas
> +
> +#define drmm_alloc_ordered_workqueue(dev, fmt, flags, args...) \
> + ({ \
> + struct workqueue_struct *wq = alloc_ordered_workqueue(fmt, flags, ##args); \
> + wq ? ({ \
> + int ret = drmm_add_action_or_reset(dev, __drmm_destroy_workqueue, wq); \
> + ret ? ERR_PTR(ret) : wq; \
> + }) : \
> + wq; \
> + })
> +
> #endif
>
--
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstrasse 146, 90461 Nuernberg, Germany
GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman
HRB 36809 (AG Nuernberg)
next prev parent reply other threads:[~2025-01-14 14:25 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-14 14:05 [PATCH v8 0/8] drm/vkms: Switch all vkms object to DRM managed objects Louis Chauvet
2025-01-14 14:05 ` [PATCH v8 1/8] drm/vkms: Switch to managed for connector Louis Chauvet
2025-01-16 15:54 ` José Expósito
2025-01-14 14:05 ` [PATCH v8 2/8] drm/vkms: Switch to managed for encoder Louis Chauvet
2025-01-16 15:54 ` José Expósito
2025-01-14 14:05 ` [PATCH v8 3/8] drm/managed: Add DRM-managed alloc_ordered_workqueue Louis Chauvet
2025-01-14 14:25 ` Thomas Zimmermann [this message]
2025-01-14 15:29 ` Maxime Ripard
2025-01-14 16:04 ` Louis Chauvet
2025-01-14 14:05 ` [PATCH v8 4/8] drm/vkms: Switch to managed for crtc Louis Chauvet
2025-01-16 8:00 ` Maxime Ripard
2025-01-16 15:55 ` José Expósito
2025-01-14 14:05 ` [PATCH v8 5/8] drm: writeback: Create an helper for drm_writeback_connector initialization Louis Chauvet
2025-01-14 14:05 ` [PATCH v8 6/8] drm: writeback: Add missing cleanup in case of initialization failure Louis Chauvet
2025-01-14 14:05 ` [PATCH v8 7/8] drm: writeback: Create drmm variants for drm_writeback_connector initialization Louis Chauvet
2025-01-16 7:59 ` Maxime Ripard
2025-01-14 14:05 ` [PATCH v8 8/8] drm/vkms: Switch to managed for writeback connector Louis Chauvet
2025-01-16 8:00 ` Maxime Ripard
2025-01-16 15:55 ` José Expósito
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=fd940912-44b1-4009-988b-8b6d3e52f88f@suse.de \
--to=tzimmermann@suse.de \
--cc=airlied@gmail.com \
--cc=arthurgrillo@riseup.net \
--cc=dri-devel@lists.freedesktop.org \
--cc=hamohammed.sa@gmail.com \
--cc=jeremie.dautheribes@bootlin.com \
--cc=linux-kernel@vger.kernel.org \
--cc=louis.chauvet@bootlin.com \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mairacanal@riseup.net \
--cc=melissa.srw@gmail.com \
--cc=miquel.raynal@bootlin.com \
--cc=mripard@kernel.org \
--cc=nicolejadeyee@google.com \
--cc=rodrigosiqueiramelo@gmail.com \
--cc=seanpaul@google.com \
--cc=simona.vetter@ffwll.ch \
--cc=simona@ffwll.ch \
--cc=thomas.petazzoni@bootlin.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®