Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

rust: helpers: Add bindings/wrappers for dma_resv_lock

This is just for basic usage in the DRM shmem abstractions for implied
locking, not intended as a full DMA Reservation abstraction yet.

Cc: Sumit Semwal <sumit.semwal@linaro.org>
Cc: Christian König <christian.koenig@amd.com>
Signed-off-by: Asahi Lina <lina+kernel@asahilina.net>
Signed-off-by: Daniel Almeida <daniel.almeida@collabora.com>
Reviewed-by: Alice Ryhl <aliceryhl@google.com>
Signed-off-by: Lyude Paul <lyude@redhat.com>
Reviewed-by: Janne Grunau <j@jannau.net>
Reviewed-by: Daniel Almeida <daniel.almeida@collabora.com>
Acked-by: David Airlie <airlied@gmail.com>
Signed-off-by: Alice Ryhl <aliceryhl@google.com>
Link: https://patch.msgid.link/20260320-gpuvm-rust-v5-2-76fd44f17a87@google.com
Signed-off-by: Danilo Krummrich <dakr@kernel.org>

authored by

Asahi Lina and committed by
Danilo Krummrich
9b836641 bdf6b22f

+17
+1
MAINTAINERS
··· 7534 7534 F: include/linux/dma-buf.h 7535 7535 F: include/linux/dma-buf/ 7536 7536 F: include/linux/dma-resv.h 7537 + F: rust/helpers/dma-resv.c 7537 7538 K: \bdma_(?:buf|fence|resv)\b 7538 7539 7539 7540 DMA GENERIC OFFLOAD ENGINE SUBSYSTEM
+1
rust/bindings/bindings_helper.h
··· 52 52 #include <linux/device/faux.h> 53 53 #include <linux/dma-direction.h> 54 54 #include <linux/dma-mapping.h> 55 + #include <linux/dma-resv.h> 55 56 #include <linux/errname.h> 56 57 #include <linux/ethtool.h> 57 58 #include <linux/fdtable.h>
+14
rust/helpers/dma-resv.c
··· 1 + // SPDX-License-Identifier: GPL-2.0 2 + 3 + #include <linux/dma-resv.h> 4 + 5 + __rust_helper 6 + int rust_helper_dma_resv_lock(struct dma_resv *obj, struct ww_acquire_ctx *ctx) 7 + { 8 + return dma_resv_lock(obj, ctx); 9 + } 10 + 11 + __rust_helper void rust_helper_dma_resv_unlock(struct dma_resv *obj) 12 + { 13 + dma_resv_unlock(obj); 14 + }
+1
rust/helpers/helpers.c
··· 28 28 #include "cred.c" 29 29 #include "device.c" 30 30 #include "dma.c" 31 + #include "dma-resv.c" 31 32 #include "drm.c" 32 33 #include "err.c" 33 34 #include "irq.c"