drm/gem: Add ww_acquire_ctx support to drm_gem_lru_scan()
authorRob Clark <robdclark@chromium.org>
Sun, 29 Jun 2025 20:12:46 +0000 (13:12 -0700)
committerRob Clark <robin.clark@oss.qualcomm.com>
Fri, 4 Jul 2025 18:09:43 +0000 (11:09 -0700)
commit02070f04987524caf77d4bf4c94ebceb783b7bcc
treee0ac08daca4eca02f3615eec411557f4903499f5
parent471920ce25d50bb39bfdaf3c3d9bc9dde30fa265
drm/gem: Add ww_acquire_ctx support to drm_gem_lru_scan()

If the callback is going to have to attempt to grab more locks, it is
useful to have an ww_acquire_ctx to avoid locking order problems.

Why not use the drm_exec helper instead?  Mainly because (a) where
ww_acquire_init() is called is awkward, and (b) we don't really
need to retry after backoff, we can just move on to the next object.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Signed-off-by: Rob Clark <robin.clark@oss.qualcomm.com>
Tested-by: Antonino Maniscalco <antomani103@gmail.com>
Reviewed-by: Antonino Maniscalco <antomani103@gmail.com>
Patchwork: https://patchwork.freedesktop.org/patch/661463/
drivers/gpu/drm/drm_gem.c
drivers/gpu/drm/msm/msm_gem_shrinker.c
include/drm/drm_gem.h