]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
drm/v3d: Attach per-fd reset counters to v3d_stats
authorTvrtko Ursulin <tvrtko.ursulin@igalia.com>
Fri, 6 Mar 2026 11:30:37 +0000 (08:30 -0300)
committerMaíra Canal <mcanal@igalia.com>
Fri, 13 Mar 2026 21:02:32 +0000 (18:02 -0300)
commit2f0e110735a4e59e71e44d04b4f70e58f06c61c9
tree9fb6aac959f8a2b8d0d5adf532ee4daffa166794
parent745cc3f92a4b43606119b81d1f8bb1d1f5116049
drm/v3d: Attach per-fd reset counters to v3d_stats

To remove the file_priv NULL-ing dance needed to check if the file
descriptor is open, move the per-fd reset counter into v3d_stats, which
is heap-allocated and refcounted, outliving the fd as long as jobs
reference it.

This change allows the removal of the last `queue_lock` usage to protect
`job->file_priv` and avoids possible NULL ptr dereference issues due to
lifetime mismatches.

Also, to simplify locking, replace both the global and per-fd locked
reset counters with atomics.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Link: https://patch.msgid.link/20260306-v3d-reset-locking-improv-v3-5-49864fe00692@igalia.com
Co-developed-by: Maíra Canal <mcanal@igalia.com>
Signed-off-by: Maíra Canal <mcanal@igalia.com>
drivers/gpu/drm/v3d/v3d_drv.c
drivers/gpu/drm/v3d/v3d_drv.h
drivers/gpu/drm/v3d/v3d_sched.c