drm/xe: Use separate rpm lockdep map for non-d3cold-capable devices
authorThomas Hellström <thomas.hellstrom@linux.intel.com>
Mon, 26 Aug 2024 14:34:50 +0000 (16:34 +0200)
committerThomas Hellström <thomas.hellstrom@linux.intel.com>
Wed, 28 Aug 2024 14:29:15 +0000 (16:29 +0200)
commit379cad69bdfe522e840ed5f5c01ac8769006d53e
tree58b5326835ef3e5d5b1f71a8b8fc5ec2e1f9dcd5
parent789e51597d33ec0053b029127d797d86c0d857eb
drm/xe: Use separate rpm lockdep map for non-d3cold-capable devices

For non-d3cold-capable devices we'd like to be able to wake up the
device from reclaim. In particular, for Lunar Lake we'd like to be
able to blit CCS metadata to system at shrink time; at least from
kswapd where it's reasonable OK to wait for rpm resume and a
preceding rpm suspend.

Therefore use a separate lockdep map for such devices and prime it
reclaim-tainted.

v2:
- Rename lockmap acquire- and release functions. (Rodrigo Vivi).
- Reinstate the old xe_pm_runtime_lockdep_prime() function and
  rename it to xe_rpm_might_enter_cb(). (Matthew Auld).
- Introduce a separate xe_pm_runtime_lockdep_prime function
  called from module init for known required locking orders.
v3:
- Actually hook up the prime function at module init.
v4:
- Rebase.
v5:
- Don't use reclaim-safe RPM with sriov.

Cc: "Vivi, Rodrigo" <rodrigo.vivi@intel.com>
Cc: "Auld, Matthew" <matthew.auld@intel.com>
Signed-off-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
Reviewed-by: Matthew Auld <matthew.auld@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240826143450.92511-1-thomas.hellstrom@linux.intel.com
drivers/gpu/drm/xe/xe_module.c
drivers/gpu/drm/xe/xe_pm.c
drivers/gpu/drm/xe/xe_pm.h