Skip to content

Commit 492be2a

Browse files
committed
drm/xe/display: Match i915 driver suspend/resume sequences better
Suspend fbdev sooner, and disable user access before suspending to prevent some races. I've noticed this when comparing xe suspend to i915's. Matches the following commits from i915: 24b412b ("drm/i915: Disable intel HPD poll after DRM poll init/enable") 1ef28d8 ("drm/i915: Suspend the framebuffer console earlier during system suspend") bd738d8 ("drm/i915: Prevent modesets during driver init/shutdown") Thanks to Imre for pointing me to those commits. Driver shutdown is currently missing, but I have some idea how to implement it next. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Cc: Imre Deak <imre.deak@intel.com> Reviewed-by: Uma Shankar <uma.shankar@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20240806105044.596842-2-maarten.lankhorst@linux.intel.com Signed-off-by: Maarten Lankhorst,,, <maarten.lankhorst@linux.intel.com>
1 parent 7116c35 commit 492be2a

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

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

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -299,8 +299,11 @@ void xe_display_pm_suspend(struct xe_device *xe, bool runtime)
299299
* properly.
300300
*/
301301
intel_power_domains_disable(xe);
302-
if (has_display(xe))
302+
intel_fbdev_set_suspend(&xe->drm, FBINFO_STATE_SUSPENDED, true);
303+
if (has_display(xe)) {
303304
drm_kms_helper_poll_disable(&xe->drm);
305+
intel_display_driver_disable_user_access(xe);
306+
}
304307

305308
if (!runtime)
306309
intel_display_driver_suspend(xe);
@@ -309,12 +312,13 @@ void xe_display_pm_suspend(struct xe_device *xe, bool runtime)
309312

310313
intel_hpd_cancel_work(xe);
311314

315+
if (has_display(xe))
316+
intel_display_driver_suspend_access(xe);
317+
312318
intel_encoder_suspend_all(&xe->display);
313319

314320
intel_opregion_suspend(display, s2idle ? PCI_D1 : PCI_D3cold);
315321

316-
intel_fbdev_set_suspend(&xe->drm, FBINFO_STATE_SUSPENDED, true);
317-
318322
intel_dmc_suspend(xe);
319323
}
320324

@@ -354,14 +358,19 @@ void xe_display_pm_resume(struct xe_device *xe, bool runtime)
354358
intel_display_driver_init_hw(xe);
355359
intel_hpd_init(xe);
356360

361+
if (has_display(xe))
362+
intel_display_driver_resume_access(xe);
363+
357364
/* MST sideband requires HPD interrupts enabled */
358365
intel_dp_mst_resume(xe);
359366
if (!runtime)
360367
intel_display_driver_resume(xe);
361368

362-
intel_hpd_poll_disable(xe);
363-
if (has_display(xe))
369+
if (has_display(xe)) {
364370
drm_kms_helper_poll_enable(&xe->drm);
371+
intel_display_driver_enable_user_access(xe);
372+
}
373+
intel_hpd_poll_disable(xe);
365374

366375
intel_opregion_resume(display);
367376

0 commit comments

Comments
 (0)