aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/include/drm
diff options
context:
space:
mode:
authorThomas Zimmermann <tzimmermann@suse.de>2022-05-02 16:25:12 +0200
committerThomas Zimmermann <tzimmermann@suse.de>2022-05-05 09:04:10 +0200
commite13f13e039dc8f31168b5569120a7658035c80ee (patch)
treec7d809d901f8b170f5cc329bb44204f9907dd34e /include/drm
parentdrm/format-helper: Share implementation among conversion helpers (diff)
downloadwireguard-linux-e13f13e039dc8f31168b5569120a7658035c80ee.tar.xz
wireguard-linux-e13f13e039dc8f31168b5569120a7658035c80ee.zip
drm: Add DRM-managed mutex_init()
Add drmm_mutex_init(), a helper that provides managed mutex cleanup. The mutex will be destroyed with the final reference of the DRM device. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: https://patchwork.freedesktop.org/patch/msgid/20220502142514.2174-2-tzimmermann@suse.de
Diffstat (limited to 'include/drm')
-rw-r--r--include/drm/drm_managed.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/drm/drm_managed.h b/include/drm/drm_managed.h
index b45c6fbf53ac..359883942612 100644
--- a/include/drm/drm_managed.h
+++ b/include/drm/drm_managed.h
@@ -8,6 +8,7 @@
#include <linux/types.h>
struct drm_device;
+struct mutex;
typedef void (*drmres_release_t)(struct drm_device *dev, void *res);
@@ -104,4 +105,6 @@ char *drmm_kstrdup(struct drm_device *dev, const char *s, gfp_t gfp);
void drmm_kfree(struct drm_device *dev, void *data);
+int drmm_mutex_init(struct drm_device *dev, struct mutex *lock);
+
#endif