Re: [PATCH v5 05/11] drm: nova: Add an info ioctl

From: Gary Guo

Date: Fri Sep 04 2026 - 08:23:51 EST


On Thu Sep 3, 2026 at 11:42 AM BST, Danilo Krummrich wrote:
> On Thu Sep 3, 2026 at 3:12 AM CEST, Alistair Popple wrote:
>> Originally I thought the point of providing the decoded arch rather than
>> chip-id
>
> I think there never was a "rather than". The point was that if userspace has
> conditionals based on the architecture it shouldn't have to figure it out based
> on the chipid, as this has been done by the kernel already.
>
>> because as you rightfully point out the kernel doesn't (currently at least)
>> care much about the implementation
>
> I still don't see how that value will ever be meaningful, there is no such thing
> as "all GPUs of a certain implementation regardless of architecture" have
> something in common, is it?

I don't think it's an issue that implementation field is only meaningful when
you get the architecture. That's pretty common for other IDs, e.g. PCI product
ID is meaningless without having the vendor ID.

You mentioned in an earlier email about the typing, but we could still have
meaningful impl IDs fully typed like this:

pub enum Arch {
Turing(impl_id),
Ampere(impl_id),
...
}

and some langauges can do better, e.g. TypeScript allow you to write

enumn ArchId {
Turing,
Ampere,
...
}

enum TuringImplId { ... }
enum AmpereImplId { ... }

type Id =
{ arch: ArchId.Turing, impl: TuringImplId } |
{ arch: ArchId.Ampere, impl: AmpereImplId };

So I think it's a reasonable design to have it.

>
> But since you say "currently at least", are there any plans to give this value
> some meaning beyond being a unique counter for chips within a certain
> architecture?
>
> If so, I think that'd be a horrible way to encode some chip commonality.

True, but I think the chip ID is as bad as impl ID. Feature detections should
use dedicated featuire detection mechanism, not looking up IDs directly. I.e. we
should have userspace not having to use either chip ID or impl ID as much as we
can.

That said, I do think looking up tables are unavoidable, for getting names or
applying some quirk fixes. And I agree with Alistair that if we include it,
including impl ID is better than the chip ID, as we should rather not having
user space relying on an arbitrary encoded chip ID.

Best,
Gary