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 83A7CCA601F for ; Fri, 9 Oct 2026 19:14:37 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D6B8C10EB35; Fri, 9 Oct 2026 19:14:36 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.b="WVbJbBkG"; dkim-atps=neutral Received: from tor.source.kernel.org (tor.source.kernel.org [172.105.4.254]) by gabe.freedesktop.org (Postfix) with ESMTPS id 464F910EB35 for ; Fri, 9 Oct 2026 19:14:35 +0000 (UTC) Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by tor.source.kernel.org (Postfix) with ESMTP id 3DD4760AB9; Fri, 9 Oct 2026 19:14:34 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3E1991F000FF; Fri, 9 Oct 2026 19:14:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1791573273; bh=YvjiYYGb1HHkRI/noHetRX7tr+whhoEHSilSms9Fg8I=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=WVbJbBkGUFnTM16cyhJ0gwH4vvXpsiuVE9+nQSDccJSo62taThMkrlnLsa3YUfDYn zoqfhjjPBrXD1DQKJUWooxwlCNz16LdxL7qFEaodiaHGzdOFTrBCzcdWcI8BAA4QTC oGiRiLw/KaDUTjHV26ohLgmLNfj2YJ3mX1OJrqDTj8eZOL8nyo8nwVQrVGRjG7Lqvd fsP4PADfegH28H0apXiVwic79QpavCXpqlTG9vynqedSpxDYzZHM5sT1BcatMBj0km LxhxG+PfeCOKjMn1FBZrHBvyrMatUi0dxGmYJ5vJ15cujJpAe6pyzwv3NRhXDC1ZsS dbJK9J5uB5YRA== From: Philipp Stanner To: Danilo Krummrich , Alice Ryhl , Sumit Semwal , =?UTF-8?q?Christian=20K=C3=B6nig?= , Philipp Stanner , Miguel Ojeda , Boqun Feng , Gary Guo , =?UTF-8?q?Bj=C3=B6rn=20Roy=20Baron?= , Benno Lossin , Andreas Hindborg , Trevor Gross , Daniel Almeida , Tamir Duberstein , Alexandre Courbot , =?UTF-8?q?Onur=20=C3=96zkan?= , David Airlie , Simona Vetter , Boris Brezillon , John.harrison@igalia.com, da.gomez@kernel.org Cc: linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org, rust-for-linux@vger.kernel.org Subject: [RFC PATCH v5 2/6] rust: DmaFence: Implement Deref for FenceContext Date: Fri, 9 Oct 2026 21:11:20 +0200 Message-ID: <20261009191124.1022902-4-phasta@kernel.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20261009191124.1022902-2-phasta@kernel.org> References: <20261009191124.1022902-2-phasta@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" A FenceContext carries data, which the user should be able to access. Implement Deref for FenceContext. Signed-off-by: Philipp Stanner --- rust/kernel/dma_buf/dma_fence.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/rust/kernel/dma_buf/dma_fence.rs b/rust/kernel/dma_buf/dma_fence.rs index eef2b9e93f35..0028124e6aa6 100644 --- a/rust/kernel/dma_buf/dma_fence.rs +++ b/rust/kernel/dma_buf/dma_fence.rs @@ -86,6 +86,14 @@ pub struct FenceContext { data: T, } +impl Deref for FenceContext { + type Target = T; + + fn deref(&self) -> &Self::Target { + &self.data + } +} + impl<'a, T: Send + Sync + FenceContextOps> FenceContext { // This can later be extended as a vtable in case other parties need support // for the more "exotic" callbacks. -- 2.55.0