diff options
Diffstat (limited to 'drivers/gpu/drm/nouveau/nouveau_drm.c')
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_drm.c | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_drm.c b/drivers/gpu/drm/nouveau/nouveau_drm.c index 46c152ff0a80..383f4e6ea9d1 100644 --- a/drivers/gpu/drm/nouveau/nouveau_drm.c +++ b/drivers/gpu/drm/nouveau/nouveau_drm.c | |||
@@ -453,18 +453,32 @@ nouveau_do_suspend(struct drm_device *dev) | |||
453 | NV_INFO(drm, "evicting buffers...\n"); | 453 | NV_INFO(drm, "evicting buffers...\n"); |
454 | ttm_bo_evict_mm(&drm->ttm.bdev, TTM_PL_VRAM); | 454 | ttm_bo_evict_mm(&drm->ttm.bdev, TTM_PL_VRAM); |
455 | 455 | ||
456 | NV_INFO(drm, "waiting for kernel channels to go idle...\n"); | ||
457 | if (drm->cechan) { | ||
458 | ret = nouveau_channel_idle(drm->cechan); | ||
459 | if (ret) | ||
460 | return ret; | ||
461 | } | ||
462 | |||
463 | if (drm->channel) { | ||
464 | ret = nouveau_channel_idle(drm->channel); | ||
465 | if (ret) | ||
466 | return ret; | ||
467 | } | ||
468 | |||
469 | NV_INFO(drm, "suspending client object trees...\n"); | ||
456 | if (drm->fence && nouveau_fence(drm)->suspend) { | 470 | if (drm->fence && nouveau_fence(drm)->suspend) { |
457 | if (!nouveau_fence(drm)->suspend(drm)) | 471 | if (!nouveau_fence(drm)->suspend(drm)) |
458 | return -ENOMEM; | 472 | return -ENOMEM; |
459 | } | 473 | } |
460 | 474 | ||
461 | NV_INFO(drm, "suspending client object trees...\n"); | ||
462 | list_for_each_entry(cli, &drm->clients, head) { | 475 | list_for_each_entry(cli, &drm->clients, head) { |
463 | ret = nouveau_client_fini(&cli->base, true); | 476 | ret = nouveau_client_fini(&cli->base, true); |
464 | if (ret) | 477 | if (ret) |
465 | goto fail_client; | 478 | goto fail_client; |
466 | } | 479 | } |
467 | 480 | ||
481 | NV_INFO(drm, "suspending kernel object tree...\n"); | ||
468 | ret = nouveau_client_fini(&drm->client.base, true); | 482 | ret = nouveau_client_fini(&drm->client.base, true); |
469 | if (ret) | 483 | if (ret) |
470 | goto fail_client; | 484 | goto fail_client; |
@@ -514,17 +528,18 @@ nouveau_do_resume(struct drm_device *dev) | |||
514 | 528 | ||
515 | nouveau_agp_reset(drm); | 529 | nouveau_agp_reset(drm); |
516 | 530 | ||
517 | NV_INFO(drm, "resuming client object trees...\n"); | 531 | NV_INFO(drm, "resuming kernel object tree...\n"); |
518 | nouveau_client_init(&drm->client.base); | 532 | nouveau_client_init(&drm->client.base); |
519 | nouveau_agp_init(drm); | 533 | nouveau_agp_init(drm); |
520 | 534 | ||
535 | NV_INFO(drm, "resuming client object trees...\n"); | ||
536 | if (drm->fence && nouveau_fence(drm)->resume) | ||
537 | nouveau_fence(drm)->resume(drm); | ||
538 | |||
521 | list_for_each_entry(cli, &drm->clients, head) { | 539 | list_for_each_entry(cli, &drm->clients, head) { |
522 | nouveau_client_init(&cli->base); | 540 | nouveau_client_init(&cli->base); |
523 | } | 541 | } |
524 | 542 | ||
525 | if (drm->fence && nouveau_fence(drm)->resume) | ||
526 | nouveau_fence(drm)->resume(drm); | ||
527 | |||
528 | nouveau_run_vbios_init(dev); | 543 | nouveau_run_vbios_init(dev); |
529 | nouveau_pm_resume(dev); | 544 | nouveau_pm_resume(dev); |
530 | 545 | ||