Re: [PATCH v8 2/4] drm/panthor: Add driver IOCTL for setting BO labels

From: Boris Brezillon
Date: Thu Apr 17 2025 - 08:30:25 EST


On Tue, 15 Apr 2025 20:15:31 +0100
Adrián Larumbe <adrian.larumbe@xxxxxxxxxxxxx> wrote:

> +/**
> + * struct drm_panthor_bo_set_label - Arguments passed to DRM_IOCTL_PANTHOR_BO_SET_LABEL
> + */
> +struct drm_panthor_bo_set_label {
> + /** @handle: Handle of the buffer object to label. */
> + __u32 handle;
> +

Funny that this one pops up just after I fixed a missing-padding-field
issue in panthor_drm.h. We really need to tool based on pahole to
detect those before merging.

TLDR;

/** @pad: MBZ. */
__u32 pad;

> + /**
> + * @label: User pointer to a NUL-terminated string
> + *
> + * Length cannot be greater than 4096
> + */
> + __u64 label;
> +};
> +
> /**
> * DRM_IOCTL_PANTHOR() - Build a Panthor IOCTL number
> * @__access: Access type. Must be R, W or RW.
> @@ -1019,6 +1037,8 @@ enum {
> DRM_IOCTL_PANTHOR(WR, TILER_HEAP_CREATE, tiler_heap_create),
> DRM_IOCTL_PANTHOR_TILER_HEAP_DESTROY =
> DRM_IOCTL_PANTHOR(WR, TILER_HEAP_DESTROY, tiler_heap_destroy),
> + DRM_IOCTL_PANTHOR_BO_SET_LABEL =
> + DRM_IOCTL_PANTHOR(WR, BO_SET_LABEL, bo_set_label),
> };
>
> #if defined(__cplusplus)