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 05071CD6E56 for ; Mon, 1 Jun 2026 10:59:44 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5DB511131D4; Mon, 1 Jun 2026 10:59:43 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=collabora.com header.i=@collabora.com header.b="jDT3G3Jb"; dkim-atps=neutral Received: from bali.collaboradmins.com (bali.collaboradmins.com [148.251.105.195]) by gabe.freedesktop.org (Postfix) with ESMTPS id 36C161131D4 for ; Mon, 1 Jun 2026 10:59:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1780311580; bh=Oj7qS6tCatuQd6v/AdPdQ1yTq6EBjPpukk1n6mBZaDY=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=jDT3G3JbDb4+8nGVmGp41Da6WyNqifQEpLVE2rktUe7VEhM4wwEzU4zxPEO0mRCAZ S54cSYDjRxD8i73BAg8QcPiKMhCmTQlsa2eUnXeCBzbkLLyk0rlHfeeMa+sAN3nFig 7Pim0wDrdbyRkB0oZjtsguBfJpnrUPphEp85nC3TlCJDVzjL8NGrJc1OKUu4HVx/tK x6AYIk5mNJk0r9a3z9n7SNSnTjmSoYUEy4l90Op/WJxMxMD2osYYyHDqpJeTuz2xVD 8QATTOHpmh9+mdxg/7B5BqOCwYgiH/sppl30tsGDS276dRqxW2phCf1oaNzuNL83f1 yRoJrH22VFiwg== Received: from fedora-2.home (unknown [100.64.0.11]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: bbrezillon) by bali.collaboradmins.com (Postfix) with ESMTPSA id 6223C17E03DA; Mon, 1 Jun 2026 12:59:39 +0200 (CEST) Date: Mon, 1 Jun 2026 12:59:33 +0200 From: Boris Brezillon To: Alice Ryhl Cc: Philipp Stanner , Miguel Ojeda , Boqun Feng , Gary Guo , " =?UTF-8?B?QmrDtnJu?= Roy Baron" , Benno Lossin , Andreas Hindborg , Trevor Gross , Danilo Krummrich , Sumit Semwal , "Christian =?UTF-8?B?S8O2bmln?=" , "Paul E. McKenney" , Frederic Weisbecker , Neeraj Upadhyay , Joel Fernandes , Josh Triplett , Uladzislau Rezki , Steven Rostedt , Mathieu Desnoyers , Lai Jiangshan , Zqiang , Daniel Almeida , Greg Kroah-Hartman , Igor Korotin , Lorenzo Stoakes , Alexandre Courbot , FUJITA Tomonori , Krishna Ketan Rai , Shankari Anand , manos@pitsidianak.is, linux-kernel@vger.kernel.org, rust-for-linux@vger.kernel.org, linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org, linaro-mm-sig@lists.linaro.org, rcu@vger.kernel.org Subject: Re: [PATCH 3/4] rust: Add dma_fence abstractions Message-ID: <20260601125933.17ca4dd5@fedora-2.home> In-Reply-To: References: <20260530143541.229628-2-phasta@kernel.org> <20260530143541.229628-5-phasta@kernel.org> Organization: Collabora X-Mailer: Claws Mail 4.4.0 (GTK 3.24.52; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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" On Mon, 1 Jun 2026 10:36:06 +0000 Alice Ryhl wrote: > > +}; > > + > > +use bindings::ECANCELED; > > + > > +use kernel::str::CString; > > +use kernel::sync::{ > > + aref::{ > > + ARef, > > + AlwaysRefCounted, // > > + }, > > + Arc, > > + ArcBorrow, // > > +}; > > + > > +/// VTable for dma_fence backend_ops callbacks. > > +// > > +// Mandatory dma_fence backend_ops are implemented implicitly through > > +// [`FenceCtx`]. Additional ones shall get implemented on this trait, which then > > +// shall be demanded for the fence context data. > > +pub trait FenceCtxOps {} > > This empty trait is unused. I had initially suggested to add the F type (AKA FenceData) passed around in multiple places type as an associated type pub trait FenceCtxOps { type FenceData: Send + Sync; } so we don't have to pass both F and C. The reasoning here is that: 1. We expect we'll have to define more methods to the FenceCtxOps trait at some point, so adding it now kinda makes sense. 2. In the current design, we've assumed that a Fence can't live/be created outside of a given context, so there's no world where the FenceData wouldn't be known by the FenceCtx implementation, and forcing users to pass F and C around seems needlessly verbose.