From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (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 9C045371D0D for ; Mon, 16 Mar 2026 21:17:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773695835; cv=none; b=roClj/l2YPqFCafeXVs1mZlJnJVEYyrC0tAuVaBIrcYyGopshYTxUEPZIQYTPVR6j4bXfrc2N/VqLbNcGpwryvIi2NU34fDgoj1aMt6VLiiX2v0lhlR31g9qZONaVfWoHdxQWdxOVhZ0MIVprtndz8gkWWG6vcS8Lua/AnmtUpM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773695835; c=relaxed/simple; bh=ffFXjVGJI8De8uvcOmL8xpnNtkMBQveyKWwsKB6si5s=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=rMQepWFiBsZawJaIsjIubdmicDft/IrK8YlPlJygyrzTjWJsT8tluns/7LXOw6NYHXI3gvBTxpEI2/0nQxKV3BCH/vwugceETfZpD95KDG0+saBdNLY9M9Y5pGoBlc5b30D16KjT8jTalCLo+vSfcLFsu0SgBAGK3ov1piAo/qw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=Pi0dAp8p; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="Pi0dAp8p" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1773695831; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=e+WXbsnpykkPWNgfP9lm2btwaJkvLFLmTBeYQq+/GUw=; b=Pi0dAp8pDNHIbbIYT9x5SO8tDEr6tbMJ8fWsEA19Uya5TE3olLHaxTTZvPR4HHmghBDHMy yE1+huQ70h+L7lvgaFJkb92Fk/udPQw0J/l6VkG5sUUt/dgNMsebNBxkCHIVK8wd6bxmq0 1CunSxqB1oBfguAiwLmCsGfovP2KOow= Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-370--0cbofisOmmVKj_cRskofw-1; Mon, 16 Mar 2026 17:17:07 -0400 X-MC-Unique: -0cbofisOmmVKj_cRskofw-1 X-Mimecast-MFC-AGG-ID: -0cbofisOmmVKj_cRskofw_1773695824 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 201E01956094; Mon, 16 Mar 2026 21:17:04 +0000 (UTC) Received: from GoldenWind.redhat.com (unknown [10.22.88.101]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 947B81800361; Mon, 16 Mar 2026 21:17:00 +0000 (UTC) From: Lyude Paul To: nouveau@lists.freedesktop.org, Gary Guo , Daniel Almeida , rust-for-linux@vger.kernel.org, Danilo Krummrich Cc: Matthew Maurer , FUJITA Tomonori , Lorenzo Stoakes , christian.koenig@amd.com, Asahi Lina , Miguel Ojeda , Andreas Hindborg , Simona Vetter , Alice Ryhl , Boqun Feng , Sumit Semwal , Krishna Ketan Rai , linux-media@vger.kernel.org, Shankari Anand , David Airlie , Benno Lossin , Viresh Kumar , linaro-mm-sig@lists.linaro.org, Asahi Lina , Greg Kroah-Hartman , kernel@vger.kernel.org Subject: [PATCH v9 3/7] rust: helpers: Add bindings/wrappers for dma_resv_lock Date: Mon, 16 Mar 2026 17:16:11 -0400 Message-ID: <20260316211646.650074-4-lyude@redhat.com> In-Reply-To: <20260316211646.650074-1-lyude@redhat.com> References: <20260316211646.650074-1-lyude@redhat.com> Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 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 Reviewed-by: Janne Grunau 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 083cc44aa952c..39a8f15603692 100644 --- a/rust/bindings/bindings_helper.h +++ b/rust/bindings/bindings_helper.h @@ -48,6 +48,7 @@ #include #include #include +#include #include #include #include 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 a3c42e51f00a0..d090e2c7c7ea8 100644 --- a/rust/helpers/helpers.c +++ b/rust/helpers/helpers.c @@ -28,6 +28,7 @@ #include "cred.c" #include "device.c" #include "dma.c" +#include "dma-resv.c" #include "drm.c" #include "err.c" #include "irq.c" -- 2.53.0 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 2081FF53D96 for ; Mon, 16 Mar 2026 21:17:14 +0000 (UTC) Received: from kara.freedesktop.org (unknown [131.252.210.166]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0040C10E4F1; Mon, 16 Mar 2026 21:17:14 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.b="ZhEipnR+"; dkim-atps=neutral Received: from kara.freedesktop.org (localhost [127.0.0.1]) by kara.freedesktop.org (Postfix) with ESMTP id 7C6294518A; Mon, 16 Mar 2026 21:06:26 +0000 (UTC) ARC-Seal: i=1; cv=none; a=rsa-sha256; d=lists.freedesktop.org; s=20240201; t=1773695186; b=S2HrhIuIAY1LLZI9ttsrDxWwozvlZknMPifVTUy0RBOvDbK18W1YEnhAT2ZG+ZFqZnfva 7ELQIFYrFIQEqTCNqp2jlFczlTVWlO9V5CfO69ssq1H+sVRoEvnXi8DQgHSr/EgCYiP10hb h7BXU04WfAnWMfrphnWxljKtR+DcaUoRSphd+dZQsJyE9kCQGX8m49LtYaIuxdz25IS/1JD WlZm0BRgKYIRYWVDGf4CoxIubrl71S80XBZobO4/326PtW635Kshn5hbzeNOiYW6OAsEyan umDZnCIf2DsdkejrfRrEk8A/bdsLEXAMmQF3xXez7AIrsT/p4FMFJ4eB2l0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=lists.freedesktop.org; s=20240201; t=1773695186; h=from : sender : reply-to : subject : date : message-id : to : cc : mime-version : content-type : content-transfer-encoding : content-id : content-description : resent-date : resent-from : resent-sender : resent-to : resent-cc : resent-message-id : in-reply-to : references : list-id : list-help : list-unsubscribe : list-subscribe : list-post : list-owner : list-archive; bh=e+WXbsnpykkPWNgfP9lm2btwaJkvLFLmTBeYQq+/GUw=; b=JW7E4QtaaTYtSRRmDj6pi0w+fCa5sWH0dTTaEZLfimiS8aVFfO/Zy8SfxXbH6q4R+N1IS XG9hRXza4yQBRasoruTXP6ELK9ipm+DBQsTCKqa1VtBYuPbfR4Vx1yfMLyxCTCBwyWuM42v MRsaZOzEW6rv66P7uiX5HzTLuOwxuFqajDjvr8aVUrMyqHBmww6aEacWhhzNbe/fpoOPdkR NfW1GySHau8eftlftngUYhC9GVP7EB5nl4KFlB3uzSjIODXEz+mVNKLBupPP15xZPrEViBV ZP0ctZ+WEVeMgjWrOuX0XtxeFNND4VYd5DYPVrss9xIvFvYKoXDSozT49zKQ== ARC-Authentication-Results: i=1; mail.freedesktop.org; dkim=pass header.d=redhat.com; arc=none (Message is not ARC signed); dmarc=pass (Used From Domain Record) header.from=redhat.com policy.dmarc=quarantine Authentication-Results: mail.freedesktop.org; dkim=pass header.d=redhat.com; arc=none (Message is not ARC signed); dmarc=pass (Used From Domain Record) header.from=redhat.com policy.dmarc=quarantine Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by kara.freedesktop.org (Postfix) with ESMTPS id 6921343790 for ; Mon, 16 Mar 2026 21:06:24 +0000 (UTC) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by gabe.freedesktop.org (Postfix) with ESMTPS id A20A810E4D6 for ; Mon, 16 Mar 2026 21:17:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1773695830; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=e+WXbsnpykkPWNgfP9lm2btwaJkvLFLmTBeYQq+/GUw=; b=ZhEipnR+J4wcJFY6WkxgEh1jpkkPEZvAjlMv9N+VfXAc1+YuYudG3mW6fjcciw36LJVDJw md1oFrpwdY8KwXNC0r0EIRZmQ6O25ATEmCJ/hHv9ltqMAQysSvp6IOOA50rbHi8qR/RWt6 pyiOBvVYo02MZcmSCS0kj6MfloRWw7A= Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-370--0cbofisOmmVKj_cRskofw-1; Mon, 16 Mar 2026 17:17:07 -0400 X-MC-Unique: -0cbofisOmmVKj_cRskofw-1 X-Mimecast-MFC-AGG-ID: -0cbofisOmmVKj_cRskofw_1773695824 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 201E01956094; Mon, 16 Mar 2026 21:17:04 +0000 (UTC) Received: from GoldenWind.redhat.com (unknown [10.22.88.101]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 947B81800361; Mon, 16 Mar 2026 21:17:00 +0000 (UTC) From: Lyude Paul To: nouveau@lists.freedesktop.org, Gary Guo , Daniel Almeida , rust-for-linux@vger.kernel.org, Danilo Krummrich Subject: [PATCH v9 3/7] rust: helpers: Add bindings/wrappers for dma_resv_lock Date: Mon, 16 Mar 2026 17:16:11 -0400 Message-ID: <20260316211646.650074-4-lyude@redhat.com> In-Reply-To: <20260316211646.650074-1-lyude@redhat.com> References: <20260316211646.650074-1-lyude@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 X-Mimecast-MFC-PROC-ID: u4dQMzZmxyrxwLdOHQBe1gX7rI473AmpF95egwAv7jo_1773695824 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit content-type: text/plain; charset="US-ASCII"; x-default=true Message-ID-Hash: CSA4EMPMPID5BQBQY7SC4AQESLVICECK X-Message-ID-Hash: CSA4EMPMPID5BQBQY7SC4AQESLVICECK X-MailFrom: lyude@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Matthew Maurer , FUJITA Tomonori , Lorenzo Stoakes , christian.koenig@amd.com, Asahi Lina , Miguel Ojeda , Andreas Hindborg , Simona Vetter , Alice Ryhl , Boqun Feng , Sumit Semwal , Krishna Ketan Rai , linux-media@vger.kernel.org, Shankari Anand , Benno Lossin , Viresh Kumar , linaro-mm-sig@lists.linaro.org, Asahi Lina , Greg Kroah-Hartman , kernel@vger.kernel.org X-Mailman-Version: 3.3.8 Precedence: list List-Id: Nouveau development list Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: 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 Reviewed-by: Janne Grunau 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 083cc44aa952c..39a8f15603692 100644 --- a/rust/bindings/bindings_helper.h +++ b/rust/bindings/bindings_helper.h @@ -48,6 +48,7 @@ #include #include #include +#include #include #include #include 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 a3c42e51f00a0..d090e2c7c7ea8 100644 --- a/rust/helpers/helpers.c +++ b/rust/helpers/helpers.c @@ -28,6 +28,7 @@ #include "cred.c" #include "device.c" #include "dma.c" +#include "dma-resv.c" #include "drm.c" #include "err.c" #include "irq.c" -- 2.53.0