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 6982D311C2C for ; Fri, 6 Feb 2026 22:35:36 +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=1770417336; cv=none; b=keViPSDMhKFiIz9plfIXyQCInWC2KPQsNpwoq0CJBzTblvh/NXdOaDmKm3C/qamfe5HtrQ+Ac4NdKxAU+EWlnNfynPFVy3Qu4e5xurqNsyyHEUuAQleequrdVhWZN9TtEG/EiwOA197RlPnJ+t71LuKMXdGCjI1KYGIzvWsNJCw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770417336; c=relaxed/simple; bh=YMYBu9jkhGJ37Ax3uV4TPVaN2J4lFLdXY2yyaHggbXw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:content-type; b=NotYCRnYGlSLChlF5zxHhl8/xyz066CdpPuKjG22SEN/Lkg/a4EJ+PF5/fF3uxgnHxfsrWrH+lp3oiy9364oj9ONooa5gbmrScvAtVUw2xg+s+3STQ6lFrVUdpdyHhnzTvRP0sgR7+KOOrTaQPHoCvWi8XoxiAUyO+AdPMpKuzE= 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=YWn9Bf6D; 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="YWn9Bf6D" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1770417335; 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=UE4XXKfvvfpryLgAXCbkxE22KwoSFTyQYL9Yz6BCPbk=; b=YWn9Bf6D1Dxpm5AOAK1WUhQagttnsqpZoMABhPl9cD2IC9SAeaxFYQkaV8nREVqw+h6Hlr 3KdbNSl7P+6SmxrVZQ1CZ4aM3p0DKbVnlEUnkHWgPlLh7Nv82pVYbVYp5bsimhOSMTrkKs /1peLg7LZTqElwEHV2AlwDCYg8j45HE= Received: from mx-prod-mc-03.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-250-pS5TagS7PL26vwJxbZ23IQ-1; Fri, 06 Feb 2026 17:35:32 -0500 X-MC-Unique: pS5TagS7PL26vwJxbZ23IQ-1 X-Mimecast-MFC-AGG-ID: pS5TagS7PL26vwJxbZ23IQ_1770417330 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (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-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 7C8D51955F20; Fri, 6 Feb 2026 22:35:30 +0000 (UTC) Received: from GoldenWind.redhat.com (unknown [10.22.64.226]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id DBA9E19373D8; Fri, 6 Feb 2026 22:35:28 +0000 (UTC) From: Lyude Paul To: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, rust-for-linux@vger.kernel.org, Danilo Krummrich Cc: nouveau@lists.freedesktop.org, Daniel Almeida , Gary Guo , Benno Lossin , Alexandre Courbot , Janne Grunau Subject: [PATCH v7 2/7] rust: helpers: Add bindings/wrappers for dma_resv_lock Date: Fri, 6 Feb 2026 17:34:26 -0500 Message-ID: <20260206223431.693765-3-lyude@redhat.com> In-Reply-To: <20260206223431.693765-1-lyude@redhat.com> References: <20260206223431.693765-1-lyude@redhat.com> Precedence: bulk X-Mailing-List: rust-for-linux@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 X-Mimecast-MFC-PROC-ID: CSbZij5B_xuobsDC3eZJpOtU4PIKl8tIxClzyLu7jn0_1770417330 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit content-type: text/plain; charset="US-ASCII"; x-default=true 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 9fdf76ca630e0..ecf31681df806 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 79c72762ad9c4..1d3333cc0d2a8 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" -- 2.53.0