summaryrefslogtreecommitdiff
path: root/rust/helpers/drm.c
diff options
context:
space:
mode:
authorAsahi Lina <lina@asahilina.net>2023-02-05 21:12:31 +0900
committerDanilo Krummrich <dakr@kernel.org>2024-10-22 23:26:31 +0200
commitcfd66f531af29e0616c58b4cd4c72770a5ac4081 (patch)
tree75d73122b0f148e7969f601dc8838fc42995c2ca /rust/helpers/drm.c
parent57e9abb1112d7008cfd13b25f8105b3e8ff78ac3 (diff)
rust: drm: gem: Add GEM object abstraction
The DRM GEM subsystem is the DRM memory management subsystem used by most modern drivers. Add a Rust abstraction to allow Rust DRM driver implementations to use it. Signed-off-by: Asahi Lina <lina@asahilina.net> Co-developed-by: Danilo Krummrich <dakr@redhat.com> Signed-off-by: Danilo Krummrich <dakr@kernel.org>
Diffstat (limited to 'rust/helpers/drm.c')
-rw-r--r--rust/helpers/drm.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/rust/helpers/drm.c b/rust/helpers/drm.c
new file mode 100644
index 000000000000..0c8f7200d29e
--- /dev/null
+++ b/rust/helpers/drm.c
@@ -0,0 +1,19 @@
+// SPDX-License-Identifier: GPL-2.0
+
+#include <drm/drm_gem.h>
+#include <drm/drm_vma_manager.h>
+
+void rust_helper_drm_gem_object_get(struct drm_gem_object *obj)
+{
+ drm_gem_object_get(obj);
+}
+
+void rust_helper_drm_gem_object_put(struct drm_gem_object *obj)
+{
+ drm_gem_object_put(obj);
+}
+
+__u64 rust_helper_drm_vma_node_offset_addr(struct drm_vma_offset_node *node)
+{
+ return drm_vma_node_offset_addr(node);
+}