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 org.kernel.vger.rust-for-linux,dev.linux.lists.nova-gpu,org.kernel.vger.linux-kernel
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(
>  
>          let value = match getparam.param as u32 {
>              uapi::NOVA_GETPARAM_VRAM_BAR_SIZE => pdev.resource_len(1)?,
> +            uapi::NOVA_GETPARAM_GPU_CHIPID => reg_data.api.chipset() as u64,

NIT: Given the subsequent changes I'd create a temporary

	let api = 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 additional
information from the chipid directly? Defining it as opaque value would make
things easier if the encoding details of the chipid ever change.