@@ -309,18 +309,7 @@ static void xe_display_flush_cleanup_work(struct xe_device *xe)
309309}
310310
311311/* 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-
323- void xe_display_pm_suspend (struct xe_device * xe , bool runtime )
312+ static void __xe_display_pm_suspend (struct xe_device * xe , bool runtime )
324313{
325314 struct intel_display * display = & xe -> display ;
326315 bool s2idle = suspend_to_idle ();
@@ -353,28 +342,38 @@ void xe_display_pm_suspend(struct xe_device *xe, bool runtime)
353342 intel_opregion_suspend (display , s2idle ? PCI_D1 : PCI_D3cold );
354343
355344 intel_dmc_suspend (xe );
345+
346+ if (runtime && has_display (xe ))
347+ intel_hpd_poll_enable (xe );
356348}
357349
358- void xe_display_pm_suspend_late (struct xe_device * xe )
350+ void xe_display_pm_suspend (struct xe_device * xe )
351+ {
352+ __xe_display_pm_suspend (xe , false);
353+ }
354+
355+ void xe_display_pm_runtime_suspend (struct xe_device * xe )
359356{
360- bool s2idle = suspend_to_idle ();
361357 if (!xe -> info .probe_display )
362358 return ;
363359
364- intel_power_domains_suspend (xe , s2idle );
360+ if (xe -> d3cold .allowed ) {
361+ __xe_display_pm_suspend (xe , true);
362+ return ;
363+ }
365364
366- intel_display_power_suspend_late (xe );
365+ intel_hpd_poll_enable (xe );
367366}
368367
369- void xe_display_pm_runtime_resume (struct xe_device * xe )
368+ void xe_display_pm_suspend_late (struct xe_device * xe )
370369{
370+ bool s2idle = suspend_to_idle ();
371371 if (!xe -> info .probe_display )
372372 return ;
373373
374- intel_hpd_poll_disable (xe );
374+ intel_power_domains_suspend (xe , s2idle );
375375
376- if (xe -> d3cold .allowed )
377- xe_display_pm_resume (xe , true);
376+ intel_display_power_suspend_late (xe );
378377}
379378
380379void xe_display_pm_resume_early (struct xe_device * xe )
@@ -387,7 +386,7 @@ void xe_display_pm_resume_early(struct xe_device *xe)
387386 intel_power_domains_resume (xe );
388387}
389388
390- void xe_display_pm_resume (struct xe_device * xe , bool runtime )
389+ static void __xe_display_pm_resume (struct xe_device * xe , bool runtime )
391390{
392391 struct intel_display * display = & xe -> display ;
393392
@@ -411,16 +410,38 @@ void xe_display_pm_resume(struct xe_device *xe, bool runtime)
411410 intel_display_driver_resume (xe );
412411 drm_kms_helper_poll_enable (& xe -> drm );
413412 intel_display_driver_enable_user_access (xe );
414- intel_hpd_poll_disable (xe );
415413 }
416414
415+ if (has_display (xe ))
416+ intel_hpd_poll_disable (xe );
417+
417418 intel_opregion_resume (display );
418419
419420 intel_fbdev_set_suspend (& xe -> drm , FBINFO_STATE_RUNNING , false);
420421
421422 intel_power_domains_enable (xe );
422423}
423424
425+ void xe_display_pm_resume (struct xe_device * xe )
426+ {
427+ __xe_display_pm_resume (xe , false);
428+ }
429+
430+ void xe_display_pm_runtime_resume (struct xe_device * xe )
431+ {
432+ if (!xe -> info .probe_display )
433+ return ;
434+
435+ if (xe -> d3cold .allowed ) {
436+ __xe_display_pm_resume (xe , true);
437+ return ;
438+ }
439+
440+ intel_hpd_init (xe );
441+ intel_hpd_poll_disable (xe );
442+ }
443+
444+
424445static void display_device_remove (struct drm_device * dev , void * arg )
425446{
426447 struct xe_device * xe = arg ;
0 commit comments