Re: [PATCH v3 4/7] drm: nova: Add GETPARAM parameter to read the GPU chipid
"Danilo Krummrich" <[email protected]> Sat, 25 Jul 2026 17:23:38 +0200
| Newsgroups | dev.linux.lists.nova-gpu,org.kernel.vger.linux-kernel,org.kernel.vger.rust-for-linux |
|---|---|
| Message-ID | <[email protected]> |
On Thu Jul 23, 2026 at 8:30 AM CEST, Alistair Popple wrote:
> diff --git a/drivers/gpu/drm/nova/file.rs b/drivers/gpu/drm/nova/file.rs
> index 1156df51c533..855f23877734 100644
> --- a/drivers/gpu/drm/nova/file.rs
> +++ b/drivers/gpu/drm/nova/file.rs
> @@ -34,7 +34,7 @@ impl File {
> /// IOCTL: get_param: Query GPU / driver metadata.
> pub(crate) fn get_param(
> dev: &NovaDevice<Registered>,
> - _reg_data: &DrmRegData<'_>,
> + reg_data: &DrmRegData<'_>,
> getparam: &mut uapi::drm_nova_getparam,
> _file: &drm::File<File>,
> ) -> Result<u32> {
> @@ -43,6 +43,7 @@ pub(crate) fn get_param(
> =20
> let value =3D match getparam.param as u32 {
> uapi::NOVA_GETPARAM_VRAM_BAR_SIZE =3D> pdev.resource_len(1)?=
,
> + uapi::NOVA_GETPARAM_GPU_CHIPID =3D> reg_data.api.chipset() a=
s u64,
NIT: Given the subsequent changes I'd create a temporary
let api =3D reg_data.api;
for this.
> +/*
> + * NOVA_GETPARAM_GPU_CHIPID
> + *
> + * Query the GPU chipid (architecture/implementation).
> + */
> +#define NOVA_GETPARAM_GPU_CHIPID 0x2
As mentioned in the previous reply, do we want userspace to extract additio=
nal
information from the chipid directly? Defining it as opaque value would mak=
e
things easier if the encoding details of the chipid ever change.