From: Maarten Maathuis Date: Mon, 11 Jan 2010 20:18:53 +0000 (+0100) Subject: drm/nv50: wait for pgraph to idle before unloading the context X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=0a90dc51aa3162abb7cd64323ba2e6674e1c5ff4;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git drm/nv50: wait for pgraph to idle before unloading the context This should fix the problem with gpu hangs people have had when closing channels. Signed-off-by: Maarten Maathuis Signed-off-by: Ben Skeggs --- diff --git a/drivers/gpu/drm/nouveau/nv50_graph.c b/drivers/gpu/drm/nouveau/nv50_graph.c index ca79f32be44c..56a9753db23c 100644 --- a/drivers/gpu/drm/nouveau/nv50_graph.c +++ b/drivers/gpu/drm/nouveau/nv50_graph.c @@ -282,6 +282,7 @@ nv50_graph_unload_context(struct drm_device *dev) return 0; inst &= NV50_PGRAPH_CTXCTL_CUR_INSTANCE; + nouveau_wait_for_idle(dev); nv_wr32(dev, 0x400500, fifo & ~1); nv_wr32(dev, 0x400784, inst); nv_wr32(dev, 0x400824, nv_rd32(dev, 0x400824) | 0x20);