From nobody Thu Apr 2 19:13:11 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 D39EA3D7D99 for ; Fri, 20 Mar 2026 23:37:34 +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=1774049856; cv=none; b=QqpVcz09g5laIMD3QXZ5ApwMmQ0as/DCGFKqAdzXLevzWPSpQQcC3SD4j4+Hq/NFxJx8u7r+QLivPWhjTbz1BsR/k5SOMloT5XAkukQTE5WQBI0ctwGirLgutH9RRGeT2rUo28a05zo3UhmEw972aXAglJqVpmjkPPe9JMCBITM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774049856; c=relaxed/simple; bh=95XhE2vRHmBj7zOhUcC79nWX/DO2ady9qpvytGf4Qi8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Zskbpk1S7BdLCUEEZodWzBCLktFMFV0kucWNgcWR0vHTDGeYB7QfT0580+4Fdx2qI/spwmYUa7TQcT7uy7IdKk+cS2Xyoo4gCa6hbgS7VmnVZZqr70jd8zMZCH9QRBY+Mbp/o9TkKJt9XrAn0+cCP8iQ6wHW2k0gjPoVjUdDPc8= 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=QRpqDAn/; 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="QRpqDAn/" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1774049854; 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=QRpqDAn/Xy9Q/0XGzFizl3Fmj7RQj7eohlZkX5oQeIbQ1X89YbrHmVpvNGykUW2s52dy6z PecjLRkLLpF0oe2J3qM4Vj1rAzEouoNPSIDUPcwdtV7nJR16OCxDR77JJP0vDAIRRSlJVi nKxfVigZj1P3/Xdpsm4UHIBhPQcf+gQ= 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-563-4f6-IlVUOOmiogtqN-RcXA-1; Fri, 20 Mar 2026 19:37:30 -0400 X-MC-Unique: 4f6-IlVUOOmiogtqN-RcXA-1 X-Mimecast-MFC-AGG-ID: 4f6-IlVUOOmiogtqN-RcXA_1774049848 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (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 B695F19560A2; Fri, 20 Mar 2026 23:37:28 +0000 (UTC) Received: from GoldenWind.redhat.com (unknown [10.22.80.37]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 66852180075C; Fri, 20 Mar 2026 23:37:26 +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" , "Alice Ryhl" , "Simona Vetter" , "Shankari Anand" , "Maxime Ripard" , "David Airlie" , "Benno Lossin" , "Asahi Lina" , "Lyude Paul" Subject: [PATCH v6 4/5] rust/drm/gem: Add DriverAllocImpl type alias Date: Fri, 20 Mar 2026 19:34:29 -0400 Message-ID: <20260320233645.950190-5-lyude@redhat.com> In-Reply-To: <20260320233645.950190-1-lyude@redhat.com> References: <20260320233645.950190-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.93 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