From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from fout-b3-smtp.messagingengine.com (fout-b3-smtp.messagingengine.com [202.12.124.146]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CCC842FC011; Sat, 6 Dec 2025 13:43:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.12.124.146 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765028584; cv=none; b=DFcgLEgUXxtRWb9yEhMNxTuZnobiNOIZ+RHeouYDxc4tFW2C+kj6hxMQIi7CgwxKlJwfR/whHQm1tqpYHt0wYWmDQXAbiAJQfQykv77I2EvqB0Y4/Ef2ELjmppzyybUxgQYvZgJCM7/R/dyLoGSYDDoPSzXhq6UhHZrxz+ozefM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765028584; c=relaxed/simple; bh=iRsFVm3/tHRY7F+K/1LFywwcvYyypQXo/0UOECEZtdE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=hOIaZUalanstOopE4UCpk3sNcUyK/cnQwEQSWzt2jgobndRoJOI9b2zudpPFfJ9UEW7bGxiLFWPafbRWkRU3xb3NTVc/C27MZhcCuJsT97/b/ilrjnFOOiDzfdr9fv3VAxPFwWpSzQfhWVsl00ZG2n0PRb1Q0H5G97sOsjOBH98= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=jannau.net; spf=pass smtp.mailfrom=jannau.net; dkim=pass (2048-bit key) header.d=jannau.net header.i=@jannau.net header.b=nEndZ23B; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=odThNdki; arc=none smtp.client-ip=202.12.124.146 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=jannau.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=jannau.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=jannau.net header.i=@jannau.net header.b="nEndZ23B"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="odThNdki" Received: from phl-compute-01.internal (phl-compute-01.internal [10.202.2.41]) by mailfout.stl.internal (Postfix) with ESMTP id 5AFF31D000B2; Sat, 6 Dec 2025 08:43:00 -0500 (EST) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-01.internal (MEProxy); Sat, 06 Dec 2025 08:43:01 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jannau.net; h=cc :cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm3; t=1765028580; x=1765114980; bh=t4o08eCYHl EJY6FVGVNnMYAccSZ4Ut22BuwBX+NWmfA=; b=nEndZ23BKZ81fbvX8guKKtaYq0 MN1GPl51//5L095iWH3zhIq65aKrcutyVQoJYBe4KYkJi6b7+WtEUNr6QfbhCrVx hvq3uwZpdjpz0fEHtDLNc0LxKeocblBreFJw8MWNM00gbk86CyX04V9Y0GWJx/WB nxvJH0WLLN2TrQ/anPAchR6f5KJR+L06hEesrB8kqRlWsKtM1oGKu8nhy9o9JU32 ADjbFC0OpNtQGsdU9OJ0+j/u8ERdCj353nPUS/F+T9hgzCbvEMvglPx7MyKxe+wt YYRpWLJIl/cJwA5+vc07QwgS3JkVMl84vocCdbKla51aFivP2mkZwFDEEahg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t= 1765028580; x=1765114980; bh=t4o08eCYHlEJY6FVGVNnMYAccSZ4Ut22Buw BX+NWmfA=; b=odThNdkidIdTuUAu/SA6FCQsysFAq8IUORAwGJvabMZ/RGqzeFi zyUfQs+hpYaaJjZQnEQvv8tHmRNFvxPlLeX622sbE6J4zeLIKLvY45VD7j55SJd/ KWbxh7YhXv+jt8gYeXHQcsUGSSZ9DmjTtdqUAsl2SjiZcmTLW7SM29V/h1Gitj62 dlZV20nq6tr5D56ev9L0m27VENAsQjZtHUqS9yhzJhJbtyfKp1UHLRCqmuMZNxwe fsLoo2iXb92byBYT60WaFv0Y6wmx4LFX//O1vvpr5vDDCeJQ5Mwe2m+oMSlObBmM Ujqi/riVA3JzyQb4ILxKBKPufgkQyKML9eA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefgedrtddtgdduuddtkecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpuffrtefokffrpgfnqfghnecuuegr ihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjug hrpeffhffvvefukfhfgggtuggjsehttdertddttdejnecuhfhrohhmpeflrghnnhgvucfi rhhunhgruhcuoehjsehjrghnnhgruhdrnhgvtheqnecuggftrfgrthhtvghrnhepgfdvff evleegudejfeefheehkeehleehfefgjefffeetudegtefhuedufeehfeetnecuvehluhhs thgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepjhesjhgrnhhnrghurd hnvghtpdhnsggprhgtphhtthhopedviedpmhhouggvpehsmhhtphhouhhtpdhrtghpthht oheplhihuhguvgesrhgvughhrghtrdgtohhmpdhrtghpthhtohepughrihdquggvvhgvlh eslhhishhtshdrfhhrvggvuggvshhkthhophdrohhrghdprhgtphhtthhopehruhhsthdq fhhorhdqlhhinhhugiesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopegrlh hitggvrhihhhhlsehgohhoghhlvgdrtghomhdprhgtphhtthhopegurghnihgvlhdrrghl mhgvihgurgestgholhhlrggsohhrrgdrtghomhdprhgtphhtthhopegurghkrheskhgvrh hnvghlrdhorhhgpdhrtghpthhtoheplhhinhhugidqkhgvrhhnvghlsehvghgvrhdrkhgv rhhnvghlrdhorhhgpdhrtghpthhtoheplhhinhgrsegrshgrhhhilhhinhgrrdhnvghtpd hrtghpthhtohepohhjvggurgeskhgvrhhnvghlrdhorhhg X-ME-Proxy: Feedback-ID: i47b949f6:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 6 Dec 2025 08:42:58 -0500 (EST) Date: Sat, 6 Dec 2025 14:42:57 +0100 From: Janne Grunau To: Lyude Paul Cc: dri-devel@lists.freedesktop.org, rust-for-linux@vger.kernel.org, Alice Ryhl , Daniel Almeida , Danilo Krummrich , linux-kernel@vger.kernel.org, Asahi Lina , Miguel Ojeda , Alex Gaynor , Boqun Feng , Gary Guo , =?utf-8?B?QmrDtnJu?= Roy Baron , Benno Lossin , Andreas Hindborg , Trevor Gross , Sumit Semwal , Christian =?utf-8?B?S8O2bmln?= , Greg Kroah-Hartman , Asahi Lina , Viresh Kumar , Tamir Duberstein , FUJITA Tomonori , Krishna Ketan Rai , "open list:DMA BUFFER SHARING FRAMEWORK:Keyword:bdma_(?:buf|fence|resv)b" , "moderated list:DMA BUFFER SHARING FRAMEWORK:Keyword:bdma_(?:buf|fence|resv)b" Subject: Re: [PATCH v6 2/8] rust: helpers: Add bindings/wrappers for dma_resv_lock Message-ID: <20251206134257.GA1097212@robin.jannau.net> References: <20251202220924.520644-1-lyude@redhat.com> <20251202220924.520644-3-lyude@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20251202220924.520644-3-lyude@redhat.com> On Tue, Dec 02, 2025 at 05:03:28PM -0500, Lyude Paul wrote: > From: Asahi Lina > > 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 > Signed-off-by: Daniel Almeida > Reviewed-by: Alice Ryhl > Signed-off-by: Lyude Paul > --- > rust/bindings/bindings_helper.h | 1 + > rust/helpers/dma-resv.c | 13 +++++++++++++ > rust/helpers/helpers.c | 1 + > 3 files changed, 15 insertions(+) > create mode 100644 rust/helpers/dma-resv.c > > diff --git a/rust/bindings/bindings_helper.h b/rust/bindings/bindings_helper.h > index 2e43c66635a2c..07f79e125c329 100644 > --- a/rust/bindings/bindings_helper.h > +++ b/rust/bindings/bindings_helper.h > @@ -48,6 +48,7 @@ > #include > #include > #include > +#include > #include > #include > #include nit: alphabetical order > diff --git a/rust/helpers/dma-resv.c b/rust/helpers/dma-resv.c > new file mode 100644 > index 0000000000000..05501cb814513 > --- /dev/null > +++ b/rust/helpers/dma-resv.c > @@ -0,0 +1,13 @@ > +// SPDX-License-Identifier: GPL-2.0 > + > +#include > + > +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); > +} > diff --git a/rust/helpers/helpers.c b/rust/helpers/helpers.c > index 551da6c9b5064..36d40f911345c 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 "err.c" > #include "irq.c" with that fixed Reviewed-by: Janne Grunau Janne