From: Alistair Popple <apopple@nvidia.com>
To: Danilo Krummrich <dakr@kernel.org>
Cc: M Henning <mhenning@darkrefraction.com>,
nova-gpu <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>,
John Hubbard <jhubbard@nvidia.com>,
linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org,
rust-for-linux@vger.kernel.org
Subject: Re: [PATCH v4 3/7] drm: nova: Add chipid enum to nova-drm UAPI
Date: Tue, 25 Aug 2026 22:03:48 +1000 [thread overview]
Message-ID: <ao1_ngqj2a2XB3h9@nvdebian.thelocal> (raw)
In-Reply-To: <ao062w9fdaQEEYHy@nvdebian.thelocal>
On 2026-08-25 at 17:13 +1000, Alistair Popple <apopple@nvidia.com> wrote...
> On 2026-08-25 at 05:24 +1000, Danilo Krummrich <dakr@kernel.org> wrote...
> > On Mon Aug 24, 2026 at 4:49 PM CEST, M Henning wrote:
> > > On Tue, Aug 11, 2026 at 1:12 AM Alistair Popple <apopple@nvidia.com> wrote:
> > >> +/*
> > >> + * Opaque chipids. These may be used to determine what chip a particular GPU is
> > >> + * based on the identifier but the values themselves should not be assumed to
> > >> + * carry any particular meaning.
> > >> + */
> > >
> > > You say this is opaque, but the userspace MR you posted already treats
> > > the values as non-opaque in eg. sm_for_chipset.
> > > https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/43352/diffs?commit_id=945a8e7c51939577526974b342c8dc6bafc3372f
> > > So, I guess my question is, is is opaque or not?
> >
> > The PR is outdated and goes back to the first version of this patch series;
> > what's written here is correct.
>
> Right - I was holding off on updating the PR until we'd settled on the UAPI
> here.
>
> > > I don't see much of a reason to make it opaque since the chipset has
> > > had the same structure on the hardware level for 30 years, so I don't
> > > expect it to change too often. Truly treating this as opaque would
> > > likely require a small refactor on the userspace side without much
> > > value. (I realize this has already been discussed a bit on the
> > > previous version.)
> >
> > I don't see much value in having userspace decode this value (again) after the
> > kernel did it already and can easily provide the required information without
> > making userspace commit to some encoding in the hardware (even though I do agree
> > that it is unlikely).
Userspace has to commit to some kind of encoding about HW though. If we're going
to assume everything and anything about HW can change there's also no reason to
assume HW would continue using a chip architecture and a chip implementation as
having any meaning at all.
> > OTH, the way chip IDs are derived has changed over the years (BOOT_0 / BOOT_42
> > with different register layouts), and I'd rather not have userspace commit to
> > any particular encoding when the kernel already provides the decoded
> > information.
> >
> > Regarding the refactor in mesa, the Nova uAPI won't follow nouveau anyway, so I
> > don't want to limit ourselfs here.
On the other hand we don't need to ignore the lessons of Nouveau either and try
and refactor everything - I agree there are plenty of UAPI choices that should
and will be different and we shouldn't limit ourselves - but if an interface has
been working well for 30 years and hasn't been causing anyone any issues then
perhaps we should just stick with it for Nova as well?
>
> I'm not particularly wedded to either approach but I think the approach is
> either:
>
> 1) Keep the chip_id opaque, user-space looks up arch/implementation/etc. from a
> lookup table as required.
>
> 2) Keep the current scheme of just exposing the chip_id and letting user-space
> decode it assuming the register layout won't change.
>
> In either case user-space needs to figure out arch/implementation/etc.
>
> For (1) the kernel should not be responsible for decoding arch because if you're
> assuming the register layout can change arbitrarily then the it can't reliably
> figure out the arch anyway. For example if someone plugs a shiny new card with
> a different chip_id register layout into a machine running an older kernel they
> could get an incorrect arch which would be confusing. Users would get upset if
> for example ShinyNewCard got reported as being Turing say.
Thinking about this some more I think I conflated the architecutre and
implementation a bit. A new arch would _probably_ require other driver changes
anyway, so perhaps my example is a little contrived. The point I was trying to
make was that requiring backporting of kernel patches and forced driver upgrades
just to get a new impl (or maybe arch) decoding would be unfortunate.
We may well never get to the point of being able to have a (slightly) older
driver support a new impl, but I still think it would be best not to bake that
requirement in.
> So I think it makes sense to keep this decoding in user-space regardless of
> whether that's exposed via documented opaque chip IDs and lookup tables for
> arch/implementation or by a commitment to keep the chip ID register layout the
> same.
>
> Either of 1 or 2 seems fine to me.
> - Alistair
next prev parent reply other threads:[~2026-08-25 12:04 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-11 5:06 [PATCH v4 0/7] gpu: nova: Export parameters from nova-core to nova-drm Alistair Popple
2026-08-11 5:06 ` [PATCH v4 1/7] gpu: nova-core: Add public driver API to nova-core Alistair Popple
2026-08-11 5:06 ` [PATCH v4 2/7] drm: nova: Add DRM registration data Alistair Popple
2026-08-11 5:06 ` [PATCH v4 3/7] drm: nova: Add chipid enum to nova-drm UAPI Alistair Popple
2026-08-24 14:49 ` M Henning
2026-08-24 19:24 ` Danilo Krummrich
2026-08-25 7:13 ` Alistair Popple
2026-08-25 12:03 ` Alistair Popple [this message]
2026-08-11 5:06 ` [PATCH v4 4/7] drm: nova: Add a GPU info ioctl Alistair Popple
2026-08-17 20:18 ` Danilo Krummrich
2026-08-21 5:10 ` Alistair Popple
2026-08-24 19:10 ` Danilo Krummrich
2026-08-25 7:32 ` Alistair Popple
2026-08-24 19:34 ` Danilo Krummrich
2026-08-24 20:04 ` John Hubbard
2026-08-25 6:40 ` Alistair Popple
2026-08-11 5:06 ` [PATCH v4 5/7] drm: nova: Add usable VRAM size to " Alistair Popple
2026-08-11 5:06 ` [PATCH v4 6/7] drm: nova: Use nova-core to read VRAM_BAR_SIZE parameter Alistair Popple
2026-08-17 20:11 ` Danilo Krummrich
2026-08-21 5:13 ` Alistair Popple
2026-08-11 5:06 ` [PATCH v4 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=ao1_ngqj2a2XB3h9@nvdebian.thelocal \
--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=jhubbard@nvidia.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lossin@kernel.org \
--cc=mhenning@darkrefraction.com \
--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