Thread (57 messages) 57 messages, 5 authors, 2026-09-08

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

flat view

From: "Danilo Krummrich" <dakr@kernel.org>
Date: 2026-09-04 09:34:28
Also in: dri-devel, lkml, nova-gpu

On Fri Sep 4, 2026 at 9:49 AM CEST, Alistair Popple wrote:
On 2026-09-03 at 20:42 +1000, Danilo Krummrich [off-list ref] wrote...
quoted
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.
I see. Maybe that was a bad assumption on my behalf, because I assumed that if
you make a precise hardware description available (chip-id) there'd be no point
making an imprecise subset of that description (arch) available as it isn't
particularly useful if you can't use it in isolation for any generic purpose.
Except that it is used in isolation for a generic purpose e.g. in NAK.
quoted
Then in NAK (src/nouveau/compiler/nak/ir.rs), there's this code.

	fn is_turing(&self) -> bool {
	    self.sm() >= 73 && self.sm() < 80
	}
	
	fn is_ampere(&self) -> bool {
	    self.sm() >= 80 && self.sm() < 89
	}
	
	fn is_ada(&self) -> bool {
	    self.sm() == 89
	}
	
	#[allow(dead_code)]
	fn is_hopper(&self) -> bool {
	    self.sm() >= 90 && self.sm() < 100
	}
	
	fn is_blackwell_a(&self) -> bool {
	    self.sm() >= 100 && self.sm() < 110
	}
	
	fn is_blackwell_b(&self) -> bool {
	    self.sm() >= 120 && self.sm() < 130
	}
	
	fn is_blackwell(&self) -> bool {
	    self.is_blackwell_a() || self.is_blackwell_b()
	}

That's two unnecessary indirections for something the kernel already has
available.
Again though is what the kernel provides in the form of an arch actually useful
to user-space? Obviously the code above makes it look nice and simple like that,
but as I have been saying more complete implementations can't just rely on arch
alone and so are still going to have lookup tables both for SM and for other
info the kernel can't provide.
Are you saying that NAK oversimplifies things and hence gets away with per
architecture checks in src/nouveau/compiler/nak/sm70.rs? And that a "more
complete implementation" would be specialized to a point where it becomes
impossible to have any common code per architecture and in general?
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help