From nobody Mon Apr 6 23:08:23 2026 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 93E56392838 for ; Tue, 17 Mar 2026 21:32:44 +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=1773783165; cv=none; b=sw+kXBYGfgthrx8XADHbC+d4ihcDxUPjzpcknjEgLcZzXgkMidsOO+Yrztjltzf15FBLaWcN03G4aLqG4MgSBBCTwkuPJUGs1MqiV1UqEIkqkd1kL9p56O5kQgweACqbvDETADajHSaLAfrljeBERTaL3v7GQ6tSw6gOqoBx9EM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773783165; c=relaxed/simple; bh=95XhE2vRHmBj7zOhUcC79nWX/DO2ady9qpvytGf4Qi8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=VggLLKqEtufNSwb61k2XFiydHVbGZxFokqAztX1PrBKTYOrJDnzkvqz+QEF0QJQ4DMx2kct6mlFC0N4meF1qJvd60t+24xv0zS3LQKE75LN0ex/NllXCxDK0RzZ7m+ZQDG+rC/2++xUuX591p2FoNftxMX9q2qmFB3zaD1ckFgo= 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=bEA6WJ4L; 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="bEA6WJ4L" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1773783163; 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=QouNEtmlaggCaQo2P5IO63zf/LsG/YgCtk54rapeiQI=; b=bEA6WJ4LYGjXr2sglLUj4bV78hOYFj+dTtOUt2M4KaHgK5VXiSmyZDF/dE6OnWyMBDbWiF Mfd57YfIqls4dUa7/D27oGDfzzODK7Zn4PffbrY9Vsqi/x/OwKZUtf0NgLCnyIxDubxZJE rMRo1zanqrzVXWfndxNbrw/0mfZrjUA= Received: from mx-prod-mc-01.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-288-3AwmOY-QP06Fu3U4XIjoXg-1; Tue, 17 Mar 2026 17:32:39 -0400 X-MC-Unique: 3AwmOY-QP06Fu3U4XIjoXg-1 X-Mimecast-MFC-AGG-ID: 3AwmOY-QP06Fu3U4XIjoXg_1773783157 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-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id DD5F119560B5; Tue, 17 Mar 2026 21:32:36 +0000 (UTC) Received: from GoldenWind.lan (unknown [10.22.64.56]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 7F8C41800576; Tue, 17 Mar 2026 21:32:34 +0000 (UTC) From: Lyude Paul To: linux-kernel@vger.kernel.org, Danilo Krummrich , rust-for-linux@vger.kernel.org, dri-devel@lists.freedesktop.org Cc: Daniel Almeida , nouveau@lists.freedesktop.org, "Gary Guo" , "Miguel Ojeda" , "Simona Vetter" , "Alice Ryhl" , "Shankari Anand" , "David Airlie" , "Benno Lossin" , "Asahi Lina" , "Lyude Paul" Subject: [PATCH v5 3/4] rust/drm/gem: Add DriverAllocImpl type alias Date: Tue, 17 Mar 2026 17:28:32 -0400 Message-ID: <20260317213003.606088-4-lyude@redhat.com> In-Reply-To: <20260317213003.606088-1-lyude@redhat.com> References: <20260317213003.606088-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.53.0