From: Alistair Popple <apopple@nvidia.com>
To: rust-for-linux@vger.kernel.org, nova-gpu <nova-gpu@lists.linux.dev>
Cc: Alistair Popple <apopple@nvidia.com>,
M Henning <mhenning@darkrefraction.com>,
Danilo Krummrich <dakr@kernel.org>,
Alice Ryhl <aliceryhl@google.com>,
David Airlie <airlied@gmail.com>,
Alexandre Courbot <acourbot@nvidia.com>,
Benno Lossin <lossin@kernel.org>, Gary Guo <gary@garyguo.net>,
Eliot Courtney <ecourtney@nvidia.com>,
John Hubbard <jhubbard@nvidia.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
"Rafael J. Wysocki" <rafael@kernel.org>,
linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org
Subject: [PATCH v6 00/13] gpu: nova: Export parameters from nova-core to nova-drm
Date: Wed, 9 Sep 2026 16:44:53 +1000 [thread overview]
Message-ID: <20260909064506.910162-1-apopple@nvidia.com> (raw)
This patch series adds some basic GPU properties via a new GPU info
ioctl. The goal is to provide enough information for a basic CUDA
deviceQuery sample, and the equivalent Mesa device properties, to be
populated from nova-drm.
It builds on the "drm: Higher-Ranked Lifetime private data" series[1] to
correctly manage lifetimes of registration data shared between DRM,
auxbus and nova-core, and on "ForLt/CovariantForLt split, auxiliary
closure API and DevresLt"[2]. Both are now in drm-rust-next.
This series exposes a latent build breakage with
CONFIG_RUST_DEBUG_ASSERTIONS=y, as nothing from the uapi crate is exported
to modules. The fix for this has been posted as a standalone patch at [3].
Properties are exported via a new NovaCoreApi type which implements
methods to read data from the GPU. This has been implemented in a separate
module to make the public API implementations obvious and to keep them in
one place. Auxiliary bus drivers obtain a NovaCoreApiHandle using
NovaCoreApi::of() and access the NovaCoreApi through a closure. This avoids
assuming registration data is covariant. This required a small change to
the auxiliary bus registration_data_with() closure signature, which is the
first patch.
The handle is stored as part of the DRM registration data and used to
interact with the GPU via the nova-core driver.
A new info ioctl is introduced which provides an info type field and a
method for reading extendable structs containing GPU information. The GPU
info reports the architecture and an opaque chip identifier along with
the usable VRAM size, the GPU names and the GID.
This series can be tested using drm-test[4]. The merge request adding the
tests[5] will be updated once this has been posted. A pull request for Mesa
has also been raised but is out of date. That will be updated once this
series has been merged.
Changes since v5:
- Export an opaque chipid alongside the architecture instead of the
implementation.
- Access NovaCoreApi through a closure based NovaCoreApiHandle using
ForLt as it will not remain covariant, based on a diff from Danilo.
Add the auxiliary bus change suggested by Gary that lets the closure
return covariant sub-fields directly
- Expose Spec and the GSP static info via accessors rather than
forwarding methods, and use the validated GPU name accessors
- Rename struct drm_nova_gpu_info to drm_nova_info_gpu for consistency
and document the NULL data pointer size query
- Handle the size query in write_info()
- Address further review comments
Changes since v4:
- No longer export chip-id, instead export architecture and implementation
- Add a separate info ioctl with types to read GPU info as suggested by
Danilo
Changes since v3:
- Use an ioctl to return all parameters rather than multiple key/value
queries
Changes since v2:
- Addressed review Danilo and Alex
- Minor renames to better align with HW based on internal feedback
Changes since v1:
- Address review comments from Danilo
- Add an API call to read VRAM PCI BAR size using nova-core
[1] - https://lore.kernel.org/rust-for-linux/20260628145406.2107056-1-dakr@kernel.org/
[2] - https://lore.kernel.org/driver-core/20260626183630.2585057-1-dakr@kernel.org/
[3] - https://lore.kernel.org/rust-for-linux/20260909060623.888777-1-apopple@nvidia.com/
[4] - https://gitlab.freedesktop.org/dakr/drm-test
[5] - https://gitlab.freedesktop.org/dakr/drm-test/-/merge_requests/1
Cc: M Henning <mhenning@darkrefraction.com>
Cc: Danilo Krummrich <dakr@kernel.org>
Cc: Alice Ryhl <aliceryhl@google.com>
Cc: David Airlie <airlied@gmail.com>
Cc: Alexandre Courbot <acourbot@nvidia.com>
Cc: Benno Lossin <lossin@kernel.org>
Cc: Gary Guo <gary@garyguo.net>
Cc: Eliot Courtney <ecourtney@nvidia.com>
Cc: John Hubbard <jhubbard@nvidia.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: "Rafael J. Wysocki" <rafael@kernel.org>
Cc: linux-kernel@vger.kernel.org
Cc: nova-gpu@lists.linux.dev
Cc: dri-devel@lists.freedesktop.org
Cc: rust-for-linux@vger.kernel.org
Alistair Popple (13):
rust: auxiliary: let registration_data_with() closures return
covariant sub-fields
gpu: nova-core: Add public driver API to nova-core
drm: nova: Add DRM registration data
drm: nova: Add GPU architecture enum to nova-drm UAPI
drm: nova: Add chipid enum to nova-drm UAPI
rust: uaccess: add UserSliceWriter::write_truncated()
drm: nova: Add an info ioctl
drm: nova: Add usable VRAM size to GPU info
drm: nova: Use nova-core to read VRAM_BAR_SIZE parameter
drm: nova: Expose a render node
drm: nova: Report GPU name in GPU info
drm: nova: Report GPU short name in GPU info
drm: nova: Report GPU GID in GPU info
drivers/gpu/drm/nova/driver.rs | 19 +++-
drivers/gpu/drm/nova/file.rs | 109 +++++++++++++++++---
drivers/gpu/nova-core/api.rs | 68 ++++++++++++
drivers/gpu/nova-core/driver.rs | 48 ++++++---
drivers/gpu/nova-core/gpu.rs | 111 +++++++++++---------
drivers/gpu/nova-core/gsp/commands.rs | 31 +++++-
drivers/gpu/nova-core/gsp/fw/commands.rs | 15 +++
drivers/gpu/nova-core/gsp/hal.rs | 2 +-
drivers/gpu/nova-core/nova_core.rs | 1 +
drivers/gpu/nova-core/num.rs | 2 +-
include/uapi/drm/nova_drm.h | 126 +++++++++++++++++++++++
rust/kernel/auxiliary.rs | 17 +--
rust/kernel/uaccess.rs | 14 +++
13 files changed, 476 insertions(+), 87 deletions(-)
create mode 100644 drivers/gpu/nova-core/api.rs
base-commit: b705c185105762676aa6ec16cf976101df87cc35
prerequisite-patch-id: 76f69e9677d66758b273f8415cc7785347544655
--
2.54.0
next reply other threads:[~2026-09-09 6:45 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-09 6:44 Alistair Popple [this message]
2026-09-09 6:44 ` [PATCH v6 01/13] rust: auxiliary: let registration_data_with() closures return covariant sub-fields Alistair Popple
2026-09-09 6:44 ` [PATCH v6 02/13] gpu: nova-core: Add public driver API to nova-core Alistair Popple
2026-09-09 6:44 ` [PATCH v6 03/13] drm: nova: Add DRM registration data Alistair Popple
2026-09-09 6:44 ` [PATCH v6 04/13] drm: nova: Add GPU architecture enum to nova-drm UAPI Alistair Popple
2026-09-09 6:44 ` [PATCH v6 05/13] drm: nova: Add chipid " Alistair Popple
2026-09-09 6:44 ` [PATCH v6 06/13] rust: uaccess: add UserSliceWriter::write_truncated() Alistair Popple
2026-09-09 6:45 ` [PATCH v6 07/13] drm: nova: Add an info ioctl Alistair Popple
2026-09-09 6:45 ` [PATCH v6 08/13] drm: nova: Add usable VRAM size to GPU info Alistair Popple
2026-09-09 6:45 ` [PATCH v6 09/13] drm: nova: Use nova-core to read VRAM_BAR_SIZE parameter Alistair Popple
2026-09-09 6:45 ` [PATCH v6 10/13] drm: nova: Expose a render node Alistair Popple
2026-09-09 6:45 ` [PATCH v6 11/13] drm: nova: Report GPU name in GPU info Alistair Popple
2026-09-09 6:45 ` [PATCH v6 12/13] drm: nova: Report GPU short " Alistair Popple
2026-09-09 6:45 ` [PATCH v6 13/13] drm: nova: Report GPU GID " Alistair Popple
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=20260909064506.910162-1-apopple@nvidia.com \
--to=apopple@nvidia.com \
--cc=acourbot@nvidia.com \
--cc=airlied@gmail.com \
--cc=aliceryhl@google.com \
--cc=dakr@kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=ecourtney@nvidia.com \
--cc=gary@garyguo.net \
--cc=gregkh@linuxfoundation.org \
--cc=jhubbard@nvidia.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lossin@kernel.org \
--cc=mhenning@darkrefraction.com \
--cc=nova-gpu@lists.linux.dev \
--cc=rafael@kernel.org \
--cc=rust-for-linux@vger.kernel.org \
/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