Commit f3980dc5 authored by Ilia Mirkin's avatar Ilia Mirkin Committed by Ben Skeggs

drm/nouveau: resume display if any later suspend bits fail

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=70213Signed-off-by: default avatarIlia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
parent 09c3de13
...@@ -503,19 +503,21 @@ nouveau_do_suspend(struct drm_device *dev) ...@@ -503,19 +503,21 @@ nouveau_do_suspend(struct drm_device *dev)
if (drm->cechan) { if (drm->cechan) {
ret = nouveau_channel_idle(drm->cechan); ret = nouveau_channel_idle(drm->cechan);
if (ret) if (ret)
return ret; goto fail_display;
} }
if (drm->channel) { if (drm->channel) {
ret = nouveau_channel_idle(drm->channel); ret = nouveau_channel_idle(drm->channel);
if (ret) if (ret)
return ret; goto fail_display;
} }
NV_INFO(drm, "suspending client object trees...\n"); NV_INFO(drm, "suspending client object trees...\n");
if (drm->fence && nouveau_fence(drm)->suspend) { if (drm->fence && nouveau_fence(drm)->suspend) {
if (!nouveau_fence(drm)->suspend(drm)) if (!nouveau_fence(drm)->suspend(drm)) {
return -ENOMEM; ret = -ENOMEM;
goto fail_display;
}
} }
list_for_each_entry(cli, &drm->clients, head) { list_for_each_entry(cli, &drm->clients, head) {
...@@ -537,6 +539,10 @@ nouveau_do_suspend(struct drm_device *dev) ...@@ -537,6 +539,10 @@ nouveau_do_suspend(struct drm_device *dev)
nouveau_client_init(&cli->base); 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) { if (dev->mode_config.num_crtc) {
NV_INFO(drm, "resuming display...\n"); NV_INFO(drm, "resuming display...\n");
nouveau_display_resume(dev); nouveau_display_resume(dev);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment