Skip to content

Commit 25f2ff5

Browse files
mlankhorstlucasdemarchi
authored andcommitted
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 <[email protected]> Reviewed-by: Lucas De Marchi <[email protected]> Reviewed-by: Vinod Govindapillai <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] (cherry picked from commit f90491d) Signed-off-by: Lucas De Marchi <[email protected]>
1 parent 8198375 commit 25f2ff5

File tree

3 files changed

+39
-28
lines changed

3 files changed

+39
-28
lines changed

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

Lines changed: 32 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -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();
@@ -355,26 +344,31 @@ void xe_display_pm_suspend(struct xe_device *xe, bool runtime)
355344
intel_dmc_suspend(xe);
356345
}
357346

358-
void xe_display_pm_suspend_late(struct xe_device *xe)
347+
void xe_display_pm_suspend(struct xe_device *xe)
348+
{
349+
__xe_display_pm_suspend(xe, false);
350+
}
351+
352+
void xe_display_pm_runtime_suspend(struct xe_device *xe)
359353
{
360-
bool s2idle = suspend_to_idle();
361354
if (!xe->info.probe_display)
362355
return;
363356

364-
intel_power_domains_suspend(xe, s2idle);
357+
if (xe->d3cold.allowed)
358+
__xe_display_pm_suspend(xe, true);
365359

366-
intel_display_power_suspend_late(xe);
360+
intel_hpd_poll_enable(xe);
367361
}
368362

369-
void xe_display_pm_runtime_resume(struct xe_device *xe)
363+
void xe_display_pm_suspend_late(struct xe_device *xe)
370364
{
365+
bool s2idle = suspend_to_idle();
371366
if (!xe->info.probe_display)
372367
return;
373368

374-
intel_hpd_poll_disable(xe);
369+
intel_power_domains_suspend(xe, s2idle);
375370

376-
if (xe->d3cold.allowed)
377-
xe_display_pm_resume(xe, true);
371+
intel_display_power_suspend_late(xe);
378372
}
379373

380374
void xe_display_pm_resume_early(struct xe_device *xe)
@@ -387,7 +381,7 @@ void xe_display_pm_resume_early(struct xe_device *xe)
387381
intel_power_domains_resume(xe);
388382
}
389383

390-
void xe_display_pm_resume(struct xe_device *xe, bool runtime)
384+
static void __xe_display_pm_resume(struct xe_device *xe, bool runtime)
391385
{
392386
struct intel_display *display = &xe->display;
393387

@@ -421,6 +415,23 @@ void xe_display_pm_resume(struct xe_device *xe, bool runtime)
421415
intel_power_domains_enable(xe);
422416
}
423417

418+
void xe_display_pm_resume(struct xe_device *xe)
419+
{
420+
__xe_display_pm_resume(xe, false);
421+
}
422+
423+
void xe_display_pm_runtime_resume(struct xe_device *xe)
424+
{
425+
if (!xe->info.probe_display)
426+
return;
427+
428+
intel_hpd_poll_disable(xe);
429+
430+
if (xe->d3cold.allowed)
431+
__xe_display_pm_resume(xe, true);
432+
}
433+
434+
424435
static void display_device_remove(struct drm_device *dev, void *arg)
425436
{
426437
struct xe_device *xe = arg;

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@ void xe_display_irq_enable(struct xe_device *xe, u32 gu_misc_iir);
3434
void xe_display_irq_reset(struct xe_device *xe);
3535
void xe_display_irq_postinstall(struct xe_device *xe, struct xe_gt *gt);
3636

37-
void xe_display_pm_suspend(struct xe_device *xe, bool runtime);
37+
void xe_display_pm_suspend(struct xe_device *xe);
3838
void xe_display_pm_suspend_late(struct xe_device *xe);
3939
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);
4141
void xe_display_pm_runtime_suspend(struct xe_device *xe);
4242
void xe_display_pm_runtime_resume(struct xe_device *xe);
4343

@@ -65,10 +65,10 @@ static inline void xe_display_irq_enable(struct xe_device *xe, u32 gu_misc_iir)
6565
static inline void xe_display_irq_reset(struct xe_device *xe) {}
6666
static inline void xe_display_irq_postinstall(struct xe_device *xe, struct xe_gt *gt) {}
6767

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) {}
6969
static inline void xe_display_pm_suspend_late(struct xe_device *xe) {}
7070
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) {}
7272
static inline void xe_display_pm_runtime_suspend(struct xe_device *xe) {}
7373
static inline void xe_display_pm_runtime_resume(struct xe_device *xe) {}
7474

drivers/gpu/drm/xe/xe_pm.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ int xe_pm_suspend(struct xe_device *xe)
123123
for_each_gt(gt, xe, id)
124124
xe_gt_suspend_prepare(gt);
125125

126-
xe_display_pm_suspend(xe, false);
126+
xe_display_pm_suspend(xe);
127127

128128
/* FIXME: Super racey... */
129129
err = xe_bo_evict_all(xe);
@@ -133,7 +133,7 @@ int xe_pm_suspend(struct xe_device *xe)
133133
for_each_gt(gt, xe, id) {
134134
err = xe_gt_suspend(gt);
135135
if (err) {
136-
xe_display_pm_resume(xe, false);
136+
xe_display_pm_resume(xe);
137137
goto err;
138138
}
139139
}
@@ -187,7 +187,7 @@ int xe_pm_resume(struct xe_device *xe)
187187
for_each_gt(gt, xe, id)
188188
xe_gt_resume(gt);
189189

190-
xe_display_pm_resume(xe, false);
190+
xe_display_pm_resume(xe);
191191

192192
err = xe_bo_restore_user(xe);
193193
if (err)

0 commit comments

Comments
 (0)