nv50_fifo.c 14 KB

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