From nobody Sat Feb 7 15:59:56 2026 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.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 1D8B5224249 for ; Sat, 31 Jan 2026 00:16:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769818603; cv=none; b=MiuzRrAq2PjdRwZtB1cgVyh+hBnYkbhtkl4EYu7C9eYG7xZa+B/2pFMbJkmzwc9DNVaM9apfCgDVshzXs2eVl+h7UfsK0qbEeyZZroFYyjhUFhF9f1Q4NgeA47MJU4DJYn45tQWKlyS5dUO4bewj7VDhMaANLfl5CpVoQvjjOk8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769818603; c=relaxed/simple; bh=Bh/lzjO59DWYOOdLSYM51nl//4fq8d0qw/KHwLvOYOY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Nc/QRHSmP4OkrNRymcBZDzRecDuPzCMZWZg6huNLsyzQGQGJJEi1iW76Cq+VLXU3/h2nJZSxz2hVXld8YsE76chyeZeFHbyzHileFsJ4tz0VMwFKu2nm10kw872kwEnJx8mfA8j5c1KHoPE80dQIQnwoZKShdMb48IdBpkgVKyw= 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=htqFr04G; arc=none smtp.client-ip=170.10.129.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="htqFr04G" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1769818601; 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=IeGVh8eg3y5XRBcRrvdnHSZCYu5A8t1Oo+7qwOk5rSg=; b=htqFr04GDuf8KgeznyPt6kZyPsdmET/XpE67oLuAjN2fyYBhg9/22HmC/s1UfM7MkmhQNJ tSsCD4caiHsQiQEvDsnD0MuYDWuWjWYrp8CrfxUGC4jKNXNFU5p6KcSpKOn6k5MwDnv1Yf anh03SuU7hR6JShc/1tlIlOzA+C8S1M= Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-581-jGUs_dbeOb6KgEEDE4Lu3w-1; Fri, 30 Jan 2026 19:16:38 -0500 X-MC-Unique: jGUs_dbeOb6KgEEDE4Lu3w-1 X-Mimecast-MFC-AGG-ID: jGUs_dbeOb6KgEEDE4Lu3w_1769818596 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-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 2FF391800451; Sat, 31 Jan 2026 00:16:36 +0000 (UTC) Received: from GoldenWind.lan (unknown [10.22.81.64]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 15D6C18002A6; Sat, 31 Jan 2026 00:16:33 +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, "Miguel Ojeda" , "Simona Vetter" , "Alice Ryhl" , "Shankari Anand" , "David Airlie" , "Benno Lossin" , "Asahi Lina" , "Daniel Almeida" , "Lyude Paul" Subject: [PATCH v5 3/4] rust/drm/gem: Add DriverAllocImpl type alias Date: Fri, 30 Jan 2026 19:13:32 -0500 Message-ID: <20260131001602.2095470-4-lyude@redhat.com> In-Reply-To: <20260131001602.2095470-1-lyude@redhat.com> References: <20260131001602.2095470-1-lyude@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 Content-Type: text/plain; charset="utf-8" This is just a type alias that resolves into the AllocImpl for a given T: drm::gem::DriverObject Signed-off-by: Lyude Paul Reviewed-by: Daniel Almeida --- rust/kernel/drm/gem/mod.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/rust/kernel/drm/gem/mod.rs b/rust/kernel/drm/gem/mod.rs index b4199945db378..ad74c5159f725 100644 --- a/rust/kernel/drm/gem/mod.rs +++ b/rust/kernel/drm/gem/mod.rs @@ -33,6 +33,11 @@ /// [`DriverFile`]: drm::file::DriverFile pub type DriverFile =3D drm::File<<::Driver as drm::= Driver>::File>; =20 +/// A type alias for retrieving the current [`AllocImpl`] for a given [`Dr= iverObject`]. +/// +/// [`Driver`]: drm::Driver +pub type DriverAllocImpl =3D <::Driver as drm::Drive= r>::Object; + /// GEM object functions, which must be implemented by drivers. pub trait DriverObject: Sync + Send + Sized { /// Parent `Driver` for this object. @@ -42,12 +47,12 @@ pub trait DriverObject: Sync + Send + Sized { fn new(dev: &drm::Device, size: usize) -> impl PinInit; =20 /// Open a new handle to an existing object, associated with a File. - fn open(_obj: &::Object, _file: &DriverFi= le) -> Result { + fn open(_obj: &DriverAllocImpl, _file: &DriverFile) -> Res= ult { Ok(()) } =20 /// Close a handle to an existing object, associated with a File. - fn close(_obj: &::Object, _file: &DriverF= ile) {} + fn close(_obj: &DriverAllocImpl, _file: &DriverFile) {} } =20 /// Trait that represents a GEM object subtype --=20 2.52.0