From 36c9bfedff8a961cf6370bb319193993dc93c31e Mon Sep 17 00:00:00 2001 From: Asahi Lina Date: Wed, 22 Nov 2023 14:12:08 +0900 Subject: [PATCH] rust: helpers: Add bindings/wrappers for dma_resv This is just for basic usage in the DRM shmem abstractions for implied locking, not intended as a full DMA Reservation abstraction yet. Signed-off-by: Asahi Lina --- rust/bindings/bindings_helper.h | 1 + rust/helpers.c | 13 +++++++++++++ 2 files changed, 14 insertions(+) diff --git a/rust/bindings/bindings_helper.h b/rust/bindings/bindings_helper.h index c4c4036f597e5f..75c790131739a6 100644 --- a/rust/bindings/bindings_helper.h +++ b/rust/bindings/bindings_helper.h @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include diff --git a/rust/helpers.c b/rust/helpers.c index 930334e6970117..181afe7453bba1 100644 --- a/rust/helpers.c +++ b/rust/helpers.c @@ -30,6 +30,7 @@ #include #include #include +#include #include #include #include @@ -488,6 +489,18 @@ void rust_helper_dma_fence_set_error(struct dma_fence *fence, int error) } EXPORT_SYMBOL_GPL(rust_helper_dma_fence_set_error); +int rust_helper_dma_resv_lock(struct dma_resv *obj, struct ww_acquire_ctx *ctx) +{ + return dma_resv_lock(obj, ctx); +} +EXPORT_SYMBOL_GPL(rust_helper_dma_resv_lock); + +void rust_helper_dma_resv_unlock(struct dma_resv *obj) +{ + dma_resv_unlock(obj); +} +EXPORT_SYMBOL_GPL(rust_helper_dma_resv_unlock); + #endif #ifdef CONFIG_DRM