<div dir="ltr">On Mon, Apr 8, 2013 at 10:04 PM, Maarten Lankhorst <span dir="ltr"><<a href="mailto:maarten.lankhorst@canonical.com" target="_blank">maarten.lankhorst@canonical.com</a>></span> wrote:<br><div class="gmail_extra">
<div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Seems to make suspend slightly more reliable on my system.<br></blockquote><div style>NACK.</div>
<div style><br></div><div style>"Seems to", and "slightly" don't make a very good argument for this.  Likely all you've done is change the timing of certain things happening.</div><div style><br>
</div><div style>The PFIFO and engine (PGRAPH etc) modules already take care of idling and unloading active channels.  If something is broken there, that's where it needs fixing, not this hack that "maybe" "possibly" "slightly" works.</div>
<div style><br></div><div style>Ben.</div><div style><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Cc: <a href="mailto:stable@vger.kernel.org">stable@vger.kernel.org</a> [3.7+]<br>
Signed-off-by: Maarten Lankhorst <<a href="mailto:maarten.lankhorst@canonical.com">maarten.lankhorst@canonical.com</a>><br>
---<br>
diff --git a/drivers/gpu/drm/nouveau/nouveau_drm.c b/drivers/gpu/drm/nouveau/nouveau_drm.c<br>
index b6bdc9f..5032c31 100644<br>
--- a/drivers/gpu/drm/nouveau/nouveau_drm.c<br>
+++ b/drivers/gpu/drm/nouveau/nouveau_drm.c<br>
@@ -464,6 +464,23 @@ nouveau_do_suspend(struct drm_device *dev)<br>
        NV_INFO(drm, "evicting buffers...\n");<br>
        ttm_bo_evict_mm(&drm->ttm.bdev, TTM_PL_VRAM);<br>
<br>
+       list_for_each_entry(cli, &drm->clients, head) {<br>
+               struct nouveau_abi16 *abi16 = cli->abi16;<br>
+               struct nouveau_abi16_chan *chan;<br>
+<br>
+               if (!abi16)<br>
+                       continue;<br>
+<br>
+               list_for_each_entry(chan, &abi16->channels, head)<br>
+                       nouveau_channel_idle(chan->chan);<br>
+       }<br>
+<br>
+       if (drm->channel)<br>
+               nouveau_channel_idle(drm->channel);<br>
+<br>
+       if (drm->cechan)<br>
+               nouveau_channel_idle(drm->cechan);<br>
+<br>
        if (drm->fence && nouveau_fence(drm)->suspend) {<br>
                if (!nouveau_fence(drm)->suspend(drm))<br>
                        return -ENOMEM;<br>
<br>
_______________________________________________<br>
dri-devel mailing list<br>
<a href="mailto:dri-devel@lists.freedesktop.org">dri-devel@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/dri-devel" target="_blank">http://lists.freedesktop.org/mailman/listinfo/dri-devel</a><br>
</blockquote></div><br></div></div>