Lines Matching refs:ctx

49  *   rather than a cp_lsr(ctx, dwords_for_1_vs_unit) instruction.
159 nv40_gr_construct_general(struct nvkm_grctx *ctx)
161 struct nvkm_device *device = ctx->device;
164 cp_ctx(ctx, 0x4000a4, 1);
165 gr_def(ctx, 0x4000a4, 0x00000008);
166 cp_ctx(ctx, 0x400144, 58);
167 gr_def(ctx, 0x400144, 0x00000001);
168 cp_ctx(ctx, 0x400314, 1);
169 gr_def(ctx, 0x400314, 0x00000000);
170 cp_ctx(ctx, 0x400400, 10);
171 cp_ctx(ctx, 0x400480, 10);
172 cp_ctx(ctx, 0x400500, 19);
173 gr_def(ctx, 0x400514, 0x00040000);
174 gr_def(ctx, 0x400524, 0x55555555);
175 gr_def(ctx, 0x400528, 0x55555555);
176 gr_def(ctx, 0x40052c, 0x55555555);
177 gr_def(ctx, 0x400530, 0x55555555);
178 cp_ctx(ctx, 0x400560, 6);
179 gr_def(ctx, 0x400568, 0x0000ffff);
180 gr_def(ctx, 0x40056c, 0x0000ffff);
181 cp_ctx(ctx, 0x40057c, 5);
182 cp_ctx(ctx, 0x400710, 3);
183 gr_def(ctx, 0x400710, 0x20010001);
184 gr_def(ctx, 0x400714, 0x0f73ef00);
185 cp_ctx(ctx, 0x400724, 1);
186 gr_def(ctx, 0x400724, 0x02008821);
187 cp_ctx(ctx, 0x400770, 3);
189 cp_ctx(ctx, 0x400814, 4);
190 cp_ctx(ctx, 0x400828, 5);
191 cp_ctx(ctx, 0x400840, 5);
192 gr_def(ctx, 0x400850, 0x00000040);
193 cp_ctx(ctx, 0x400858, 4);
194 gr_def(ctx, 0x400858, 0x00000040);
195 gr_def(ctx, 0x40085c, 0x00000040);
196 gr_def(ctx, 0x400864, 0x80000000);
197 cp_ctx(ctx, 0x40086c, 9);
198 gr_def(ctx, 0x40086c, 0x80000000);
199 gr_def(ctx, 0x400870, 0x80000000);
200 gr_def(ctx, 0x400874, 0x80000000);
201 gr_def(ctx, 0x400878, 0x80000000);
202 gr_def(ctx, 0x400888, 0x00000040);
203 gr_def(ctx, 0x40088c, 0x80000000);
204 cp_ctx(ctx, 0x4009c0, 8);
205 gr_def(ctx, 0x4009cc, 0x80000000);
206 gr_def(ctx, 0x4009dc, 0x80000000);
208 cp_ctx(ctx, 0x400840, 20);
209 if (nv44_gr_class(ctx->device)) {
211 gr_def(ctx, 0x400860 + (i * 4), 0x00000001);
213 gr_def(ctx, 0x400880, 0x00000040);
214 gr_def(ctx, 0x400884, 0x00000040);
215 gr_def(ctx, 0x400888, 0x00000040);
216 cp_ctx(ctx, 0x400894, 11);
217 gr_def(ctx, 0x400894, 0x00000040);
218 if (!nv44_gr_class(ctx->device)) {
220 gr_def(ctx, 0x4008a0 + (i * 4), 0x80000000);
222 cp_ctx(ctx, 0x4008e0, 2);
223 cp_ctx(ctx, 0x4008f8, 2);
226 cp_ctx(ctx, 0x4009f8, 1);
228 cp_ctx(ctx, 0x400a00, 73);
229 gr_def(ctx, 0x400b0c, 0x0b0b0b0c);
230 cp_ctx(ctx, 0x401000, 4);
231 cp_ctx(ctx, 0x405004, 1);
236 cp_ctx(ctx, 0x403448, 1);
237 gr_def(ctx, 0x403448, 0x00001010);
240 cp_ctx(ctx, 0x403440, 1);
243 gr_def(ctx, 0x403440, 0x00000010);
248 gr_def(ctx, 0x403440, 0x00003010);
257 gr_def(ctx, 0x403440, 0x00001010);
265 nv40_gr_construct_state3d(struct nvkm_grctx *ctx)
267 struct nvkm_device *device = ctx->device;
271 cp_ctx(ctx, 0x401880, 51);
272 gr_def(ctx, 0x401940, 0x00000100);
276 cp_ctx(ctx, 0x401880, 32);
278 gr_def(ctx, 0x401880 + (i * 4), 0x00000111);
280 cp_ctx(ctx, 0x401900, 16);
281 cp_ctx(ctx, 0x401940, 3);
283 cp_ctx(ctx, 0x40194c, 18);
284 gr_def(ctx, 0x401954, 0x00000111);
285 gr_def(ctx, 0x401958, 0x00080060);
286 gr_def(ctx, 0x401974, 0x00000080);
287 gr_def(ctx, 0x401978, 0xffff0000);
288 gr_def(ctx, 0x40197c, 0x00000001);
289 gr_def(ctx, 0x401990, 0x46400000);
291 cp_ctx(ctx, 0x4019a0, 2);
292 cp_ctx(ctx, 0x4019ac, 5);
294 cp_ctx(ctx, 0x4019a0, 1);
295 cp_ctx(ctx, 0x4019b4, 3);
297 gr_def(ctx, 0x4019bc, 0xffff0000);
303 cp_ctx(ctx, 0x4019c0, 18);
305 gr_def(ctx, 0x4019c0 + (i * 4), 0x88888888);
308 cp_ctx(ctx, 0x401a08, 8);
309 gr_def(ctx, 0x401a10, 0x0fff0000);
310 gr_def(ctx, 0x401a14, 0x0fff0000);
311 gr_def(ctx, 0x401a1c, 0x00011100);
312 cp_ctx(ctx, 0x401a2c, 4);
313 cp_ctx(ctx, 0x401a44, 26);
315 gr_def(ctx, 0x401a44 + (i * 4), 0x07ff0000);
316 gr_def(ctx, 0x401a8c, 0x4b7fffff);
318 cp_ctx(ctx, 0x401ab8, 3);
320 cp_ctx(ctx, 0x401ab8, 1);
321 cp_ctx(ctx, 0x401ac0, 1);
323 cp_ctx(ctx, 0x401ad0, 8);
324 gr_def(ctx, 0x401ad0, 0x30201000);
325 gr_def(ctx, 0x401ad4, 0x70605040);
326 gr_def(ctx, 0x401ad8, 0xb8a89888);
327 gr_def(ctx, 0x401adc, 0xf8e8d8c8);
328 cp_ctx(ctx, 0x401b10, device->chipset == 0x40 ? 2 : 1);
329 gr_def(ctx, 0x401b10, 0x40100000);
330 cp_ctx(ctx, 0x401b18, device->chipset == 0x40 ? 6 : 5);
331 gr_def(ctx, 0x401b28, device->chipset == 0x40 ?
333 cp_ctx(ctx, 0x401b30, 25);
334 gr_def(ctx, 0x401b34, 0x0000ffff);
335 gr_def(ctx, 0x401b68, 0x435185d6);
336 gr_def(ctx, 0x401b6c, 0x2155b699);
337 gr_def(ctx, 0x401b70, 0xfedcba98);
338 gr_def(ctx, 0x401b74, 0x00000098);
339 gr_def(ctx, 0x401b84, 0xffffffff);
340 gr_def(ctx, 0x401b88, 0x00ff7000);
341 gr_def(ctx, 0x401b8c, 0x0000ffff);
344 cp_ctx(ctx, 0x401b94, 1);
345 cp_ctx(ctx, 0x401b98, 8);
346 gr_def(ctx, 0x401b9c, 0x00ff0000);
347 cp_ctx(ctx, 0x401bc0, 9);
348 gr_def(ctx, 0x401be0, 0x00ffff00);
349 cp_ctx(ctx, 0x401c00, 192);
351 gr_def(ctx, 0x401c40 + (i * 4), 0x00018488);
352 gr_def(ctx, 0x401c80 + (i * 4), 0x00028202);
353 gr_def(ctx, 0x401d00 + (i * 4), 0x0000aae4);
354 gr_def(ctx, 0x401d40 + (i * 4), 0x01012000);
355 gr_def(ctx, 0x401d80 + (i * 4), 0x00080008);
356 gr_def(ctx, 0x401e00 + (i * 4), 0x00100008);
359 gr_def(ctx, 0x401e90 + (i * 4), 0x0001bc80);
360 gr_def(ctx, 0x401ea0 + (i * 4), 0x00000202);
361 gr_def(ctx, 0x401ec0 + (i * 4), 0x00000008);
362 gr_def(ctx, 0x401ee0 + (i * 4), 0x00080008);
364 cp_ctx(ctx, 0x400f5c, 3);
365 gr_def(ctx, 0x400f5c, 0x00000002);
366 cp_ctx(ctx, 0x400f84, 1);
370 nv40_gr_construct_state3d_2(struct nvkm_grctx *ctx)
372 struct nvkm_device *device = ctx->device;
375 cp_ctx(ctx, 0x402000, 1);
376 cp_ctx(ctx, 0x402404, device->chipset == 0x40 ? 1 : 2);
379 gr_def(ctx, 0x402404, 0x00000001);
384 gr_def(ctx, 0x402404, 0x00000020);
389 gr_def(ctx, 0x402404, 0x00000421);
392 gr_def(ctx, 0x402404, 0x00000021);
395 gr_def(ctx, 0x402408, 0x030c30c3);
403 cp_ctx(ctx, 0x402440, 1);
404 gr_def(ctx, 0x402440, 0x00011001);
409 cp_ctx(ctx, 0x402480, device->chipset == 0x40 ? 8 : 9);
410 gr_def(ctx, 0x402488, 0x3e020200);
411 gr_def(ctx, 0x40248c, 0x00ffffff);
414 gr_def(ctx, 0x402490, 0x60103f00);
417 gr_def(ctx, 0x402490, 0x40103f00);
423 gr_def(ctx, 0x402490, 0x20103f00);
426 gr_def(ctx, 0x402490, 0x0c103f00);
429 gr_def(ctx, 0x40249c, device->chipset <= 0x43 ?
431 cp_ctx(ctx, 0x402500, 31);
432 gr_def(ctx, 0x402530, 0x00008100);
434 cp_ctx(ctx, 0x40257c, 6);
435 cp_ctx(ctx, 0x402594, 16);
436 cp_ctx(ctx, 0x402800, 17);
437 gr_def(ctx, 0x402800, 0x00000001);
442 cp_ctx(ctx, 0x402864, 1);
443 gr_def(ctx, 0x402864, 0x00001001);
444 cp_ctx(ctx, 0x402870, 3);
445 gr_def(ctx, 0x402878, 0x00000003);
447 cp_ctx(ctx, 0x402900, 1);
448 cp_ctx(ctx, 0x402940, 1);
449 cp_ctx(ctx, 0x402980, 1);
450 cp_ctx(ctx, 0x4029c0, 1);
451 cp_ctx(ctx, 0x402a00, 1);
452 cp_ctx(ctx, 0x402a40, 1);
453 cp_ctx(ctx, 0x402a80, 1);
454 cp_ctx(ctx, 0x402ac0, 1);
458 cp_ctx(ctx, 0x402844, 1);
459 gr_def(ctx, 0x402844, 0x00000001);
460 cp_ctx(ctx, 0x402850, 1);
463 cp_ctx(ctx, 0x402844, 1);
464 gr_def(ctx, 0x402844, 0x00001001);
465 cp_ctx(ctx, 0x402850, 2);
466 gr_def(ctx, 0x402854, 0x00000003);
470 cp_ctx(ctx, 0x402c00, 4);
471 gr_def(ctx, 0x402c00, device->chipset == 0x40 ?
477 cp_ctx(ctx, 0x402c20, 40);
479 gr_def(ctx, 0x402c40 + (i * 4), 0xffffffff);
480 cp_ctx(ctx, 0x4030b8, 13);
481 gr_def(ctx, 0x4030dc, 0x00000005);
482 gr_def(ctx, 0x4030e8, 0x0000ffff);
485 cp_ctx(ctx, 0x402c10, 4);
487 cp_ctx(ctx, 0x402c20, 36);
490 cp_ctx(ctx, 0x402c20, 24);
493 cp_ctx(ctx, 0x402c20, 16);
495 cp_ctx(ctx, 0x402c20, 8);
496 cp_ctx(ctx, 0x402cb0, device->chipset == 0x40 ? 12 : 13);
497 gr_def(ctx, 0x402cd4, 0x00000005);
499 gr_def(ctx, 0x402ce0, 0x0000ffff);
503 cp_ctx(ctx, 0x403400, device->chipset == 0x40 ? 4 : 3);
504 cp_ctx(ctx, 0x403410, device->chipset == 0x40 ? 4 : 3);
505 cp_ctx(ctx, 0x403420, nv40_gr_vs_count(ctx->device));
506 for (i = 0; i < nv40_gr_vs_count(ctx->device); i++)
507 gr_def(ctx, 0x403420 + (i * 4), 0x00005555);
510 cp_ctx(ctx, 0x403600, 1);
511 gr_def(ctx, 0x403600, 0x00000001);
513 cp_ctx(ctx, 0x403800, 1);
515 cp_ctx(ctx, 0x403c18, 1);
516 gr_def(ctx, 0x403c18, 0x00000001);
522 cp_ctx(ctx, 0x405018, 1);
523 gr_def(ctx, 0x405018, 0x08e00001);
524 cp_ctx(ctx, 0x405c24, 1);
525 gr_def(ctx, 0x405c24, 0x000e3000);
529 cp_ctx(ctx, 0x405800, 11);
530 cp_ctx(ctx, 0x407000, 1);
534 nv40_gr_construct_state3d_3(struct nvkm_grctx *ctx)
536 int len = nv44_gr_class(ctx->device) ? 0x0084 : 0x0684;
538 cp_out (ctx, 0x300000);
539 cp_lsr (ctx, len - 4);
540 cp_bra (ctx, SWAP_DIRECTION, SAVE, cp_swap_state3d_3_is_save);
541 cp_lsr (ctx, len);
542 cp_name(ctx, cp_swap_state3d_3_is_save);
543 cp_out (ctx, 0x800001);
545 ctx->ctxvals_pos += len;
549 nv40_gr_construct_shader(struct nvkm_grctx *ctx)
551 struct nvkm_device *device = ctx->device;
552 struct nvkm_gpuobj *obj = ctx->data;
556 vs_nr = nv40_gr_vs_count(ctx->device);
574 cp_lsr(ctx, vs_len * vs_nr + 0x300/4);
575 cp_out(ctx, nv44_gr_class(device) ? 0x800029 : 0x800041);
577 offset = ctx->ctxvals_pos;
578 ctx->ctxvals_pos += (0x0300/4 + (vs_nr * vs_len));
580 if (ctx->mode != NVKM_GRCTX_VALS)
596 nv40_grctx_generate(struct nvkm_grctx *ctx)
599 cp_bra (ctx, AUTO_SAVE, PENDING, cp_setup_save);
600 cp_bra (ctx, USER_SAVE, PENDING, cp_setup_save);
602 cp_name(ctx, cp_check_load);
603 cp_bra (ctx, AUTO_LOAD, PENDING, cp_setup_auto_load);
604 cp_bra (ctx, USER_LOAD, PENDING, cp_setup_load);
605 cp_bra (ctx, ALWAYS, TRUE, cp_exit);
608 cp_name(ctx, cp_setup_auto_load);
609 cp_wait(ctx, STATUS, IDLE);
610 cp_out (ctx, CP_NEXT_TO_SWAP);
611 cp_name(ctx, cp_setup_load);
612 cp_wait(ctx, STATUS, IDLE);
613 cp_set (ctx, SWAP_DIRECTION, LOAD);
614 cp_out (ctx, 0x00910880); /* ?? */
615 cp_out (ctx, 0x00901ffe); /* ?? */
616 cp_out (ctx, 0x01940000); /* ?? */
617 cp_lsr (ctx, 0x20);
618 cp_out (ctx, 0x0060000b); /* ?? */
619 cp_wait(ctx, UNK57, CLEAR);
620 cp_out (ctx, 0x0060000c); /* ?? */
621 cp_bra (ctx, ALWAYS, TRUE, cp_swap_state);
624 cp_name(ctx, cp_setup_save);
625 cp_set (ctx, SWAP_DIRECTION, SAVE);
628 cp_name(ctx, cp_swap_state);
629 cp_pos (ctx, 0x00020/4);
630 nv40_gr_construct_general(ctx);
631 cp_wait(ctx, STATUS, IDLE);
634 cp_bra (ctx, UNK54, CLEAR, cp_prepare_exit);
635 nv40_gr_construct_state3d(ctx);
636 cp_wait(ctx, STATUS, IDLE);
639 nv40_gr_construct_state3d_2(ctx);
642 nv40_gr_construct_state3d_3(ctx);
645 cp_pos (ctx, ctx->ctxvals_pos);
646 nv40_gr_construct_shader(ctx);
649 cp_name(ctx, cp_prepare_exit);
650 cp_bra (ctx, SWAP_DIRECTION, SAVE, cp_check_load);
651 cp_bra (ctx, USER_SAVE, PENDING, cp_exit);
652 cp_out (ctx, CP_NEXT_TO_CURRENT);
654 cp_name(ctx, cp_exit);
655 cp_set (ctx, USER_SAVE, NOT_PENDING);
656 cp_set (ctx, USER_LOAD, NOT_PENDING);
657 cp_out (ctx, CP_END);
674 struct nvkm_grctx ctx = {
684 nv40_grctx_generate(&ctx);
687 for (i = 0; i < ctx.ctxprog_len; i++)
689 *size = ctx.ctxvals_pos * 4;