Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/xe: Remove runtime argument from display s/r functions

The previous change ensures that pm_suspend is only called when
suspending or resuming. This ensures no further bugs like those
in the previous commit.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Reviewed-by: Lucas De Marchi <lucas.demarchi@intel.com>
Reviewed-by: Vinod Govindapillai <vinod.govindapillai@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240905150052.174895-3-maarten.lankhorst@linux.intel.com
(cherry picked from commit f90491d4b64e302e940133103d3d9908e70e454f)
Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>

authored by

Maarten Lankhorst and committed by
Lucas De Marchi
25f2ff53 81983758

+42 -31
+35 -24
drivers/gpu/drm/xe/display/xe_display.c
··· 309 309 } 310 310 311 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 - 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) 324 313 { 325 314 struct intel_display *display = &xe->display; 326 315 bool s2idle = suspend_to_idle(); ··· 344 355 intel_dmc_suspend(xe); 345 356 } 346 357 358 + void xe_display_pm_suspend(struct xe_device *xe) 359 + { 360 + __xe_display_pm_suspend(xe, false); 361 + } 362 + 363 + void xe_display_pm_runtime_suspend(struct xe_device *xe) 364 + { 365 + if (!xe->info.probe_display) 366 + return; 367 + 368 + if (xe->d3cold.allowed) 369 + __xe_display_pm_suspend(xe, true); 370 + 371 + intel_hpd_poll_enable(xe); 372 + } 373 + 347 374 void xe_display_pm_suspend_late(struct xe_device *xe) 348 375 { 349 376 bool s2idle = suspend_to_idle(); ··· 369 364 intel_power_domains_suspend(xe, s2idle); 370 365 371 366 intel_display_power_suspend_late(xe); 372 - } 373 - 374 - void xe_display_pm_runtime_resume(struct xe_device *xe) 375 - { 376 - if (!xe->info.probe_display) 377 - return; 378 - 379 - intel_hpd_poll_disable(xe); 380 - 381 - if (xe->d3cold.allowed) 382 - xe_display_pm_resume(xe, true); 383 367 } 384 368 385 369 void xe_display_pm_resume_early(struct xe_device *xe) ··· 381 387 intel_power_domains_resume(xe); 382 388 } 383 389 384 - void xe_display_pm_resume(struct xe_device *xe, bool runtime) 390 + static void __xe_display_pm_resume(struct xe_device *xe, bool runtime) 385 391 { 386 392 struct intel_display *display = &xe->display; 387 393 ··· 414 420 415 421 intel_power_domains_enable(xe); 416 422 } 423 + 424 + void xe_display_pm_resume(struct xe_device *xe) 425 + { 426 + __xe_display_pm_resume(xe, false); 427 + } 428 + 429 + void xe_display_pm_runtime_resume(struct xe_device *xe) 430 + { 431 + if (!xe->info.probe_display) 432 + return; 433 + 434 + intel_hpd_poll_disable(xe); 435 + 436 + if (xe->d3cold.allowed) 437 + __xe_display_pm_resume(xe, true); 438 + } 439 + 417 440 418 441 static void display_device_remove(struct drm_device *dev, void *arg) 419 442 {
+4 -4
drivers/gpu/drm/xe/display/xe_display.h
··· 34 34 void xe_display_irq_reset(struct xe_device *xe); 35 35 void xe_display_irq_postinstall(struct xe_device *xe, struct xe_gt *gt); 36 36 37 - void xe_display_pm_suspend(struct xe_device *xe, bool runtime); 37 + void xe_display_pm_suspend(struct xe_device *xe); 38 38 void xe_display_pm_suspend_late(struct xe_device *xe); 39 39 void xe_display_pm_resume_early(struct xe_device *xe); 40 - void xe_display_pm_resume(struct xe_device *xe, bool runtime); 40 + void xe_display_pm_resume(struct xe_device *xe); 41 41 void xe_display_pm_runtime_suspend(struct xe_device *xe); 42 42 void xe_display_pm_runtime_resume(struct xe_device *xe); 43 43 ··· 65 65 static inline void xe_display_irq_reset(struct xe_device *xe) {} 66 66 static inline void xe_display_irq_postinstall(struct xe_device *xe, struct xe_gt *gt) {} 67 67 68 - static inline void xe_display_pm_suspend(struct xe_device *xe, bool runtime) {} 68 + static inline void xe_display_pm_suspend(struct xe_device *xe) {} 69 69 static inline void xe_display_pm_suspend_late(struct xe_device *xe) {} 70 70 static inline void xe_display_pm_resume_early(struct xe_device *xe) {} 71 - static inline void xe_display_pm_resume(struct xe_device *xe, bool runtime) {} 71 + static inline void xe_display_pm_resume(struct xe_device *xe) {} 72 72 static inline void xe_display_pm_runtime_suspend(struct xe_device *xe) {} 73 73 static inline void xe_display_pm_runtime_resume(struct xe_device *xe) {} 74 74
+3 -3
drivers/gpu/drm/xe/xe_pm.c
··· 123 123 for_each_gt(gt, xe, id) 124 124 xe_gt_suspend_prepare(gt); 125 125 126 - xe_display_pm_suspend(xe, false); 126 + xe_display_pm_suspend(xe); 127 127 128 128 /* FIXME: Super racey... */ 129 129 err = xe_bo_evict_all(xe); ··· 133 133 for_each_gt(gt, xe, id) { 134 134 err = xe_gt_suspend(gt); 135 135 if (err) { 136 - xe_display_pm_resume(xe, false); 136 + xe_display_pm_resume(xe); 137 137 goto err; 138 138 } 139 139 } ··· 187 187 for_each_gt(gt, xe, id) 188 188 xe_gt_resume(gt); 189 189 190 - xe_display_pm_resume(xe, false); 190 + xe_display_pm_resume(xe); 191 191 192 192 err = xe_bo_restore_user(xe); 193 193 if (err)