drm: add DRM_SET_CLIENT_NAME ioctl
Giving the opportunity to userspace to associate a free-form name with a drm_file struct is helpful for tracking and debugging. This is similar to the existing DMA_BUF_SET_NAME ioctl. Access to client_name is protected by a mutex, and the 'clients' debugfs file has been updated to print it. Userspace MR to use this ioctl: virgl/virglrenderer!1428 If the string passed by userspace contains chars that would mess up output when it's going to be printed (in dmesg, fdinfo, etc), -EINVAL is returned. A 0-length string is a valid use, and clears the existing name. Reviewed-by:Tvrtko Ursulin <tvrtko.ursulin@igalia.com> Reviewed-by:
Dmitry Osipenko <dmitry.osipenko@collabora.com> Signed-off-by:
Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Link: https://patchwork.freedesktop.org/patch/msgid/20241003124506.470931-2-pierre-eric.pelloux-prayer@amd.com Reviewed-by:
Christian König <christian.koenig@amd.com> Signed-off-by:
Christian König <christian.koenig@amd.com>
Showing
- drivers/gpu/drm/drm_debugfs.c 10 additions, 4 deletionsdrivers/gpu/drm/drm_debugfs.c
- drivers/gpu/drm/drm_file.c 5 additions, 0 deletionsdrivers/gpu/drm/drm_file.c
- drivers/gpu/drm/drm_ioctl.c 51 additions, 0 deletionsdrivers/gpu/drm/drm_ioctl.c
- include/drm/drm_file.h 9 additions, 0 deletionsinclude/drm/drm_file.h
- include/uapi/drm/drm.h 17 additions, 0 deletionsinclude/uapi/drm/drm.h
Loading