[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <DFUDTCPXZ816.FKOR7VJAF8SZ@garyguo.net>
Date: Wed, 21 Jan 2026 15:44:59 +0000
From: "Gary Guo" <gary@...yguo.net>
To: "Alice Ryhl" <aliceryhl@...gle.com>, "Danilo Krummrich"
<dakr@...nel.org>, "Daniel Almeida" <daniel.almeida@...labora.com>
Cc: "Boris Brezillon" <boris.brezillon@...labora.com>, "Janne Grunau"
<j@...nau.net>, "Matthew Brost" <matthew.brost@...el.com>,
Thomas Hellström <thomas.hellstrom@...ux.intel.com>,
"Lyude Paul" <lyude@...hat.com>, "Asahi Lina" <lina+kernel@...hilina.net>,
<dri-devel@...ts.freedesktop.org>, <linux-kernel@...r.kernel.org>,
<rust-for-linux@...r.kernel.org>
Subject: Re: [PATCH v3 2/6] rust: helpers: Add bindings/wrappers for
dma_resv_lock
On Wed Jan 21, 2026 at 11:31 AM GMT, Alice Ryhl wrote:
> From: Asahi Lina <lina+kernel@...hilina.net>
>
> 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 <lina+kernel@...hilina.net>
> Signed-off-by: Daniel Almeida <daniel.almeida@...labora.com>
> Reviewed-by: Alice Ryhl <aliceryhl@...gle.com>
> Signed-off-by: Lyude Paul <lyude@...hat.com>
> Reviewed-by: Janne Grunau <j@...nau.net>
> Signed-off-by: Alice Ryhl <aliceryhl@...gle.com>
> ---
> Taken from:
> https://lore.kernel.org/all/20251202220924.520644-3-lyude@redhat.com/
> ---
> rust/bindings/bindings_helper.h | 1 +
> rust/helpers/dma-resv.c | 13 +++++++++++++
> rust/helpers/helpers.c | 1 +
> 3 files changed, 15 insertions(+)
>
> diff --git a/rust/bindings/bindings_helper.h b/rust/bindings/bindings_helper.h
> index dd60a5c6b142ec2c5fd6df80279ab6813163791c..ed80dd8088bc60c67b02f7666e602e33158bb962 100644
> --- a/rust/bindings/bindings_helper.h
> +++ b/rust/bindings/bindings_helper.h
> @@ -52,6 +52,7 @@
> #include <linux/device/faux.h>
> #include <linux/dma-direction.h>
> #include <linux/dma-mapping.h>
> +#include <linux/dma-resv.h>
> #include <linux/errname.h>
> #include <linux/ethtool.h>
> #include <linux/fdtable.h>
> diff --git a/rust/helpers/dma-resv.c b/rust/helpers/dma-resv.c
> new file mode 100644
> index 0000000000000000000000000000000000000000..05501cb814513b483afd0b7f220230d867863c2f
> --- /dev/null
> +++ b/rust/helpers/dma-resv.c
> @@ -0,0 +1,13 @@
> +// SPDX-License-Identifier: GPL-2.0
> +
> +#include <linux/dma-resv.h>
> +
> +int rust_helper_dma_resv_lock(struct dma_resv *obj, struct ww_acquire_ctx *ctx)
> +{
> + return dma_resv_lock(obj, ctx);
> +}
> +
> +void rust_helper_dma_resv_unlock(struct dma_resv *obj)
> +{
> + dma_resv_unlock(obj);
> +}
This is missing __rust_helper
Best,
Gary
> diff --git a/rust/helpers/helpers.c b/rust/helpers/helpers.c
> index 0943d589b7578d3c0e207937f63a5e02719c6146..aae78c938b0b5848b1740fb3f2dc4b7f93b1a760 100644
> --- a/rust/helpers/helpers.c
> +++ b/rust/helpers/helpers.c
> @@ -25,6 +25,7 @@
> #include "cred.c"
> #include "device.c"
> #include "dma.c"
> +#include "dma-resv.c"
> #include "drm.c"
> #include "drm_gpuvm.c"
> #include "err.c"
Powered by blists - more mailing lists