File tree Expand file tree Collapse file tree 2 files changed +29
-5
lines changed Expand file tree Collapse file tree 2 files changed +29
-5
lines changed Original file line number Diff line number Diff line change @@ -283,6 +283,27 @@ static bool suspend_to_idle(void)
283
283
return false;
284
284
}
285
285
286
+ static void xe_display_flush_cleanup_work (struct xe_device * xe )
287
+ {
288
+ struct intel_crtc * crtc ;
289
+
290
+ for_each_intel_crtc (& xe -> drm , crtc ) {
291
+ struct drm_crtc_commit * commit ;
292
+
293
+ spin_lock (& crtc -> base .commit_lock );
294
+ commit = list_first_entry_or_null (& crtc -> base .commit_list ,
295
+ struct drm_crtc_commit , commit_entry );
296
+ if (commit )
297
+ drm_crtc_commit_get (commit );
298
+ spin_unlock (& crtc -> base .commit_lock );
299
+
300
+ if (commit ) {
301
+ wait_for_completion (& commit -> cleanup_done );
302
+ drm_crtc_commit_put (commit );
303
+ }
304
+ }
305
+ }
306
+
286
307
void xe_display_pm_suspend (struct xe_device * xe , bool runtime )
287
308
{
288
309
bool s2idle = suspend_to_idle ();
@@ -300,6 +321,8 @@ void xe_display_pm_suspend(struct xe_device *xe, bool runtime)
300
321
if (!runtime )
301
322
intel_display_driver_suspend (xe );
302
323
324
+ xe_display_flush_cleanup_work (xe );
325
+
303
326
intel_dp_mst_suspend (xe );
304
327
305
328
intel_hpd_cancel_work (xe );
Original file line number Diff line number Diff line change @@ -91,13 +91,13 @@ int xe_pm_suspend(struct xe_device *xe)
91
91
for_each_gt (gt , xe , id )
92
92
xe_gt_suspend_prepare (gt );
93
93
94
+ xe_display_pm_suspend (xe , false);
95
+
94
96
/* FIXME: Super racey... */
95
97
err = xe_bo_evict_all (xe );
96
98
if (err )
97
99
goto err ;
98
100
99
- xe_display_pm_suspend (xe , false);
100
-
101
101
for_each_gt (gt , xe , id ) {
102
102
err = xe_gt_suspend (gt );
103
103
if (err ) {
@@ -151,11 +151,11 @@ int xe_pm_resume(struct xe_device *xe)
151
151
152
152
xe_irq_resume (xe );
153
153
154
- xe_display_pm_resume (xe , false);
155
-
156
154
for_each_gt (gt , xe , id )
157
155
xe_gt_resume (gt );
158
156
157
+ xe_display_pm_resume (xe , false);
158
+
159
159
err = xe_bo_restore_user (xe );
160
160
if (err )
161
161
goto err ;
@@ -363,10 +363,11 @@ int xe_pm_runtime_suspend(struct xe_device *xe)
363
363
mutex_unlock (& xe -> mem_access .vram_userfault .lock );
364
364
365
365
if (xe -> d3cold .allowed ) {
366
+ xe_display_pm_suspend (xe , true);
367
+
366
368
err = xe_bo_evict_all (xe );
367
369
if (err )
368
370
goto out ;
369
- xe_display_pm_suspend (xe , true);
370
371
}
371
372
372
373
for_each_gt (gt , xe , id ) {
You can’t perform that action at this time.
0 commit comments