nv40_graph.c 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520
  1. /*
  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. #include "drmP.h"
  27. #include "drm.h"
  28. #include "nouveau_drv.h"
  29. #include "nouveau_grctx.h"
  30. static int nv40_graph_register(struct drm_device *);
  31. static void nv40_graph_isr(struct drm_device *);
  32. struct nouveau_channel *
  33. nv40_graph_channel(struct drm_device *dev)
  34. {
  35. struct drm_nouveau_private *dev_priv = dev->dev_private;
  36. uint32_t inst;
  37. int i;
  38. inst = nv_rd32(dev, NV40_PGRAPH_CTXCTL_CUR);
  39. if (!(inst & NV40_PGRAPH_CTXCTL_CUR_LOADED))
  40. return NULL;
  41. inst = (inst & NV40_PGRAPH_CTXCTL_CUR_INSTANCE) << 4;
  42. for (i = 0; i < dev_priv->engine.fifo.channels; i++) {
  43. struct nouveau_channel *chan = dev_priv->channels.ptr[i];
  44. if (chan && chan->ramin_grctx &&
  45. chan->ramin_grctx->pinst == inst)
  46. return chan;
  47. }
  48. return NULL;
  49. }
  50. int
  51. nv40_graph_create_context(struct nouveau_channel *chan)
  52. {
  53. struct drm_device *dev = chan->dev;
  54. struct drm_nouveau_private *dev_priv = dev->dev_private;
  55. struct nouveau_pgraph_engine *pgraph = &dev_priv->engine.graph;
  56. struct nouveau_grctx ctx = {};
  57. int ret;
  58. ret = nouveau_gpuobj_new(dev, chan, pgraph->grctx_size, 16,
  59. NVOBJ_FLAG_ZERO_ALLOC, &chan->ramin_grctx);
  60. if (ret)
  61. return ret;
  62. /* Initialise default context values */
  63. ctx.dev = chan->dev;
  64. ctx.mode = NOUVEAU_GRCTX_VALS;
  65. ctx.data = chan->ramin_grctx;
  66. nv40_grctx_init(&ctx);
  67. nv_wo32(chan->ramin_grctx, 0, chan->ramin_grctx->pinst);
  68. return 0;
  69. }
  70. void
  71. nv40_graph_destroy_context(struct nouveau_channel *chan)
  72. {
  73. struct drm_device *dev = chan->dev;
  74. struct drm_nouveau_private *dev_priv = dev->dev_private;
  75. struct nouveau_pgraph_engine *pgraph = &dev_priv->engine.graph;
  76. unsigned long flags;
  77. spin_lock_irqsave(&dev_priv->context_switch_lock, flags);
  78. pgraph->fifo_access(dev, false);
  79. /* Unload the context if it's the currently active one */
  80. if (pgraph->channel(dev) == chan)
  81. pgraph->unload_context(dev);
  82. pgraph->fifo_access(dev, true);
  83. spin_unlock_irqrestore(&dev_priv->context_switch_lock, flags);
  84. /* Free the context resources */
  85. nouveau_gpuobj_ref(NULL, &chan->ramin_grctx);
  86. }
  87. static int
  88. nv40_graph_transfer_context(struct drm_device *dev, uint32_t inst, int save)
  89. {
  90. uint32_t old_cp, tv = 1000, tmp;
  91. int i;
  92. old_cp = nv_rd32(dev, NV20_PGRAPH_CHANNEL_CTX_POINTER);
  93. nv_wr32(dev, NV20_PGRAPH_CHANNEL_CTX_POINTER, inst);
  94. tmp = nv_rd32(dev, NV40_PGRAPH_CTXCTL_0310);
  95. tmp |= save ? NV40_PGRAPH_CTXCTL_0310_XFER_SAVE :
  96. NV40_PGRAPH_CTXCTL_0310_XFER_LOAD;
  97. nv_wr32(dev, NV40_PGRAPH_CTXCTL_0310, tmp);
  98. tmp = nv_rd32(dev, NV40_PGRAPH_CTXCTL_0304);
  99. tmp |= NV40_PGRAPH_CTXCTL_0304_XFER_CTX;
  100. nv_wr32(dev, NV40_PGRAPH_CTXCTL_0304, tmp);
  101. nouveau_wait_for_idle(dev);
  102. for (i = 0; i < tv; i++) {
  103. if (nv_rd32(dev, NV40_PGRAPH_CTXCTL_030C) == 0)
  104. break;
  105. }
  106. nv_wr32(dev, NV20_PGRAPH_CHANNEL_CTX_POINTER, old_cp);
  107. if (i == tv) {
  108. uint32_t ucstat = nv_rd32(dev, NV40_PGRAPH_CTXCTL_UCODE_STAT);
  109. NV_ERROR(dev, "Failed: Instance=0x%08x Save=%d\n", inst, save);
  110. NV_ERROR(dev, "IP: 0x%02x, Opcode: 0x%08x\n",
  111. ucstat >> NV40_PGRAPH_CTXCTL_UCODE_STAT_IP_SHIFT,
  112. ucstat & NV40_PGRAPH_CTXCTL_UCODE_STAT_OP_MASK);
  113. NV_ERROR(dev, "0x40030C = 0x%08x\n",
  114. nv_rd32(dev, NV40_PGRAPH_CTXCTL_030C));
  115. return -EBUSY;
  116. }
  117. return 0;
  118. }
  119. /* Restore the context for a specific channel into PGRAPH */
  120. int
  121. nv40_graph_load_context(struct nouveau_channel *chan)
  122. {
  123. struct drm_device *dev = chan->dev;
  124. uint32_t inst;
  125. int ret;
  126. if (!chan->ramin_grctx)
  127. return -EINVAL;
  128. inst = chan->ramin_grctx->pinst >> 4;
  129. ret = nv40_graph_transfer_context(dev, inst, 0);
  130. if (ret)
  131. return ret;
  132. /* 0x40032C, no idea of it's exact function. Could simply be a
  133. * record of the currently active PGRAPH context. It's currently
  134. * unknown as to what bit 24 does. The nv ddx has it set, so we will
  135. * set it here too.
  136. */
  137. nv_wr32(dev, NV20_PGRAPH_CHANNEL_CTX_POINTER, inst);
  138. nv_wr32(dev, NV40_PGRAPH_CTXCTL_CUR,
  139. (inst & NV40_PGRAPH_CTXCTL_CUR_INSTANCE) |
  140. NV40_PGRAPH_CTXCTL_CUR_LOADED);
  141. /* 0x32E0 records the instance address of the active FIFO's PGRAPH
  142. * context. If at any time this doesn't match 0x40032C, you will
  143. * recieve PGRAPH_INTR_CONTEXT_SWITCH
  144. */
  145. nv_wr32(dev, NV40_PFIFO_GRCTX_INSTANCE, inst);
  146. return 0;
  147. }
  148. int
  149. nv40_graph_unload_context(struct drm_device *dev)
  150. {
  151. uint32_t inst;
  152. int ret;
  153. inst = nv_rd32(dev, NV40_PGRAPH_CTXCTL_CUR);
  154. if (!(inst & NV40_PGRAPH_CTXCTL_CUR_LOADED))
  155. return 0;
  156. inst &= NV40_PGRAPH_CTXCTL_CUR_INSTANCE;
  157. ret = nv40_graph_transfer_context(dev, inst, 1);
  158. nv_wr32(dev, NV40_PGRAPH_CTXCTL_CUR, inst);
  159. return ret;
  160. }
  161. void
  162. nv40_graph_set_tile_region(struct drm_device *dev, int i)
  163. {
  164. struct drm_nouveau_private *dev_priv = dev->dev_private;
  165. struct nouveau_tile_reg *tile = &dev_priv->tile.reg[i];
  166. switch (dev_priv->chipset) {
  167. case 0x44:
  168. case 0x4a:
  169. case 0x4e:
  170. nv_wr32(dev, NV20_PGRAPH_TSIZE(i), tile->pitch);
  171. nv_wr32(dev, NV20_PGRAPH_TLIMIT(i), tile->limit);
  172. nv_wr32(dev, NV20_PGRAPH_TILE(i), tile->addr);
  173. break;
  174. case 0x46:
  175. case 0x47:
  176. case 0x49:
  177. case 0x4b:
  178. nv_wr32(dev, NV47_PGRAPH_TSIZE(i), tile->pitch);
  179. nv_wr32(dev, NV47_PGRAPH_TLIMIT(i), tile->limit);
  180. nv_wr32(dev, NV47_PGRAPH_TILE(i), tile->addr);
  181. nv_wr32(dev, NV40_PGRAPH_TSIZE1(i), tile->pitch);
  182. nv_wr32(dev, NV40_PGRAPH_TLIMIT1(i), tile->limit);
  183. nv_wr32(dev, NV40_PGRAPH_TILE1(i), tile->addr);
  184. break;
  185. default:
  186. nv_wr32(dev, NV20_PGRAPH_TSIZE(i), tile->pitch);
  187. nv_wr32(dev, NV20_PGRAPH_TLIMIT(i), tile->limit);
  188. nv_wr32(dev, NV20_PGRAPH_TILE(i), tile->addr);
  189. nv_wr32(dev, NV40_PGRAPH_TSIZE1(i), tile->pitch);
  190. nv_wr32(dev, NV40_PGRAPH_TLIMIT1(i), tile->limit);
  191. nv_wr32(dev, NV40_PGRAPH_TILE1(i), tile->addr);
  192. break;
  193. }
  194. }
  195. /*
  196. * G70 0x47
  197. * G71 0x49
  198. * NV45 0x48
  199. * G72[M] 0x46
  200. * G73 0x4b
  201. * C51_G7X 0x4c
  202. * C51 0x4e
  203. */
  204. int
  205. nv40_graph_init(struct drm_device *dev)
  206. {
  207. struct drm_nouveau_private *dev_priv =
  208. (struct drm_nouveau_private *)dev->dev_private;
  209. struct nouveau_fb_engine *pfb = &dev_priv->engine.fb;
  210. struct nouveau_grctx ctx = {};
  211. uint32_t vramsz, *cp;
  212. int ret, i, j;
  213. nv_wr32(dev, NV03_PMC_ENABLE, nv_rd32(dev, NV03_PMC_ENABLE) &
  214. ~NV_PMC_ENABLE_PGRAPH);
  215. nv_wr32(dev, NV03_PMC_ENABLE, nv_rd32(dev, NV03_PMC_ENABLE) |
  216. NV_PMC_ENABLE_PGRAPH);
  217. cp = kmalloc(sizeof(*cp) * 256, GFP_KERNEL);
  218. if (!cp)
  219. return -ENOMEM;
  220. ctx.dev = dev;
  221. ctx.mode = NOUVEAU_GRCTX_PROG;
  222. ctx.data = cp;
  223. ctx.ctxprog_max = 256;
  224. nv40_grctx_init(&ctx);
  225. dev_priv->engine.graph.grctx_size = ctx.ctxvals_pos * 4;
  226. nv_wr32(dev, NV40_PGRAPH_CTXCTL_UCODE_INDEX, 0);
  227. for (i = 0; i < ctx.ctxprog_len; i++)
  228. nv_wr32(dev, NV40_PGRAPH_CTXCTL_UCODE_DATA, cp[i]);
  229. kfree(cp);
  230. ret = nv40_graph_register(dev);
  231. if (ret)
  232. return ret;
  233. /* No context present currently */
  234. nv_wr32(dev, NV40_PGRAPH_CTXCTL_CUR, 0x00000000);
  235. nouveau_irq_register(dev, 12, nv40_graph_isr);
  236. nv_wr32(dev, NV03_PGRAPH_INTR , 0xFFFFFFFF);
  237. nv_wr32(dev, NV40_PGRAPH_INTR_EN, 0xFFFFFFFF);
  238. nv_wr32(dev, NV04_PGRAPH_DEBUG_0, 0xFFFFFFFF);
  239. nv_wr32(dev, NV04_PGRAPH_DEBUG_0, 0x00000000);
  240. nv_wr32(dev, NV04_PGRAPH_DEBUG_1, 0x401287c0);
  241. nv_wr32(dev, NV04_PGRAPH_DEBUG_3, 0xe0de8055);
  242. nv_wr32(dev, NV10_PGRAPH_DEBUG_4, 0x00008000);
  243. nv_wr32(dev, NV04_PGRAPH_LIMIT_VIOL_PIX, 0x00be3c5f);
  244. nv_wr32(dev, NV10_PGRAPH_CTX_CONTROL, 0x10010100);
  245. nv_wr32(dev, NV10_PGRAPH_STATE , 0xFFFFFFFF);
  246. j = nv_rd32(dev, 0x1540) & 0xff;
  247. if (j) {
  248. for (i = 0; !(j & 1); j >>= 1, i++)
  249. ;
  250. nv_wr32(dev, 0x405000, i);
  251. }
  252. if (dev_priv->chipset == 0x40) {
  253. nv_wr32(dev, 0x4009b0, 0x83280fff);
  254. nv_wr32(dev, 0x4009b4, 0x000000a0);
  255. } else {
  256. nv_wr32(dev, 0x400820, 0x83280eff);
  257. nv_wr32(dev, 0x400824, 0x000000a0);
  258. }
  259. switch (dev_priv->chipset) {
  260. case 0x40:
  261. case 0x45:
  262. nv_wr32(dev, 0x4009b8, 0x0078e366);
  263. nv_wr32(dev, 0x4009bc, 0x0000014c);
  264. break;
  265. case 0x41:
  266. case 0x42: /* pciid also 0x00Cx */
  267. /* case 0x0120: XXX (pciid) */
  268. nv_wr32(dev, 0x400828, 0x007596ff);
  269. nv_wr32(dev, 0x40082c, 0x00000108);
  270. break;
  271. case 0x43:
  272. nv_wr32(dev, 0x400828, 0x0072cb77);
  273. nv_wr32(dev, 0x40082c, 0x00000108);
  274. break;
  275. case 0x44:
  276. case 0x46: /* G72 */
  277. case 0x4a:
  278. case 0x4c: /* G7x-based C51 */
  279. case 0x4e:
  280. nv_wr32(dev, 0x400860, 0);
  281. nv_wr32(dev, 0x400864, 0);
  282. break;
  283. case 0x47: /* G70 */
  284. case 0x49: /* G71 */
  285. case 0x4b: /* G73 */
  286. nv_wr32(dev, 0x400828, 0x07830610);
  287. nv_wr32(dev, 0x40082c, 0x0000016A);
  288. break;
  289. default:
  290. break;
  291. }
  292. nv_wr32(dev, 0x400b38, 0x2ffff800);
  293. nv_wr32(dev, 0x400b3c, 0x00006000);
  294. /* Tiling related stuff. */
  295. switch (dev_priv->chipset) {
  296. case 0x44:
  297. case 0x4a:
  298. nv_wr32(dev, 0x400bc4, 0x1003d888);
  299. nv_wr32(dev, 0x400bbc, 0xb7a7b500);
  300. break;
  301. case 0x46:
  302. nv_wr32(dev, 0x400bc4, 0x0000e024);
  303. nv_wr32(dev, 0x400bbc, 0xb7a7b520);
  304. break;
  305. case 0x4c:
  306. case 0x4e:
  307. case 0x67:
  308. nv_wr32(dev, 0x400bc4, 0x1003d888);
  309. nv_wr32(dev, 0x400bbc, 0xb7a7b540);
  310. break;
  311. default:
  312. break;
  313. }
  314. /* Turn all the tiling regions off. */
  315. for (i = 0; i < pfb->num_tiles; i++)
  316. nv40_graph_set_tile_region(dev, i);
  317. /* begin RAM config */
  318. vramsz = pci_resource_len(dev->pdev, 0) - 1;
  319. switch (dev_priv->chipset) {
  320. case 0x40:
  321. nv_wr32(dev, 0x4009A4, nv_rd32(dev, NV04_PFB_CFG0));
  322. nv_wr32(dev, 0x4009A8, nv_rd32(dev, NV04_PFB_CFG1));
  323. nv_wr32(dev, 0x4069A4, nv_rd32(dev, NV04_PFB_CFG0));
  324. nv_wr32(dev, 0x4069A8, nv_rd32(dev, NV04_PFB_CFG1));
  325. nv_wr32(dev, 0x400820, 0);
  326. nv_wr32(dev, 0x400824, 0);
  327. nv_wr32(dev, 0x400864, vramsz);
  328. nv_wr32(dev, 0x400868, vramsz);
  329. break;
  330. default:
  331. switch (dev_priv->chipset) {
  332. case 0x46:
  333. case 0x47:
  334. case 0x49:
  335. case 0x4b:
  336. nv_wr32(dev, 0x400DF0, nv_rd32(dev, NV04_PFB_CFG0));
  337. nv_wr32(dev, 0x400DF4, nv_rd32(dev, NV04_PFB_CFG1));
  338. break;
  339. default:
  340. nv_wr32(dev, 0x4009F0, nv_rd32(dev, NV04_PFB_CFG0));
  341. nv_wr32(dev, 0x4009F4, nv_rd32(dev, NV04_PFB_CFG1));
  342. break;
  343. }
  344. nv_wr32(dev, 0x4069F0, nv_rd32(dev, NV04_PFB_CFG0));
  345. nv_wr32(dev, 0x4069F4, nv_rd32(dev, NV04_PFB_CFG1));
  346. nv_wr32(dev, 0x400840, 0);
  347. nv_wr32(dev, 0x400844, 0);
  348. nv_wr32(dev, 0x4008A0, vramsz);
  349. nv_wr32(dev, 0x4008A4, vramsz);
  350. break;
  351. }
  352. return 0;
  353. }
  354. void nv40_graph_takedown(struct drm_device *dev)
  355. {
  356. nouveau_irq_unregister(dev, 12);
  357. }
  358. static int
  359. nv40_graph_register(struct drm_device *dev)
  360. {
  361. struct drm_nouveau_private *dev_priv = dev->dev_private;
  362. if (dev_priv->engine.graph.registered)
  363. return 0;
  364. NVOBJ_CLASS(dev, 0x506e, SW); /* nvsw */
  365. NVOBJ_CLASS(dev, 0x0030, GR); /* null */
  366. NVOBJ_CLASS(dev, 0x0039, GR); /* m2mf */
  367. NVOBJ_CLASS(dev, 0x004a, GR); /* gdirect */
  368. NVOBJ_CLASS(dev, 0x009f, GR); /* imageblit (nv12) */
  369. NVOBJ_CLASS(dev, 0x008a, GR); /* ifc */
  370. NVOBJ_CLASS(dev, 0x0089, GR); /* sifm */
  371. NVOBJ_CLASS(dev, 0x3089, GR); /* sifm (nv40) */
  372. NVOBJ_CLASS(dev, 0x0062, GR); /* surf2d */
  373. NVOBJ_CLASS(dev, 0x3062, GR); /* surf2d (nv40) */
  374. NVOBJ_CLASS(dev, 0x0043, GR); /* rop */
  375. NVOBJ_CLASS(dev, 0x0012, GR); /* beta1 */
  376. NVOBJ_CLASS(dev, 0x0072, GR); /* beta4 */
  377. NVOBJ_CLASS(dev, 0x0019, GR); /* cliprect */
  378. NVOBJ_CLASS(dev, 0x0044, GR); /* pattern */
  379. NVOBJ_CLASS(dev, 0x309e, GR); /* swzsurf */
  380. /* curie */
  381. if (dev_priv->chipset >= 0x60 ||
  382. 0x00005450 & (1 << (dev_priv->chipset & 0x0f)))
  383. NVOBJ_CLASS(dev, 0x4497, GR);
  384. else
  385. NVOBJ_CLASS(dev, 0x4097, GR);
  386. /* nvsw */
  387. NVOBJ_CLASS(dev, 0x506e, SW);
  388. NVOBJ_MTHD (dev, 0x506e, 0x0500, nv04_graph_mthd_page_flip);
  389. dev_priv->engine.graph.registered = true;
  390. return 0;
  391. }
  392. static int
  393. nv40_graph_isr_chid(struct drm_device *dev, u32 inst)
  394. {
  395. struct drm_nouveau_private *dev_priv = dev->dev_private;
  396. struct nouveau_channel *chan;
  397. unsigned long flags;
  398. int i;
  399. spin_lock_irqsave(&dev_priv->channels.lock, flags);
  400. for (i = 0; i < dev_priv->engine.fifo.channels; i++) {
  401. chan = dev_priv->channels.ptr[i];
  402. if (!chan || !chan->ramin_grctx)
  403. continue;
  404. if (inst == chan->ramin_grctx->pinst)
  405. break;
  406. }
  407. spin_unlock_irqrestore(&dev_priv->channels.lock, flags);
  408. return i;
  409. }
  410. static void
  411. nv40_graph_isr(struct drm_device *dev)
  412. {
  413. u32 stat;
  414. while ((stat = nv_rd32(dev, NV03_PGRAPH_INTR))) {
  415. u32 nsource = nv_rd32(dev, NV03_PGRAPH_NSOURCE);
  416. u32 nstatus = nv_rd32(dev, NV03_PGRAPH_NSTATUS);
  417. u32 inst = (nv_rd32(dev, 0x40032c) & 0x000fffff) << 4;
  418. u32 chid = nv40_graph_isr_chid(dev, inst);
  419. u32 addr = nv_rd32(dev, NV04_PGRAPH_TRAPPED_ADDR);
  420. u32 subc = (addr & 0x00070000) >> 16;
  421. u32 mthd = (addr & 0x00001ffc);
  422. u32 data = nv_rd32(dev, NV04_PGRAPH_TRAPPED_DATA);
  423. u32 class = nv_rd32(dev, 0x400160 + subc * 4) & 0xffff;
  424. u32 show = stat;
  425. if (stat & NV_PGRAPH_INTR_ERROR) {
  426. if (nsource & NV03_PGRAPH_NSOURCE_ILLEGAL_MTHD) {
  427. if (!nouveau_gpuobj_mthd_call2(dev, chid, class, mthd, data))
  428. show &= ~NV_PGRAPH_INTR_ERROR;
  429. } else
  430. if (nsource & NV03_PGRAPH_NSOURCE_DMA_VTX_PROTECTION) {
  431. nv_mask(dev, 0x402000, 0, 0);
  432. }
  433. }
  434. nv_wr32(dev, NV03_PGRAPH_INTR, stat);
  435. nv_wr32(dev, NV04_PGRAPH_FIFO, 0x00000001);
  436. if (show && nouveau_ratelimit()) {
  437. NV_INFO(dev, "PGRAPH -");
  438. nouveau_bitfield_print(nv10_graph_intr, show);
  439. printk(" nsource:");
  440. nouveau_bitfield_print(nv04_graph_nsource, nsource);
  441. printk(" nstatus:");
  442. nouveau_bitfield_print(nv10_graph_nstatus, nstatus);
  443. printk("\n");
  444. NV_INFO(dev, "PGRAPH - ch %d (0x%08x) subc %d "
  445. "class 0x%04x mthd 0x%04x data 0x%08x\n",
  446. chid, inst, subc, class, mthd, data);
  447. }
  448. }
  449. }