Re: [PATCH v18 5/8] accel/rocket: add a GET_PARAM ioctl for the hardware version

From: Daniel Drake

Date: Tue Nov 24 2026 - 04:53:20 EST


On 24/11/2026 00:01, Jiaxing Hu wrote:
> Add DRM_IOCTL_ROCKET_GET_PARAM so that userspace can tell which NPU it
> runs on. DRM_ROCKET_PARAM_HW_VERSION returns an enum
> drm_rocket_hw_version value, taken from the compatible's match data when
> the first core probes. The PC_VERSION registers cannot be used: the
> RK3568 reads 0 from them.

I also spotted that the vendor driver uses compatible-based matching for
this kind of thing.

> @@ -197,6 +224,9 @@ static int rocket_probe(struct platform_device *pdev)
> devres_close_group(&drm_dev->dev, rdev_group);
> }
>
> + if (hw_version != rdev->hw_version)
> + return -EINVAL;
> +

This check can be dropped, we can assume that a DT that gives cores with
a mix of hw versions is invalid and broken.

With that change feel free to add my Reviewed-By