Skip to content

Commit 66a0f6b

Browse files
committed
drm/xe/display: handle HPD polling in display runtime suspend/resume
In XE, display runtime suspend / resume routines are called only if d3cold is allowed. This makes the driver unable to detect any HPDs once the device goes into runtime suspend state in platforms like LNL. Update the display runtime suspend / resume routines to include HPD polling regardless of d3cold status. While xe_display_pm_suspend/resume() performs steps during runtime suspend/resume that shouldn't happen, like suspending MST and they are missing other steps like enabling DC9, this patchset is meant to keep the current behavior wrt. these, leaving the corresponding updates for a follow-up v2: have a separate function for display runtime s/r (Rodrigo) v3: better streamlining of system s/r and runtime s/r calls (Imre) v4: rebased Reviewed-by: Arun R Murthy <[email protected]> Signed-off-by: Vinod Govindapillai <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 1228241 commit 66a0f6b

File tree

3 files changed

+32
-3
lines changed

3 files changed

+32
-3
lines changed

drivers/gpu/drm/xe/display/xe_display.c

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,18 @@ static void xe_display_flush_cleanup_work(struct xe_device *xe)
308308
}
309309
}
310310

311+
/* TODO: System and runtime suspend/resume sequences will be sanitized as a follow-up. */
312+
void xe_display_pm_runtime_suspend(struct xe_device *xe)
313+
{
314+
if (!xe->info.probe_display)
315+
return;
316+
317+
if (xe->d3cold.allowed)
318+
xe_display_pm_suspend(xe, true);
319+
320+
intel_hpd_poll_enable(xe);
321+
}
322+
311323
void xe_display_pm_suspend(struct xe_device *xe, bool runtime)
312324
{
313325
struct intel_display *display = &xe->display;
@@ -354,6 +366,17 @@ void xe_display_pm_suspend_late(struct xe_device *xe)
354366
intel_display_power_suspend_late(xe);
355367
}
356368

369+
void xe_display_pm_runtime_resume(struct xe_device *xe)
370+
{
371+
if (!xe->info.probe_display)
372+
return;
373+
374+
intel_hpd_poll_disable(xe);
375+
376+
if (xe->d3cold.allowed)
377+
xe_display_pm_resume(xe, true);
378+
}
379+
357380
void xe_display_pm_resume_early(struct xe_device *xe)
358381
{
359382
if (!xe->info.probe_display)

drivers/gpu/drm/xe/display/xe_display.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ void xe_display_pm_suspend(struct xe_device *xe, bool runtime);
3838
void xe_display_pm_suspend_late(struct xe_device *xe);
3939
void xe_display_pm_resume_early(struct xe_device *xe);
4040
void xe_display_pm_resume(struct xe_device *xe, bool runtime);
41+
void xe_display_pm_runtime_suspend(struct xe_device *xe);
42+
void xe_display_pm_runtime_resume(struct xe_device *xe);
4143

4244
#else
4345

@@ -67,6 +69,8 @@ static inline void xe_display_pm_suspend(struct xe_device *xe, bool runtime) {}
6769
static inline void xe_display_pm_suspend_late(struct xe_device *xe) {}
6870
static inline void xe_display_pm_resume_early(struct xe_device *xe) {}
6971
static inline void xe_display_pm_resume(struct xe_device *xe, bool runtime) {}
72+
static inline void xe_display_pm_runtime_suspend(struct xe_device *xe) {}
73+
static inline void xe_display_pm_runtime_resume(struct xe_device *xe) {}
7074

7175
#endif /* CONFIG_DRM_XE_DISPLAY */
7276
#endif /* _XE_DISPLAY_H_ */

drivers/gpu/drm/xe/xe_pm.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -366,9 +366,9 @@ int xe_pm_runtime_suspend(struct xe_device *xe)
366366
xe_bo_runtime_pm_release_mmap_offset(bo);
367367
mutex_unlock(&xe->mem_access.vram_userfault.lock);
368368

369-
if (xe->d3cold.allowed) {
370-
xe_display_pm_suspend(xe, true);
369+
xe_display_pm_runtime_suspend(xe);
371370

371+
if (xe->d3cold.allowed) {
372372
err = xe_bo_evict_all(xe);
373373
if (err)
374374
goto out;
@@ -431,12 +431,14 @@ int xe_pm_runtime_resume(struct xe_device *xe)
431431
for_each_gt(gt, xe, id)
432432
xe_gt_resume(gt);
433433

434+
xe_display_pm_runtime_resume(xe);
435+
434436
if (xe->d3cold.allowed) {
435-
xe_display_pm_resume(xe, true);
436437
err = xe_bo_restore_user(xe);
437438
if (err)
438439
goto out;
439440
}
441+
440442
out:
441443
lock_map_release(&xe_pm_runtime_lockdep_map);
442444
xe_pm_write_callback_task(xe, NULL);

0 commit comments

Comments
 (0)