return 0;
 }
 
+static int panthor_ioctl_bo_set_label(struct drm_device *ddev, void *data,
+                                     struct drm_file *file)
+{
+       struct drm_panthor_bo_set_label *args = data;
+       struct drm_gem_object *obj;
+       const char *label = NULL;
+       int ret = 0;
+
+       if (args->pad)
+               return -EINVAL;
+
+       obj = drm_gem_object_lookup(file, args->handle);
+       if (!obj)
+               return -ENOENT;
+
+       if (args->label) {
+               label = strndup_user((const char __user *)(uintptr_t)args->label,
+                                    PANTHOR_BO_LABEL_MAXLEN);
+               if (IS_ERR(label)) {
+                       ret = PTR_ERR(label);
+                       if (ret == -EINVAL)
+                               ret = -E2BIG;
+                       goto err_put_obj;
+               }
+       }
+
+       /*
+        * We treat passing a label of length 0 and passing a NULL label
+        * differently, because even though they might seem conceptually
+        * similar, future uses of the BO label might expect a different
+        * behaviour in each case.
+        */
+       panthor_gem_bo_set_label(obj, label);
+
+err_put_obj:
+       drm_gem_object_put(obj);
+
+       return ret;
+}
+
 static int
 panthor_open(struct drm_device *ddev, struct drm_file *file)
 {
        PANTHOR_IOCTL(TILER_HEAP_CREATE, tiler_heap_create, DRM_RENDER_ALLOW),
        PANTHOR_IOCTL(TILER_HEAP_DESTROY, tiler_heap_destroy, DRM_RENDER_ALLOW),
        PANTHOR_IOCTL(GROUP_SUBMIT, group_submit, DRM_RENDER_ALLOW),
+       PANTHOR_IOCTL(BO_SET_LABEL, bo_set_label, DRM_RENDER_ALLOW),
 };
 
 static int panthor_mmap(struct file *filp, struct vm_area_struct *vma)
  * - 1.2 - adds DEV_QUERY_GROUP_PRIORITIES_INFO query
  *       - adds PANTHOR_GROUP_PRIORITY_REALTIME priority
  * - 1.3 - adds DRM_PANTHOR_GROUP_STATE_INNOCENT flag
+ * - 1.4 - adds DRM_IOCTL_PANTHOR_BO_SET_LABEL ioctl
  */
 static const struct drm_driver panthor_drm_driver = {
        .driver_features = DRIVER_RENDER | DRIVER_GEM | DRIVER_SYNCOBJ |
        .name = "panthor",
        .desc = "Panthor DRM driver",
        .major = 1,
-       .minor = 3,
+       .minor = 4,
 
        .gem_create_object = panthor_gem_create_object,
        .gem_prime_import_sg_table = drm_gem_shmem_prime_import_sg_table,
 
 
        /** @DRM_PANTHOR_TILER_HEAP_DESTROY: Destroy a tiler heap. */
        DRM_PANTHOR_TILER_HEAP_DESTROY,
+
+       /** @DRM_PANTHOR_BO_SET_LABEL: Label a BO. */
+       DRM_PANTHOR_BO_SET_LABEL,
 };
 
 /**
        __u32 pad;
 };
 
+/**
+ * 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;
+
+       /**  @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.
                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)