[PATCH v6 11/12] drm/xe/pm/s2idle: Don't evict user BOs D3cold-VRSR state

Badal Nilawar
2026-01-13T16:32:48Z

Since VRAM stays active in D3cold-VRSR, evicting user BOs is unnecessary.

Cc: Matthew Auld <matthew.auld@intel.com>
Co-developed-by: Sk Anirban <sk.anirban@intel.com>
Signed-off-by: Sk Anirban <sk.anirban@intel.com>
Signed-off-by: Badal Nilawar <badal.nilawar@intel.com>
---
V1: Removed D3hot handling since, on discrete cards, we do not block
D3cold during system suspend
---
drivers/gpu/drm/xe/xe_pm.c | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/xe/xe_pm.c b/drivers/gpu/drm/xe/xe_pm.c
index 1dd8e2c0f51e..3c7983afca9c 100644
--- a/drivers/gpu/drm/xe/xe_pm.c
+++ b/drivers/gpu/drm/xe/xe_pm.c
@@ -169,7 +169,7 @@ static void xe_rpm_lockmap_release(const struct xe_device *xe)

static void xe_pm_suspend_prepare(struct xe_device *xe)
{
- if (pm_suspend_target_state == PM_SUSPEND_TO_IDLE)
+ if (pm_suspend_default_s2idle())
xe_pm_d3cold_target_state_toggle(xe);
else
xe->d3cold.target_state = XE_D3COLD_OFF;
@@ -192,8 +192,6 @@ int xe_pm_suspend(struct xe_device *xe, bool hibernation)
xe_pm_block_begin_signalling();
trace_xe_pm_suspend(xe, __builtin_return_address(0));

- xe_pm_suspend_prepare(xe);
-
err = xe_pxp_pm_suspend(xe->pxp);
if (err)
goto err;
@@ -554,8 +552,12 @@ static int xe_pm_notifier_callback(struct notifier_block *nb,
int err = 0;

switch (action) {
- case PM_HIBERNATION_PREPARE:
case PM_SUSPEND_PREPARE:
+ xe_pm_suspend_prepare(xe);
+ if (xe->d3cold.target_state == XE_D3COLD_VRSR)
+ break;
+ fallthrough;
+ case PM_HIBERNATION_PREPARE:
{
struct xe_validation_ctx ctx;

@@ -580,8 +582,11 @@ static int xe_pm_notifier_callback(struct notifier_block *nb,
xe_pm_block_end_signalling();
break;
}
- case PM_POST_HIBERNATION:
case PM_POST_SUSPEND:
+ if (xe->d3cold.target_state == XE_D3COLD_VRSR)
+ break;
+ fallthrough;
+ case PM_POST_HIBERNATION:
complete_all(&xe->pm_block);
xe_pm_wake_rebind_workers(xe);
xe_bo_notifier_unprepare_all_pinned(xe);
--
2.52.0