Skip to content

Commit

Permalink
drm/nouveau: resume display if any later suspend bits fail
Browse files Browse the repository at this point in the history
If either idling channels or suspending the fence were to fail, the
display would never be resumed. Also if a client fails, resume the fence
(not functionally important, but it would potentially leak memory).

See https://bugs.freedesktop.org/show_bug.cgi?id=70213

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
  • Loading branch information
Ilia Mirkin authored and Ben Skeggs committed Jan 29, 2014
1 parent 09c3de1 commit f3980dc
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions drivers/gpu/drm/nouveau/nouveau_drm.c
Original file line number Diff line number Diff line change
Expand Up @@ -503,19 +503,21 @@ nouveau_do_suspend(struct drm_device *dev)
if (drm->cechan) {
ret = nouveau_channel_idle(drm->cechan);
if (ret)
return ret;
goto fail_display;
}

if (drm->channel) {
ret = nouveau_channel_idle(drm->channel);
if (ret)
return ret;
goto fail_display;
}

NV_INFO(drm, "suspending client object trees...\n");
if (drm->fence && nouveau_fence(drm)->suspend) {
if (!nouveau_fence(drm)->suspend(drm))
return -ENOMEM;
if (!nouveau_fence(drm)->suspend(drm)) {
ret = -ENOMEM;
goto fail_display;
}
}

list_for_each_entry(cli, &drm->clients, head) {
Expand All @@ -537,6 +539,10 @@ nouveau_do_suspend(struct drm_device *dev)
nouveau_client_init(&cli->base);
}

if (drm->fence && nouveau_fence(drm)->resume)
nouveau_fence(drm)->resume(drm);

fail_display:
if (dev->mode_config.num_crtc) {
NV_INFO(drm, "resuming display...\n");
nouveau_display_resume(dev);
Expand Down

0 comments on commit f3980dc

Please sign in to comment.