From: "Danilo Krummrich" <dakr@kernel.org>
To: "John Hubbard" <jhubbard@nvidia.com>
Cc: "Alistair Popple" <apopple@nvidia.com>,
<nova-gpu@lists.linux.dev>, "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>,
<linux-kernel@vger.kernel.org>, <dri-devel@lists.freedesktop.org>,
<rust-for-linux@vger.kernel.org>
Subject: Re: [PATCH v3 3/7] drm: nova: Add chipid enum to nova-drm UAPI
Date: Wed, 29 Jul 2026 00:57:54 +0200 [thread overview]
Message-ID: <DKAKR85QX9UM.1VYAAL82QBWJ5@kernel.org> (raw)
In-Reply-To: <57e2b956-89fd-43e8-8cb3-a15aee272660@nvidia.com>
On Tue Jul 28, 2026 at 11:49 PM CEST, John Hubbard wrote:
> On 7/28/26 2:29 PM, Danilo Krummrich wrote:
>> On Tue Jul 28, 2026 at 10:00 AM CEST, Alistair Popple wrote:
>>> On 2026-07-26 at 01:23 +1000, Danilo Krummrich <dakr@kernel.org> wrote...
>>>> On Thu Jul 23, 2026 at 8:30 AM CEST, Alistair Popple wrote:
> ...
>>>> For instance, what's valid for userspace to extract from this? Given chipid is a
>>>> composed value, is userspace e.g. allowed to make assumptions on extracting the
>>>> architecture? Or is this something we want to expose separately and tell
>>>> userspace that the chipid is an opaque value identifying a specific chip only?
>>>
>>> I _think_ it makes sense for this to just be an opaque value, but it's a good
>>> question that I should probably try and get some internal feedback on as well.
>>> Reading the arch would then be a separate parameter.
>>
>> I'd prefer exposing it as an opaque value and provide other information
>> separately; the kernel already does the work anyway, so why duplicate it in
>> userspace. It would also remain much cleaner if encoding details ever change.
>>
>
> Just to orient myself, I'm assuming that by "opaque values", you mean using
> something that just counts up from, say, 1, instead of using real boot42
> values below, right?
>
> That seems like a good approach to me, too. Because I can't imagine anything
> particularly good coming from providing unnecessary details to user space
> here. :)
I'd probably not be too worried about keeping it as is, but just document it as
being an opaque value that shouldn't be messed with.
If we expose the encoded information separately I don't see a huge incentive for
userspace to redo the work and mess with it anyway.
The advantage of keeping the values as they are is that we avoid having to deal
with mapping values back and forth. I kind of like that nova-core uses the
values from the uAPI header to define the Chipset struct, passes it to nova-drm
and nova-drm does use it to fill in the userspace exposed data.
Something else worth to consider in this context is whether we really want to go
with the key-value pair GETPARAM approach, which can become a bit tedious.
I think for the basic GPU information we could have a struct drm_nova_gpu_info,
which contains all the relevant information obtained at probe time, such as
chipid, architecture, VRAM size, etc.
If everything is available in a single struct there should be no reason for
userspace to mess with the chipid value. However, I'd also not object to make it
a "real" opaque value.
In order to deal with additions to the struct we could take a two stage approach
to obtain the information from userspace; probe size first, then allocate with
the returned size:
We can have a DRM_NOVA_INFO ioctl, which takes a struct containing the info
identifier (e.g. DRM_NOVA_GPU_INFO), a size and a pointer to the actual info
structure.
struct drm_nova_info {
__u32 id;
__u32 size;
__u64 info;
};
Userspace can call the DRM_NOVA_INFO with the identifier (e.g.
DRM_NOVA_GPU_INFO), size and info pointer set to zero, and the kernel fills in
the size of the info struct (e.g. struct drm_nova_gpu_info).
Subsequently, userspace can allocate memory with the size reported by the kernel
and call the same ioctl with the info pointer set to the allocated memory.
This way existing info structs remain extensible (as long as the layout isn't
changed of course) and new ones can be added at any time.
next prev parent reply other threads:[~2026-07-28 22:57 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-23 6:30 [PATCH v3 0/7] gpu: nova: Export parameters from nova-core to nova-drm Alistair Popple
2026-07-23 6:30 ` [PATCH v3 1/7] gpu: nova-core: Add public driver API to nova-core Alistair Popple
2026-07-25 15:23 ` Danilo Krummrich
2026-07-23 6:30 ` [PATCH v3 2/7] drm: nova: Add DRM registration data Alistair Popple
2026-07-25 15:23 ` Danilo Krummrich
2026-07-23 6:30 ` [PATCH v3 3/7] drm: nova: Add chipid enum to nova-drm UAPI Alistair Popple
2026-07-25 15:23 ` Danilo Krummrich
2026-07-28 8:00 ` Alistair Popple
2026-07-28 21:29 ` Danilo Krummrich
2026-07-28 21:49 ` John Hubbard
2026-07-28 22:57 ` Danilo Krummrich [this message]
2026-07-23 6:30 ` [PATCH v3 4/7] drm: nova: Add GETPARAM parameter to read the GPU chipid Alistair Popple
2026-07-25 15:23 ` Danilo Krummrich
2026-07-23 6:30 ` [PATCH v3 5/7] drm: nova: Add GETPARAM parameter to read usable VRAM size Alistair Popple
2026-07-23 6:30 ` [PATCH v3 6/7] drm: nova: Use nova-core to read VRAM_BAR_SIZE parameter Alistair Popple
2026-07-23 6:30 ` [PATCH v3 7/7] drm: nova: Expose a render node 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=DKAKR85QX9UM.1VYAAL82QBWJ5@kernel.org \
--to=dakr@kernel.org \
--cc=acourbot@nvidia.com \
--cc=airlied@gmail.com \
--cc=aliceryhl@google.com \
--cc=apopple@nvidia.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=ecourtney@nvidia.com \
--cc=gary@garyguo.net \
--cc=jhubbard@nvidia.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lossin@kernel.org \
--cc=nova-gpu@lists.linux.dev \
--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