@@ -288,11 +288,58 @@ static void xe_display_flush_cleanup_work(struct xe_device *xe)
288
288
}
289
289
}
290
290
291
- /* TODO: System and runtime suspend/resume sequences will be sanitized as a follow-up. */
292
- static void __xe_display_pm_suspend (struct xe_device * xe , bool runtime )
291
+ static void xe_display_enable_d3cold (struct xe_device * xe )
292
+ {
293
+ struct intel_display * display = & xe -> display ;
294
+
295
+ if (!xe -> info .probe_display )
296
+ return ;
297
+
298
+ /*
299
+ * We do a lot of poking in a lot of registers, make sure they work
300
+ * properly.
301
+ */
302
+ intel_power_domains_disable (display );
303
+
304
+ xe_display_flush_cleanup_work (xe );
305
+
306
+ intel_opregion_suspend (display , PCI_D3cold );
307
+
308
+ intel_dmc_suspend (display );
309
+
310
+ if (has_display (xe ))
311
+ intel_hpd_poll_enable (xe );
312
+ }
313
+
314
+ static void xe_display_disable_d3cold (struct xe_device * xe )
315
+ {
316
+ struct intel_display * display = & xe -> display ;
317
+
318
+ if (!xe -> info .probe_display )
319
+ return ;
320
+
321
+ intel_dmc_resume (display );
322
+
323
+ if (has_display (xe ))
324
+ drm_mode_config_reset (& xe -> drm );
325
+
326
+ intel_display_driver_init_hw (display );
327
+
328
+ intel_hpd_init (xe );
329
+
330
+ if (has_display (xe ))
331
+ intel_hpd_poll_disable (xe );
332
+
333
+ intel_opregion_resume (display );
334
+
335
+ intel_power_domains_enable (display );
336
+ }
337
+
338
+ void xe_display_pm_suspend (struct xe_device * xe )
293
339
{
294
340
struct intel_display * display = & xe -> display ;
295
341
bool s2idle = suspend_to_idle ();
342
+
296
343
if (!xe -> info .probe_display )
297
344
return ;
298
345
@@ -301,36 +348,26 @@ static void __xe_display_pm_suspend(struct xe_device *xe, bool runtime)
301
348
* properly.
302
349
*/
303
350
intel_power_domains_disable (display );
304
- if (!runtime )
305
- intel_fbdev_set_suspend (& xe -> drm , FBINFO_STATE_SUSPENDED , true);
351
+ intel_fbdev_set_suspend (& xe -> drm , FBINFO_STATE_SUSPENDED , true);
306
352
307
- if (! runtime && has_display (xe )) {
353
+ if (has_display (xe )) {
308
354
drm_kms_helper_poll_disable (& xe -> drm );
309
355
intel_display_driver_disable_user_access (display );
310
356
intel_display_driver_suspend (display );
311
357
}
312
358
313
359
xe_display_flush_cleanup_work (xe );
314
360
315
- if (!runtime )
316
- intel_hpd_cancel_work (xe );
361
+ intel_hpd_cancel_work (xe );
317
362
318
- if (! runtime && has_display (xe )) {
363
+ if (has_display (xe )) {
319
364
intel_display_driver_suspend_access (display );
320
365
intel_encoder_suspend_all (& xe -> display );
321
366
}
322
367
323
368
intel_opregion_suspend (display , s2idle ? PCI_D1 : PCI_D3cold );
324
369
325
370
intel_dmc_suspend (display );
326
-
327
- if (runtime && has_display (xe ))
328
- intel_hpd_poll_enable (xe );
329
- }
330
-
331
- void xe_display_pm_suspend (struct xe_device * xe )
332
- {
333
- __xe_display_pm_suspend (xe , false);
334
371
}
335
372
336
373
void xe_display_pm_shutdown (struct xe_device * xe )
@@ -369,7 +406,7 @@ void xe_display_pm_runtime_suspend(struct xe_device *xe)
369
406
return ;
370
407
371
408
if (xe -> d3cold .allowed ) {
372
- __xe_display_pm_suspend (xe , true );
409
+ xe_display_enable_d3cold (xe );
373
410
return ;
374
411
}
375
412
@@ -430,7 +467,7 @@ void xe_display_pm_resume_early(struct xe_device *xe)
430
467
intel_display_power_resume_early (display );
431
468
}
432
469
433
- static void __xe_display_pm_resume (struct xe_device * xe , bool runtime )
470
+ void xe_display_pm_resume (struct xe_device * xe )
434
471
{
435
472
struct intel_display * display = & xe -> display ;
436
473
@@ -444,12 +481,12 @@ static void __xe_display_pm_resume(struct xe_device *xe, bool runtime)
444
481
445
482
intel_display_driver_init_hw (display );
446
483
447
- if (! runtime && has_display (xe ))
484
+ if (has_display (xe ))
448
485
intel_display_driver_resume_access (display );
449
486
450
487
intel_hpd_init (xe );
451
488
452
- if (! runtime && has_display (xe )) {
489
+ if (has_display (xe )) {
453
490
intel_display_driver_resume (display );
454
491
drm_kms_helper_poll_enable (& xe -> drm );
455
492
intel_display_driver_enable_user_access (display );
@@ -460,24 +497,18 @@ static void __xe_display_pm_resume(struct xe_device *xe, bool runtime)
460
497
461
498
intel_opregion_resume (display );
462
499
463
- if (!runtime )
464
- intel_fbdev_set_suspend (& xe -> drm , FBINFO_STATE_RUNNING , false);
500
+ intel_fbdev_set_suspend (& xe -> drm , FBINFO_STATE_RUNNING , false);
465
501
466
502
intel_power_domains_enable (display );
467
503
}
468
504
469
- void xe_display_pm_resume (struct xe_device * xe )
470
- {
471
- __xe_display_pm_resume (xe , false);
472
- }
473
-
474
505
void xe_display_pm_runtime_resume (struct xe_device * xe )
475
506
{
476
507
if (!xe -> info .probe_display )
477
508
return ;
478
509
479
510
if (xe -> d3cold .allowed ) {
480
- __xe_display_pm_resume (xe , true );
511
+ xe_display_disable_d3cold (xe );
481
512
return ;
482
513
}
483
514
0 commit comments