nv50_fifo.c 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489
  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_ramht.h"
  30. static void
  31. nv50_fifo_playlist_update(struct drm_device *dev)
  32. {
  33. struct drm_nouveau_private *dev_priv = dev->dev_private;
  34. struct nouveau_fifo_engine *pfifo = &dev_priv->engine.fifo;
  35. struct nouveau_gpuobj *cur;
  36. int i, nr;
  37. NV_DEBUG(dev, "\n");
  38. cur = pfifo->playlist[pfifo->cur_playlist];
  39. pfifo->cur_playlist = !pfifo->cur_playlist;
  40. /* We never schedule channel 0 or 127 */
  41. for (i = 1, nr = 0; i < 127; i++) {
  42. if (dev_priv->channels.ptr[i] &&
  43. dev_priv->channels.ptr[i]->ramfc) {
  44. nv_wo32(cur, (nr * 4), i);
  45. nr++;
  46. }
  47. }
  48. dev_priv->engine.instmem.flush(dev);
  49. nv_wr32(dev, 0x32f4, cur->vinst >> 12);
  50. nv_wr32(dev, 0x32ec, nr);
  51. nv_wr32(dev, 0x2500, 0x101);
  52. }
  53. static void
  54. nv50_fifo_channel_enable(struct drm_device *dev, int channel)
  55. {
  56. struct drm_nouveau_private *dev_priv = dev->dev_private;
  57. struct nouveau_channel *chan = dev_priv->channels.ptr[channel];
  58. uint32_t inst;
  59. NV_DEBUG(dev, "ch%d\n", channel);
  60. if (dev_priv->chipset == 0x50)
  61. inst = chan->ramfc->vinst >> 12;
  62. else
  63. inst = chan->ramfc->vinst >> 8;
  64. nv_wr32(dev, NV50_PFIFO_CTX_TABLE(channel), inst |
  65. NV50_PFIFO_CTX_TABLE_CHANNEL_ENABLED);
  66. }
  67. static void
  68. nv50_fifo_channel_disable(struct drm_device *dev, int channel)
  69. {
  70. struct drm_nouveau_private *dev_priv = dev->dev_private;
  71. uint32_t inst;
  72. NV_DEBUG(dev, "ch%d\n", channel);
  73. if (dev_priv->chipset == 0x50)
  74. inst = NV50_PFIFO_CTX_TABLE_INSTANCE_MASK_G80;
  75. else
  76. inst = NV50_PFIFO_CTX_TABLE_INSTANCE_MASK_G84;
  77. nv_wr32(dev, NV50_PFIFO_CTX_TABLE(channel), inst);
  78. }
  79. static void
  80. nv50_fifo_init_reset(struct drm_device *dev)
  81. {
  82. uint32_t pmc_e = NV_PMC_ENABLE_PFIFO;
  83. NV_DEBUG(dev, "\n");
  84. nv_wr32(dev, NV03_PMC_ENABLE, nv_rd32(dev, NV03_PMC_ENABLE) & ~pmc_e);
  85. nv_wr32(dev, NV03_PMC_ENABLE, nv_rd32(dev, NV03_PMC_ENABLE) | pmc_e);
  86. }
  87. static void
  88. nv50_fifo_init_intr(struct drm_device *dev)
  89. {
  90. NV_DEBUG(dev, "\n");
  91. nv_wr32(dev, NV03_PFIFO_INTR_0, 0xFFFFFFFF);
  92. nv_wr32(dev, NV03_PFIFO_INTR_EN_0, 0xFFFFFFFF);
  93. }
  94. static void
  95. nv50_fifo_init_context_table(struct drm_device *dev)
  96. {
  97. struct drm_nouveau_private *dev_priv = dev->dev_private;
  98. int i;
  99. NV_DEBUG(dev, "\n");
  100. for (i = 0; i < NV50_PFIFO_CTX_TABLE__SIZE; i++) {
  101. if (dev_priv->channels.ptr[i])
  102. nv50_fifo_channel_enable(dev, i);
  103. else
  104. nv50_fifo_channel_disable(dev, i);
  105. }
  106. nv50_fifo_playlist_update(dev);
  107. }
  108. static void
  109. nv50_fifo_init_regs__nv(struct drm_device *dev)
  110. {
  111. NV_DEBUG(dev, "\n");
  112. nv_wr32(dev, 0x250c, 0x6f3cfc34);
  113. }
  114. static void
  115. nv50_fifo_init_regs(struct drm_device *dev)
  116. {
  117. NV_DEBUG(dev, "\n");
  118. nv_wr32(dev, 0x2500, 0);
  119. nv_wr32(dev, 0x3250, 0);
  120. nv_wr32(dev, 0x3220, 0);
  121. nv_wr32(dev, 0x3204, 0);
  122. nv_wr32(dev, 0x3210, 0);
  123. nv_wr32(dev, 0x3270, 0);
  124. /* Enable dummy channels setup by nv50_instmem.c */
  125. nv50_fifo_channel_enable(dev, 0);
  126. nv50_fifo_channel_enable(dev, 127);
  127. }
  128. int
  129. nv50_fifo_init(struct drm_device *dev)
  130. {
  131. struct drm_nouveau_private *dev_priv = dev->dev_private;
  132. struct nouveau_fifo_engine *pfifo = &dev_priv->engine.fifo;
  133. int ret;
  134. NV_DEBUG(dev, "\n");
  135. if (pfifo->playlist[0]) {
  136. pfifo->cur_playlist = !pfifo->cur_playlist;
  137. goto just_reset;
  138. }
  139. ret = nouveau_gpuobj_new(dev, NULL, 128*4, 0x1000,
  140. NVOBJ_FLAG_ZERO_ALLOC,
  141. &pfifo->playlist[0]);
  142. if (ret) {
  143. NV_ERROR(dev, "error creating playlist 0: %d\n", ret);
  144. return ret;
  145. }
  146. ret = nouveau_gpuobj_new(dev, NULL, 128*4, 0x1000,
  147. NVOBJ_FLAG_ZERO_ALLOC,
  148. &pfifo->playlist[1]);
  149. if (ret) {
  150. nouveau_gpuobj_ref(NULL, &pfifo->playlist[0]);
  151. NV_ERROR(dev, "error creating playlist 1: %d\n", ret);
  152. return ret;
  153. }
  154. just_reset:
  155. nv50_fifo_init_reset(dev);
  156. nv50_fifo_init_intr(dev);
  157. nv50_fifo_init_context_table(dev);
  158. nv50_fifo_init_regs__nv(dev);
  159. nv50_fifo_init_regs(dev);
  160. dev_priv->engine.fifo.enable(dev);
  161. dev_priv->engine.fifo.reassign(dev, true);
  162. return 0;
  163. }
  164. void
  165. nv50_fifo_takedown(struct drm_device *dev)
  166. {
  167. struct drm_nouveau_private *dev_priv = dev->dev_private;
  168. struct nouveau_fifo_engine *pfifo = &dev_priv->engine.fifo;
  169. NV_DEBUG(dev, "\n");
  170. if (!pfifo->playlist[0])
  171. return;
  172. nouveau_gpuobj_ref(NULL, &pfifo->playlist[0]);
  173. nouveau_gpuobj_ref(NULL, &pfifo->playlist[1]);
  174. }
  175. int
  176. nv50_fifo_channel_id(struct drm_device *dev)
  177. {
  178. return nv_rd32(dev, NV03_PFIFO_CACHE1_PUSH1) &
  179. NV50_PFIFO_CACHE1_PUSH1_CHID_MASK;
  180. }
  181. int
  182. nv50_fifo_create_context(struct nouveau_channel *chan)
  183. {
  184. struct drm_device *dev = chan->dev;
  185. struct drm_nouveau_private *dev_priv = dev->dev_private;
  186. struct nouveau_gpuobj *ramfc = NULL;
  187. unsigned long flags;
  188. int ret;
  189. NV_DEBUG(dev, "ch%d\n", chan->id);
  190. if (dev_priv->chipset == 0x50) {
  191. ret = nouveau_gpuobj_new_fake(dev, chan->ramin->pinst,
  192. chan->ramin->vinst, 0x100,
  193. NVOBJ_FLAG_ZERO_ALLOC |
  194. NVOBJ_FLAG_ZERO_FREE,
  195. &chan->ramfc);
  196. if (ret)
  197. return ret;
  198. ret = nouveau_gpuobj_new_fake(dev, chan->ramin->pinst + 0x0400,
  199. chan->ramin->vinst + 0x0400,
  200. 4096, 0, &chan->cache);
  201. if (ret)
  202. return ret;
  203. } else {
  204. ret = nouveau_gpuobj_new(dev, chan, 0x100, 256,
  205. NVOBJ_FLAG_ZERO_ALLOC |
  206. NVOBJ_FLAG_ZERO_FREE, &chan->ramfc);
  207. if (ret)
  208. return ret;
  209. ret = nouveau_gpuobj_new(dev, chan, 4096, 1024,
  210. 0, &chan->cache);
  211. if (ret)
  212. return ret;
  213. }
  214. ramfc = chan->ramfc;
  215. spin_lock_irqsave(&dev_priv->context_switch_lock, flags);
  216. nv_wo32(ramfc, 0x48, chan->pushbuf->cinst >> 4);
  217. nv_wo32(ramfc, 0x80, ((chan->ramht->bits - 9) << 27) |
  218. (4 << 24) /* SEARCH_FULL */ |
  219. (chan->ramht->gpuobj->cinst >> 4));
  220. nv_wo32(ramfc, 0x44, 0x2101ffff);
  221. nv_wo32(ramfc, 0x60, 0x7fffffff);
  222. nv_wo32(ramfc, 0x40, 0x00000000);
  223. nv_wo32(ramfc, 0x7c, 0x30000001);
  224. nv_wo32(ramfc, 0x78, 0x00000000);
  225. nv_wo32(ramfc, 0x3c, 0x403f6078);
  226. nv_wo32(ramfc, 0x50, chan->pushbuf_base + chan->dma.ib_base * 4);
  227. nv_wo32(ramfc, 0x54, drm_order(chan->dma.ib_max + 1) << 16);
  228. if (dev_priv->chipset != 0x50) {
  229. nv_wo32(chan->ramin, 0, chan->id);
  230. nv_wo32(chan->ramin, 4, chan->ramfc->vinst >> 8);
  231. nv_wo32(ramfc, 0x88, chan->cache->vinst >> 10);
  232. nv_wo32(ramfc, 0x98, chan->ramin->vinst >> 12);
  233. }
  234. dev_priv->engine.instmem.flush(dev);
  235. nv50_fifo_channel_enable(dev, chan->id);
  236. nv50_fifo_playlist_update(dev);
  237. spin_unlock_irqrestore(&dev_priv->context_switch_lock, flags);
  238. return 0;
  239. }
  240. void
  241. nv50_fifo_destroy_context(struct nouveau_channel *chan)
  242. {
  243. struct drm_device *dev = chan->dev;
  244. struct drm_nouveau_private *dev_priv = dev->dev_private;
  245. struct nouveau_fifo_engine *pfifo = &dev_priv->engine.fifo;
  246. struct nouveau_gpuobj *ramfc = NULL;
  247. unsigned long flags;
  248. NV_DEBUG(dev, "ch%d\n", chan->id);
  249. spin_lock_irqsave(&dev_priv->context_switch_lock, flags);
  250. pfifo->reassign(dev, false);
  251. /* Unload the context if it's the currently active one */
  252. if (pfifo->channel_id(dev) == chan->id) {
  253. pfifo->disable(dev);
  254. pfifo->unload_context(dev);
  255. pfifo->enable(dev);
  256. }
  257. /* This will ensure the channel is seen as disabled. */
  258. nouveau_gpuobj_ref(chan->ramfc, &ramfc);
  259. nouveau_gpuobj_ref(NULL, &chan->ramfc);
  260. nv50_fifo_channel_disable(dev, chan->id);
  261. /* Dummy channel, also used on ch 127 */
  262. if (chan->id == 0)
  263. nv50_fifo_channel_disable(dev, 127);
  264. nv50_fifo_playlist_update(dev);
  265. pfifo->reassign(dev, true);
  266. spin_unlock_irqrestore(&dev_priv->context_switch_lock, flags);
  267. /* Free the channel resources */
  268. nouveau_gpuobj_ref(NULL, &ramfc);
  269. nouveau_gpuobj_ref(NULL, &chan->cache);
  270. }
  271. int
  272. nv50_fifo_load_context(struct nouveau_channel *chan)
  273. {
  274. struct drm_device *dev = chan->dev;
  275. struct drm_nouveau_private *dev_priv = dev->dev_private;
  276. struct nouveau_gpuobj *ramfc = chan->ramfc;
  277. struct nouveau_gpuobj *cache = chan->cache;
  278. int ptr, cnt;
  279. NV_DEBUG(dev, "ch%d\n", chan->id);
  280. nv_wr32(dev, 0x3330, nv_ro32(ramfc, 0x00));
  281. nv_wr32(dev, 0x3334, nv_ro32(ramfc, 0x04));
  282. nv_wr32(dev, 0x3240, nv_ro32(ramfc, 0x08));
  283. nv_wr32(dev, 0x3320, nv_ro32(ramfc, 0x0c));
  284. nv_wr32(dev, 0x3244, nv_ro32(ramfc, 0x10));
  285. nv_wr32(dev, 0x3328, nv_ro32(ramfc, 0x14));
  286. nv_wr32(dev, 0x3368, nv_ro32(ramfc, 0x18));
  287. nv_wr32(dev, 0x336c, nv_ro32(ramfc, 0x1c));
  288. nv_wr32(dev, 0x3370, nv_ro32(ramfc, 0x20));
  289. nv_wr32(dev, 0x3374, nv_ro32(ramfc, 0x24));
  290. nv_wr32(dev, 0x3378, nv_ro32(ramfc, 0x28));
  291. nv_wr32(dev, 0x337c, nv_ro32(ramfc, 0x2c));
  292. nv_wr32(dev, 0x3228, nv_ro32(ramfc, 0x30));
  293. nv_wr32(dev, 0x3364, nv_ro32(ramfc, 0x34));
  294. nv_wr32(dev, 0x32a0, nv_ro32(ramfc, 0x38));
  295. nv_wr32(dev, 0x3224, nv_ro32(ramfc, 0x3c));
  296. nv_wr32(dev, 0x324c, nv_ro32(ramfc, 0x40));
  297. nv_wr32(dev, 0x2044, nv_ro32(ramfc, 0x44));
  298. nv_wr32(dev, 0x322c, nv_ro32(ramfc, 0x48));
  299. nv_wr32(dev, 0x3234, nv_ro32(ramfc, 0x4c));
  300. nv_wr32(dev, 0x3340, nv_ro32(ramfc, 0x50));
  301. nv_wr32(dev, 0x3344, nv_ro32(ramfc, 0x54));
  302. nv_wr32(dev, 0x3280, nv_ro32(ramfc, 0x58));
  303. nv_wr32(dev, 0x3254, nv_ro32(ramfc, 0x5c));
  304. nv_wr32(dev, 0x3260, nv_ro32(ramfc, 0x60));
  305. nv_wr32(dev, 0x3264, nv_ro32(ramfc, 0x64));
  306. nv_wr32(dev, 0x3268, nv_ro32(ramfc, 0x68));
  307. nv_wr32(dev, 0x326c, nv_ro32(ramfc, 0x6c));
  308. nv_wr32(dev, 0x32e4, nv_ro32(ramfc, 0x70));
  309. nv_wr32(dev, 0x3248, nv_ro32(ramfc, 0x74));
  310. nv_wr32(dev, 0x2088, nv_ro32(ramfc, 0x78));
  311. nv_wr32(dev, 0x2058, nv_ro32(ramfc, 0x7c));
  312. nv_wr32(dev, 0x2210, nv_ro32(ramfc, 0x80));
  313. cnt = nv_ro32(ramfc, 0x84);
  314. for (ptr = 0; ptr < cnt; ptr++) {
  315. nv_wr32(dev, NV40_PFIFO_CACHE1_METHOD(ptr),
  316. nv_ro32(cache, (ptr * 8) + 0));
  317. nv_wr32(dev, NV40_PFIFO_CACHE1_DATA(ptr),
  318. nv_ro32(cache, (ptr * 8) + 4));
  319. }
  320. nv_wr32(dev, NV03_PFIFO_CACHE1_PUT, cnt << 2);
  321. nv_wr32(dev, NV03_PFIFO_CACHE1_GET, 0);
  322. /* guessing that all the 0x34xx regs aren't on NV50 */
  323. if (dev_priv->chipset != 0x50) {
  324. nv_wr32(dev, 0x340c, nv_ro32(ramfc, 0x88));
  325. nv_wr32(dev, 0x3400, nv_ro32(ramfc, 0x8c));
  326. nv_wr32(dev, 0x3404, nv_ro32(ramfc, 0x90));
  327. nv_wr32(dev, 0x3408, nv_ro32(ramfc, 0x94));
  328. nv_wr32(dev, 0x3410, nv_ro32(ramfc, 0x98));
  329. }
  330. nv_wr32(dev, NV03_PFIFO_CACHE1_PUSH1, chan->id | (1<<16));
  331. return 0;
  332. }
  333. int
  334. nv50_fifo_unload_context(struct drm_device *dev)
  335. {
  336. struct drm_nouveau_private *dev_priv = dev->dev_private;
  337. struct nouveau_fifo_engine *pfifo = &dev_priv->engine.fifo;
  338. struct nouveau_gpuobj *ramfc, *cache;
  339. struct nouveau_channel *chan = NULL;
  340. int chid, get, put, ptr;
  341. NV_DEBUG(dev, "\n");
  342. chid = pfifo->channel_id(dev);
  343. if (chid < 1 || chid >= dev_priv->engine.fifo.channels - 1)
  344. return 0;
  345. chan = dev_priv->channels.ptr[chid];
  346. if (!chan) {
  347. NV_ERROR(dev, "Inactive channel on PFIFO: %d\n", chid);
  348. return -EINVAL;
  349. }
  350. NV_DEBUG(dev, "ch%d\n", chan->id);
  351. ramfc = chan->ramfc;
  352. cache = chan->cache;
  353. nv_wo32(ramfc, 0x00, nv_rd32(dev, 0x3330));
  354. nv_wo32(ramfc, 0x04, nv_rd32(dev, 0x3334));
  355. nv_wo32(ramfc, 0x08, nv_rd32(dev, 0x3240));
  356. nv_wo32(ramfc, 0x0c, nv_rd32(dev, 0x3320));
  357. nv_wo32(ramfc, 0x10, nv_rd32(dev, 0x3244));
  358. nv_wo32(ramfc, 0x14, nv_rd32(dev, 0x3328));
  359. nv_wo32(ramfc, 0x18, nv_rd32(dev, 0x3368));
  360. nv_wo32(ramfc, 0x1c, nv_rd32(dev, 0x336c));
  361. nv_wo32(ramfc, 0x20, nv_rd32(dev, 0x3370));
  362. nv_wo32(ramfc, 0x24, nv_rd32(dev, 0x3374));
  363. nv_wo32(ramfc, 0x28, nv_rd32(dev, 0x3378));
  364. nv_wo32(ramfc, 0x2c, nv_rd32(dev, 0x337c));
  365. nv_wo32(ramfc, 0x30, nv_rd32(dev, 0x3228));
  366. nv_wo32(ramfc, 0x34, nv_rd32(dev, 0x3364));
  367. nv_wo32(ramfc, 0x38, nv_rd32(dev, 0x32a0));
  368. nv_wo32(ramfc, 0x3c, nv_rd32(dev, 0x3224));
  369. nv_wo32(ramfc, 0x40, nv_rd32(dev, 0x324c));
  370. nv_wo32(ramfc, 0x44, nv_rd32(dev, 0x2044));
  371. nv_wo32(ramfc, 0x48, nv_rd32(dev, 0x322c));
  372. nv_wo32(ramfc, 0x4c, nv_rd32(dev, 0x3234));
  373. nv_wo32(ramfc, 0x50, nv_rd32(dev, 0x3340));
  374. nv_wo32(ramfc, 0x54, nv_rd32(dev, 0x3344));
  375. nv_wo32(ramfc, 0x58, nv_rd32(dev, 0x3280));
  376. nv_wo32(ramfc, 0x5c, nv_rd32(dev, 0x3254));
  377. nv_wo32(ramfc, 0x60, nv_rd32(dev, 0x3260));
  378. nv_wo32(ramfc, 0x64, nv_rd32(dev, 0x3264));
  379. nv_wo32(ramfc, 0x68, nv_rd32(dev, 0x3268));
  380. nv_wo32(ramfc, 0x6c, nv_rd32(dev, 0x326c));
  381. nv_wo32(ramfc, 0x70, nv_rd32(dev, 0x32e4));
  382. nv_wo32(ramfc, 0x74, nv_rd32(dev, 0x3248));
  383. nv_wo32(ramfc, 0x78, nv_rd32(dev, 0x2088));
  384. nv_wo32(ramfc, 0x7c, nv_rd32(dev, 0x2058));
  385. nv_wo32(ramfc, 0x80, nv_rd32(dev, 0x2210));
  386. put = (nv_rd32(dev, NV03_PFIFO_CACHE1_PUT) & 0x7ff) >> 2;
  387. get = (nv_rd32(dev, NV03_PFIFO_CACHE1_GET) & 0x7ff) >> 2;
  388. ptr = 0;
  389. while (put != get) {
  390. nv_wo32(cache, ptr + 0,
  391. nv_rd32(dev, NV40_PFIFO_CACHE1_METHOD(get)));
  392. nv_wo32(cache, ptr + 4,
  393. nv_rd32(dev, NV40_PFIFO_CACHE1_DATA(get)));
  394. get = (get + 1) & 0x1ff;
  395. ptr += 8;
  396. }
  397. /* guessing that all the 0x34xx regs aren't on NV50 */
  398. if (dev_priv->chipset != 0x50) {
  399. nv_wo32(ramfc, 0x84, ptr >> 3);
  400. nv_wo32(ramfc, 0x88, nv_rd32(dev, 0x340c));
  401. nv_wo32(ramfc, 0x8c, nv_rd32(dev, 0x3400));
  402. nv_wo32(ramfc, 0x90, nv_rd32(dev, 0x3404));
  403. nv_wo32(ramfc, 0x94, nv_rd32(dev, 0x3408));
  404. nv_wo32(ramfc, 0x98, nv_rd32(dev, 0x3410));
  405. }
  406. dev_priv->engine.instmem.flush(dev);
  407. /*XXX: probably reload ch127 (NULL) state back too */
  408. nv_wr32(dev, NV03_PFIFO_CACHE1_PUSH1, 127);
  409. return 0;
  410. }
  411. void
  412. nv50_fifo_tlb_flush(struct drm_device *dev)
  413. {
  414. nv50_vm_flush(dev, 5);
  415. }