63 *pobject = nv_object(obj);
68 nv_wo32(obj, 0x04, 0x00000000);
69 nv_wo32(obj, 0x08, 0x00000000);
71 nv_mo32(obj, 0x08, 0x01000000, 0x01000000);
73 nv_wo32(obj, 0x0c, 0x00000000);
74 nv_wo32(obj, 0x10, 0x00000000);
80 .ctor = nv40_graph_object_ctor,
89 nv40_graph_sclass[] = {
90 { 0x0012, &nv40_graph_ofuncs,
NULL },
91 { 0x0019, &nv40_graph_ofuncs,
NULL },
92 { 0x0030, &nv40_graph_ofuncs,
NULL },
93 { 0x0039, &nv40_graph_ofuncs,
NULL },
94 { 0x0043, &nv40_graph_ofuncs,
NULL },
95 { 0x0044, &nv40_graph_ofuncs,
NULL },
96 { 0x004a, &nv40_graph_ofuncs,
NULL },
97 { 0x0062, &nv40_graph_ofuncs,
NULL },
98 { 0x0072, &nv40_graph_ofuncs,
NULL },
99 { 0x0089, &nv40_graph_ofuncs,
NULL },
100 { 0x008a, &nv40_graph_ofuncs,
NULL },
101 { 0x009f, &nv40_graph_ofuncs,
NULL },
102 { 0x3062, &nv40_graph_ofuncs,
NULL },
103 { 0x3089, &nv40_graph_ofuncs,
NULL },
104 { 0x309e, &nv40_graph_ofuncs,
NULL },
105 { 0x4097, &nv40_graph_ofuncs,
NULL },
110 nv44_graph_sclass[] = {
111 { 0x0012, &nv40_graph_ofuncs,
NULL },
112 { 0x0019, &nv40_graph_ofuncs,
NULL },
113 { 0x0030, &nv40_graph_ofuncs,
NULL },
114 { 0x0039, &nv40_graph_ofuncs,
NULL },
115 { 0x0043, &nv40_graph_ofuncs,
NULL },
116 { 0x0044, &nv40_graph_ofuncs,
NULL },
117 { 0x004a, &nv40_graph_ofuncs,
NULL },
118 { 0x0062, &nv40_graph_ofuncs,
NULL },
119 { 0x0072, &nv40_graph_ofuncs,
NULL },
120 { 0x0089, &nv40_graph_ofuncs,
NULL },
121 { 0x008a, &nv40_graph_ofuncs,
NULL },
122 { 0x009f, &nv40_graph_ofuncs,
NULL },
123 { 0x3062, &nv40_graph_ofuncs,
NULL },
124 { 0x3089, &nv40_graph_ofuncs,
NULL },
125 { 0x309e, &nv40_graph_ofuncs,
NULL },
126 { 0x4497, &nv40_graph_ofuncs,
NULL },
147 *pobject = nv_object(chan);
152 nv_wo32(chan, 0x00000, nv_gpuobj(chan)->
addr >> 4);
161 u32 inst = 0x01000000 | nv_gpuobj(chan)->addr >> 4;
164 nv_mask(priv, 0x400720, 0x00000001, 0x00000000);
166 if (nv_rd32(priv, 0x40032c) == inst) {
168 nv_wr32(priv, 0x400720, 0x00000000);
169 nv_wr32(priv, 0x400784, inst);
170 nv_mask(priv, 0x400310, 0x00000020, 0x00000020);
171 nv_mask(priv, 0x400304, 0x00000001, 0x00000001);
172 if (!
nv_wait(priv, 0x400300, 0x00000001, 0x00000000)) {
173 u32 insn = nv_rd32(priv, 0x400308);
174 nv_warn(priv,
"ctxprog timeout 0x%08x\n", insn);
179 nv_mask(priv, 0x40032c, 0x01000000, 0x00000000);
182 if (nv_rd32(priv, 0x400330) == inst)
183 nv_mask(priv, 0x400330, 0x01000000, 0x00000000);
185 nv_mask(priv, 0x400720, 0x00000001, 0x00000001);
190 nv40_graph_cclass = {
193 .ctor = nv40_graph_context_ctor,
196 .fini = nv40_graph_context_fini,
214 pfifo->
pause(pfifo, &flags);
217 switch (nv_device(priv)->
chipset) {
253 pfifo->
start(pfifo, &flags);
267 u32 inst = nv_rd32(priv, 0x40032c) & 0x000fffff;
269 u32 subc = (addr & 0x00070000) >> 16;
270 u32 mthd = (addr & 0x00001ffc);
272 u32 class = nv_rd32(priv, 0x400160 + subc * 4) & 0xffff;
277 chid = pfifo->
chid(pfifo, engctx);
282 if (handle && !nv_call(handle->
object, mthd, data))
283 show &= ~NV_PGRAPH_INTR_ERROR;
288 nv_mask(priv, 0x402000, 0, 0);
303 nv_error(priv,
"ch %d [0x%08x] subc %d class 0x%04x "
304 "mthd 0x%04x data 0x%08x\n",
305 chid, inst << 4, subc,
class, mthd, data);
320 *pobject = nv_object(priv);
324 nv_subdev(priv)->unit = 0x00001000;
325 nv_subdev(priv)->intr = nv40_graph_intr;
326 nv_engine(priv)->cclass = &nv40_graph_cclass;
327 if (nv44_graph_class(priv))
328 nv_engine(priv)->sclass = nv44_graph_sclass;
330 nv_engine(priv)->sclass = nv40_graph_sclass;
331 nv_engine(priv)->tile_prog = nv40_graph_tile_prog;
369 j = nv_rd32(priv, 0x1540) & 0xff;
371 for (i = 0; !(j & 1); j >>= 1, i++)
373 nv_wr32(priv, 0x405000, i);
376 if (nv_device(priv)->
chipset == 0x40) {
377 nv_wr32(priv, 0x4009b0, 0x83280fff);
378 nv_wr32(priv, 0x4009b4, 0x000000a0);
380 nv_wr32(priv, 0x400820, 0x83280eff);
381 nv_wr32(priv, 0x400824, 0x000000a0);
384 switch (nv_device(priv)->
chipset) {
387 nv_wr32(priv, 0x4009b8, 0x0078e366);
388 nv_wr32(priv, 0x4009bc, 0x0000014c);
393 nv_wr32(priv, 0x400828, 0x007596ff);
394 nv_wr32(priv, 0x40082c, 0x00000108);
397 nv_wr32(priv, 0x400828, 0x0072cb77);
398 nv_wr32(priv, 0x40082c, 0x00000108);
405 nv_wr32(priv, 0x400860, 0);
406 nv_wr32(priv, 0x400864, 0);
411 nv_wr32(priv, 0x400828, 0x07830610);
412 nv_wr32(priv, 0x40082c, 0x0000016A);
418 nv_wr32(priv, 0x400b38, 0x2ffff800);
419 nv_wr32(priv, 0x400b3c, 0x00006000);
422 switch (nv_device(priv)->
chipset) {
425 nv_wr32(priv, 0x400bc4, 0x1003d888);
426 nv_wr32(priv, 0x400bbc, 0xb7a7b500);
429 nv_wr32(priv, 0x400bc4, 0x0000e024);
430 nv_wr32(priv, 0x400bbc, 0xb7a7b520);
435 nv_wr32(priv, 0x400bc4, 0x1003d888);
436 nv_wr32(priv, 0x400bbc, 0xb7a7b540);
443 for (i = 0; i < pfb->
tile.regions; i++)
448 switch (nv_device(priv)->
chipset) {
450 nv_wr32(priv, 0x4009A4, nv_rd32(priv, 0x100200));
451 nv_wr32(priv, 0x4009A8, nv_rd32(priv, 0x100204));
452 nv_wr32(priv, 0x4069A4, nv_rd32(priv, 0x100200));
453 nv_wr32(priv, 0x4069A8, nv_rd32(priv, 0x100204));
454 nv_wr32(priv, 0x400820, 0);
455 nv_wr32(priv, 0x400824, 0);
456 nv_wr32(priv, 0x400864, vramsz);
457 nv_wr32(priv, 0x400868, vramsz);
460 switch (nv_device(priv)->
chipset) {
468 nv_wr32(priv, 0x4009F0, nv_rd32(priv, 0x100200));
469 nv_wr32(priv, 0x4009F4, nv_rd32(priv, 0x100204));
472 nv_wr32(priv, 0x400DF0, nv_rd32(priv, 0x100200));
473 nv_wr32(priv, 0x400DF4, nv_rd32(priv, 0x100204));
476 nv_wr32(priv, 0x4069F0, nv_rd32(priv, 0x100200));
477 nv_wr32(priv, 0x4069F4, nv_rd32(priv, 0x100204));
478 nv_wr32(priv, 0x400840, 0);
479 nv_wr32(priv, 0x400844, 0);
480 nv_wr32(priv, 0x4008A0, vramsz);
481 nv_wr32(priv, 0x4008A4, vramsz);
492 .ctor = nv40_graph_ctor,
494 .init = nv40_graph_init,