nv50_fifo.c 14 KB

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