On 9/27/24 11:48, Pierre-Eric Pelloux-Prayer wrote: > 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: > https://gitlab.freedesktop.org/virgl/virglrenderer/-/merge_requests/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@xxxxxxxxxx> > Signed-off-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@xxxxxxx> > --- > drivers/gpu/drm/drm_debugfs.c | 14 ++++++--- > drivers/gpu/drm/drm_file.c | 5 ++++ > drivers/gpu/drm/drm_ioctl.c | 55 +++++++++++++++++++++++++++++++++++ > include/drm/drm_file.h | 9 ++++++ > include/uapi/drm/drm.h | 17 +++++++++++ > 5 files changed, 96 insertions(+), 4 deletions(-) Reviewed-by: Dmitry Osipenko <dmitry.osipenko@xxxxxxxxxxxxx> -- Best regards, Dmitry