NVIDIA GPU driver infrastructure
 help / color / mirror / Atom feed
From: Danilo Krummrich <dakr@kernel.org>
To: dakr@kernel.org, acourbot@nvidia.com, aliceryhl@google.com,
	jhubbard@nvidia.com, ecourtney@nvidia.com, ttabi@nvidia.com,
	joelagnelf@nvidia.com, gary@garyguo.net
Cc: nova-gpu@lists.linux.dev, dri-devel@lists.freedesktop.org,
	rust-for-linux@vger.kernel.org
Subject: [PATCH 5/5] gpu: nova: separate driver type from driver data
Date: Tue, 26 May 2026 00:58:33 +0200	[thread overview]
Message-ID: <20260525225838.276108-6-dakr@kernel.org> (raw)
In-Reply-To: <20260525225838.276108-1-dakr@kernel.org>

Split NovaDriver into a unit struct for trait implementations and a
separate Nova struct for the private driver data.

Signed-off-by: Danilo Krummrich <dakr@kernel.org>
---
 drivers/gpu/drm/nova/driver.rs | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/nova/driver.rs b/drivers/gpu/drm/nova/driver.rs
index e4765bc5b3ec..4289df7de01c 100644
--- a/drivers/gpu/drm/nova/driver.rs
+++ b/drivers/gpu/drm/nova/driver.rs
@@ -15,9 +15,11 @@
 use crate::file::File;
 use crate::gem::NovaObject;
 
-pub(crate) struct NovaDriver {
+pub(crate) struct NovaDriver;
+
+pub(crate) struct Nova {
     #[expect(unused)]
-    drm: ARef<drm::Device<Self>>,
+    drm: ARef<drm::Device<NovaDriver>>,
 }
 
 /// Convienence type alias for the DRM device type for this driver
@@ -51,19 +53,19 @@ pub(crate) struct NovaData {
 
 impl auxiliary::Driver for NovaDriver {
     type IdInfo = ();
-    type Data<'bound> = Self;
+    type Data<'bound> = Nova;
     const ID_TABLE: auxiliary::IdTable<Self::IdInfo> = &AUX_TABLE;
 
     fn probe<'bound>(
         adev: &'bound auxiliary::Device<Core<'_>>,
         _info: &'bound Self::IdInfo,
-    ) -> impl PinInit<Self, Error> + 'bound {
+    ) -> impl PinInit<Self::Data<'bound>, Error> + 'bound {
         let data = try_pin_init!(NovaData { adev: adev.into() });
 
         let drm = drm::Device::<Self>::new(adev.as_ref(), data)?;
         drm::Registration::new_foreign_owned(&drm, adev.as_ref(), 0)?;
 
-        Ok(Self { drm })
+        Ok(Nova { drm })
     }
 }
 
-- 
2.54.0


  parent reply	other threads:[~2026-05-25 22:59 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-25 22:58 [PATCH 0/5] gpu: nova: adopt driver lifetime infrastructure Danilo Krummrich
2026-05-25 22:58 ` [PATCH 1/5] gpu: nova-core: use lifetime for Bar Danilo Krummrich
2026-05-26  2:06   ` Eliot Courtney
2026-05-25 22:58 ` [PATCH 2/5] gpu: nova-core: unregister sysmem flush page from Drop Danilo Krummrich
2026-05-26  1:43   ` Eliot Courtney
2026-05-25 22:58 ` [PATCH 3/5] gpu: nova-core: replace ARef<Device> with &'bound Device in SysmemFlush Danilo Krummrich
2026-05-26  1:44   ` Eliot Courtney
2026-05-25 22:58 ` [PATCH 4/5] gpu: nova-core: gsp: replace ARef<Device> with &'a Device in sequencer Danilo Krummrich
2026-05-26  1:44   ` Eliot Courtney
2026-05-25 22:58 ` Danilo Krummrich [this message]
2026-05-26  1:46   ` [PATCH 5/5] gpu: nova: separate driver type from driver data Eliot Courtney
2026-05-26  7:11 ` [PATCH 0/5] gpu: nova: adopt driver lifetime infrastructure Alexandre Courbot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260525225838.276108-6-dakr@kernel.org \
    --to=dakr@kernel.org \
    --cc=acourbot@nvidia.com \
    --cc=aliceryhl@google.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=ecourtney@nvidia.com \
    --cc=gary@garyguo.net \
    --cc=jhubbard@nvidia.com \
    --cc=joelagnelf@nvidia.com \
    --cc=nova-gpu@lists.linux.dev \
    --cc=rust-for-linux@vger.kernel.org \
    --cc=ttabi@nvidia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox