blob: dcc9175fb7945ba970eafa8be6531a6ae5a87f6f [file] [log] [blame]
Ben Skeggs6ee73862009-12-11 19:24:15 +10001/*
2 * Copyright (C) 2007 Ben Skeggs.
3 * All Rights Reserved.
4 *
5 * Permission is hereby granted, free of charge, to any person obtaining
6 * a copy of this software and associated documentation files (the
7 * "Software"), to deal in the Software without restriction, including
8 * without limitation the rights to use, copy, modify, merge, publish,
9 * distribute, sublicense, and/or sell copies of the Software, and to
10 * permit persons to whom the Software is furnished to do so, subject to
11 * the following conditions:
12 *
13 * The above copyright notice and this permission notice (including the
14 * next paragraph) shall be included in all copies or substantial
15 * portions of the Software.
16 *
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
18 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
19 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
20 * IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
21 * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
22 * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
23 * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24 *
25 */
26
27#include "drmP.h"
28#include "drm.h"
29#include "nouveau_drv.h"
Ben Skeggsa8eaebc2010-09-01 15:24:31 +100030#include "nouveau_ramht.h"
Marcin Kościelnickid5f3c902010-02-25 00:54:02 +000031#include "nouveau_grctx.h"
Ben Skeggs6ee73862009-12-11 19:24:15 +100032
Ben Skeggs6ee73862009-12-11 19:24:15 +100033static void
34nv50_graph_init_reset(struct drm_device *dev)
35{
36 uint32_t pmc_e = NV_PMC_ENABLE_PGRAPH | (1 << 21);
37
38 NV_DEBUG(dev, "\n");
39
40 nv_wr32(dev, NV03_PMC_ENABLE, nv_rd32(dev, NV03_PMC_ENABLE) & ~pmc_e);
41 nv_wr32(dev, NV03_PMC_ENABLE, nv_rd32(dev, NV03_PMC_ENABLE) | pmc_e);
42}
43
44static void
45nv50_graph_init_intr(struct drm_device *dev)
46{
47 NV_DEBUG(dev, "\n");
48
49 nv_wr32(dev, NV03_PGRAPH_INTR, 0xffffffff);
50 nv_wr32(dev, 0x400138, 0xffffffff);
51 nv_wr32(dev, NV40_PGRAPH_INTR_EN, 0xffffffff);
52}
53
54static void
55nv50_graph_init_regs__nv(struct drm_device *dev)
56{
Marcin Kościelnicki304424e2010-03-01 00:18:39 +000057 struct drm_nouveau_private *dev_priv = dev->dev_private;
58 uint32_t units = nv_rd32(dev, 0x1540);
59 int i;
60
Ben Skeggs6ee73862009-12-11 19:24:15 +100061 NV_DEBUG(dev, "\n");
62
63 nv_wr32(dev, 0x400804, 0xc0000000);
64 nv_wr32(dev, 0x406800, 0xc0000000);
65 nv_wr32(dev, 0x400c04, 0xc0000000);
Marcin Kościelnicki716abaa2010-01-12 18:21:56 +000066 nv_wr32(dev, 0x401800, 0xc0000000);
Ben Skeggs6ee73862009-12-11 19:24:15 +100067 nv_wr32(dev, 0x405018, 0xc0000000);
68 nv_wr32(dev, 0x402000, 0xc0000000);
69
Marcin Kościelnicki304424e2010-03-01 00:18:39 +000070 for (i = 0; i < 16; i++) {
71 if (units & 1 << i) {
72 if (dev_priv->chipset < 0xa0) {
73 nv_wr32(dev, 0x408900 + (i << 12), 0xc0000000);
74 nv_wr32(dev, 0x408e08 + (i << 12), 0xc0000000);
75 nv_wr32(dev, 0x408314 + (i << 12), 0xc0000000);
76 } else {
77 nv_wr32(dev, 0x408600 + (i << 11), 0xc0000000);
78 nv_wr32(dev, 0x408708 + (i << 11), 0xc0000000);
79 nv_wr32(dev, 0x40831c + (i << 11), 0xc0000000);
80 }
81 }
82 }
83
Ben Skeggs6ee73862009-12-11 19:24:15 +100084 nv_wr32(dev, 0x400108, 0xffffffff);
85
86 nv_wr32(dev, 0x400824, 0x00004000);
87 nv_wr32(dev, 0x400500, 0x00010001);
88}
89
90static void
91nv50_graph_init_regs(struct drm_device *dev)
92{
93 NV_DEBUG(dev, "\n");
94
95 nv_wr32(dev, NV04_PGRAPH_DEBUG_3,
96 (1 << 2) /* HW_CONTEXT_SWITCH_ENABLED */);
97 nv_wr32(dev, 0x402ca8, 0x800);
98}
99
100static int
101nv50_graph_init_ctxctl(struct drm_device *dev)
102{
Ben Skeggs054b93e2009-12-15 22:02:47 +1000103 struct drm_nouveau_private *dev_priv = dev->dev_private;
Ben Skeggsec91db22010-07-08 11:53:19 +1000104 struct nouveau_grctx ctx = {};
105 uint32_t *cp;
106 int i;
Ben Skeggs054b93e2009-12-15 22:02:47 +1000107
Ben Skeggs6ee73862009-12-11 19:24:15 +1000108 NV_DEBUG(dev, "\n");
109
Ben Skeggsec91db22010-07-08 11:53:19 +1000110 cp = kmalloc(512 * 4, GFP_KERNEL);
111 if (!cp) {
112 NV_ERROR(dev, "failed to allocate ctxprog\n");
113 dev_priv->engine.graph.accel_blocked = true;
114 return 0;
Marcin Kościelnickid5f3c902010-02-25 00:54:02 +0000115 }
Marcin Kościelnickid5f3c902010-02-25 00:54:02 +0000116
Ben Skeggsec91db22010-07-08 11:53:19 +1000117 ctx.dev = dev;
118 ctx.mode = NOUVEAU_GRCTX_PROG;
119 ctx.data = cp;
120 ctx.ctxprog_max = 512;
121 if (!nv50_grctx_init(&ctx)) {
122 dev_priv->engine.graph.grctx_size = ctx.ctxvals_pos * 4;
123
124 nv_wr32(dev, NV40_PGRAPH_CTXCTL_UCODE_INDEX, 0);
125 for (i = 0; i < ctx.ctxprog_len; i++)
126 nv_wr32(dev, NV40_PGRAPH_CTXCTL_UCODE_DATA, cp[i]);
127 } else {
128 dev_priv->engine.graph.accel_blocked = true;
Marcin Kościelnickid5f3c902010-02-25 00:54:02 +0000129 }
Ben Skeggsec91db22010-07-08 11:53:19 +1000130 kfree(cp);
Ben Skeggs6ee73862009-12-11 19:24:15 +1000131
132 nv_wr32(dev, 0x400320, 4);
133 nv_wr32(dev, NV40_PGRAPH_CTXCTL_CUR, 0);
134 nv_wr32(dev, NV20_PGRAPH_CHANNEL_CTX_POINTER, 0);
135 return 0;
136}
137
138int
139nv50_graph_init(struct drm_device *dev)
140{
141 int ret;
142
143 NV_DEBUG(dev, "\n");
144
145 nv50_graph_init_reset(dev);
146 nv50_graph_init_regs__nv(dev);
147 nv50_graph_init_regs(dev);
148 nv50_graph_init_intr(dev);
149
150 ret = nv50_graph_init_ctxctl(dev);
151 if (ret)
152 return ret;
153
154 return 0;
155}
156
157void
158nv50_graph_takedown(struct drm_device *dev)
159{
160 NV_DEBUG(dev, "\n");
Ben Skeggs6ee73862009-12-11 19:24:15 +1000161}
162
163void
164nv50_graph_fifo_access(struct drm_device *dev, bool enabled)
165{
166 const uint32_t mask = 0x00010001;
167
168 if (enabled)
169 nv_wr32(dev, 0x400500, nv_rd32(dev, 0x400500) | mask);
170 else
171 nv_wr32(dev, 0x400500, nv_rd32(dev, 0x400500) & ~mask);
172}
173
174struct nouveau_channel *
175nv50_graph_channel(struct drm_device *dev)
176{
177 struct drm_nouveau_private *dev_priv = dev->dev_private;
178 uint32_t inst;
179 int i;
180
Maarten Maathuisa51a3bf2010-02-01 18:32:09 +0100181 /* Be sure we're not in the middle of a context switch or bad things
182 * will happen, such as unloading the wrong pgraph context.
183 */
Francisco Jerez4b5c1522010-09-07 17:34:44 +0200184 if (!nv_wait(dev, 0x400300, 0x00000001, 0x00000000))
Maarten Maathuisa51a3bf2010-02-01 18:32:09 +0100185 NV_ERROR(dev, "Ctxprog is still running\n");
186
Ben Skeggs6ee73862009-12-11 19:24:15 +1000187 inst = nv_rd32(dev, NV50_PGRAPH_CTXCTL_CUR);
188 if (!(inst & NV50_PGRAPH_CTXCTL_CUR_LOADED))
189 return NULL;
190 inst = (inst & NV50_PGRAPH_CTXCTL_CUR_INSTANCE) << 12;
191
192 for (i = 0; i < dev_priv->engine.fifo.channels; i++) {
Ben Skeggscff5c132010-10-06 16:16:59 +1000193 struct nouveau_channel *chan = dev_priv->channels.ptr[i];
Ben Skeggs6ee73862009-12-11 19:24:15 +1000194
Ben Skeggsa8eaebc2010-09-01 15:24:31 +1000195 if (chan && chan->ramin && chan->ramin->vinst == inst)
Ben Skeggs6ee73862009-12-11 19:24:15 +1000196 return chan;
197 }
198
199 return NULL;
200}
201
202int
203nv50_graph_create_context(struct nouveau_channel *chan)
204{
205 struct drm_device *dev = chan->dev;
206 struct drm_nouveau_private *dev_priv = dev->dev_private;
Ben Skeggsa8eaebc2010-09-01 15:24:31 +1000207 struct nouveau_gpuobj *ramin = chan->ramin;
Marcin Kościelnickid5f3c902010-02-25 00:54:02 +0000208 struct nouveau_pgraph_engine *pgraph = &dev_priv->engine.graph;
Ben Skeggsec91db22010-07-08 11:53:19 +1000209 struct nouveau_grctx ctx = {};
Ben Skeggs6ee73862009-12-11 19:24:15 +1000210 int hdr, ret;
211
212 NV_DEBUG(dev, "ch%d\n", chan->id);
213
Ben Skeggsa8eaebc2010-09-01 15:24:31 +1000214 ret = nouveau_gpuobj_new(dev, chan, pgraph->grctx_size, 0x1000,
215 NVOBJ_FLAG_ZERO_ALLOC |
216 NVOBJ_FLAG_ZERO_FREE, &chan->ramin_grctx);
Ben Skeggs6ee73862009-12-11 19:24:15 +1000217 if (ret)
218 return ret;
Ben Skeggs6ee73862009-12-11 19:24:15 +1000219
Ben Skeggsac94a342010-07-08 15:28:48 +1000220 hdr = (dev_priv->chipset == 0x50) ? 0x200 : 0x20;
Ben Skeggsb3beb162010-09-01 15:24:29 +1000221 nv_wo32(ramin, hdr + 0x00, 0x00190002);
Ben Skeggsa8eaebc2010-09-01 15:24:31 +1000222 nv_wo32(ramin, hdr + 0x04, chan->ramin_grctx->vinst +
Ben Skeggsb3beb162010-09-01 15:24:29 +1000223 pgraph->grctx_size - 1);
Ben Skeggsa8eaebc2010-09-01 15:24:31 +1000224 nv_wo32(ramin, hdr + 0x08, chan->ramin_grctx->vinst);
Ben Skeggsb3beb162010-09-01 15:24:29 +1000225 nv_wo32(ramin, hdr + 0x0c, 0);
226 nv_wo32(ramin, hdr + 0x10, 0);
227 nv_wo32(ramin, hdr + 0x14, 0x00010000);
Ben Skeggs6ee73862009-12-11 19:24:15 +1000228
Ben Skeggsec91db22010-07-08 11:53:19 +1000229 ctx.dev = chan->dev;
230 ctx.mode = NOUVEAU_GRCTX_VALS;
Ben Skeggsa8eaebc2010-09-01 15:24:31 +1000231 ctx.data = chan->ramin_grctx;
Ben Skeggsec91db22010-07-08 11:53:19 +1000232 nv50_grctx_init(&ctx);
233
Ben Skeggsa8eaebc2010-09-01 15:24:31 +1000234 nv_wo32(chan->ramin_grctx, 0x00000, chan->ramin->vinst >> 12);
Ben Skeggs6ee73862009-12-11 19:24:15 +1000235
Ben Skeggsf56cb862010-07-08 11:29:10 +1000236 dev_priv->engine.instmem.flush(dev);
Ben Skeggs6ee73862009-12-11 19:24:15 +1000237 return 0;
238}
239
240void
241nv50_graph_destroy_context(struct nouveau_channel *chan)
242{
243 struct drm_device *dev = chan->dev;
244 struct drm_nouveau_private *dev_priv = dev->dev_private;
Francisco Jerez3945e472010-10-18 03:53:39 +0200245 struct nouveau_pgraph_engine *pgraph = &dev_priv->engine.graph;
Ben Skeggsac94a342010-07-08 15:28:48 +1000246 int i, hdr = (dev_priv->chipset == 0x50) ? 0x200 : 0x20;
Francisco Jerez3945e472010-10-18 03:53:39 +0200247 unsigned long flags;
Ben Skeggs6ee73862009-12-11 19:24:15 +1000248
249 NV_DEBUG(dev, "ch%d\n", chan->id);
250
Ben Skeggsa8eaebc2010-09-01 15:24:31 +1000251 if (!chan->ramin)
Ben Skeggs6ee73862009-12-11 19:24:15 +1000252 return;
253
Francisco Jerez3945e472010-10-18 03:53:39 +0200254 spin_lock_irqsave(&dev_priv->context_switch_lock, flags);
255 pgraph->fifo_access(dev, false);
256
257 if (pgraph->channel(dev) == chan)
258 pgraph->unload_context(dev);
259
Ben Skeggs6ee73862009-12-11 19:24:15 +1000260 for (i = hdr; i < hdr + 24; i += 4)
Ben Skeggsa8eaebc2010-09-01 15:24:31 +1000261 nv_wo32(chan->ramin, i, 0);
Ben Skeggsf56cb862010-07-08 11:29:10 +1000262 dev_priv->engine.instmem.flush(dev);
Ben Skeggs6ee73862009-12-11 19:24:15 +1000263
Francisco Jerez3945e472010-10-18 03:53:39 +0200264 pgraph->fifo_access(dev, true);
265 spin_unlock_irqrestore(&dev_priv->context_switch_lock, flags);
266
Ben Skeggsa8eaebc2010-09-01 15:24:31 +1000267 nouveau_gpuobj_ref(NULL, &chan->ramin_grctx);
Ben Skeggs6ee73862009-12-11 19:24:15 +1000268}
269
270static int
271nv50_graph_do_load_context(struct drm_device *dev, uint32_t inst)
272{
273 uint32_t fifo = nv_rd32(dev, 0x400500);
274
275 nv_wr32(dev, 0x400500, fifo & ~1);
276 nv_wr32(dev, 0x400784, inst);
277 nv_wr32(dev, 0x400824, nv_rd32(dev, 0x400824) | 0x40);
278 nv_wr32(dev, 0x400320, nv_rd32(dev, 0x400320) | 0x11);
279 nv_wr32(dev, 0x400040, 0xffffffff);
280 (void)nv_rd32(dev, 0x400040);
281 nv_wr32(dev, 0x400040, 0x00000000);
282 nv_wr32(dev, 0x400304, nv_rd32(dev, 0x400304) | 1);
283
284 if (nouveau_wait_for_idle(dev))
285 nv_wr32(dev, 0x40032c, inst | (1<<31));
286 nv_wr32(dev, 0x400500, fifo);
287
288 return 0;
289}
290
291int
292nv50_graph_load_context(struct nouveau_channel *chan)
293{
Ben Skeggsa8eaebc2010-09-01 15:24:31 +1000294 uint32_t inst = chan->ramin->vinst >> 12;
Ben Skeggs6ee73862009-12-11 19:24:15 +1000295
296 NV_DEBUG(chan->dev, "ch%d\n", chan->id);
297 return nv50_graph_do_load_context(chan->dev, inst);
298}
299
300int
301nv50_graph_unload_context(struct drm_device *dev)
302{
Maarten Maathuisa51a3bf2010-02-01 18:32:09 +0100303 uint32_t inst;
Ben Skeggs6ee73862009-12-11 19:24:15 +1000304
305 inst = nv_rd32(dev, NV50_PGRAPH_CTXCTL_CUR);
306 if (!(inst & NV50_PGRAPH_CTXCTL_CUR_LOADED))
307 return 0;
308 inst &= NV50_PGRAPH_CTXCTL_CUR_INSTANCE;
309
Maarten Maathuis0a90dc512010-01-11 21:18:53 +0100310 nouveau_wait_for_idle(dev);
Ben Skeggs6ee73862009-12-11 19:24:15 +1000311 nv_wr32(dev, 0x400784, inst);
312 nv_wr32(dev, 0x400824, nv_rd32(dev, 0x400824) | 0x20);
313 nv_wr32(dev, 0x400304, nv_rd32(dev, 0x400304) | 0x01);
314 nouveau_wait_for_idle(dev);
Ben Skeggs6ee73862009-12-11 19:24:15 +1000315
316 nv_wr32(dev, NV50_PGRAPH_CTXCTL_CUR, inst);
317 return 0;
318}
319
320void
321nv50_graph_context_switch(struct drm_device *dev)
322{
323 uint32_t inst;
324
325 nv50_graph_unload_context(dev);
326
327 inst = nv_rd32(dev, NV50_PGRAPH_CTXCTL_NEXT);
328 inst &= NV50_PGRAPH_CTXCTL_NEXT_INSTANCE;
329 nv50_graph_do_load_context(dev, inst);
330
331 nv_wr32(dev, NV40_PGRAPH_INTR_EN, nv_rd32(dev,
332 NV40_PGRAPH_INTR_EN) | NV_PGRAPH_INTR_CONTEXT_SWITCH);
333}
334
335static int
336nv50_graph_nvsw_dma_vblsem(struct nouveau_channel *chan, int grclass,
337 int mthd, uint32_t data)
338{
Ben Skeggsa8eaebc2010-09-01 15:24:31 +1000339 struct nouveau_gpuobj *gpuobj;
Ben Skeggs6ee73862009-12-11 19:24:15 +1000340
Ben Skeggsa8eaebc2010-09-01 15:24:31 +1000341 gpuobj = nouveau_ramht_find(chan, data);
342 if (!gpuobj)
Ben Skeggs6ee73862009-12-11 19:24:15 +1000343 return -ENOENT;
344
Ben Skeggsa8eaebc2010-09-01 15:24:31 +1000345 if (nouveau_notifier_offset(gpuobj, NULL))
Ben Skeggs6ee73862009-12-11 19:24:15 +1000346 return -EINVAL;
347
Ben Skeggsa8eaebc2010-09-01 15:24:31 +1000348 chan->nvsw.vblsem = gpuobj;
Ben Skeggs6ee73862009-12-11 19:24:15 +1000349 chan->nvsw.vblsem_offset = ~0;
350 return 0;
351}
352
353static int
354nv50_graph_nvsw_vblsem_offset(struct nouveau_channel *chan, int grclass,
355 int mthd, uint32_t data)
356{
357 if (nouveau_notifier_offset(chan->nvsw.vblsem, &data))
358 return -ERANGE;
359
360 chan->nvsw.vblsem_offset = data >> 2;
361 return 0;
362}
363
364static int
365nv50_graph_nvsw_vblsem_release_val(struct nouveau_channel *chan, int grclass,
366 int mthd, uint32_t data)
367{
368 chan->nvsw.vblsem_rval = data;
369 return 0;
370}
371
372static int
373nv50_graph_nvsw_vblsem_release(struct nouveau_channel *chan, int grclass,
374 int mthd, uint32_t data)
375{
376 struct drm_device *dev = chan->dev;
377 struct drm_nouveau_private *dev_priv = dev->dev_private;
378
379 if (!chan->nvsw.vblsem || chan->nvsw.vblsem_offset == ~0 || data > 1)
380 return -EINVAL;
381
382 if (!(nv_rd32(dev, NV50_PDISPLAY_INTR_EN) &
383 NV50_PDISPLAY_INTR_EN_VBLANK_CRTC_(data))) {
384 nv_wr32(dev, NV50_PDISPLAY_INTR_1,
385 NV50_PDISPLAY_INTR_1_VBLANK_CRTC_(data));
386 nv_wr32(dev, NV50_PDISPLAY_INTR_EN, nv_rd32(dev,
387 NV50_PDISPLAY_INTR_EN) |
388 NV50_PDISPLAY_INTR_EN_VBLANK_CRTC_(data));
389 }
390
391 list_add(&chan->nvsw.vbl_wait, &dev_priv->vbl_waiting);
392 return 0;
393}
394
395static struct nouveau_pgraph_object_method nv50_graph_nvsw_methods[] = {
396 { 0x018c, nv50_graph_nvsw_dma_vblsem },
397 { 0x0400, nv50_graph_nvsw_vblsem_offset },
398 { 0x0404, nv50_graph_nvsw_vblsem_release_val },
399 { 0x0408, nv50_graph_nvsw_vblsem_release },
400 {}
401};
402
403struct nouveau_pgraph_object_class nv50_graph_grclass[] = {
404 { 0x506e, true, nv50_graph_nvsw_methods }, /* nvsw */
405 { 0x0030, false, NULL }, /* null */
406 { 0x5039, false, NULL }, /* m2mf */
407 { 0x502d, false, NULL }, /* 2d */
408 { 0x50c0, false, NULL }, /* compute */
Marcin Kościelnickid327dd42010-03-24 13:43:16 +0000409 { 0x85c0, false, NULL }, /* compute (nva3, nva5, nva8) */
Ben Skeggs6ee73862009-12-11 19:24:15 +1000410 { 0x5097, false, NULL }, /* tesla (nv50) */
Marcin Kościelnickid327dd42010-03-24 13:43:16 +0000411 { 0x8297, false, NULL }, /* tesla (nv8x/nv9x) */
412 { 0x8397, false, NULL }, /* tesla (nva0, nvaa, nvac) */
413 { 0x8597, false, NULL }, /* tesla (nva3, nva5, nva8) */
Ben Skeggs6ee73862009-12-11 19:24:15 +1000414 {}
415};
Ben Skeggs56ac7472010-10-22 10:26:24 +1000416
417void
418nv50_graph_tlb_flush(struct drm_device *dev)
419{
420 nv50_vm_flush(dev, 0);
421}
422
423void
424nv86_graph_tlb_flush(struct drm_device *dev)
425{
426 struct drm_nouveau_private *dev_priv = dev->dev_private;
427 struct nouveau_timer_engine *ptimer = &dev_priv->engine.timer;
428 bool idle, timeout = false;
429 unsigned long flags;
430 u64 start;
431 u32 tmp;
432
433 spin_lock_irqsave(&dev_priv->context_switch_lock, flags);
434 nv_mask(dev, 0x400500, 0x00000001, 0x00000000);
435
436 start = ptimer->read(dev);
437 do {
438 idle = true;
439
440 for (tmp = nv_rd32(dev, 0x400380); tmp && idle; tmp >>= 3) {
441 if ((tmp & 7) == 1)
442 idle = false;
443 }
444
445 for (tmp = nv_rd32(dev, 0x400384); tmp && idle; tmp >>= 3) {
446 if ((tmp & 7) == 1)
447 idle = false;
448 }
449
450 for (tmp = nv_rd32(dev, 0x400388); tmp && idle; tmp >>= 3) {
451 if ((tmp & 7) == 1)
452 idle = false;
453 }
454 } while (!idle && !(timeout = ptimer->read(dev) - start > 2000000000));
455
456 if (timeout) {
457 NV_ERROR(dev, "PGRAPH TLB flush idle timeout fail: "
458 "0x%08x 0x%08x 0x%08x 0x%08x\n",
459 nv_rd32(dev, 0x400700), nv_rd32(dev, 0x400380),
460 nv_rd32(dev, 0x400384), nv_rd32(dev, 0x400388));
461 }
462
463 nv50_vm_flush(dev, 0);
464
465 nv_mask(dev, 0x400500, 0x00000001, 0x00000001);
466 spin_unlock_irqrestore(&dev_priv->context_switch_lock, flags);
467}