diff options
author | Marcin KoĆcielnicki <koriakin@0x04.net> | 2010-09-01 01:41:24 -0400 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2010-09-24 02:24:00 -0400 |
commit | e69b4418825c2e4c6563ae1d69bd75377826e263 (patch) | |
tree | 1a038d5471af35dddab358b51b0086d7d7b9e1de /drivers/gpu/drm/nouveau/nv50_grctx.c | |
parent | 2941482ead0b02c9efd81fc3862be3ebfce607a5 (diff) |
drm/nv50: demagic grctx, and add NVAF support
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Marcin KoĆcielnicki <koriakin@0x04.net>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nv50_grctx.c')
-rw-r--r-- | drivers/gpu/drm/nouveau/nv50_grctx.c | 3305 |
1 files changed, 2123 insertions, 1182 deletions
diff --git a/drivers/gpu/drm/nouveau/nv50_grctx.c b/drivers/gpu/drm/nouveau/nv50_grctx.c index ba6c033c8c95..336aab2a24a6 100644 --- a/drivers/gpu/drm/nouveau/nv50_grctx.c +++ b/drivers/gpu/drm/nouveau/nv50_grctx.c | |||
@@ -103,6 +103,9 @@ | |||
103 | #include "nouveau_drv.h" | 103 | #include "nouveau_drv.h" |
104 | #include "nouveau_grctx.h" | 104 | #include "nouveau_grctx.h" |
105 | 105 | ||
106 | #define IS_NVA3F(x) (((x) > 0xa0 && (x) < 0xaa) || (x) == 0xaf) | ||
107 | #define IS_NVAAF(x) ((x) >= 0xaa && (x) <= 0xac) | ||
108 | |||
106 | /* | 109 | /* |
107 | * This code deals with PGRAPH contexts on NV50 family cards. Like NV40, it's | 110 | * This code deals with PGRAPH contexts on NV50 family cards. Like NV40, it's |
108 | * the GPU itself that does context-switching, but it needs a special | 111 | * the GPU itself that does context-switching, but it needs a special |
@@ -182,6 +185,7 @@ nv50_grctx_init(struct nouveau_grctx *ctx) | |||
182 | case 0xa8: | 185 | case 0xa8: |
183 | case 0xaa: | 186 | case 0xaa: |
184 | case 0xac: | 187 | case 0xac: |
188 | case 0xaf: | ||
185 | break; | 189 | break; |
186 | default: | 190 | default: |
187 | NV_ERROR(ctx->dev, "I don't know how to make a ctxprog for " | 191 | NV_ERROR(ctx->dev, "I don't know how to make a ctxprog for " |
@@ -268,6 +272,9 @@ nv50_grctx_init(struct nouveau_grctx *ctx) | |||
268 | */ | 272 | */ |
269 | 273 | ||
270 | static void | 274 | static void |
275 | nv50_graph_construct_mmio_ddata(struct nouveau_grctx *ctx); | ||
276 | |||
277 | static void | ||
271 | nv50_graph_construct_mmio(struct nouveau_grctx *ctx) | 278 | nv50_graph_construct_mmio(struct nouveau_grctx *ctx) |
272 | { | 279 | { |
273 | struct drm_nouveau_private *dev_priv = ctx->dev->dev_private; | 280 | struct drm_nouveau_private *dev_priv = ctx->dev->dev_private; |
@@ -286,7 +293,7 @@ nv50_graph_construct_mmio(struct nouveau_grctx *ctx) | |||
286 | gr_def(ctx, 0x400840, 0xffe806a8); | 293 | gr_def(ctx, 0x400840, 0xffe806a8); |
287 | } | 294 | } |
288 | gr_def(ctx, 0x400844, 0x00000002); | 295 | gr_def(ctx, 0x400844, 0x00000002); |
289 | if (dev_priv->chipset > 0xa0 && dev_priv->chipset < 0xaa) | 296 | if (IS_NVA3F(dev_priv->chipset)) |
290 | gr_def(ctx, 0x400894, 0x00001000); | 297 | gr_def(ctx, 0x400894, 0x00001000); |
291 | gr_def(ctx, 0x4008e8, 0x00000003); | 298 | gr_def(ctx, 0x4008e8, 0x00000003); |
292 | gr_def(ctx, 0x4008ec, 0x00001000); | 299 | gr_def(ctx, 0x4008ec, 0x00001000); |
@@ -299,13 +306,15 @@ nv50_graph_construct_mmio(struct nouveau_grctx *ctx) | |||
299 | 306 | ||
300 | if (dev_priv->chipset >= 0xa0) | 307 | if (dev_priv->chipset >= 0xa0) |
301 | cp_ctx(ctx, 0x400b00, 0x1); | 308 | cp_ctx(ctx, 0x400b00, 0x1); |
302 | if (dev_priv->chipset > 0xa0 && dev_priv->chipset < 0xaa) { | 309 | if (IS_NVA3F(dev_priv->chipset)) { |
303 | cp_ctx(ctx, 0x400b10, 0x1); | 310 | cp_ctx(ctx, 0x400b10, 0x1); |
304 | gr_def(ctx, 0x400b10, 0x0001629d); | 311 | gr_def(ctx, 0x400b10, 0x0001629d); |
305 | cp_ctx(ctx, 0x400b20, 0x1); | 312 | cp_ctx(ctx, 0x400b20, 0x1); |
306 | gr_def(ctx, 0x400b20, 0x0001629d); | 313 | gr_def(ctx, 0x400b20, 0x0001629d); |
307 | } | 314 | } |
308 | 315 | ||
316 | nv50_graph_construct_mmio_ddata(ctx); | ||
317 | |||
309 | /* 0C00: VFETCH */ | 318 | /* 0C00: VFETCH */ |
310 | cp_ctx(ctx, 0x400c08, 0x2); | 319 | cp_ctx(ctx, 0x400c08, 0x2); |
311 | gr_def(ctx, 0x400c08, 0x0000fe0c); | 320 | gr_def(ctx, 0x400c08, 0x0000fe0c); |
@@ -314,7 +323,7 @@ nv50_graph_construct_mmio(struct nouveau_grctx *ctx) | |||
314 | if (dev_priv->chipset < 0xa0) { | 323 | if (dev_priv->chipset < 0xa0) { |
315 | cp_ctx(ctx, 0x401008, 0x4); | 324 | cp_ctx(ctx, 0x401008, 0x4); |
316 | gr_def(ctx, 0x401014, 0x00001000); | 325 | gr_def(ctx, 0x401014, 0x00001000); |
317 | } else if (dev_priv->chipset == 0xa0 || dev_priv->chipset >= 0xaa) { | 326 | } else if (!IS_NVA3F(dev_priv->chipset)) { |
318 | cp_ctx(ctx, 0x401008, 0x5); | 327 | cp_ctx(ctx, 0x401008, 0x5); |
319 | gr_def(ctx, 0x401018, 0x00001000); | 328 | gr_def(ctx, 0x401018, 0x00001000); |
320 | } else { | 329 | } else { |
@@ -368,10 +377,13 @@ nv50_graph_construct_mmio(struct nouveau_grctx *ctx) | |||
368 | case 0xa3: | 377 | case 0xa3: |
369 | case 0xa5: | 378 | case 0xa5: |
370 | case 0xa8: | 379 | case 0xa8: |
380 | case 0xaf: | ||
371 | gr_def(ctx, 0x401c00, 0x142500df); | 381 | gr_def(ctx, 0x401c00, 0x142500df); |
372 | break; | 382 | break; |
373 | } | 383 | } |
374 | 384 | ||
385 | /* 2000 */ | ||
386 | |||
375 | /* 2400 */ | 387 | /* 2400 */ |
376 | cp_ctx(ctx, 0x402400, 0x1); | 388 | cp_ctx(ctx, 0x402400, 0x1); |
377 | if (dev_priv->chipset == 0x50) | 389 | if (dev_priv->chipset == 0x50) |
@@ -380,12 +392,12 @@ nv50_graph_construct_mmio(struct nouveau_grctx *ctx) | |||
380 | cp_ctx(ctx, 0x402408, 0x2); | 392 | cp_ctx(ctx, 0x402408, 0x2); |
381 | gr_def(ctx, 0x402408, 0x00000600); | 393 | gr_def(ctx, 0x402408, 0x00000600); |
382 | 394 | ||
383 | /* 2800 */ | 395 | /* 2800: CSCHED */ |
384 | cp_ctx(ctx, 0x402800, 0x1); | 396 | cp_ctx(ctx, 0x402800, 0x1); |
385 | if (dev_priv->chipset == 0x50) | 397 | if (dev_priv->chipset == 0x50) |
386 | gr_def(ctx, 0x402800, 0x00000006); | 398 | gr_def(ctx, 0x402800, 0x00000006); |
387 | 399 | ||
388 | /* 2C00 */ | 400 | /* 2C00: ZCULL */ |
389 | cp_ctx(ctx, 0x402c08, 0x6); | 401 | cp_ctx(ctx, 0x402c08, 0x6); |
390 | if (dev_priv->chipset != 0x50) | 402 | if (dev_priv->chipset != 0x50) |
391 | gr_def(ctx, 0x402c14, 0x01000000); | 403 | gr_def(ctx, 0x402c14, 0x01000000); |
@@ -396,23 +408,23 @@ nv50_graph_construct_mmio(struct nouveau_grctx *ctx) | |||
396 | cp_ctx(ctx, 0x402ca0, 0x2); | 408 | cp_ctx(ctx, 0x402ca0, 0x2); |
397 | if (dev_priv->chipset < 0xa0) | 409 | if (dev_priv->chipset < 0xa0) |
398 | gr_def(ctx, 0x402ca0, 0x00000400); | 410 | gr_def(ctx, 0x402ca0, 0x00000400); |
399 | else if (dev_priv->chipset == 0xa0 || dev_priv->chipset >= 0xaa) | 411 | else if (!IS_NVA3F(dev_priv->chipset)) |
400 | gr_def(ctx, 0x402ca0, 0x00000800); | 412 | gr_def(ctx, 0x402ca0, 0x00000800); |
401 | else | 413 | else |
402 | gr_def(ctx, 0x402ca0, 0x00000400); | 414 | gr_def(ctx, 0x402ca0, 0x00000400); |
403 | cp_ctx(ctx, 0x402cac, 0x4); | 415 | cp_ctx(ctx, 0x402cac, 0x4); |
404 | 416 | ||
405 | /* 3000 */ | 417 | /* 3000: ENG2D */ |
406 | cp_ctx(ctx, 0x403004, 0x1); | 418 | cp_ctx(ctx, 0x403004, 0x1); |
407 | gr_def(ctx, 0x403004, 0x00000001); | 419 | gr_def(ctx, 0x403004, 0x00000001); |
408 | 420 | ||
409 | /* 3404 */ | 421 | /* 3400 */ |
410 | if (dev_priv->chipset >= 0xa0) { | 422 | if (dev_priv->chipset >= 0xa0) { |
411 | cp_ctx(ctx, 0x403404, 0x1); | 423 | cp_ctx(ctx, 0x403404, 0x1); |
412 | gr_def(ctx, 0x403404, 0x00000001); | 424 | gr_def(ctx, 0x403404, 0x00000001); |
413 | } | 425 | } |
414 | 426 | ||
415 | /* 5000 */ | 427 | /* 5000: CCACHE */ |
416 | cp_ctx(ctx, 0x405000, 0x1); | 428 | cp_ctx(ctx, 0x405000, 0x1); |
417 | switch (dev_priv->chipset) { | 429 | switch (dev_priv->chipset) { |
418 | case 0x50: | 430 | case 0x50: |
@@ -425,6 +437,7 @@ nv50_graph_construct_mmio(struct nouveau_grctx *ctx) | |||
425 | case 0xa8: | 437 | case 0xa8: |
426 | case 0xaa: | 438 | case 0xaa: |
427 | case 0xac: | 439 | case 0xac: |
440 | case 0xaf: | ||
428 | gr_def(ctx, 0x405000, 0x000e0080); | 441 | gr_def(ctx, 0x405000, 0x000e0080); |
429 | break; | 442 | break; |
430 | case 0x86: | 443 | case 0x86: |
@@ -441,210 +454,6 @@ nv50_graph_construct_mmio(struct nouveau_grctx *ctx) | |||
441 | cp_ctx(ctx, 0x405024, 0x1); | 454 | cp_ctx(ctx, 0x405024, 0x1); |
442 | cp_ctx(ctx, 0x40502c, 0x1); | 455 | cp_ctx(ctx, 0x40502c, 0x1); |
443 | 456 | ||
444 | /* 5400 or maybe 4800 */ | ||
445 | if (dev_priv->chipset == 0x50) { | ||
446 | offset = 0x405400; | ||
447 | cp_ctx(ctx, 0x405400, 0xea); | ||
448 | } else if (dev_priv->chipset < 0x94) { | ||
449 | offset = 0x405400; | ||
450 | cp_ctx(ctx, 0x405400, 0xcb); | ||
451 | } else if (dev_priv->chipset < 0xa0) { | ||
452 | offset = 0x405400; | ||
453 | cp_ctx(ctx, 0x405400, 0xcc); | ||
454 | } else if (dev_priv->chipset > 0xa0 && dev_priv->chipset < 0xaa) { | ||
455 | offset = 0x404800; | ||
456 | cp_ctx(ctx, 0x404800, 0xda); | ||
457 | } else { | ||
458 | offset = 0x405400; | ||
459 | cp_ctx(ctx, 0x405400, 0xd4); | ||
460 | } | ||
461 | gr_def(ctx, offset + 0x0c, 0x00000002); | ||
462 | gr_def(ctx, offset + 0x10, 0x00000001); | ||
463 | if (dev_priv->chipset >= 0x94) | ||
464 | offset += 4; | ||
465 | gr_def(ctx, offset + 0x1c, 0x00000001); | ||
466 | gr_def(ctx, offset + 0x20, 0x00000100); | ||
467 | gr_def(ctx, offset + 0x38, 0x00000002); | ||
468 | gr_def(ctx, offset + 0x3c, 0x00000001); | ||
469 | gr_def(ctx, offset + 0x40, 0x00000001); | ||
470 | gr_def(ctx, offset + 0x50, 0x00000001); | ||
471 | gr_def(ctx, offset + 0x54, 0x003fffff); | ||
472 | gr_def(ctx, offset + 0x58, 0x00001fff); | ||
473 | gr_def(ctx, offset + 0x60, 0x00000001); | ||
474 | gr_def(ctx, offset + 0x64, 0x00000001); | ||
475 | gr_def(ctx, offset + 0x6c, 0x00000001); | ||
476 | gr_def(ctx, offset + 0x70, 0x00000001); | ||
477 | gr_def(ctx, offset + 0x74, 0x00000001); | ||
478 | gr_def(ctx, offset + 0x78, 0x00000004); | ||
479 | gr_def(ctx, offset + 0x7c, 0x00000001); | ||
480 | if (dev_priv->chipset > 0xa0 && dev_priv->chipset < 0xaa) | ||
481 | offset += 4; | ||
482 | gr_def(ctx, offset + 0x80, 0x00000001); | ||
483 | gr_def(ctx, offset + 0x84, 0x00000001); | ||
484 | gr_def(ctx, offset + 0x88, 0x00000007); | ||
485 | gr_def(ctx, offset + 0x8c, 0x00000001); | ||
486 | gr_def(ctx, offset + 0x90, 0x00000007); | ||
487 | gr_def(ctx, offset + 0x94, 0x00000001); | ||
488 | gr_def(ctx, offset + 0x98, 0x00000001); | ||
489 | gr_def(ctx, offset + 0x9c, 0x00000001); | ||
490 | if (dev_priv->chipset == 0x50) { | ||
491 | gr_def(ctx, offset + 0xb0, 0x00000001); | ||
492 | gr_def(ctx, offset + 0xb4, 0x00000001); | ||
493 | gr_def(ctx, offset + 0xbc, 0x00000001); | ||
494 | gr_def(ctx, offset + 0xc0, 0x0000000a); | ||
495 | gr_def(ctx, offset + 0xd0, 0x00000040); | ||
496 | gr_def(ctx, offset + 0xd8, 0x00000002); | ||
497 | gr_def(ctx, offset + 0xdc, 0x00000100); | ||
498 | gr_def(ctx, offset + 0xe0, 0x00000001); | ||
499 | gr_def(ctx, offset + 0xe4, 0x00000100); | ||
500 | gr_def(ctx, offset + 0x100, 0x00000001); | ||
501 | gr_def(ctx, offset + 0x124, 0x00000004); | ||
502 | gr_def(ctx, offset + 0x13c, 0x00000001); | ||
503 | gr_def(ctx, offset + 0x140, 0x00000100); | ||
504 | gr_def(ctx, offset + 0x148, 0x00000001); | ||
505 | gr_def(ctx, offset + 0x154, 0x00000100); | ||
506 | gr_def(ctx, offset + 0x158, 0x00000001); | ||
507 | gr_def(ctx, offset + 0x15c, 0x00000100); | ||
508 | gr_def(ctx, offset + 0x164, 0x00000001); | ||
509 | gr_def(ctx, offset + 0x170, 0x00000100); | ||
510 | gr_def(ctx, offset + 0x174, 0x00000001); | ||
511 | gr_def(ctx, offset + 0x17c, 0x00000001); | ||
512 | gr_def(ctx, offset + 0x188, 0x00000002); | ||
513 | gr_def(ctx, offset + 0x190, 0x00000001); | ||
514 | gr_def(ctx, offset + 0x198, 0x00000001); | ||
515 | gr_def(ctx, offset + 0x1ac, 0x00000003); | ||
516 | offset += 0xd0; | ||
517 | } else { | ||
518 | gr_def(ctx, offset + 0xb0, 0x00000001); | ||
519 | gr_def(ctx, offset + 0xb4, 0x00000100); | ||
520 | gr_def(ctx, offset + 0xbc, 0x00000001); | ||
521 | gr_def(ctx, offset + 0xc8, 0x00000100); | ||
522 | gr_def(ctx, offset + 0xcc, 0x00000001); | ||
523 | gr_def(ctx, offset + 0xd0, 0x00000100); | ||
524 | gr_def(ctx, offset + 0xd8, 0x00000001); | ||
525 | gr_def(ctx, offset + 0xe4, 0x00000100); | ||
526 | } | ||
527 | gr_def(ctx, offset + 0xf8, 0x00000004); | ||
528 | gr_def(ctx, offset + 0xfc, 0x00000070); | ||
529 | gr_def(ctx, offset + 0x100, 0x00000080); | ||
530 | if (dev_priv->chipset > 0xa0 && dev_priv->chipset < 0xaa) | ||
531 | offset += 4; | ||
532 | gr_def(ctx, offset + 0x114, 0x0000000c); | ||
533 | if (dev_priv->chipset == 0x50) | ||
534 | offset -= 4; | ||
535 | gr_def(ctx, offset + 0x11c, 0x00000008); | ||
536 | gr_def(ctx, offset + 0x120, 0x00000014); | ||
537 | if (dev_priv->chipset == 0x50) { | ||
538 | gr_def(ctx, offset + 0x124, 0x00000026); | ||
539 | offset -= 0x18; | ||
540 | } else { | ||
541 | gr_def(ctx, offset + 0x128, 0x00000029); | ||
542 | gr_def(ctx, offset + 0x12c, 0x00000027); | ||
543 | gr_def(ctx, offset + 0x130, 0x00000026); | ||
544 | gr_def(ctx, offset + 0x134, 0x00000008); | ||
545 | gr_def(ctx, offset + 0x138, 0x00000004); | ||
546 | gr_def(ctx, offset + 0x13c, 0x00000027); | ||
547 | } | ||
548 | gr_def(ctx, offset + 0x148, 0x00000001); | ||
549 | gr_def(ctx, offset + 0x14c, 0x00000002); | ||
550 | gr_def(ctx, offset + 0x150, 0x00000003); | ||
551 | gr_def(ctx, offset + 0x154, 0x00000004); | ||
552 | gr_def(ctx, offset + 0x158, 0x00000005); | ||
553 | gr_def(ctx, offset + 0x15c, 0x00000006); | ||
554 | gr_def(ctx, offset + 0x160, 0x00000007); | ||
555 | gr_def(ctx, offset + 0x164, 0x00000001); | ||
556 | gr_def(ctx, offset + 0x1a8, 0x000000cf); | ||
557 | if (dev_priv->chipset == 0x50) | ||
558 | offset -= 4; | ||
559 | gr_def(ctx, offset + 0x1d8, 0x00000080); | ||
560 | gr_def(ctx, offset + 0x1dc, 0x00000004); | ||
561 | gr_def(ctx, offset + 0x1e0, 0x00000004); | ||
562 | if (dev_priv->chipset == 0x50) | ||
563 | offset -= 4; | ||
564 | else | ||
565 | gr_def(ctx, offset + 0x1e4, 0x00000003); | ||
566 | if (dev_priv->chipset > 0xa0 && dev_priv->chipset < 0xaa) { | ||
567 | gr_def(ctx, offset + 0x1ec, 0x00000003); | ||
568 | offset += 8; | ||
569 | } | ||
570 | gr_def(ctx, offset + 0x1e8, 0x00000001); | ||
571 | if (dev_priv->chipset == 0x50) | ||
572 | offset -= 4; | ||
573 | gr_def(ctx, offset + 0x1f4, 0x00000012); | ||
574 | gr_def(ctx, offset + 0x1f8, 0x00000010); | ||
575 | gr_def(ctx, offset + 0x1fc, 0x0000000c); | ||
576 | gr_def(ctx, offset + 0x200, 0x00000001); | ||
577 | gr_def(ctx, offset + 0x210, 0x00000004); | ||
578 | gr_def(ctx, offset + 0x214, 0x00000002); | ||
579 | gr_def(ctx, offset + 0x218, 0x00000004); | ||
580 | if (dev_priv->chipset >= 0xa0) | ||
581 | offset += 4; | ||
582 | gr_def(ctx, offset + 0x224, 0x003fffff); | ||
583 | gr_def(ctx, offset + 0x228, 0x00001fff); | ||
584 | if (dev_priv->chipset == 0x50) | ||
585 | offset -= 0x20; | ||
586 | else if (dev_priv->chipset >= 0xa0) { | ||
587 | gr_def(ctx, offset + 0x250, 0x00000001); | ||
588 | gr_def(ctx, offset + 0x254, 0x00000001); | ||
589 | gr_def(ctx, offset + 0x258, 0x00000002); | ||
590 | offset += 0x10; | ||
591 | } | ||
592 | gr_def(ctx, offset + 0x250, 0x00000004); | ||
593 | gr_def(ctx, offset + 0x254, 0x00000014); | ||
594 | gr_def(ctx, offset + 0x258, 0x00000001); | ||
595 | if (dev_priv->chipset > 0xa0 && dev_priv->chipset < 0xaa) | ||
596 | offset += 4; | ||
597 | gr_def(ctx, offset + 0x264, 0x00000002); | ||
598 | if (dev_priv->chipset >= 0xa0) | ||
599 | offset += 8; | ||
600 | gr_def(ctx, offset + 0x270, 0x00000001); | ||
601 | gr_def(ctx, offset + 0x278, 0x00000002); | ||
602 | gr_def(ctx, offset + 0x27c, 0x00001000); | ||
603 | if (dev_priv->chipset == 0x50) | ||
604 | offset -= 0xc; | ||
605 | else { | ||
606 | gr_def(ctx, offset + 0x280, 0x00000e00); | ||
607 | gr_def(ctx, offset + 0x284, 0x00001000); | ||
608 | gr_def(ctx, offset + 0x288, 0x00001e00); | ||
609 | } | ||
610 | gr_def(ctx, offset + 0x290, 0x00000001); | ||
611 | gr_def(ctx, offset + 0x294, 0x00000001); | ||
612 | gr_def(ctx, offset + 0x298, 0x00000001); | ||
613 | gr_def(ctx, offset + 0x29c, 0x00000001); | ||
614 | gr_def(ctx, offset + 0x2a0, 0x00000001); | ||
615 | gr_def(ctx, offset + 0x2b0, 0x00000200); | ||
616 | if (dev_priv->chipset > 0xa0 && dev_priv->chipset < 0xaa) { | ||
617 | gr_def(ctx, offset + 0x2b4, 0x00000200); | ||
618 | offset += 4; | ||
619 | } | ||
620 | if (dev_priv->chipset < 0xa0) { | ||
621 | gr_def(ctx, offset + 0x2b8, 0x00000001); | ||
622 | gr_def(ctx, offset + 0x2bc, 0x00000070); | ||
623 | gr_def(ctx, offset + 0x2c0, 0x00000080); | ||
624 | gr_def(ctx, offset + 0x2cc, 0x00000001); | ||
625 | gr_def(ctx, offset + 0x2d0, 0x00000070); | ||
626 | gr_def(ctx, offset + 0x2d4, 0x00000080); | ||
627 | } else { | ||
628 | gr_def(ctx, offset + 0x2b8, 0x00000001); | ||
629 | gr_def(ctx, offset + 0x2bc, 0x000000f0); | ||
630 | gr_def(ctx, offset + 0x2c0, 0x000000ff); | ||
631 | gr_def(ctx, offset + 0x2cc, 0x00000001); | ||
632 | gr_def(ctx, offset + 0x2d0, 0x000000f0); | ||
633 | gr_def(ctx, offset + 0x2d4, 0x000000ff); | ||
634 | gr_def(ctx, offset + 0x2dc, 0x00000009); | ||
635 | offset += 4; | ||
636 | } | ||
637 | gr_def(ctx, offset + 0x2e4, 0x00000001); | ||
638 | gr_def(ctx, offset + 0x2e8, 0x000000cf); | ||
639 | gr_def(ctx, offset + 0x2f0, 0x00000001); | ||
640 | gr_def(ctx, offset + 0x300, 0x000000cf); | ||
641 | gr_def(ctx, offset + 0x308, 0x00000002); | ||
642 | gr_def(ctx, offset + 0x310, 0x00000001); | ||
643 | gr_def(ctx, offset + 0x318, 0x00000001); | ||
644 | gr_def(ctx, offset + 0x320, 0x000000cf); | ||
645 | gr_def(ctx, offset + 0x324, 0x000000cf); | ||
646 | gr_def(ctx, offset + 0x328, 0x00000001); | ||
647 | |||
648 | /* 6000? */ | 457 | /* 6000? */ |
649 | if (dev_priv->chipset == 0x50) | 458 | if (dev_priv->chipset == 0x50) |
650 | cp_ctx(ctx, 0x4063e0, 0x1); | 459 | cp_ctx(ctx, 0x4063e0, 0x1); |
@@ -661,7 +470,7 @@ nv50_graph_construct_mmio(struct nouveau_grctx *ctx) | |||
661 | gr_def(ctx, 0x406818, 0x00000f80); | 470 | gr_def(ctx, 0x406818, 0x00000f80); |
662 | else | 471 | else |
663 | gr_def(ctx, 0x406818, 0x00001f80); | 472 | gr_def(ctx, 0x406818, 0x00001f80); |
664 | if (dev_priv->chipset > 0xa0 && dev_priv->chipset < 0xaa) | 473 | if (IS_NVA3F(dev_priv->chipset)) |
665 | gr_def(ctx, 0x40681c, 0x00000030); | 474 | gr_def(ctx, 0x40681c, 0x00000030); |
666 | cp_ctx(ctx, 0x406830, 0x3); | 475 | cp_ctx(ctx, 0x406830, 0x3); |
667 | } | 476 | } |
@@ -706,7 +515,7 @@ nv50_graph_construct_mmio(struct nouveau_grctx *ctx) | |||
706 | 515 | ||
707 | if (dev_priv->chipset < 0xa0) | 516 | if (dev_priv->chipset < 0xa0) |
708 | cp_ctx(ctx, 0x407094 + (i<<8), 1); | 517 | cp_ctx(ctx, 0x407094 + (i<<8), 1); |
709 | else if (dev_priv->chipset <= 0xa0 || dev_priv->chipset >= 0xaa) | 518 | else if (!IS_NVA3F(dev_priv->chipset)) |
710 | cp_ctx(ctx, 0x407094 + (i<<8), 3); | 519 | cp_ctx(ctx, 0x407094 + (i<<8), 3); |
711 | else { | 520 | else { |
712 | cp_ctx(ctx, 0x407094 + (i<<8), 4); | 521 | cp_ctx(ctx, 0x407094 + (i<<8), 4); |
@@ -799,6 +608,7 @@ nv50_graph_construct_mmio(struct nouveau_grctx *ctx) | |||
799 | case 0xa8: | 608 | case 0xa8: |
800 | case 0xaa: | 609 | case 0xaa: |
801 | case 0xac: | 610 | case 0xac: |
611 | case 0xaf: | ||
802 | gr_def(ctx, offset + 0x1c, 0x300c0000); | 612 | gr_def(ctx, offset + 0x1c, 0x300c0000); |
803 | break; | 613 | break; |
804 | } | 614 | } |
@@ -825,7 +635,7 @@ nv50_graph_construct_mmio(struct nouveau_grctx *ctx) | |||
825 | gr_def(ctx, base + 0x304, 0x00007070); | 635 | gr_def(ctx, base + 0x304, 0x00007070); |
826 | else if (dev_priv->chipset < 0xa0) | 636 | else if (dev_priv->chipset < 0xa0) |
827 | gr_def(ctx, base + 0x304, 0x00027070); | 637 | gr_def(ctx, base + 0x304, 0x00027070); |
828 | else if (dev_priv->chipset <= 0xa0 || dev_priv->chipset >= 0xaa) | 638 | else if (!IS_NVA3F(dev_priv->chipset)) |
829 | gr_def(ctx, base + 0x304, 0x01127070); | 639 | gr_def(ctx, base + 0x304, 0x01127070); |
830 | else | 640 | else |
831 | gr_def(ctx, base + 0x304, 0x05127070); | 641 | gr_def(ctx, base + 0x304, 0x05127070); |
@@ -849,7 +659,7 @@ nv50_graph_construct_mmio(struct nouveau_grctx *ctx) | |||
849 | if (dev_priv->chipset < 0xa0) { | 659 | if (dev_priv->chipset < 0xa0) { |
850 | cp_ctx(ctx, base + 0x340, 9); | 660 | cp_ctx(ctx, base + 0x340, 9); |
851 | offset = base + 0x340; | 661 | offset = base + 0x340; |
852 | } else if (dev_priv->chipset <= 0xa0 || dev_priv->chipset >= 0xaa) { | 662 | } else if (!IS_NVA3F(dev_priv->chipset)) { |
853 | cp_ctx(ctx, base + 0x33c, 0xb); | 663 | cp_ctx(ctx, base + 0x33c, 0xb); |
854 | offset = base + 0x344; | 664 | offset = base + 0x344; |
855 | } else { | 665 | } else { |
@@ -880,7 +690,7 @@ nv50_graph_construct_mmio(struct nouveau_grctx *ctx) | |||
880 | gr_def(ctx, offset + 0x0, 0x000001f0); | 690 | gr_def(ctx, offset + 0x0, 0x000001f0); |
881 | gr_def(ctx, offset + 0x4, 0x00000001); | 691 | gr_def(ctx, offset + 0x4, 0x00000001); |
882 | gr_def(ctx, offset + 0x8, 0x00000003); | 692 | gr_def(ctx, offset + 0x8, 0x00000003); |
883 | if (dev_priv->chipset == 0x50 || dev_priv->chipset >= 0xaa) | 693 | if (dev_priv->chipset == 0x50 || IS_NVAAF(dev_priv->chipset)) |
884 | gr_def(ctx, offset + 0xc, 0x00008000); | 694 | gr_def(ctx, offset + 0xc, 0x00008000); |
885 | gr_def(ctx, offset + 0x14, 0x00039e00); | 695 | gr_def(ctx, offset + 0x14, 0x00039e00); |
886 | cp_ctx(ctx, offset + 0x1c, 2); | 696 | cp_ctx(ctx, offset + 0x1c, 2); |
@@ -892,7 +702,7 @@ nv50_graph_construct_mmio(struct nouveau_grctx *ctx) | |||
892 | 702 | ||
893 | if (dev_priv->chipset >= 0xa0) { | 703 | if (dev_priv->chipset >= 0xa0) { |
894 | cp_ctx(ctx, base + 0x54c, 2); | 704 | cp_ctx(ctx, base + 0x54c, 2); |
895 | if (dev_priv->chipset <= 0xa0 || dev_priv->chipset >= 0xaa) | 705 | if (!IS_NVA3F(dev_priv->chipset)) |
896 | gr_def(ctx, base + 0x54c, 0x003fe006); | 706 | gr_def(ctx, base + 0x54c, 0x003fe006); |
897 | else | 707 | else |
898 | gr_def(ctx, base + 0x54c, 0x003fe007); | 708 | gr_def(ctx, base + 0x54c, 0x003fe007); |
@@ -948,6 +758,336 @@ nv50_graph_construct_mmio(struct nouveau_grctx *ctx) | |||
948 | } | 758 | } |
949 | } | 759 | } |
950 | 760 | ||
761 | static void | ||
762 | dd_emit(struct nouveau_grctx *ctx, int num, uint32_t val) { | ||
763 | int i; | ||
764 | if (val && ctx->mode == NOUVEAU_GRCTX_VALS) | ||
765 | for (i = 0; i < num; i++) | ||
766 | nv_wo32(ctx->data, 4 * (ctx->ctxvals_pos + i), val); | ||
767 | ctx->ctxvals_pos += num; | ||
768 | } | ||
769 | |||
770 | static void | ||
771 | nv50_graph_construct_mmio_ddata(struct nouveau_grctx *ctx) | ||
772 | { | ||
773 | struct drm_nouveau_private *dev_priv = ctx->dev->dev_private; | ||
774 | int base, num; | ||
775 | base = ctx->ctxvals_pos; | ||
776 | |||
777 | /* tesla state */ | ||
778 | dd_emit(ctx, 1, 0); /* 00000001 UNK0F90 */ | ||
779 | dd_emit(ctx, 1, 0); /* 00000001 UNK135C */ | ||
780 | |||
781 | /* SRC_TIC state */ | ||
782 | dd_emit(ctx, 1, 0); /* 00000007 SRC_TILE_MODE_Z */ | ||
783 | dd_emit(ctx, 1, 2); /* 00000007 SRC_TILE_MODE_Y */ | ||
784 | dd_emit(ctx, 1, 1); /* 00000001 SRC_LINEAR #1 */ | ||
785 | dd_emit(ctx, 1, 0); /* 000000ff SRC_ADDRESS_HIGH */ | ||
786 | dd_emit(ctx, 1, 0); /* 00000001 SRC_SRGB */ | ||
787 | if (dev_priv->chipset >= 0x94) | ||
788 | dd_emit(ctx, 1, 0); /* 00000003 eng2d UNK0258 */ | ||
789 | dd_emit(ctx, 1, 1); /* 00000fff SRC_DEPTH */ | ||
790 | dd_emit(ctx, 1, 0x100); /* 0000ffff SRC_HEIGHT */ | ||
791 | |||
792 | /* turing state */ | ||
793 | dd_emit(ctx, 1, 0); /* 0000000f TEXTURES_LOG2 */ | ||
794 | dd_emit(ctx, 1, 0); /* 0000000f SAMPLERS_LOG2 */ | ||
795 | dd_emit(ctx, 1, 0); /* 000000ff CB_DEF_ADDRESS_HIGH */ | ||
796 | dd_emit(ctx, 1, 0); /* ffffffff CB_DEF_ADDRESS_LOW */ | ||
797 | dd_emit(ctx, 1, 0); /* ffffffff SHARED_SIZE */ | ||
798 | dd_emit(ctx, 1, 2); /* ffffffff REG_MODE */ | ||
799 | dd_emit(ctx, 1, 1); /* 0000ffff BLOCK_ALLOC_THREADS */ | ||
800 | dd_emit(ctx, 1, 1); /* 00000001 LANES32 */ | ||
801 | dd_emit(ctx, 1, 0); /* 000000ff UNK370 */ | ||
802 | dd_emit(ctx, 1, 0); /* 000000ff USER_PARAM_UNK */ | ||
803 | dd_emit(ctx, 1, 0); /* 000000ff USER_PARAM_COUNT */ | ||
804 | dd_emit(ctx, 1, 1); /* 000000ff UNK384 bits 8-15 */ | ||
805 | dd_emit(ctx, 1, 0x3fffff); /* 003fffff TIC_LIMIT */ | ||
806 | dd_emit(ctx, 1, 0x1fff); /* 000fffff TSC_LIMIT */ | ||
807 | dd_emit(ctx, 1, 0); /* 0000ffff CB_ADDR_INDEX */ | ||
808 | dd_emit(ctx, 1, 1); /* 000007ff BLOCKDIM_X */ | ||
809 | dd_emit(ctx, 1, 1); /* 000007ff BLOCKDIM_XMY */ | ||
810 | dd_emit(ctx, 1, 0); /* 00000001 BLOCKDIM_XMY_OVERFLOW */ | ||
811 | dd_emit(ctx, 1, 1); /* 0003ffff BLOCKDIM_XMYMZ */ | ||
812 | dd_emit(ctx, 1, 1); /* 000007ff BLOCKDIM_Y */ | ||
813 | dd_emit(ctx, 1, 1); /* 0000007f BLOCKDIM_Z */ | ||
814 | dd_emit(ctx, 1, 4); /* 000000ff CP_REG_ALLOC_TEMP */ | ||
815 | dd_emit(ctx, 1, 1); /* 00000001 BLOCKDIM_DIRTY */ | ||
816 | if (IS_NVA3F(dev_priv->chipset)) | ||
817 | dd_emit(ctx, 1, 0); /* 00000003 UNK03E8 */ | ||
818 | dd_emit(ctx, 1, 1); /* 0000007f BLOCK_ALLOC_HALFWARPS */ | ||
819 | dd_emit(ctx, 1, 1); /* 00000007 LOCAL_WARPS_NO_CLAMP */ | ||
820 | dd_emit(ctx, 1, 7); /* 00000007 LOCAL_WARPS_LOG_ALLOC */ | ||
821 | dd_emit(ctx, 1, 1); /* 00000007 STACK_WARPS_NO_CLAMP */ | ||
822 | dd_emit(ctx, 1, 7); /* 00000007 STACK_WARPS_LOG_ALLOC */ | ||
823 | dd_emit(ctx, 1, 1); /* 00001fff BLOCK_ALLOC_REGSLOTS_PACKED */ | ||
824 | dd_emit(ctx, 1, 1); /* 00001fff BLOCK_ALLOC_REGSLOTS_STRIDED */ | ||
825 | dd_emit(ctx, 1, 1); /* 000007ff BLOCK_ALLOC_THREADS */ | ||
826 | |||
827 | /* compat 2d state */ | ||
828 | if (dev_priv->chipset == 0x50) { | ||
829 | dd_emit(ctx, 4, 0); /* 0000ffff clip X, Y, W, H */ | ||
830 | |||
831 | dd_emit(ctx, 1, 1); /* ffffffff chroma COLOR_FORMAT */ | ||
832 | |||
833 | dd_emit(ctx, 1, 1); /* ffffffff pattern COLOR_FORMAT */ | ||
834 | dd_emit(ctx, 1, 0); /* ffffffff pattern SHAPE */ | ||
835 | dd_emit(ctx, 1, 1); /* ffffffff pattern PATTERN_SELECT */ | ||
836 | |||
837 | dd_emit(ctx, 1, 0xa); /* ffffffff surf2d SRC_FORMAT */ | ||
838 | dd_emit(ctx, 1, 0); /* ffffffff surf2d DMA_SRC */ | ||
839 | dd_emit(ctx, 1, 0); /* 000000ff surf2d SRC_ADDRESS_HIGH */ | ||
840 | dd_emit(ctx, 1, 0); /* ffffffff surf2d SRC_ADDRESS_LOW */ | ||
841 | dd_emit(ctx, 1, 0x40); /* 0000ffff surf2d SRC_PITCH */ | ||
842 | dd_emit(ctx, 1, 0); /* 0000000f surf2d SRC_TILE_MODE_Z */ | ||
843 | dd_emit(ctx, 1, 2); /* 0000000f surf2d SRC_TILE_MODE_Y */ | ||
844 | dd_emit(ctx, 1, 0x100); /* ffffffff surf2d SRC_HEIGHT */ | ||
845 | dd_emit(ctx, 1, 1); /* 00000001 surf2d SRC_LINEAR */ | ||
846 | dd_emit(ctx, 1, 0x100); /* ffffffff surf2d SRC_WIDTH */ | ||
847 | |||
848 | dd_emit(ctx, 1, 0); /* 0000ffff gdirect CLIP_B_X */ | ||
849 | dd_emit(ctx, 1, 0); /* 0000ffff gdirect CLIP_B_Y */ | ||
850 | dd_emit(ctx, 1, 0); /* 0000ffff gdirect CLIP_C_X */ | ||
851 | dd_emit(ctx, 1, 0); /* 0000ffff gdirect CLIP_C_Y */ | ||
852 | dd_emit(ctx, 1, 0); /* 0000ffff gdirect CLIP_D_X */ | ||
853 | dd_emit(ctx, 1, 0); /* 0000ffff gdirect CLIP_D_Y */ | ||
854 | dd_emit(ctx, 1, 1); /* ffffffff gdirect COLOR_FORMAT */ | ||
855 | dd_emit(ctx, 1, 0); /* ffffffff gdirect OPERATION */ | ||
856 | dd_emit(ctx, 1, 0); /* 0000ffff gdirect POINT_X */ | ||
857 | dd_emit(ctx, 1, 0); /* 0000ffff gdirect POINT_Y */ | ||
858 | |||
859 | dd_emit(ctx, 1, 0); /* 0000ffff blit SRC_Y */ | ||
860 | dd_emit(ctx, 1, 0); /* ffffffff blit OPERATION */ | ||
861 | |||
862 | dd_emit(ctx, 1, 0); /* ffffffff ifc OPERATION */ | ||
863 | |||
864 | dd_emit(ctx, 1, 0); /* ffffffff iifc INDEX_FORMAT */ | ||
865 | dd_emit(ctx, 1, 0); /* ffffffff iifc LUT_OFFSET */ | ||
866 | dd_emit(ctx, 1, 4); /* ffffffff iifc COLOR_FORMAT */ | ||
867 | dd_emit(ctx, 1, 0); /* ffffffff iifc OPERATION */ | ||
868 | } | ||
869 | |||
870 | /* m2mf state */ | ||
871 | dd_emit(ctx, 1, 0); /* ffffffff m2mf LINE_COUNT */ | ||
872 | dd_emit(ctx, 1, 0); /* ffffffff m2mf LINE_LENGTH_IN */ | ||
873 | dd_emit(ctx, 2, 0); /* ffffffff m2mf OFFSET_IN, OFFSET_OUT */ | ||
874 | dd_emit(ctx, 1, 1); /* ffffffff m2mf TILING_DEPTH_OUT */ | ||
875 | dd_emit(ctx, 1, 0x100); /* ffffffff m2mf TILING_HEIGHT_OUT */ | ||
876 | dd_emit(ctx, 1, 0); /* ffffffff m2mf TILING_POSITION_OUT_Z */ | ||
877 | dd_emit(ctx, 1, 1); /* 00000001 m2mf LINEAR_OUT */ | ||
878 | dd_emit(ctx, 2, 0); /* 0000ffff m2mf TILING_POSITION_OUT_X, Y */ | ||
879 | dd_emit(ctx, 1, 0x100); /* ffffffff m2mf TILING_PITCH_OUT */ | ||
880 | dd_emit(ctx, 1, 1); /* ffffffff m2mf TILING_DEPTH_IN */ | ||
881 | dd_emit(ctx, 1, 0x100); /* ffffffff m2mf TILING_HEIGHT_IN */ | ||
882 | dd_emit(ctx, 1, 0); /* ffffffff m2mf TILING_POSITION_IN_Z */ | ||
883 | dd_emit(ctx, 1, 1); /* 00000001 m2mf LINEAR_IN */ | ||
884 | dd_emit(ctx, 2, 0); /* 0000ffff m2mf TILING_POSITION_IN_X, Y */ | ||
885 | dd_emit(ctx, 1, 0x100); /* ffffffff m2mf TILING_PITCH_IN */ | ||
886 | |||
887 | /* more compat 2d state */ | ||
888 | if (dev_priv->chipset == 0x50) { | ||
889 | dd_emit(ctx, 1, 1); /* ffffffff line COLOR_FORMAT */ | ||
890 | dd_emit(ctx, 1, 0); /* ffffffff line OPERATION */ | ||
891 | |||
892 | dd_emit(ctx, 1, 1); /* ffffffff triangle COLOR_FORMAT */ | ||
893 | dd_emit(ctx, 1, 0); /* ffffffff triangle OPERATION */ | ||
894 | |||
895 | dd_emit(ctx, 1, 0); /* 0000000f sifm TILE_MODE_Z */ | ||
896 | dd_emit(ctx, 1, 2); /* 0000000f sifm TILE_MODE_Y */ | ||
897 | dd_emit(ctx, 1, 0); /* 000000ff sifm FORMAT_FILTER */ | ||
898 | dd_emit(ctx, 1, 1); /* 000000ff sifm FORMAT_ORIGIN */ | ||
899 | dd_emit(ctx, 1, 0); /* 0000ffff sifm SRC_PITCH */ | ||
900 | dd_emit(ctx, 1, 1); /* 00000001 sifm SRC_LINEAR */ | ||
901 | dd_emit(ctx, 1, 0); /* 000000ff sifm SRC_OFFSET_HIGH */ | ||
902 | dd_emit(ctx, 1, 0); /* ffffffff sifm SRC_OFFSET */ | ||
903 | dd_emit(ctx, 1, 0); /* 0000ffff sifm SRC_HEIGHT */ | ||
904 | dd_emit(ctx, 1, 0); /* 0000ffff sifm SRC_WIDTH */ | ||
905 | dd_emit(ctx, 1, 3); /* ffffffff sifm COLOR_FORMAT */ | ||
906 | dd_emit(ctx, 1, 0); /* ffffffff sifm OPERATION */ | ||
907 | |||
908 | dd_emit(ctx, 1, 0); /* ffffffff sifc OPERATION */ | ||
909 | } | ||
910 | |||
911 | /* tesla state */ | ||
912 | dd_emit(ctx, 1, 0); /* 0000000f GP_TEXTURES_LOG2 */ | ||
913 | dd_emit(ctx, 1, 0); /* 0000000f GP_SAMPLERS_LOG2 */ | ||
914 | dd_emit(ctx, 1, 0); /* 000000ff */ | ||
915 | dd_emit(ctx, 1, 0); /* ffffffff */ | ||
916 | dd_emit(ctx, 1, 4); /* 000000ff UNK12B0_0 */ | ||
917 | dd_emit(ctx, 1, 0x70); /* 000000ff UNK12B0_1 */ | ||
918 | dd_emit(ctx, 1, 0x80); /* 000000ff UNK12B0_3 */ | ||
919 | dd_emit(ctx, 1, 0); /* 000000ff UNK12B0_2 */ | ||
920 | dd_emit(ctx, 1, 0); /* 0000000f FP_TEXTURES_LOG2 */ | ||
921 | dd_emit(ctx, 1, 0); /* 0000000f FP_SAMPLERS_LOG2 */ | ||
922 | if (IS_NVA3F(dev_priv->chipset)) { | ||
923 | dd_emit(ctx, 1, 0); /* ffffffff */ | ||
924 | dd_emit(ctx, 1, 0); /* 0000007f MULTISAMPLE_SAMPLES_LOG2 */ | ||
925 | } else { | ||
926 | dd_emit(ctx, 1, 0); /* 0000000f MULTISAMPLE_SAMPLES_LOG2 */ | ||
927 | } | ||
928 | dd_emit(ctx, 1, 0xc); /* 000000ff SEMANTIC_COLOR.BFC0_ID */ | ||
929 | if (dev_priv->chipset != 0x50) | ||
930 | dd_emit(ctx, 1, 0); /* 00000001 SEMANTIC_COLOR.CLMP_EN */ | ||
931 | dd_emit(ctx, 1, 8); /* 000000ff SEMANTIC_COLOR.COLR_NR */ | ||
932 | dd_emit(ctx, 1, 0x14); /* 000000ff SEMANTIC_COLOR.FFC0_ID */ | ||
933 | if (dev_priv->chipset == 0x50) { | ||
934 | dd_emit(ctx, 1, 0); /* 000000ff SEMANTIC_LAYER */ | ||
935 | dd_emit(ctx, 1, 0); /* 00000001 */ | ||
936 | } else { | ||
937 | dd_emit(ctx, 1, 0); /* 00000001 SEMANTIC_PTSZ.ENABLE */ | ||
938 | dd_emit(ctx, 1, 0x29); /* 000000ff SEMANTIC_PTSZ.PTSZ_ID */ | ||
939 | dd_emit(ctx, 1, 0x27); /* 000000ff SEMANTIC_PRIM */ | ||
940 | dd_emit(ctx, 1, 0x26); /* 000000ff SEMANTIC_LAYER */ | ||
941 | dd_emit(ctx, 1, 8); /* 0000000f SMENATIC_CLIP.CLIP_HIGH */ | ||
942 | dd_emit(ctx, 1, 4); /* 000000ff SEMANTIC_CLIP.CLIP_LO */ | ||
943 | dd_emit(ctx, 1, 0x27); /* 000000ff UNK0FD4 */ | ||
944 | dd_emit(ctx, 1, 0); /* 00000001 UNK1900 */ | ||
945 | } | ||
946 | dd_emit(ctx, 1, 0); /* 00000007 RT_CONTROL_MAP0 */ | ||
947 | dd_emit(ctx, 1, 1); /* 00000007 RT_CONTROL_MAP1 */ | ||
948 | dd_emit(ctx, 1, 2); /* 00000007 RT_CONTROL_MAP2 */ | ||
949 | dd_emit(ctx, 1, 3); /* 00000007 RT_CONTROL_MAP3 */ | ||
950 | dd_emit(ctx, 1, 4); /* 00000007 RT_CONTROL_MAP4 */ | ||
951 | dd_emit(ctx, 1, 5); /* 00000007 RT_CONTROL_MAP5 */ | ||
952 | dd_emit(ctx, 1, 6); /* 00000007 RT_CONTROL_MAP6 */ | ||
953 | dd_emit(ctx, 1, 7); /* 00000007 RT_CONTROL_MAP7 */ | ||
954 | dd_emit(ctx, 1, 1); /* 0000000f RT_CONTROL_COUNT */ | ||
955 | dd_emit(ctx, 8, 0); /* 00000001 RT_HORIZ_UNK */ | ||
956 | dd_emit(ctx, 8, 0); /* ffffffff RT_ADDRESS_LOW */ | ||
957 | dd_emit(ctx, 1, 0xcf); /* 000000ff RT_FORMAT */ | ||
958 | dd_emit(ctx, 7, 0); /* 000000ff RT_FORMAT */ | ||
959 | if (dev_priv->chipset != 0x50) | ||
960 | dd_emit(ctx, 3, 0); /* 1, 1, 1 */ | ||
961 | else | ||
962 | dd_emit(ctx, 2, 0); /* 1, 1 */ | ||
963 | dd_emit(ctx, 1, 0); /* ffffffff GP_ENABLE */ | ||
964 | dd_emit(ctx, 1, 0x80); /* 0000ffff GP_VERTEX_OUTPUT_COUNT*/ | ||
965 | dd_emit(ctx, 1, 4); /* 000000ff GP_REG_ALLOC_RESULT */ | ||
966 | dd_emit(ctx, 1, 4); /* 000000ff GP_RESULT_MAP_SIZE */ | ||
967 | if (IS_NVA3F(dev_priv->chipset)) { | ||
968 | dd_emit(ctx, 1, 3); /* 00000003 */ | ||
969 | dd_emit(ctx, 1, 0); /* 00000001 UNK1418. Alone. */ | ||
970 | } | ||
971 | if (dev_priv->chipset != 0x50) | ||
972 | dd_emit(ctx, 1, 3); /* 00000003 UNK15AC */ | ||
973 | dd_emit(ctx, 1, 1); /* ffffffff RASTERIZE_ENABLE */ | ||
974 | dd_emit(ctx, 1, 0); /* 00000001 FP_CONTROL.EXPORTS_Z */ | ||
975 | if (dev_priv->chipset != 0x50) | ||
976 | dd_emit(ctx, 1, 0); /* 00000001 FP_CONTROL.MULTIPLE_RESULTS */ | ||
977 | dd_emit(ctx, 1, 0x12); /* 000000ff FP_INTERPOLANT_CTRL.COUNT */ | ||
978 | dd_emit(ctx, 1, 0x10); /* 000000ff FP_INTERPOLANT_CTRL.COUNT_NONFLAT */ | ||
979 | dd_emit(ctx, 1, 0xc); /* 000000ff FP_INTERPOLANT_CTRL.OFFSET */ | ||
980 | dd_emit(ctx, 1, 1); /* 00000001 FP_INTERPOLANT_CTRL.UMASK.W */ | ||
981 | dd_emit(ctx, 1, 0); /* 00000001 FP_INTERPOLANT_CTRL.UMASK.X */ | ||
982 | dd_emit(ctx, 1, 0); /* 00000001 FP_INTERPOLANT_CTRL.UMASK.Y */ | ||
983 | dd_emit(ctx, 1, 0); /* 00000001 FP_INTERPOLANT_CTRL.UMASK.Z */ | ||
984 | dd_emit(ctx, 1, 4); /* 000000ff FP_RESULT_COUNT */ | ||
985 | dd_emit(ctx, 1, 2); /* ffffffff REG_MODE */ | ||
986 | dd_emit(ctx, 1, 4); /* 000000ff FP_REG_ALLOC_TEMP */ | ||
987 | if (dev_priv->chipset >= 0xa0) | ||
988 | dd_emit(ctx, 1, 0); /* ffffffff */ | ||
989 | dd_emit(ctx, 1, 0); /* 00000001 GP_BUILTIN_RESULT_EN.LAYER_IDX */ | ||
990 | dd_emit(ctx, 1, 0); /* ffffffff STRMOUT_ENABLE */ | ||
991 | dd_emit(ctx, 1, 0x3fffff); /* 003fffff TIC_LIMIT */ | ||
992 | dd_emit(ctx, 1, 0x1fff); /* 000fffff TSC_LIMIT */ | ||
993 | dd_emit(ctx, 1, 0); /* 00000001 VERTEX_TWO_SIDE_ENABLE*/ | ||
994 | if (dev_priv->chipset != 0x50) | ||
995 | dd_emit(ctx, 8, 0); /* 00000001 */ | ||
996 | if (dev_priv->chipset >= 0xa0) { | ||
997 | dd_emit(ctx, 1, 1); /* 00000007 VTX_ATTR_DEFINE.COMP */ | ||
998 | dd_emit(ctx, 1, 1); /* 00000007 VTX_ATTR_DEFINE.SIZE */ | ||
999 | dd_emit(ctx, 1, 2); /* 00000007 VTX_ATTR_DEFINE.TYPE */ | ||
1000 | dd_emit(ctx, 1, 0); /* 000000ff VTX_ATTR_DEFINE.ATTR */ | ||
1001 | } | ||
1002 | dd_emit(ctx, 1, 4); /* 0000007f VP_RESULT_MAP_SIZE */ | ||
1003 | dd_emit(ctx, 1, 0x14); /* 0000001f ZETA_FORMAT */ | ||
1004 | dd_emit(ctx, 1, 1); /* 00000001 ZETA_ENABLE */ | ||
1005 | dd_emit(ctx, 1, 0); /* 0000000f VP_TEXTURES_LOG2 */ | ||
1006 | dd_emit(ctx, 1, 0); /* 0000000f VP_SAMPLERS_LOG2 */ | ||
1007 | if (IS_NVA3F(dev_priv->chipset)) | ||
1008 | dd_emit(ctx, 1, 0); /* 00000001 */ | ||
1009 | dd_emit(ctx, 1, 2); /* 00000003 POLYGON_MODE_BACK */ | ||
1010 | if (dev_priv->chipset >= 0xa0) | ||
1011 | dd_emit(ctx, 1, 0); /* 00000003 VTX_ATTR_DEFINE.SIZE - 1 */ | ||
1012 | dd_emit(ctx, 1, 0); /* 0000ffff CB_ADDR_INDEX */ | ||
1013 | if (dev_priv->chipset >= 0xa0) | ||
1014 | dd_emit(ctx, 1, 0); /* 00000003 */ | ||
1015 | dd_emit(ctx, 1, 0); /* 00000001 CULL_FACE_ENABLE */ | ||
1016 | dd_emit(ctx, 1, 1); /* 00000003 CULL_FACE */ | ||
1017 | dd_emit(ctx, 1, 0); /* 00000001 FRONT_FACE */ | ||
1018 | dd_emit(ctx, 1, 2); /* 00000003 POLYGON_MODE_FRONT */ | ||
1019 | dd_emit(ctx, 1, 0x1000); /* 00007fff UNK141C */ | ||
1020 | if (dev_priv->chipset != 0x50) { | ||
1021 | dd_emit(ctx, 1, 0xe00); /* 7fff */ | ||
1022 | dd_emit(ctx, 1, 0x1000); /* 7fff */ | ||
1023 | dd_emit(ctx, 1, 0x1e00); /* 7fff */ | ||
1024 | } | ||
1025 | dd_emit(ctx, 1, 0); /* 00000001 BEGIN_END_ACTIVE */ | ||
1026 | dd_emit(ctx, 1, 1); /* 00000001 POLYGON_MODE_??? */ | ||
1027 | dd_emit(ctx, 1, 1); /* 000000ff GP_REG_ALLOC_TEMP / 4 rounded up */ | ||
1028 | dd_emit(ctx, 1, 1); /* 000000ff FP_REG_ALLOC_TEMP... without /4? */ | ||
1029 | dd_emit(ctx, 1, 1); /* 000000ff VP_REG_ALLOC_TEMP / 4 rounded up */ | ||
1030 | dd_emit(ctx, 1, 1); /* 00000001 */ | ||
1031 | dd_emit(ctx, 1, 0); /* 00000001 */ | ||
1032 | dd_emit(ctx, 1, 0); /* 00000001 VTX_ATTR_MASK_UNK0 nonempty */ | ||
1033 | dd_emit(ctx, 1, 0); /* 00000001 VTX_ATTR_MASK_UNK1 nonempty */ | ||
1034 | dd_emit(ctx, 1, 0x200); /* 0003ffff GP_VERTEX_OUTPUT_COUNT*GP_REG_ALLOC_RESULT */ | ||
1035 | if (IS_NVA3F(dev_priv->chipset)) | ||
1036 | dd_emit(ctx, 1, 0x200); | ||
1037 | dd_emit(ctx, 1, 0); /* 00000001 */ | ||
1038 | if (dev_priv->chipset < 0xa0) { | ||
1039 | dd_emit(ctx, 1, 1); /* 00000001 */ | ||
1040 | dd_emit(ctx, 1, 0x70); /* 000000ff */ | ||
1041 | dd_emit(ctx, 1, 0x80); /* 000000ff */ | ||
1042 | dd_emit(ctx, 1, 0); /* 000000ff */ | ||
1043 | dd_emit(ctx, 1, 0); /* 00000001 */ | ||
1044 | dd_emit(ctx, 1, 1); /* 00000001 */ | ||
1045 | dd_emit(ctx, 1, 0x70); /* 000000ff */ | ||
1046 | dd_emit(ctx, 1, 0x80); /* 000000ff */ | ||
1047 | dd_emit(ctx, 1, 0); /* 000000ff */ | ||
1048 | } else { | ||
1049 | dd_emit(ctx, 1, 1); /* 00000001 */ | ||
1050 | dd_emit(ctx, 1, 0xf0); /* 000000ff */ | ||
1051 | dd_emit(ctx, 1, 0xff); /* 000000ff */ | ||
1052 | dd_emit(ctx, 1, 0); /* 000000ff */ | ||
1053 | dd_emit(ctx, 1, 0); /* 00000001 */ | ||
1054 | dd_emit(ctx, 1, 1); /* 00000001 */ | ||
1055 | dd_emit(ctx, 1, 0xf0); /* 000000ff */ | ||
1056 | dd_emit(ctx, 1, 0xff); /* 000000ff */ | ||
1057 | dd_emit(ctx, 1, 0); /* 000000ff */ | ||
1058 | dd_emit(ctx, 1, 9); /* 0000003f UNK114C.COMP,SIZE */ | ||
1059 | } | ||
1060 | |||
1061 | /* eng2d state */ | ||
1062 | dd_emit(ctx, 1, 0); /* 00000001 eng2d COLOR_KEY_ENABLE */ | ||
1063 | dd_emit(ctx, 1, 0); /* 00000007 eng2d COLOR_KEY_FORMAT */ | ||
1064 | dd_emit(ctx, 1, 1); /* ffffffff eng2d DST_DEPTH */ | ||
1065 | dd_emit(ctx, 1, 0xcf); /* 000000ff eng2d DST_FORMAT */ | ||
1066 | dd_emit(ctx, 1, 0); /* ffffffff eng2d DST_LAYER */ | ||
1067 | dd_emit(ctx, 1, 1); /* 00000001 eng2d DST_LINEAR */ | ||
1068 | dd_emit(ctx, 1, 0); /* 00000007 eng2d PATTERN_COLOR_FORMAT */ | ||
1069 | dd_emit(ctx, 1, 0); /* 00000007 eng2d OPERATION */ | ||
1070 | dd_emit(ctx, 1, 0); /* 00000003 eng2d PATTERN_SELECT */ | ||
1071 | dd_emit(ctx, 1, 0xcf); /* 000000ff eng2d SIFC_FORMAT */ | ||
1072 | dd_emit(ctx, 1, 0); /* 00000001 eng2d SIFC_BITMAP_ENABLE */ | ||
1073 | dd_emit(ctx, 1, 2); /* 00000003 eng2d SIFC_BITMAP_UNK808 */ | ||
1074 | dd_emit(ctx, 1, 0); /* ffffffff eng2d BLIT_DU_DX_FRACT */ | ||
1075 | dd_emit(ctx, 1, 1); /* ffffffff eng2d BLIT_DU_DX_INT */ | ||
1076 | dd_emit(ctx, 1, 0); /* ffffffff eng2d BLIT_DV_DY_FRACT */ | ||
1077 | dd_emit(ctx, 1, 1); /* ffffffff eng2d BLIT_DV_DY_INT */ | ||
1078 | dd_emit(ctx, 1, 0); /* 00000001 eng2d BLIT_CONTROL_FILTER */ | ||
1079 | dd_emit(ctx, 1, 0xcf); /* 000000ff eng2d DRAW_COLOR_FORMAT */ | ||
1080 | dd_emit(ctx, 1, 0xcf); /* 000000ff eng2d SRC_FORMAT */ | ||
1081 | dd_emit(ctx, 1, 1); /* 00000001 eng2d SRC_LINEAR #2 */ | ||
1082 | |||
1083 | num = ctx->ctxvals_pos - base; | ||
1084 | ctx->ctxvals_pos = base; | ||
1085 | if (IS_NVA3F(dev_priv->chipset)) | ||
1086 | cp_ctx(ctx, 0x404800, num); | ||
1087 | else | ||
1088 | cp_ctx(ctx, 0x405400, num); | ||
1089 | } | ||
1090 | |||
951 | /* | 1091 | /* |
952 | * xfer areas. These are a pain. | 1092 | * xfer areas. These are a pain. |
953 | * | 1093 | * |
@@ -990,28 +1130,33 @@ nv50_graph_construct_mmio(struct nouveau_grctx *ctx) | |||
990 | * without the help of ctxprog. | 1130 | * without the help of ctxprog. |
991 | */ | 1131 | */ |
992 | 1132 | ||
993 | static inline void | 1133 | static void |
994 | xf_emit(struct nouveau_grctx *ctx, int num, uint32_t val) { | 1134 | xf_emit(struct nouveau_grctx *ctx, int num, uint32_t val) { |
995 | int i; | 1135 | int i; |
996 | if (val && ctx->mode == NOUVEAU_GRCTX_VALS) | 1136 | if (val && ctx->mode == NOUVEAU_GRCTX_VALS) |
997 | for (i = 0; i < num; i++) | 1137 | for (i = 0; i < num; i++) |
998 | nv_wo32(ctx->data, (ctx->ctxvals_pos + (i << 3))*4, val); | 1138 | nv_wo32(ctx->data, 4 * (ctx->ctxvals_pos + (i << 3)), val); |
999 | ctx->ctxvals_pos += num << 3; | 1139 | ctx->ctxvals_pos += num << 3; |
1000 | } | 1140 | } |
1001 | 1141 | ||
1002 | /* Gene declarations... */ | 1142 | /* Gene declarations... */ |
1003 | 1143 | ||
1144 | static void nv50_graph_construct_gene_dispatch(struct nouveau_grctx *ctx); | ||
1004 | static void nv50_graph_construct_gene_m2mf(struct nouveau_grctx *ctx); | 1145 | static void nv50_graph_construct_gene_m2mf(struct nouveau_grctx *ctx); |
1005 | static void nv50_graph_construct_gene_unk1(struct nouveau_grctx *ctx); | 1146 | static void nv50_graph_construct_gene_ccache(struct nouveau_grctx *ctx); |
1006 | static void nv50_graph_construct_gene_unk2(struct nouveau_grctx *ctx); | 1147 | static void nv50_graph_construct_gene_unk10xx(struct nouveau_grctx *ctx); |
1007 | static void nv50_graph_construct_gene_unk3(struct nouveau_grctx *ctx); | 1148 | static void nv50_graph_construct_gene_unk14xx(struct nouveau_grctx *ctx); |
1008 | static void nv50_graph_construct_gene_unk4(struct nouveau_grctx *ctx); | 1149 | static void nv50_graph_construct_gene_zcull(struct nouveau_grctx *ctx); |
1009 | static void nv50_graph_construct_gene_unk5(struct nouveau_grctx *ctx); | 1150 | static void nv50_graph_construct_gene_clipid(struct nouveau_grctx *ctx); |
1010 | static void nv50_graph_construct_gene_unk6(struct nouveau_grctx *ctx); | 1151 | static void nv50_graph_construct_gene_unk24xx(struct nouveau_grctx *ctx); |
1011 | static void nv50_graph_construct_gene_unk7(struct nouveau_grctx *ctx); | 1152 | static void nv50_graph_construct_gene_vfetch(struct nouveau_grctx *ctx); |
1012 | static void nv50_graph_construct_gene_unk8(struct nouveau_grctx *ctx); | 1153 | static void nv50_graph_construct_gene_eng2d(struct nouveau_grctx *ctx); |
1013 | static void nv50_graph_construct_gene_unk9(struct nouveau_grctx *ctx); | 1154 | static void nv50_graph_construct_gene_csched(struct nouveau_grctx *ctx); |
1014 | static void nv50_graph_construct_gene_unk10(struct nouveau_grctx *ctx); | 1155 | static void nv50_graph_construct_gene_unk1cxx(struct nouveau_grctx *ctx); |
1156 | static void nv50_graph_construct_gene_strmout(struct nouveau_grctx *ctx); | ||
1157 | static void nv50_graph_construct_gene_unk34xx(struct nouveau_grctx *ctx); | ||
1158 | static void nv50_graph_construct_gene_ropm1(struct nouveau_grctx *ctx); | ||
1159 | static void nv50_graph_construct_gene_ropm2(struct nouveau_grctx *ctx); | ||
1015 | static void nv50_graph_construct_gene_ropc(struct nouveau_grctx *ctx); | 1160 | static void nv50_graph_construct_gene_ropc(struct nouveau_grctx *ctx); |
1016 | static void nv50_graph_construct_xfer_tp(struct nouveau_grctx *ctx); | 1161 | static void nv50_graph_construct_xfer_tp(struct nouveau_grctx *ctx); |
1017 | 1162 | ||
@@ -1030,102 +1175,32 @@ nv50_graph_construct_xfer1(struct nouveau_grctx *ctx) | |||
1030 | if (dev_priv->chipset < 0xa0) { | 1175 | if (dev_priv->chipset < 0xa0) { |
1031 | /* Strand 0 */ | 1176 | /* Strand 0 */ |
1032 | ctx->ctxvals_pos = offset; | 1177 | ctx->ctxvals_pos = offset; |
1033 | switch (dev_priv->chipset) { | 1178 | nv50_graph_construct_gene_dispatch(ctx); |
1034 | case 0x50: | 1179 | nv50_graph_construct_gene_m2mf(ctx); |
1035 | xf_emit(ctx, 0x99, 0); | 1180 | nv50_graph_construct_gene_unk24xx(ctx); |
1036 | break; | 1181 | nv50_graph_construct_gene_clipid(ctx); |
1037 | case 0x84: | 1182 | nv50_graph_construct_gene_zcull(ctx); |
1038 | case 0x86: | ||
1039 | xf_emit(ctx, 0x384, 0); | ||
1040 | break; | ||
1041 | case 0x92: | ||
1042 | case 0x94: | ||
1043 | case 0x96: | ||
1044 | case 0x98: | ||
1045 | xf_emit(ctx, 0x380, 0); | ||
1046 | break; | ||
1047 | } | ||
1048 | nv50_graph_construct_gene_m2mf (ctx); | ||
1049 | switch (dev_priv->chipset) { | ||
1050 | case 0x50: | ||
1051 | case 0x84: | ||
1052 | case 0x86: | ||
1053 | case 0x98: | ||
1054 | xf_emit(ctx, 0x4c4, 0); | ||
1055 | break; | ||
1056 | case 0x92: | ||
1057 | case 0x94: | ||
1058 | case 0x96: | ||
1059 | xf_emit(ctx, 0x984, 0); | ||
1060 | break; | ||
1061 | } | ||
1062 | nv50_graph_construct_gene_unk5(ctx); | ||
1063 | if (dev_priv->chipset == 0x50) | ||
1064 | xf_emit(ctx, 0xa, 0); | ||
1065 | else | ||
1066 | xf_emit(ctx, 0xb, 0); | ||
1067 | nv50_graph_construct_gene_unk4(ctx); | ||
1068 | nv50_graph_construct_gene_unk3(ctx); | ||
1069 | if ((ctx->ctxvals_pos-offset)/8 > size) | 1183 | if ((ctx->ctxvals_pos-offset)/8 > size) |
1070 | size = (ctx->ctxvals_pos-offset)/8; | 1184 | size = (ctx->ctxvals_pos-offset)/8; |
1071 | 1185 | ||
1072 | /* Strand 1 */ | 1186 | /* Strand 1 */ |
1073 | ctx->ctxvals_pos = offset + 0x1; | 1187 | ctx->ctxvals_pos = offset + 0x1; |
1074 | nv50_graph_construct_gene_unk6(ctx); | 1188 | nv50_graph_construct_gene_vfetch(ctx); |
1075 | nv50_graph_construct_gene_unk7(ctx); | 1189 | nv50_graph_construct_gene_eng2d(ctx); |
1076 | nv50_graph_construct_gene_unk8(ctx); | 1190 | nv50_graph_construct_gene_csched(ctx); |
1077 | switch (dev_priv->chipset) { | 1191 | nv50_graph_construct_gene_ropm1(ctx); |
1078 | case 0x50: | 1192 | nv50_graph_construct_gene_ropm2(ctx); |
1079 | case 0x92: | ||
1080 | xf_emit(ctx, 0xfb, 0); | ||
1081 | break; | ||
1082 | case 0x84: | ||
1083 | xf_emit(ctx, 0xd3, 0); | ||
1084 | break; | ||
1085 | case 0x94: | ||
1086 | case 0x96: | ||
1087 | xf_emit(ctx, 0xab, 0); | ||
1088 | break; | ||
1089 | case 0x86: | ||
1090 | case 0x98: | ||
1091 | xf_emit(ctx, 0x6b, 0); | ||
1092 | break; | ||
1093 | } | ||
1094 | xf_emit(ctx, 2, 0x4e3bfdf); | ||
1095 | xf_emit(ctx, 4, 0); | ||
1096 | xf_emit(ctx, 1, 0x0fac6881); | ||
1097 | xf_emit(ctx, 0xb, 0); | ||
1098 | xf_emit(ctx, 2, 0x4e3bfdf); | ||
1099 | if ((ctx->ctxvals_pos-offset)/8 > size) | 1193 | if ((ctx->ctxvals_pos-offset)/8 > size) |
1100 | size = (ctx->ctxvals_pos-offset)/8; | 1194 | size = (ctx->ctxvals_pos-offset)/8; |
1101 | 1195 | ||
1102 | /* Strand 2 */ | 1196 | /* Strand 2 */ |
1103 | ctx->ctxvals_pos = offset + 0x2; | 1197 | ctx->ctxvals_pos = offset + 0x2; |
1104 | switch (dev_priv->chipset) { | 1198 | nv50_graph_construct_gene_ccache(ctx); |
1105 | case 0x50: | 1199 | nv50_graph_construct_gene_unk1cxx(ctx); |
1106 | case 0x92: | 1200 | nv50_graph_construct_gene_strmout(ctx); |
1107 | xf_emit(ctx, 0xa80, 0); | 1201 | nv50_graph_construct_gene_unk14xx(ctx); |
1108 | break; | 1202 | nv50_graph_construct_gene_unk10xx(ctx); |
1109 | case 0x84: | 1203 | nv50_graph_construct_gene_unk34xx(ctx); |
1110 | xf_emit(ctx, 0xa7e, 0); | ||
1111 | break; | ||
1112 | case 0x94: | ||
1113 | case 0x96: | ||
1114 | xf_emit(ctx, 0xa7c, 0); | ||
1115 | break; | ||
1116 | case 0x86: | ||
1117 | case 0x98: | ||
1118 | xf_emit(ctx, 0xa7a, 0); | ||
1119 | break; | ||
1120 | } | ||
1121 | xf_emit(ctx, 1, 0x3fffff); | ||
1122 | xf_emit(ctx, 2, 0); | ||
1123 | xf_emit(ctx, 1, 0x1fff); | ||
1124 | xf_emit(ctx, 0xe, 0); | ||
1125 | nv50_graph_construct_gene_unk9(ctx); | ||
1126 | nv50_graph_construct_gene_unk2(ctx); | ||
1127 | nv50_graph_construct_gene_unk1(ctx); | ||
1128 | nv50_graph_construct_gene_unk10(ctx); | ||
1129 | if ((ctx->ctxvals_pos-offset)/8 > size) | 1204 | if ((ctx->ctxvals_pos-offset)/8 > size) |
1130 | size = (ctx->ctxvals_pos-offset)/8; | 1205 | size = (ctx->ctxvals_pos-offset)/8; |
1131 | 1206 | ||
@@ -1150,86 +1225,46 @@ nv50_graph_construct_xfer1(struct nouveau_grctx *ctx) | |||
1150 | } else { | 1225 | } else { |
1151 | /* Strand 0 */ | 1226 | /* Strand 0 */ |
1152 | ctx->ctxvals_pos = offset; | 1227 | ctx->ctxvals_pos = offset; |
1153 | if (dev_priv->chipset > 0xa0 && dev_priv->chipset < 0xaa) | 1228 | nv50_graph_construct_gene_dispatch(ctx); |
1154 | xf_emit(ctx, 0x385, 0); | ||
1155 | else | ||
1156 | xf_emit(ctx, 0x384, 0); | ||
1157 | nv50_graph_construct_gene_m2mf(ctx); | 1229 | nv50_graph_construct_gene_m2mf(ctx); |
1158 | xf_emit(ctx, 0x950, 0); | 1230 | nv50_graph_construct_gene_unk34xx(ctx); |
1159 | nv50_graph_construct_gene_unk10(ctx); | 1231 | nv50_graph_construct_gene_csched(ctx); |
1160 | xf_emit(ctx, 1, 0x0fac6881); | 1232 | nv50_graph_construct_gene_unk1cxx(ctx); |
1161 | if (dev_priv->chipset > 0xa0 && dev_priv->chipset < 0xaa) { | 1233 | nv50_graph_construct_gene_strmout(ctx); |
1162 | xf_emit(ctx, 1, 1); | ||
1163 | xf_emit(ctx, 3, 0); | ||
1164 | } | ||
1165 | nv50_graph_construct_gene_unk8(ctx); | ||
1166 | if (dev_priv->chipset == 0xa0) | ||
1167 | xf_emit(ctx, 0x189, 0); | ||
1168 | else if (dev_priv->chipset == 0xa3) | ||
1169 | xf_emit(ctx, 0xd5, 0); | ||
1170 | else if (dev_priv->chipset == 0xa5) | ||
1171 | xf_emit(ctx, 0x99, 0); | ||
1172 | else if (dev_priv->chipset == 0xaa) | ||
1173 | xf_emit(ctx, 0x65, 0); | ||
1174 | else | ||
1175 | xf_emit(ctx, 0x6d, 0); | ||
1176 | nv50_graph_construct_gene_unk9(ctx); | ||
1177 | if ((ctx->ctxvals_pos-offset)/8 > size) | 1234 | if ((ctx->ctxvals_pos-offset)/8 > size) |
1178 | size = (ctx->ctxvals_pos-offset)/8; | 1235 | size = (ctx->ctxvals_pos-offset)/8; |
1179 | 1236 | ||
1180 | /* Strand 1 */ | 1237 | /* Strand 1 */ |
1181 | ctx->ctxvals_pos = offset + 1; | 1238 | ctx->ctxvals_pos = offset + 1; |
1182 | nv50_graph_construct_gene_unk1(ctx); | 1239 | nv50_graph_construct_gene_unk10xx(ctx); |
1183 | if ((ctx->ctxvals_pos-offset)/8 > size) | 1240 | if ((ctx->ctxvals_pos-offset)/8 > size) |
1184 | size = (ctx->ctxvals_pos-offset)/8; | 1241 | size = (ctx->ctxvals_pos-offset)/8; |
1185 | 1242 | ||
1186 | /* Strand 2 */ | 1243 | /* Strand 2 */ |
1187 | ctx->ctxvals_pos = offset + 2; | 1244 | ctx->ctxvals_pos = offset + 2; |
1188 | if (dev_priv->chipset == 0xa0) { | 1245 | if (dev_priv->chipset == 0xa0) |
1189 | nv50_graph_construct_gene_unk2(ctx); | 1246 | nv50_graph_construct_gene_unk14xx(ctx); |
1190 | } | 1247 | nv50_graph_construct_gene_unk24xx(ctx); |
1191 | xf_emit(ctx, 0x36, 0); | ||
1192 | nv50_graph_construct_gene_unk5(ctx); | ||
1193 | if ((ctx->ctxvals_pos-offset)/8 > size) | 1248 | if ((ctx->ctxvals_pos-offset)/8 > size) |
1194 | size = (ctx->ctxvals_pos-offset)/8; | 1249 | size = (ctx->ctxvals_pos-offset)/8; |
1195 | 1250 | ||
1196 | /* Strand 3 */ | 1251 | /* Strand 3 */ |
1197 | ctx->ctxvals_pos = offset + 3; | 1252 | ctx->ctxvals_pos = offset + 3; |
1198 | xf_emit(ctx, 1, 0); | 1253 | nv50_graph_construct_gene_vfetch(ctx); |
1199 | xf_emit(ctx, 1, 1); | ||
1200 | nv50_graph_construct_gene_unk6(ctx); | ||
1201 | if ((ctx->ctxvals_pos-offset)/8 > size) | 1254 | if ((ctx->ctxvals_pos-offset)/8 > size) |
1202 | size = (ctx->ctxvals_pos-offset)/8; | 1255 | size = (ctx->ctxvals_pos-offset)/8; |
1203 | 1256 | ||
1204 | /* Strand 4 */ | 1257 | /* Strand 4 */ |
1205 | ctx->ctxvals_pos = offset + 4; | 1258 | ctx->ctxvals_pos = offset + 4; |
1206 | if (dev_priv->chipset == 0xa0) | 1259 | nv50_graph_construct_gene_ccache(ctx); |
1207 | xf_emit(ctx, 0xa80, 0); | ||
1208 | else if (dev_priv->chipset == 0xa3) | ||
1209 | xf_emit(ctx, 0xa7c, 0); | ||
1210 | else | ||
1211 | xf_emit(ctx, 0xa7a, 0); | ||
1212 | xf_emit(ctx, 1, 0x3fffff); | ||
1213 | xf_emit(ctx, 2, 0); | ||
1214 | xf_emit(ctx, 1, 0x1fff); | ||
1215 | if ((ctx->ctxvals_pos-offset)/8 > size) | 1260 | if ((ctx->ctxvals_pos-offset)/8 > size) |
1216 | size = (ctx->ctxvals_pos-offset)/8; | 1261 | size = (ctx->ctxvals_pos-offset)/8; |
1217 | 1262 | ||
1218 | /* Strand 5 */ | 1263 | /* Strand 5 */ |
1219 | ctx->ctxvals_pos = offset + 5; | 1264 | ctx->ctxvals_pos = offset + 5; |
1220 | xf_emit(ctx, 1, 0); | 1265 | nv50_graph_construct_gene_ropm2(ctx); |
1221 | xf_emit(ctx, 1, 0x0fac6881); | 1266 | nv50_graph_construct_gene_ropm1(ctx); |
1222 | xf_emit(ctx, 0xb, 0); | 1267 | /* per-ROP context */ |
1223 | xf_emit(ctx, 2, 0x4e3bfdf); | ||
1224 | xf_emit(ctx, 3, 0); | ||
1225 | if (dev_priv->chipset > 0xa0 && dev_priv->chipset < 0xaa) | ||
1226 | xf_emit(ctx, 1, 0x11); | ||
1227 | xf_emit(ctx, 1, 0); | ||
1228 | xf_emit(ctx, 2, 0x4e3bfdf); | ||
1229 | xf_emit(ctx, 2, 0); | ||
1230 | if (dev_priv->chipset > 0xa0 && dev_priv->chipset < 0xaa) | ||
1231 | xf_emit(ctx, 1, 0x11); | ||
1232 | xf_emit(ctx, 1, 0); | ||
1233 | for (i = 0; i < 8; i++) | 1268 | for (i = 0; i < 8; i++) |
1234 | if (units & (1<<(i+16))) | 1269 | if (units & (1<<(i+16))) |
1235 | nv50_graph_construct_gene_ropc(ctx); | 1270 | nv50_graph_construct_gene_ropc(ctx); |
@@ -1238,10 +1273,9 @@ nv50_graph_construct_xfer1(struct nouveau_grctx *ctx) | |||
1238 | 1273 | ||
1239 | /* Strand 6 */ | 1274 | /* Strand 6 */ |
1240 | ctx->ctxvals_pos = offset + 6; | 1275 | ctx->ctxvals_pos = offset + 6; |
1241 | nv50_graph_construct_gene_unk3(ctx); | 1276 | nv50_graph_construct_gene_zcull(ctx); |
1242 | xf_emit(ctx, 0xb, 0); | 1277 | nv50_graph_construct_gene_clipid(ctx); |
1243 | nv50_graph_construct_gene_unk4(ctx); | 1278 | nv50_graph_construct_gene_eng2d(ctx); |
1244 | nv50_graph_construct_gene_unk7(ctx); | ||
1245 | if (units & (1 << 0)) | 1279 | if (units & (1 << 0)) |
1246 | nv50_graph_construct_xfer_tp(ctx); | 1280 | nv50_graph_construct_xfer_tp(ctx); |
1247 | if (units & (1 << 1)) | 1281 | if (units & (1 << 1)) |
@@ -1269,7 +1303,7 @@ nv50_graph_construct_xfer1(struct nouveau_grctx *ctx) | |||
1269 | if (units & (1 << 9)) | 1303 | if (units & (1 << 9)) |
1270 | nv50_graph_construct_xfer_tp(ctx); | 1304 | nv50_graph_construct_xfer_tp(ctx); |
1271 | } else { | 1305 | } else { |
1272 | nv50_graph_construct_gene_unk2(ctx); | 1306 | nv50_graph_construct_gene_unk14xx(ctx); |
1273 | } | 1307 | } |
1274 | if ((ctx->ctxvals_pos-offset)/8 > size) | 1308 | if ((ctx->ctxvals_pos-offset)/8 > size) |
1275 | size = (ctx->ctxvals_pos-offset)/8; | 1309 | size = (ctx->ctxvals_pos-offset)/8; |
@@ -1290,9 +1324,70 @@ nv50_graph_construct_xfer1(struct nouveau_grctx *ctx) | |||
1290 | */ | 1324 | */ |
1291 | 1325 | ||
1292 | static void | 1326 | static void |
1327 | nv50_graph_construct_gene_dispatch(struct nouveau_grctx *ctx) | ||
1328 | { | ||
1329 | /* start of strand 0 */ | ||
1330 | struct drm_nouveau_private *dev_priv = ctx->dev->dev_private; | ||
1331 | /* SEEK */ | ||
1332 | if (dev_priv->chipset == 0x50) | ||
1333 | xf_emit(ctx, 5, 0); | ||
1334 | else if (!IS_NVA3F(dev_priv->chipset)) | ||
1335 | xf_emit(ctx, 6, 0); | ||
1336 | else | ||
1337 | xf_emit(ctx, 4, 0); | ||
1338 | /* SEEK */ | ||
1339 | /* the PGRAPH's internal FIFO */ | ||
1340 | if (dev_priv->chipset == 0x50) | ||
1341 | xf_emit(ctx, 8*3, 0); | ||
1342 | else | ||
1343 | xf_emit(ctx, 0x100*3, 0); | ||
1344 | /* and another bonus slot?!? */ | ||
1345 | xf_emit(ctx, 3, 0); | ||
1346 | /* and YET ANOTHER bonus slot? */ | ||
1347 | if (IS_NVA3F(dev_priv->chipset)) | ||
1348 | xf_emit(ctx, 3, 0); | ||
1349 | /* SEEK */ | ||
1350 | /* CTX_SWITCH: caches of gr objects bound to subchannels. 8 values, last used index */ | ||
1351 | xf_emit(ctx, 9, 0); | ||
1352 | /* SEEK */ | ||
1353 | xf_emit(ctx, 9, 0); | ||
1354 | /* SEEK */ | ||
1355 | xf_emit(ctx, 9, 0); | ||
1356 | /* SEEK */ | ||
1357 | xf_emit(ctx, 9, 0); | ||
1358 | /* SEEK */ | ||
1359 | if (dev_priv->chipset < 0x90) | ||
1360 | xf_emit(ctx, 4, 0); | ||
1361 | /* SEEK */ | ||
1362 | xf_emit(ctx, 2, 0); | ||
1363 | /* SEEK */ | ||
1364 | xf_emit(ctx, 6*2, 0); | ||
1365 | xf_emit(ctx, 2, 0); | ||
1366 | /* SEEK */ | ||
1367 | xf_emit(ctx, 2, 0); | ||
1368 | /* SEEK */ | ||
1369 | xf_emit(ctx, 6*2, 0); | ||
1370 | xf_emit(ctx, 2, 0); | ||
1371 | /* SEEK */ | ||
1372 | if (dev_priv->chipset == 0x50) | ||
1373 | xf_emit(ctx, 0x1c, 0); | ||
1374 | else if (dev_priv->chipset < 0xa0) | ||
1375 | xf_emit(ctx, 0x1e, 0); | ||
1376 | else | ||
1377 | xf_emit(ctx, 0x22, 0); | ||
1378 | /* SEEK */ | ||
1379 | xf_emit(ctx, 0x15, 0); | ||
1380 | } | ||
1381 | |||
1382 | static void | ||
1293 | nv50_graph_construct_gene_m2mf(struct nouveau_grctx *ctx) | 1383 | nv50_graph_construct_gene_m2mf(struct nouveau_grctx *ctx) |
1294 | { | 1384 | { |
1295 | /* m2mf state */ | 1385 | /* Strand 0, right after dispatch */ |
1386 | struct drm_nouveau_private *dev_priv = ctx->dev->dev_private; | ||
1387 | int smallm2mf = 0; | ||
1388 | if (dev_priv->chipset < 0x92 || dev_priv->chipset == 0x98) | ||
1389 | smallm2mf = 1; | ||
1390 | /* SEEK */ | ||
1296 | xf_emit (ctx, 1, 0); /* DMA_NOTIFY instance >> 4 */ | 1391 | xf_emit (ctx, 1, 0); /* DMA_NOTIFY instance >> 4 */ |
1297 | xf_emit (ctx, 1, 0); /* DMA_BUFFER_IN instance >> 4 */ | 1392 | xf_emit (ctx, 1, 0); /* DMA_BUFFER_IN instance >> 4 */ |
1298 | xf_emit (ctx, 1, 0); /* DMA_BUFFER_OUT instance >> 4 */ | 1393 | xf_emit (ctx, 1, 0); /* DMA_BUFFER_OUT instance >> 4 */ |
@@ -1319,427 +1414,975 @@ nv50_graph_construct_gene_m2mf(struct nouveau_grctx *ctx) | |||
1319 | xf_emit (ctx, 1, 0); /* TILING_POSITION_OUT */ | 1414 | xf_emit (ctx, 1, 0); /* TILING_POSITION_OUT */ |
1320 | xf_emit (ctx, 1, 0); /* OFFSET_IN_HIGH */ | 1415 | xf_emit (ctx, 1, 0); /* OFFSET_IN_HIGH */ |
1321 | xf_emit (ctx, 1, 0); /* OFFSET_OUT_HIGH */ | 1416 | xf_emit (ctx, 1, 0); /* OFFSET_OUT_HIGH */ |
1417 | /* SEEK */ | ||
1418 | if (smallm2mf) | ||
1419 | xf_emit(ctx, 0x40, 0); /* 20 * ffffffff, 3ffff */ | ||
1420 | else | ||
1421 | xf_emit(ctx, 0x100, 0); /* 80 * ffffffff, 3ffff */ | ||
1422 | xf_emit(ctx, 4, 0); /* 1f/7f, 0, 1f/7f, 0 [1f for smallm2mf, 7f otherwise] */ | ||
1423 | /* SEEK */ | ||
1424 | if (smallm2mf) | ||
1425 | xf_emit(ctx, 0x400, 0); /* ffffffff */ | ||
1426 | else | ||
1427 | xf_emit(ctx, 0x800, 0); /* ffffffff */ | ||
1428 | xf_emit(ctx, 4, 0); /* ff/1ff, 0, 0, 0 [ff for smallm2mf, 1ff otherwise] */ | ||
1429 | /* SEEK */ | ||
1430 | xf_emit(ctx, 0x40, 0); /* 20 * bits ffffffff, 3ffff */ | ||
1431 | xf_emit(ctx, 0x6, 0); /* 1f, 0, 1f, 0, 1f, 0 */ | ||
1322 | } | 1432 | } |
1323 | 1433 | ||
1324 | static void | 1434 | static void |
1325 | nv50_graph_construct_gene_unk1(struct nouveau_grctx *ctx) | 1435 | nv50_graph_construct_gene_ccache(struct nouveau_grctx *ctx) |
1326 | { | 1436 | { |
1327 | struct drm_nouveau_private *dev_priv = ctx->dev->dev_private; | 1437 | struct drm_nouveau_private *dev_priv = ctx->dev->dev_private; |
1328 | /* end of area 2 on pre-NVA0, area 1 on NVAx */ | 1438 | xf_emit(ctx, 2, 0); /* RO */ |
1329 | xf_emit(ctx, 2, 4); | 1439 | xf_emit(ctx, 0x800, 0); /* ffffffff */ |
1330 | xf_emit(ctx, 1, 0); | ||
1331 | xf_emit(ctx, 1, 0x80); | ||
1332 | xf_emit(ctx, 1, 4); | ||
1333 | xf_emit(ctx, 1, 0x80c14); | ||
1334 | xf_emit(ctx, 1, 0); | ||
1335 | if (dev_priv->chipset == 0x50) | ||
1336 | xf_emit(ctx, 1, 0x3ff); | ||
1337 | else | ||
1338 | xf_emit(ctx, 1, 0x7ff); | ||
1339 | switch (dev_priv->chipset) { | 1440 | switch (dev_priv->chipset) { |
1340 | case 0x50: | 1441 | case 0x50: |
1341 | case 0x86: | 1442 | case 0x92: |
1342 | case 0x98: | 1443 | case 0xa0: |
1343 | case 0xaa: | 1444 | xf_emit(ctx, 0x2b, 0); |
1344 | case 0xac: | ||
1345 | xf_emit(ctx, 0x542, 0); | ||
1346 | break; | 1445 | break; |
1347 | case 0x84: | 1446 | case 0x84: |
1348 | case 0x92: | 1447 | xf_emit(ctx, 0x29, 0); |
1448 | break; | ||
1349 | case 0x94: | 1449 | case 0x94: |
1350 | case 0x96: | 1450 | case 0x96: |
1351 | xf_emit(ctx, 0x942, 0); | ||
1352 | break; | ||
1353 | case 0xa0: | ||
1354 | case 0xa3: | 1451 | case 0xa3: |
1355 | xf_emit(ctx, 0x2042, 0); | 1452 | xf_emit(ctx, 0x27, 0); |
1356 | break; | 1453 | break; |
1454 | case 0x86: | ||
1455 | case 0x98: | ||
1357 | case 0xa5: | 1456 | case 0xa5: |
1358 | case 0xa8: | 1457 | case 0xa8: |
1359 | xf_emit(ctx, 0x842, 0); | 1458 | case 0xaa: |
1459 | case 0xac: | ||
1460 | case 0xaf: | ||
1461 | xf_emit(ctx, 0x25, 0); | ||
1360 | break; | 1462 | break; |
1361 | } | 1463 | } |
1362 | xf_emit(ctx, 2, 4); | 1464 | /* CB bindings, 0x80 of them. first word is address >> 8, second is |
1363 | xf_emit(ctx, 1, 0); | 1465 | * size >> 4 | valid << 24 */ |
1364 | xf_emit(ctx, 1, 0x80); | 1466 | xf_emit(ctx, 0x100, 0); /* ffffffff CB_DEF */ |
1365 | xf_emit(ctx, 1, 4); | 1467 | xf_emit(ctx, 1, 0); /* 0000007f CB_ADDR_BUFFER */ |
1366 | xf_emit(ctx, 1, 1); | 1468 | xf_emit(ctx, 1, 0); /* 0 */ |
1367 | xf_emit(ctx, 1, 0); | 1469 | xf_emit(ctx, 0x30, 0); /* ff SET_PROGRAM_CB */ |
1368 | xf_emit(ctx, 1, 0x27); | 1470 | xf_emit(ctx, 1, 0); /* 3f last SET_PROGRAM_CB */ |
1369 | xf_emit(ctx, 1, 0); | 1471 | xf_emit(ctx, 4, 0); /* RO */ |
1370 | xf_emit(ctx, 1, 0x26); | 1472 | xf_emit(ctx, 0x100, 0); /* ffffffff */ |
1371 | xf_emit(ctx, 3, 0); | 1473 | xf_emit(ctx, 8, 0); /* 1f, 0, 0, ... */ |
1474 | xf_emit(ctx, 8, 0); /* ffffffff */ | ||
1475 | xf_emit(ctx, 4, 0); /* ffffffff */ | ||
1476 | xf_emit(ctx, 1, 0); /* 3 */ | ||
1477 | xf_emit(ctx, 1, 0); /* ffffffff */ | ||
1478 | xf_emit(ctx, 1, 0); /* 0000ffff DMA_CODE_CB */ | ||
1479 | xf_emit(ctx, 1, 0); /* 0000ffff DMA_TIC */ | ||
1480 | xf_emit(ctx, 1, 0); /* 0000ffff DMA_TSC */ | ||
1481 | xf_emit(ctx, 1, 0); /* 00000001 LINKED_TSC */ | ||
1482 | xf_emit(ctx, 1, 0); /* 000000ff TIC_ADDRESS_HIGH */ | ||
1483 | xf_emit(ctx, 1, 0); /* ffffffff TIC_ADDRESS_LOW */ | ||
1484 | xf_emit(ctx, 1, 0x3fffff); /* 003fffff TIC_LIMIT */ | ||
1485 | xf_emit(ctx, 1, 0); /* 000000ff TSC_ADDRESS_HIGH */ | ||
1486 | xf_emit(ctx, 1, 0); /* ffffffff TSC_ADDRESS_LOW */ | ||
1487 | xf_emit(ctx, 1, 0x1fff); /* 000fffff TSC_LIMIT */ | ||
1488 | xf_emit(ctx, 1, 0); /* 000000ff VP_ADDRESS_HIGH */ | ||
1489 | xf_emit(ctx, 1, 0); /* ffffffff VP_ADDRESS_LOW */ | ||
1490 | xf_emit(ctx, 1, 0); /* 00ffffff VP_START_ID */ | ||
1491 | xf_emit(ctx, 1, 0); /* 000000ff CB_DEF_ADDRESS_HIGH */ | ||
1492 | xf_emit(ctx, 1, 0); /* ffffffff CB_DEF_ADDRESS_LOW */ | ||
1493 | xf_emit(ctx, 1, 0); /* 00000001 GP_ENABLE */ | ||
1494 | xf_emit(ctx, 1, 0); /* 000000ff GP_ADDRESS_HIGH */ | ||
1495 | xf_emit(ctx, 1, 0); /* ffffffff GP_ADDRESS_LOW */ | ||
1496 | xf_emit(ctx, 1, 0); /* 00ffffff GP_START_ID */ | ||
1497 | xf_emit(ctx, 1, 0); /* 000000ff FP_ADDRESS_HIGH */ | ||
1498 | xf_emit(ctx, 1, 0); /* ffffffff FP_ADDRESS_LOW */ | ||
1499 | xf_emit(ctx, 1, 0); /* 00ffffff FP_START_ID */ | ||
1372 | } | 1500 | } |
1373 | 1501 | ||
1374 | static void | 1502 | static void |
1375 | nv50_graph_construct_gene_unk10(struct nouveau_grctx *ctx) | 1503 | nv50_graph_construct_gene_unk10xx(struct nouveau_grctx *ctx) |
1376 | { | 1504 | { |
1505 | struct drm_nouveau_private *dev_priv = ctx->dev->dev_private; | ||
1506 | int i; | ||
1377 | /* end of area 2 on pre-NVA0, area 1 on NVAx */ | 1507 | /* end of area 2 on pre-NVA0, area 1 on NVAx */ |
1378 | xf_emit(ctx, 0x10, 0x04000000); | 1508 | xf_emit(ctx, 1, 4); /* 000000ff GP_RESULT_MAP_SIZE */ |
1379 | xf_emit(ctx, 0x24, 0); | 1509 | xf_emit(ctx, 1, 4); /* 0000007f VP_RESULT_MAP_SIZE */ |
1380 | xf_emit(ctx, 2, 0x04e3bfdf); | 1510 | xf_emit(ctx, 1, 0); /* 00000001 GP_ENABLE */ |
1381 | xf_emit(ctx, 2, 0); | 1511 | xf_emit(ctx, 1, 0x80); /* 0000ffff GP_VERTEX_OUTPUT_COUNT */ |
1382 | xf_emit(ctx, 1, 0x1fe21); | 1512 | xf_emit(ctx, 1, 4); /* 000000ff GP_REG_ALLOC_RESULT */ |
1513 | xf_emit(ctx, 1, 0x80c14); /* 01ffffff SEMANTIC_COLOR */ | ||
1514 | xf_emit(ctx, 1, 0); /* 00000001 VERTEX_TWO_SIDE_ENABLE */ | ||
1515 | if (dev_priv->chipset == 0x50) | ||
1516 | xf_emit(ctx, 1, 0x3ff); | ||
1517 | else | ||
1518 | xf_emit(ctx, 1, 0x7ff); /* 000007ff */ | ||
1519 | xf_emit(ctx, 1, 0); /* 111/113 */ | ||
1520 | xf_emit(ctx, 1, 0); /* ffffffff tesla UNK1A30 */ | ||
1521 | for (i = 0; i < 8; i++) { | ||
1522 | switch (dev_priv->chipset) { | ||
1523 | case 0x50: | ||
1524 | case 0x86: | ||
1525 | case 0x98: | ||
1526 | case 0xaa: | ||
1527 | case 0xac: | ||
1528 | xf_emit(ctx, 0xa0, 0); /* ffffffff */ | ||
1529 | break; | ||
1530 | case 0x84: | ||
1531 | case 0x92: | ||
1532 | case 0x94: | ||
1533 | case 0x96: | ||
1534 | xf_emit(ctx, 0x120, 0); | ||
1535 | break; | ||
1536 | case 0xa5: | ||
1537 | case 0xa8: | ||
1538 | xf_emit(ctx, 0x100, 0); /* ffffffff */ | ||
1539 | break; | ||
1540 | case 0xa0: | ||
1541 | case 0xa3: | ||
1542 | case 0xaf: | ||
1543 | xf_emit(ctx, 0x400, 0); /* ffffffff */ | ||
1544 | break; | ||
1545 | } | ||
1546 | xf_emit(ctx, 4, 0); /* 3f, 0, 0, 0 */ | ||
1547 | xf_emit(ctx, 4, 0); /* ffffffff */ | ||
1548 | } | ||
1549 | xf_emit(ctx, 1, 4); /* 000000ff GP_RESULT_MAP_SIZE */ | ||
1550 | xf_emit(ctx, 1, 4); /* 0000007f VP_RESULT_MAP_SIZE */ | ||
1551 | xf_emit(ctx, 1, 0); /* 00000001 GP_ENABLE */ | ||
1552 | xf_emit(ctx, 1, 0x80); /* 0000ffff GP_VERTEX_OUTPUT_COUNT */ | ||
1553 | xf_emit(ctx, 1, 4); /* 000000ff GP_REG_ALLOC_TEMP */ | ||
1554 | xf_emit(ctx, 1, 1); /* 00000001 RASTERIZE_ENABLE */ | ||
1555 | xf_emit(ctx, 1, 0); /* 00000001 tesla UNK1900 */ | ||
1556 | xf_emit(ctx, 1, 0x27); /* 000000ff UNK0FD4 */ | ||
1557 | xf_emit(ctx, 1, 0); /* 0001ffff GP_BUILTIN_RESULT_EN */ | ||
1558 | xf_emit(ctx, 1, 0x26); /* 000000ff SEMANTIC_LAYER */ | ||
1559 | xf_emit(ctx, 1, 0); /* ffffffff tesla UNK1A30 */ | ||
1560 | } | ||
1561 | |||
1562 | static void | ||
1563 | nv50_graph_construct_gene_unk34xx(struct nouveau_grctx *ctx) | ||
1564 | { | ||
1565 | struct drm_nouveau_private *dev_priv = ctx->dev->dev_private; | ||
1566 | /* end of area 2 on pre-NVA0, area 1 on NVAx */ | ||
1567 | xf_emit(ctx, 1, 0); /* 00000001 VIEWPORT_CLIP_RECTS_EN */ | ||
1568 | xf_emit(ctx, 1, 0); /* 00000003 VIEWPORT_CLIP_MODE */ | ||
1569 | xf_emit(ctx, 0x10, 0x04000000); /* 07ffffff VIEWPORT_CLIP_HORIZ*8, VIEWPORT_CLIP_VERT*8 */ | ||
1570 | xf_emit(ctx, 1, 0); /* 00000001 POLYGON_STIPPLE_ENABLE */ | ||
1571 | xf_emit(ctx, 0x20, 0); /* ffffffff POLYGON_STIPPLE */ | ||
1572 | xf_emit(ctx, 2, 0); /* 00007fff WINDOW_OFFSET_XY */ | ||
1573 | xf_emit(ctx, 1, 0); /* ffff0ff3 */ | ||
1574 | xf_emit(ctx, 1, 0x04e3bfdf); /* ffffffff UNK0D64 */ | ||
1575 | xf_emit(ctx, 1, 0x04e3bfdf); /* ffffffff UNK0DF4 */ | ||
1576 | xf_emit(ctx, 1, 0); /* 00000003 WINDOW_ORIGIN */ | ||
1577 | xf_emit(ctx, 1, 0); /* 00000007 */ | ||
1578 | xf_emit(ctx, 1, 0x1fe21); /* 0001ffff tesla UNK0FAC */ | ||
1579 | if (dev_priv->chipset >= 0xa0) | ||
1580 | xf_emit(ctx, 1, 0x0fac6881); | ||
1581 | if (IS_NVA3F(dev_priv->chipset)) { | ||
1582 | xf_emit(ctx, 1, 1); | ||
1583 | xf_emit(ctx, 3, 0); | ||
1584 | } | ||
1383 | } | 1585 | } |
1384 | 1586 | ||
1385 | static void | 1587 | static void |
1386 | nv50_graph_construct_gene_unk2(struct nouveau_grctx *ctx) | 1588 | nv50_graph_construct_gene_unk14xx(struct nouveau_grctx *ctx) |
1387 | { | 1589 | { |
1388 | struct drm_nouveau_private *dev_priv = ctx->dev->dev_private; | 1590 | struct drm_nouveau_private *dev_priv = ctx->dev->dev_private; |
1389 | /* middle of area 2 on pre-NVA0, beginning of area 2 on NVA0, area 7 on >NVA0 */ | 1591 | /* middle of area 2 on pre-NVA0, beginning of area 2 on NVA0, area 7 on >NVA0 */ |
1390 | if (dev_priv->chipset != 0x50) { | 1592 | if (dev_priv->chipset != 0x50) { |
1391 | xf_emit(ctx, 5, 0); | 1593 | xf_emit(ctx, 5, 0); /* ffffffff */ |
1392 | xf_emit(ctx, 1, 0x80c14); | 1594 | xf_emit(ctx, 1, 0x80c14); /* 01ffffff SEMANTIC_COLOR */ |
1393 | xf_emit(ctx, 2, 0); | 1595 | xf_emit(ctx, 1, 0); /* 00000001 */ |
1394 | xf_emit(ctx, 1, 0x804); | 1596 | xf_emit(ctx, 1, 0); /* 000003ff */ |
1395 | xf_emit(ctx, 1, 0); | 1597 | xf_emit(ctx, 1, 0x804); /* 00000fff SEMANTIC_CLIP */ |
1396 | xf_emit(ctx, 2, 4); | 1598 | xf_emit(ctx, 1, 0); /* 00000001 */ |
1397 | xf_emit(ctx, 1, 0x8100c12); | 1599 | xf_emit(ctx, 2, 4); /* 7f, ff */ |
1600 | xf_emit(ctx, 1, 0x8100c12); /* 1fffffff FP_INTERPOLANT_CTRL */ | ||
1398 | } | 1601 | } |
1399 | xf_emit(ctx, 1, 0); | 1602 | xf_emit(ctx, 1, 0); /* ffffffff tesla UNK1A30 */ |
1400 | xf_emit(ctx, 2, 4); | 1603 | xf_emit(ctx, 1, 4); /* 0000007f VP_RESULT_MAP_SIZE */ |
1401 | xf_emit(ctx, 1, 0); | 1604 | xf_emit(ctx, 1, 4); /* 000000ff GP_RESULT_MAP_SIZE */ |
1402 | xf_emit(ctx, 1, 0x10); | 1605 | xf_emit(ctx, 1, 0); /* 00000001 GP_ENABLE */ |
1403 | if (dev_priv->chipset == 0x50) | 1606 | xf_emit(ctx, 1, 0x10); /* 7f/ff VIEW_VOLUME_CLIP_CTRL */ |
1404 | xf_emit(ctx, 3, 0); | 1607 | xf_emit(ctx, 1, 0); /* 000000ff VP_CLIP_DISTANCE_ENABLE */ |
1405 | else | ||
1406 | xf_emit(ctx, 4, 0); | ||
1407 | xf_emit(ctx, 1, 0x804); | ||
1408 | xf_emit(ctx, 1, 1); | ||
1409 | xf_emit(ctx, 1, 0x1a); | ||
1410 | if (dev_priv->chipset != 0x50) | 1608 | if (dev_priv->chipset != 0x50) |
1411 | xf_emit(ctx, 1, 0x7f); | 1609 | xf_emit(ctx, 1, 0); /* 3ff */ |
1412 | xf_emit(ctx, 1, 0); | 1610 | xf_emit(ctx, 1, 0); /* 000000ff tesla UNK1940 */ |
1413 | xf_emit(ctx, 1, 1); | 1611 | xf_emit(ctx, 1, 0); /* 00000001 tesla UNK0D7C */ |
1414 | xf_emit(ctx, 1, 0x80c14); | 1612 | xf_emit(ctx, 1, 0x804); /* 00000fff SEMANTIC_CLIP */ |
1415 | xf_emit(ctx, 1, 0); | 1613 | xf_emit(ctx, 1, 1); /* 00000001 VIEWPORT_TRANSFORM_EN */ |
1416 | xf_emit(ctx, 1, 0x8100c12); | 1614 | xf_emit(ctx, 1, 0x1a); /* 0000001f POLYGON_MODE */ |
1417 | xf_emit(ctx, 2, 4); | ||
1418 | xf_emit(ctx, 1, 0); | ||
1419 | xf_emit(ctx, 1, 0x10); | ||
1420 | xf_emit(ctx, 3, 0); | ||
1421 | xf_emit(ctx, 1, 1); | ||
1422 | xf_emit(ctx, 1, 0x8100c12); | ||
1423 | xf_emit(ctx, 6, 0); | ||
1424 | if (dev_priv->chipset == 0x50) | ||
1425 | xf_emit(ctx, 1, 0x3ff); | ||
1426 | else | ||
1427 | xf_emit(ctx, 1, 0x7ff); | ||
1428 | xf_emit(ctx, 1, 0x80c14); | ||
1429 | xf_emit(ctx, 0x38, 0); | ||
1430 | xf_emit(ctx, 1, 1); | ||
1431 | xf_emit(ctx, 2, 0); | ||
1432 | xf_emit(ctx, 1, 0x10); | ||
1433 | xf_emit(ctx, 0x38, 0); | ||
1434 | xf_emit(ctx, 2, 0x88); | ||
1435 | xf_emit(ctx, 2, 0); | ||
1436 | xf_emit(ctx, 1, 4); | ||
1437 | xf_emit(ctx, 0x16, 0); | ||
1438 | xf_emit(ctx, 1, 0x26); | ||
1439 | xf_emit(ctx, 2, 0); | ||
1440 | xf_emit(ctx, 1, 0x3f800000); | ||
1441 | if (dev_priv->chipset > 0xa0 && dev_priv->chipset < 0xaa) | ||
1442 | xf_emit(ctx, 4, 0); | ||
1443 | else | ||
1444 | xf_emit(ctx, 3, 0); | ||
1445 | xf_emit(ctx, 1, 0x1a); | ||
1446 | xf_emit(ctx, 1, 0x10); | ||
1447 | if (dev_priv->chipset != 0x50) | 1615 | if (dev_priv->chipset != 0x50) |
1448 | xf_emit(ctx, 0x28, 0); | 1616 | xf_emit(ctx, 1, 0x7f); /* 000000ff tesla UNK0FFC */ |
1617 | xf_emit(ctx, 1, 0); /* ffffffff tesla UNK1A30 */ | ||
1618 | xf_emit(ctx, 1, 1); /* 00000001 SHADE_MODEL */ | ||
1619 | xf_emit(ctx, 1, 0x80c14); /* 01ffffff SEMANTIC_COLOR */ | ||
1620 | xf_emit(ctx, 1, 0); /* 00000001 tesla UNK1900 */ | ||
1621 | xf_emit(ctx, 1, 0x8100c12); /* 1fffffff FP_INTERPOLANT_CTRL */ | ||
1622 | xf_emit(ctx, 1, 4); /* 0000007f VP_RESULT_MAP_SIZE */ | ||
1623 | xf_emit(ctx, 1, 4); /* 000000ff GP_RESULT_MAP_SIZE */ | ||
1624 | xf_emit(ctx, 1, 0); /* 00000001 GP_ENABLE */ | ||
1625 | xf_emit(ctx, 1, 0x10); /* 7f/ff VIEW_VOLUME_CLIP_CTRL */ | ||
1626 | xf_emit(ctx, 1, 0); /* 00000001 tesla UNK0D7C */ | ||
1627 | xf_emit(ctx, 1, 0); /* 00000001 tesla UNK0F8C */ | ||
1628 | xf_emit(ctx, 1, 0); /* ffffffff tesla UNK1A30 */ | ||
1629 | xf_emit(ctx, 1, 1); /* 00000001 VIEWPORT_TRANSFORM_EN */ | ||
1630 | xf_emit(ctx, 1, 0x8100c12); /* 1fffffff FP_INTERPOLANT_CTRL */ | ||
1631 | xf_emit(ctx, 4, 0); /* ffffffff NOPERSPECTIVE_BITMAP */ | ||
1632 | xf_emit(ctx, 1, 0); /* 00000001 tesla UNK1900 */ | ||
1633 | xf_emit(ctx, 1, 0); /* 0000000f */ | ||
1634 | if (dev_priv->chipset == 0x50) | ||
1635 | xf_emit(ctx, 1, 0x3ff); /* 000003ff tesla UNK0D68 */ | ||
1449 | else | 1636 | else |
1450 | xf_emit(ctx, 0x25, 0); | 1637 | xf_emit(ctx, 1, 0x7ff); /* 000007ff tesla UNK0D68 */ |
1451 | xf_emit(ctx, 1, 0x52); | 1638 | xf_emit(ctx, 1, 0x80c14); /* 01ffffff SEMANTIC_COLOR */ |
1452 | xf_emit(ctx, 1, 0); | 1639 | xf_emit(ctx, 1, 0); /* 00000001 VERTEX_TWO_SIDE_ENABLE */ |
1453 | xf_emit(ctx, 1, 0x26); | 1640 | xf_emit(ctx, 0x30, 0); /* ffffffff VIEWPORT_SCALE: X0, Y0, Z0, X1, Y1, ... */ |
1454 | xf_emit(ctx, 1, 0); | 1641 | xf_emit(ctx, 3, 0); /* f, 0, 0 */ |
1455 | xf_emit(ctx, 2, 4); | 1642 | xf_emit(ctx, 3, 0); /* ffffffff last VIEWPORT_SCALE? */ |
1456 | xf_emit(ctx, 1, 0); | 1643 | xf_emit(ctx, 1, 0); /* ffffffff tesla UNK1A30 */ |
1457 | xf_emit(ctx, 1, 0x1a); | 1644 | xf_emit(ctx, 1, 1); /* 00000001 VIEWPORT_TRANSFORM_EN */ |
1458 | xf_emit(ctx, 2, 0); | 1645 | xf_emit(ctx, 1, 0); /* 00000001 tesla UNK1900 */ |
1459 | xf_emit(ctx, 1, 0x00ffff00); | 1646 | xf_emit(ctx, 1, 0); /* 00000001 tesla UNK1924 */ |
1460 | xf_emit(ctx, 1, 0); | 1647 | xf_emit(ctx, 1, 0x10); /* 000000ff VIEW_VOLUME_CLIP_CTRL */ |
1648 | xf_emit(ctx, 1, 0); /* 00000001 */ | ||
1649 | xf_emit(ctx, 0x30, 0); /* ffffffff VIEWPORT_TRANSLATE */ | ||
1650 | xf_emit(ctx, 3, 0); /* f, 0, 0 */ | ||
1651 | xf_emit(ctx, 3, 0); /* ffffffff */ | ||
1652 | xf_emit(ctx, 1, 0); /* ffffffff tesla UNK1A30 */ | ||
1653 | xf_emit(ctx, 2, 0x88); /* 000001ff tesla UNK19D8 */ | ||
1654 | xf_emit(ctx, 1, 0); /* 00000001 tesla UNK1924 */ | ||
1655 | xf_emit(ctx, 1, 0); /* ffffffff tesla UNK1A30 */ | ||
1656 | xf_emit(ctx, 1, 4); /* 0000000f CULL_MODE */ | ||
1657 | xf_emit(ctx, 2, 0); /* 07ffffff SCREEN_SCISSOR */ | ||
1658 | xf_emit(ctx, 2, 0); /* 00007fff WINDOW_OFFSET_XY */ | ||
1659 | xf_emit(ctx, 1, 0); /* 00000003 WINDOW_ORIGIN */ | ||
1660 | xf_emit(ctx, 0x10, 0); /* 00000001 SCISSOR_ENABLE */ | ||
1661 | xf_emit(ctx, 1, 0); /* 0001ffff GP_BUILTIN_RESULT_EN */ | ||
1662 | xf_emit(ctx, 1, 0x26); /* 000000ff SEMANTIC_LAYER */ | ||
1663 | xf_emit(ctx, 1, 0); /* 00000001 tesla UNK1900 */ | ||
1664 | xf_emit(ctx, 1, 0); /* 0000000f */ | ||
1665 | xf_emit(ctx, 1, 0x3f800000); /* ffffffff LINE_WIDTH */ | ||
1666 | xf_emit(ctx, 1, 0); /* 00000001 LINE_STIPPLE_ENABLE */ | ||
1667 | xf_emit(ctx, 1, 0); /* 00000001 LINE_SMOOTH_ENABLE */ | ||
1668 | xf_emit(ctx, 1, 0); /* 00000007 MULTISAMPLE_SAMPLES_LOG2 */ | ||
1669 | if (IS_NVA3F(dev_priv->chipset)) | ||
1670 | xf_emit(ctx, 1, 0); /* 00000001 */ | ||
1671 | xf_emit(ctx, 1, 0x1a); /* 0000001f POLYGON_MODE */ | ||
1672 | xf_emit(ctx, 1, 0x10); /* 000000ff VIEW_VOLUME_CLIP_CTRL */ | ||
1673 | if (dev_priv->chipset != 0x50) { | ||
1674 | xf_emit(ctx, 1, 0); /* ffffffff */ | ||
1675 | xf_emit(ctx, 1, 0); /* 00000001 */ | ||
1676 | xf_emit(ctx, 1, 0); /* 000003ff */ | ||
1677 | } | ||
1678 | xf_emit(ctx, 0x20, 0); /* 10xbits ffffffff, 3fffff. SCISSOR_* */ | ||
1679 | xf_emit(ctx, 1, 0); /* f */ | ||
1680 | xf_emit(ctx, 1, 0); /* 0? */ | ||
1681 | xf_emit(ctx, 1, 0); /* ffffffff */ | ||
1682 | xf_emit(ctx, 1, 0); /* 003fffff */ | ||
1683 | xf_emit(ctx, 1, 0); /* ffffffff tesla UNK1A30 */ | ||
1684 | xf_emit(ctx, 1, 0x52); /* 000001ff SEMANTIC_PTSZ */ | ||
1685 | xf_emit(ctx, 1, 0); /* 0001ffff GP_BUILTIN_RESULT_EN */ | ||
1686 | xf_emit(ctx, 1, 0x26); /* 000000ff SEMANTIC_LAYER */ | ||
1687 | xf_emit(ctx, 1, 0); /* 00000001 tesla UNK1900 */ | ||
1688 | xf_emit(ctx, 1, 4); /* 0000007f VP_RESULT_MAP_SIZE */ | ||
1689 | xf_emit(ctx, 1, 4); /* 000000ff GP_RESULT_MAP_SIZE */ | ||
1690 | xf_emit(ctx, 1, 0); /* 00000001 GP_ENABLE */ | ||
1691 | xf_emit(ctx, 1, 0x1a); /* 0000001f POLYGON_MODE */ | ||
1692 | xf_emit(ctx, 1, 0); /* 00000001 LINE_SMOOTH_ENABLE */ | ||
1693 | xf_emit(ctx, 1, 0); /* 00000001 LINE_STIPPLE_ENABLE */ | ||
1694 | xf_emit(ctx, 1, 0x00ffff00); /* 00ffffff LINE_STIPPLE_PATTERN */ | ||
1695 | xf_emit(ctx, 1, 0); /* 0000000f */ | ||
1461 | } | 1696 | } |
1462 | 1697 | ||
1463 | static void | 1698 | static void |
1464 | nv50_graph_construct_gene_unk3(struct nouveau_grctx *ctx) | 1699 | nv50_graph_construct_gene_zcull(struct nouveau_grctx *ctx) |
1465 | { | 1700 | { |
1466 | struct drm_nouveau_private *dev_priv = ctx->dev->dev_private; | 1701 | struct drm_nouveau_private *dev_priv = ctx->dev->dev_private; |
1467 | /* end of area 0 on pre-NVA0, beginning of area 6 on NVAx */ | 1702 | /* end of strand 0 on pre-NVA0, beginning of strand 6 on NVAx */ |
1468 | xf_emit(ctx, 1, 0x3f); | 1703 | /* SEEK */ |
1469 | xf_emit(ctx, 0xa, 0); | 1704 | xf_emit(ctx, 1, 0x3f); /* 0000003f UNK1590 */ |
1470 | xf_emit(ctx, 1, 2); | 1705 | xf_emit(ctx, 1, 0); /* 00000001 ALPHA_TEST_ENABLE */ |
1471 | xf_emit(ctx, 2, 0x04000000); | 1706 | xf_emit(ctx, 1, 0); /* 00000007 MULTISAMPLE_SAMPLES_LOG2 */ |
1472 | xf_emit(ctx, 8, 0); | 1707 | xf_emit(ctx, 1, 0); /* 00000001 tesla UNK1534 */ |
1473 | xf_emit(ctx, 1, 4); | 1708 | xf_emit(ctx, 1, 0); /* 00000007 STENCIL_BACK_FUNC_FUNC */ |
1474 | xf_emit(ctx, 3, 0); | 1709 | xf_emit(ctx, 1, 0); /* 000000ff STENCIL_BACK_FUNC_MASK */ |
1475 | xf_emit(ctx, 1, 4); | 1710 | xf_emit(ctx, 1, 0); /* 000000ff STENCIL_BACK_FUNC_REF */ |
1476 | if (dev_priv->chipset == 0x50) | 1711 | xf_emit(ctx, 1, 0); /* 000000ff STENCIL_BACK_MASK */ |
1477 | xf_emit(ctx, 0x10, 0); | 1712 | xf_emit(ctx, 3, 0); /* 00000007 STENCIL_BACK_OP_FAIL, ZFAIL, ZPASS */ |
1478 | else | 1713 | xf_emit(ctx, 1, 2); /* 00000003 tesla UNK143C */ |
1479 | xf_emit(ctx, 0x11, 0); | 1714 | xf_emit(ctx, 2, 0x04000000); /* 07ffffff tesla UNK0D6C */ |
1480 | xf_emit(ctx, 1, 1); | 1715 | xf_emit(ctx, 1, 0); /* ffff0ff3 */ |
1481 | xf_emit(ctx, 1, 0x1001); | 1716 | xf_emit(ctx, 1, 0); /* 00000001 CLIPID_ENABLE */ |
1482 | xf_emit(ctx, 4, 0xffff); | 1717 | xf_emit(ctx, 2, 0); /* ffffffff DEPTH_BOUNDS */ |
1483 | xf_emit(ctx, 0x20, 0); | 1718 | xf_emit(ctx, 1, 0); /* 00000001 */ |
1484 | xf_emit(ctx, 0x10, 0x3f800000); | 1719 | xf_emit(ctx, 1, 0); /* 00000007 DEPTH_TEST_FUNC */ |
1485 | xf_emit(ctx, 1, 0x10); | 1720 | xf_emit(ctx, 1, 0); /* 00000001 DEPTH_TEST_ENABLE */ |
1486 | if (dev_priv->chipset == 0x50) | 1721 | xf_emit(ctx, 1, 0); /* 00000001 DEPTH_WRITE_ENABLE */ |
1487 | xf_emit(ctx, 1, 0); | 1722 | xf_emit(ctx, 1, 4); /* 0000000f CULL_MODE */ |
1488 | else | 1723 | xf_emit(ctx, 1, 0); /* 0000ffff */ |
1489 | xf_emit(ctx, 2, 0); | 1724 | xf_emit(ctx, 1, 0); /* 00000001 UNK0FB0 */ |
1490 | xf_emit(ctx, 1, 3); | 1725 | xf_emit(ctx, 1, 0); /* 00000001 POLYGON_STIPPLE_ENABLE */ |
1491 | xf_emit(ctx, 2, 0); | 1726 | xf_emit(ctx, 1, 4); /* 00000007 FP_CONTROL */ |
1727 | xf_emit(ctx, 1, 0); /* ffffffff */ | ||
1728 | xf_emit(ctx, 1, 0); /* 0001ffff GP_BUILTIN_RESULT_EN */ | ||
1729 | xf_emit(ctx, 1, 0); /* 000000ff CLEAR_STENCIL */ | ||
1730 | xf_emit(ctx, 1, 0); /* 00000007 STENCIL_FRONT_FUNC_FUNC */ | ||
1731 | xf_emit(ctx, 1, 0); /* 000000ff STENCIL_FRONT_FUNC_MASK */ | ||
1732 | xf_emit(ctx, 1, 0); /* 000000ff STENCIL_FRONT_FUNC_REF */ | ||
1733 | xf_emit(ctx, 1, 0); /* 000000ff STENCIL_FRONT_MASK */ | ||
1734 | xf_emit(ctx, 3, 0); /* 00000007 STENCIL_FRONT_OP_FAIL, ZFAIL, ZPASS */ | ||
1735 | xf_emit(ctx, 1, 0); /* 00000001 STENCIL_FRONT_ENABLE */ | ||
1736 | xf_emit(ctx, 1, 0); /* 00000001 STENCIL_BACK_ENABLE */ | ||
1737 | xf_emit(ctx, 1, 0); /* ffffffff CLEAR_DEPTH */ | ||
1738 | xf_emit(ctx, 1, 0); /* 00000007 */ | ||
1739 | if (dev_priv->chipset != 0x50) | ||
1740 | xf_emit(ctx, 1, 0); /* 00000003 tesla UNK1108 */ | ||
1741 | xf_emit(ctx, 1, 0); /* 00000001 SAMPLECNT_ENABLE */ | ||
1742 | xf_emit(ctx, 1, 0); /* 0000000f ZETA_FORMAT */ | ||
1743 | xf_emit(ctx, 1, 1); /* 00000001 ZETA_ENABLE */ | ||
1744 | xf_emit(ctx, 1, 0x1001); /* 00001fff ZETA_ARRAY_MODE */ | ||
1745 | /* SEEK */ | ||
1746 | xf_emit(ctx, 4, 0xffff); /* 0000ffff MSAA_MASK */ | ||
1747 | xf_emit(ctx, 0x10, 0); /* 00000001 SCISSOR_ENABLE */ | ||
1748 | xf_emit(ctx, 0x10, 0); /* ffffffff DEPTH_RANGE_NEAR */ | ||
1749 | xf_emit(ctx, 0x10, 0x3f800000); /* ffffffff DEPTH_RANGE_FAR */ | ||
1750 | xf_emit(ctx, 1, 0x10); /* 7f/ff/3ff VIEW_VOLUME_CLIP_CTRL */ | ||
1751 | xf_emit(ctx, 1, 0); /* 00000001 VIEWPORT_CLIP_RECTS_EN */ | ||
1752 | xf_emit(ctx, 1, 3); /* 00000003 FP_CTRL_UNK196C */ | ||
1753 | xf_emit(ctx, 1, 0); /* 00000003 tesla UNK1968 */ | ||
1754 | if (dev_priv->chipset != 0x50) | ||
1755 | xf_emit(ctx, 1, 0); /* 0fffffff tesla UNK1104 */ | ||
1756 | xf_emit(ctx, 1, 0); /* 00000001 tesla UNK151C */ | ||
1492 | } | 1757 | } |
1493 | 1758 | ||
1494 | static void | 1759 | static void |
1495 | nv50_graph_construct_gene_unk4(struct nouveau_grctx *ctx) | 1760 | nv50_graph_construct_gene_clipid(struct nouveau_grctx *ctx) |
1496 | { | 1761 | { |
1497 | /* middle of area 0 on pre-NVA0, middle of area 6 on NVAx */ | 1762 | /* middle of strand 0 on pre-NVA0 [after 24xx], middle of area 6 on NVAx */ |
1498 | xf_emit(ctx, 2, 0x04000000); | 1763 | /* SEEK */ |
1499 | xf_emit(ctx, 1, 0); | 1764 | xf_emit(ctx, 1, 0); /* 00000007 UNK0FB4 */ |
1500 | xf_emit(ctx, 1, 0x80); | 1765 | /* SEEK */ |
1501 | xf_emit(ctx, 3, 0); | 1766 | xf_emit(ctx, 4, 0); /* 07ffffff CLIPID_REGION_HORIZ */ |
1502 | xf_emit(ctx, 1, 0x80); | 1767 | xf_emit(ctx, 4, 0); /* 07ffffff CLIPID_REGION_VERT */ |
1503 | xf_emit(ctx, 1, 0); | 1768 | xf_emit(ctx, 2, 0); /* 07ffffff SCREEN_SCISSOR */ |
1769 | xf_emit(ctx, 2, 0x04000000); /* 07ffffff UNK1508 */ | ||
1770 | xf_emit(ctx, 1, 0); /* 00000001 CLIPID_ENABLE */ | ||
1771 | xf_emit(ctx, 1, 0x80); /* 00003fff CLIPID_WIDTH */ | ||
1772 | xf_emit(ctx, 1, 0); /* 000000ff CLIPID_ID */ | ||
1773 | xf_emit(ctx, 1, 0); /* 000000ff CLIPID_ADDRESS_HIGH */ | ||
1774 | xf_emit(ctx, 1, 0); /* ffffffff CLIPID_ADDRESS_LOW */ | ||
1775 | xf_emit(ctx, 1, 0x80); /* 00003fff CLIPID_HEIGHT */ | ||
1776 | xf_emit(ctx, 1, 0); /* 0000ffff DMA_CLIPID */ | ||
1504 | } | 1777 | } |
1505 | 1778 | ||
1506 | static void | 1779 | static void |
1507 | nv50_graph_construct_gene_unk5(struct nouveau_grctx *ctx) | 1780 | nv50_graph_construct_gene_unk24xx(struct nouveau_grctx *ctx) |
1508 | { | 1781 | { |
1509 | struct drm_nouveau_private *dev_priv = ctx->dev->dev_private; | 1782 | struct drm_nouveau_private *dev_priv = ctx->dev->dev_private; |
1510 | /* middle of area 0 on pre-NVA0 [after m2mf], end of area 2 on NVAx */ | 1783 | int i; |
1511 | xf_emit(ctx, 2, 4); | 1784 | /* middle of strand 0 on pre-NVA0 [after m2mf], end of strand 2 on NVAx */ |
1512 | if (dev_priv->chipset > 0xa0 && dev_priv->chipset < 0xaa) | 1785 | /* SEEK */ |
1513 | xf_emit(ctx, 0x1c4d, 0); | 1786 | xf_emit(ctx, 0x33, 0); |
1787 | /* SEEK */ | ||
1788 | xf_emit(ctx, 2, 0); | ||
1789 | /* SEEK */ | ||
1790 | xf_emit(ctx, 1, 0); /* 00000001 GP_ENABLE */ | ||
1791 | xf_emit(ctx, 1, 4); /* 0000007f VP_RESULT_MAP_SIZE */ | ||
1792 | xf_emit(ctx, 1, 4); /* 000000ff GP_RESULT_MAP_SIZE */ | ||
1793 | /* SEEK */ | ||
1794 | if (IS_NVA3F(dev_priv->chipset)) { | ||
1795 | xf_emit(ctx, 4, 0); /* RO */ | ||
1796 | xf_emit(ctx, 0xe10, 0); /* 190 * 9: 8*ffffffff, 7ff */ | ||
1797 | xf_emit(ctx, 1, 0); /* 1ff */ | ||
1798 | xf_emit(ctx, 8, 0); /* 0? */ | ||
1799 | xf_emit(ctx, 9, 0); /* ffffffff, 7ff */ | ||
1800 | |||
1801 | xf_emit(ctx, 4, 0); /* RO */ | ||
1802 | xf_emit(ctx, 0xe10, 0); /* 190 * 9: 8*ffffffff, 7ff */ | ||
1803 | xf_emit(ctx, 1, 0); /* 1ff */ | ||
1804 | xf_emit(ctx, 8, 0); /* 0? */ | ||
1805 | xf_emit(ctx, 9, 0); /* ffffffff, 7ff */ | ||
1806 | } | ||
1514 | else | 1807 | else |
1515 | xf_emit(ctx, 0x1c4b, 0); | 1808 | { |
1516 | xf_emit(ctx, 2, 4); | 1809 | xf_emit(ctx, 0xc, 0); /* RO */ |
1517 | xf_emit(ctx, 1, 0x8100c12); | 1810 | /* SEEK */ |
1811 | xf_emit(ctx, 0xe10, 0); /* 190 * 9: 8*ffffffff, 7ff */ | ||
1812 | xf_emit(ctx, 1, 0); /* 1ff */ | ||
1813 | xf_emit(ctx, 8, 0); /* 0? */ | ||
1814 | |||
1815 | /* SEEK */ | ||
1816 | xf_emit(ctx, 0xc, 0); /* RO */ | ||
1817 | /* SEEK */ | ||
1818 | xf_emit(ctx, 0xe10, 0); /* 190 * 9: 8*ffffffff, 7ff */ | ||
1819 | xf_emit(ctx, 1, 0); /* 1ff */ | ||
1820 | xf_emit(ctx, 8, 0); /* 0? */ | ||
1821 | } | ||
1822 | /* SEEK */ | ||
1823 | xf_emit(ctx, 1, 0); /* 00000001 GP_ENABLE */ | ||
1824 | xf_emit(ctx, 1, 4); /* 000000ff GP_RESULT_MAP_SIZE */ | ||
1825 | xf_emit(ctx, 1, 4); /* 0000007f VP_RESULT_MAP_SIZE */ | ||
1826 | xf_emit(ctx, 1, 0x8100c12); /* 1fffffff FP_INTERPOLANT_CTRL */ | ||
1518 | if (dev_priv->chipset != 0x50) | 1827 | if (dev_priv->chipset != 0x50) |
1519 | xf_emit(ctx, 1, 3); | 1828 | xf_emit(ctx, 1, 3); /* 00000003 tesla UNK1100 */ |
1520 | xf_emit(ctx, 1, 0); | 1829 | /* SEEK */ |
1521 | xf_emit(ctx, 1, 0x8100c12); | 1830 | xf_emit(ctx, 1, 0); /* 00000001 GP_ENABLE */ |
1522 | xf_emit(ctx, 1, 0); | 1831 | xf_emit(ctx, 1, 0x8100c12); /* 1fffffff FP_INTERPOLANT_CTRL */ |
1523 | xf_emit(ctx, 1, 0x80c14); | 1832 | xf_emit(ctx, 1, 0); /* 0000000f VP_GP_BUILTIN_ATTR_EN */ |
1524 | xf_emit(ctx, 1, 1); | 1833 | xf_emit(ctx, 1, 0x80c14); /* 01ffffff SEMANTIC_COLOR */ |
1834 | xf_emit(ctx, 1, 1); /* 00000001 */ | ||
1835 | /* SEEK */ | ||
1525 | if (dev_priv->chipset >= 0xa0) | 1836 | if (dev_priv->chipset >= 0xa0) |
1526 | xf_emit(ctx, 2, 4); | 1837 | xf_emit(ctx, 2, 4); /* 000000ff */ |
1527 | xf_emit(ctx, 1, 0x80c14); | 1838 | xf_emit(ctx, 1, 0x80c14); /* 01ffffff SEMANTIC_COLOR */ |
1528 | xf_emit(ctx, 2, 0); | 1839 | xf_emit(ctx, 1, 0); /* 00000001 VERTEX_TWO_SIDE_ENABLE */ |
1529 | xf_emit(ctx, 1, 0x8100c12); | 1840 | xf_emit(ctx, 1, 0); /* 00000001 POINT_SPRITE_ENABLE */ |
1530 | xf_emit(ctx, 1, 0x27); | 1841 | xf_emit(ctx, 1, 0x8100c12); /* 1fffffff FP_INTERPOLANT_CTRL */ |
1531 | xf_emit(ctx, 2, 0); | 1842 | xf_emit(ctx, 1, 0x27); /* 000000ff SEMANTIC_PRIM_ID */ |
1532 | xf_emit(ctx, 1, 1); | 1843 | xf_emit(ctx, 1, 0); /* 00000001 GP_ENABLE */ |
1533 | xf_emit(ctx, 0x3c1, 0); | 1844 | xf_emit(ctx, 1, 0); /* 0000000f */ |
1534 | xf_emit(ctx, 1, 1); | 1845 | xf_emit(ctx, 1, 1); /* 00000001 */ |
1535 | xf_emit(ctx, 0x16, 0); | 1846 | for (i = 0; i < 10; i++) { |
1536 | xf_emit(ctx, 1, 0x8100c12); | 1847 | /* SEEK */ |
1537 | xf_emit(ctx, 1, 0); | 1848 | xf_emit(ctx, 0x40, 0); /* ffffffff */ |
1849 | xf_emit(ctx, 0x10, 0); /* 3, 0, 0.... */ | ||
1850 | xf_emit(ctx, 0x10, 0); /* ffffffff */ | ||
1851 | } | ||
1852 | /* SEEK */ | ||
1853 | xf_emit(ctx, 1, 0); /* 00000001 POINT_SPRITE_CTRL */ | ||
1854 | xf_emit(ctx, 1, 1); /* 00000001 */ | ||
1855 | xf_emit(ctx, 1, 0); /* ffffffff */ | ||
1856 | xf_emit(ctx, 4, 0); /* ffffffff NOPERSPECTIVE_BITMAP */ | ||
1857 | xf_emit(ctx, 0x10, 0); /* 00ffffff POINT_COORD_REPLACE_MAP */ | ||
1858 | xf_emit(ctx, 1, 0); /* 00000003 WINDOW_ORIGIN */ | ||
1859 | xf_emit(ctx, 1, 0x8100c12); /* 1fffffff FP_INTERPOLANT_CTRL */ | ||
1860 | if (dev_priv->chipset != 0x50) | ||
1861 | xf_emit(ctx, 1, 0); /* 000003ff */ | ||
1538 | } | 1862 | } |
1539 | 1863 | ||
1540 | static void | 1864 | static void |
1541 | nv50_graph_construct_gene_unk6(struct nouveau_grctx *ctx) | 1865 | nv50_graph_construct_gene_vfetch(struct nouveau_grctx *ctx) |
1542 | { | 1866 | { |
1543 | struct drm_nouveau_private *dev_priv = ctx->dev->dev_private; | 1867 | struct drm_nouveau_private *dev_priv = ctx->dev->dev_private; |
1544 | /* beginning of area 1 on pre-NVA0 [after m2mf], area 3 on NVAx */ | 1868 | int acnt = 0x10, rep, i; |
1545 | xf_emit(ctx, 4, 0); | 1869 | /* beginning of strand 1 on pre-NVA0, strand 3 on NVAx */ |
1546 | xf_emit(ctx, 1, 0xf); | 1870 | if (IS_NVA3F(dev_priv->chipset)) |
1547 | if (dev_priv->chipset > 0xa0 && dev_priv->chipset < 0xaa) | 1871 | acnt = 0x20; |
1548 | xf_emit(ctx, 8, 0); | 1872 | /* SEEK */ |
1549 | else | 1873 | if (dev_priv->chipset >= 0xa0) { |
1550 | xf_emit(ctx, 4, 0); | 1874 | xf_emit(ctx, 1, 0); /* ffffffff tesla UNK13A4 */ |
1551 | xf_emit(ctx, 1, 0x20); | 1875 | xf_emit(ctx, 1, 1); /* 00000fff tesla UNK1318 */ |
1552 | if (dev_priv->chipset > 0xa0 && dev_priv->chipset < 0xaa) | 1876 | } |
1553 | xf_emit(ctx, 0x11, 0); | 1877 | xf_emit(ctx, 1, 0); /* ffffffff VERTEX_BUFFER_FIRST */ |
1878 | xf_emit(ctx, 1, 0); /* 00000001 PRIMITIVE_RESTART_ENABLE */ | ||
1879 | xf_emit(ctx, 1, 0); /* 00000001 UNK0DE8 */ | ||
1880 | xf_emit(ctx, 1, 0); /* ffffffff PRIMITIVE_RESTART_INDEX */ | ||
1881 | xf_emit(ctx, 1, 0xf); /* ffffffff VP_ATTR_EN */ | ||
1882 | xf_emit(ctx, (acnt/8)-1, 0); /* ffffffff VP_ATTR_EN */ | ||
1883 | xf_emit(ctx, acnt/8, 0); /* ffffffff VTX_ATR_MASK_UNK0DD0 */ | ||
1884 | xf_emit(ctx, 1, 0); /* 0000000f VP_GP_BUILTIN_ATTR_EN */ | ||
1885 | xf_emit(ctx, 1, 0x20); /* 0000ffff tesla UNK129C */ | ||
1886 | xf_emit(ctx, 1, 0); /* 000000ff turing UNK370??? */ | ||
1887 | xf_emit(ctx, 1, 0); /* 0000ffff turing USER_PARAM_COUNT */ | ||
1888 | xf_emit(ctx, 1, 0); /* ffffffff tesla UNK1A30 */ | ||
1889 | /* SEEK */ | ||
1890 | if (IS_NVA3F(dev_priv->chipset)) | ||
1891 | xf_emit(ctx, 0xb, 0); /* RO */ | ||
1554 | else if (dev_priv->chipset >= 0xa0) | 1892 | else if (dev_priv->chipset >= 0xa0) |
1555 | xf_emit(ctx, 0xf, 0); | 1893 | xf_emit(ctx, 0x9, 0); /* RO */ |
1556 | else | 1894 | else |
1557 | xf_emit(ctx, 0xe, 0); | 1895 | xf_emit(ctx, 0x8, 0); /* RO */ |
1558 | xf_emit(ctx, 1, 0x1a); | 1896 | /* SEEK */ |
1559 | xf_emit(ctx, 0xd, 0); | 1897 | xf_emit(ctx, 1, 0); /* 00000001 EDGE_FLAG */ |
1560 | xf_emit(ctx, 2, 4); | 1898 | xf_emit(ctx, 1, 0); /* 00000001 PROVOKING_VERTEX_LAST */ |
1561 | xf_emit(ctx, 1, 0); | 1899 | xf_emit(ctx, 1, 0); /* 00000001 GP_ENABLE */ |
1562 | xf_emit(ctx, 1, 4); | 1900 | xf_emit(ctx, 1, 0x1a); /* 0000001f POLYGON_MODE */ |
1563 | xf_emit(ctx, 1, 8); | 1901 | /* SEEK */ |
1564 | xf_emit(ctx, 1, 0); | 1902 | xf_emit(ctx, 0xc, 0); /* RO */ |
1903 | /* SEEK */ | ||
1904 | xf_emit(ctx, 1, 0); /* 7f/ff */ | ||
1905 | xf_emit(ctx, 1, 4); /* 7f/ff VP_REG_ALLOC_RESULT */ | ||
1906 | xf_emit(ctx, 1, 4); /* 7f/ff VP_RESULT_MAP_SIZE */ | ||
1907 | xf_emit(ctx, 1, 0); /* 0000000f VP_GP_BUILTIN_ATTR_EN */ | ||
1908 | xf_emit(ctx, 1, 4); /* 000001ff UNK1A28 */ | ||
1909 | xf_emit(ctx, 1, 8); /* 000001ff UNK0DF0 */ | ||
1910 | xf_emit(ctx, 1, 0); /* 00000001 GP_ENABLE */ | ||
1565 | if (dev_priv->chipset == 0x50) | 1911 | if (dev_priv->chipset == 0x50) |
1566 | xf_emit(ctx, 1, 0x3ff); | 1912 | xf_emit(ctx, 1, 0x3ff); /* 3ff tesla UNK0D68 */ |
1567 | else | 1913 | else |
1568 | xf_emit(ctx, 1, 0x7ff); | 1914 | xf_emit(ctx, 1, 0x7ff); /* 7ff tesla UNK0D68 */ |
1569 | if (dev_priv->chipset == 0xa8) | 1915 | if (dev_priv->chipset == 0xa8) |
1570 | xf_emit(ctx, 1, 0x1e00); | 1916 | xf_emit(ctx, 1, 0x1e00); /* 7fff */ |
1571 | xf_emit(ctx, 0xc, 0); | 1917 | /* SEEK */ |
1572 | xf_emit(ctx, 1, 0xf); | 1918 | xf_emit(ctx, 0xc, 0); /* RO or close */ |
1573 | if (dev_priv->chipset == 0x50) | 1919 | /* SEEK */ |
1574 | xf_emit(ctx, 0x125, 0); | 1920 | xf_emit(ctx, 1, 0xf); /* ffffffff VP_ATTR_EN */ |
1575 | else if (dev_priv->chipset < 0xa0) | 1921 | xf_emit(ctx, (acnt/8)-1, 0); /* ffffffff VP_ATTR_EN */ |
1576 | xf_emit(ctx, 0x126, 0); | 1922 | xf_emit(ctx, 1, 0); /* 0000000f VP_GP_BUILTIN_ATTR_EN */ |
1577 | else if (dev_priv->chipset == 0xa0 || dev_priv->chipset >= 0xaa) | 1923 | if (dev_priv->chipset > 0x50 && dev_priv->chipset < 0xa0) |
1578 | xf_emit(ctx, 0x124, 0); | 1924 | xf_emit(ctx, 2, 0); /* ffffffff */ |
1579 | else | 1925 | else |
1580 | xf_emit(ctx, 0x1f7, 0); | 1926 | xf_emit(ctx, 1, 0); /* ffffffff */ |
1581 | xf_emit(ctx, 1, 0xf); | 1927 | xf_emit(ctx, 1, 0); /* 00000003 tesla UNK0FD8 */ |
1582 | if (dev_priv->chipset > 0xa0 && dev_priv->chipset < 0xaa) | 1928 | /* SEEK */ |
1583 | xf_emit(ctx, 3, 0); | 1929 | if (IS_NVA3F(dev_priv->chipset)) { |
1930 | xf_emit(ctx, 0x10, 0); /* 0? */ | ||
1931 | xf_emit(ctx, 2, 0); /* weird... */ | ||
1932 | xf_emit(ctx, 2, 0); /* RO */ | ||
1933 | } else { | ||
1934 | xf_emit(ctx, 8, 0); /* 0? */ | ||
1935 | xf_emit(ctx, 1, 0); /* weird... */ | ||
1936 | xf_emit(ctx, 2, 0); /* RO */ | ||
1937 | } | ||
1938 | /* SEEK */ | ||
1939 | xf_emit(ctx, 1, 0); /* ffffffff VB_ELEMENT_BASE */ | ||
1940 | xf_emit(ctx, 1, 0); /* ffffffff UNK1438 */ | ||
1941 | xf_emit(ctx, acnt, 0); /* 1 tesla UNK1000 */ | ||
1942 | if (dev_priv->chipset >= 0xa0) | ||
1943 | xf_emit(ctx, 1, 0); /* ffffffff tesla UNK1118? */ | ||
1944 | /* SEEK */ | ||
1945 | xf_emit(ctx, acnt, 0); /* ffffffff VERTEX_ARRAY_UNK90C */ | ||
1946 | xf_emit(ctx, 1, 0); /* f/1f */ | ||
1947 | /* SEEK */ | ||
1948 | xf_emit(ctx, acnt, 0); /* ffffffff VERTEX_ARRAY_UNK90C */ | ||
1949 | xf_emit(ctx, 1, 0); /* f/1f */ | ||
1950 | /* SEEK */ | ||
1951 | xf_emit(ctx, acnt, 0); /* RO */ | ||
1952 | xf_emit(ctx, 2, 0); /* RO */ | ||
1953 | /* SEEK */ | ||
1954 | xf_emit(ctx, 1, 0); /* ffffffff tesla UNK111C? */ | ||
1955 | xf_emit(ctx, 1, 0); /* RO */ | ||
1956 | /* SEEK */ | ||
1957 | xf_emit(ctx, 1, 0); /* 000000ff UNK15F4_ADDRESS_HIGH */ | ||
1958 | xf_emit(ctx, 1, 0); /* ffffffff UNK15F4_ADDRESS_LOW */ | ||
1959 | xf_emit(ctx, 1, 0); /* 000000ff UNK0F84_ADDRESS_HIGH */ | ||
1960 | xf_emit(ctx, 1, 0); /* ffffffff UNK0F84_ADDRESS_LOW */ | ||
1961 | /* SEEK */ | ||
1962 | xf_emit(ctx, acnt, 0); /* 00003fff VERTEX_ARRAY_ATTRIB_OFFSET */ | ||
1963 | xf_emit(ctx, 3, 0); /* f/1f */ | ||
1964 | /* SEEK */ | ||
1965 | xf_emit(ctx, acnt, 0); /* 00000fff VERTEX_ARRAY_STRIDE */ | ||
1966 | xf_emit(ctx, 3, 0); /* f/1f */ | ||
1967 | /* SEEK */ | ||
1968 | xf_emit(ctx, acnt, 0); /* ffffffff VERTEX_ARRAY_LOW */ | ||
1969 | xf_emit(ctx, 3, 0); /* f/1f */ | ||
1970 | /* SEEK */ | ||
1971 | xf_emit(ctx, acnt, 0); /* 000000ff VERTEX_ARRAY_HIGH */ | ||
1972 | xf_emit(ctx, 3, 0); /* f/1f */ | ||
1973 | /* SEEK */ | ||
1974 | xf_emit(ctx, acnt, 0); /* ffffffff VERTEX_LIMIT_LOW */ | ||
1975 | xf_emit(ctx, 3, 0); /* f/1f */ | ||
1976 | /* SEEK */ | ||
1977 | xf_emit(ctx, acnt, 0); /* 000000ff VERTEX_LIMIT_HIGH */ | ||
1978 | xf_emit(ctx, 3, 0); /* f/1f */ | ||
1979 | /* SEEK */ | ||
1980 | if (IS_NVA3F(dev_priv->chipset)) { | ||
1981 | xf_emit(ctx, acnt, 0); /* f */ | ||
1982 | xf_emit(ctx, 3, 0); /* f/1f */ | ||
1983 | } | ||
1984 | /* SEEK */ | ||
1985 | if (IS_NVA3F(dev_priv->chipset)) | ||
1986 | xf_emit(ctx, 2, 0); /* RO */ | ||
1987 | else | ||
1988 | xf_emit(ctx, 5, 0); /* RO */ | ||
1989 | /* SEEK */ | ||
1990 | xf_emit(ctx, 1, 0); /* ffff DMA_VTXBUF */ | ||
1991 | /* SEEK */ | ||
1992 | if (dev_priv->chipset < 0xa0) { | ||
1993 | xf_emit(ctx, 0x41, 0); /* RO */ | ||
1994 | /* SEEK */ | ||
1995 | xf_emit(ctx, 0x11, 0); /* RO */ | ||
1996 | } else if (!IS_NVA3F(dev_priv->chipset)) | ||
1997 | xf_emit(ctx, 0x50, 0); /* RO */ | ||
1584 | else | 1998 | else |
1585 | xf_emit(ctx, 1, 0); | 1999 | xf_emit(ctx, 0x58, 0); /* RO */ |
1586 | xf_emit(ctx, 1, 1); | 2000 | /* SEEK */ |
1587 | if (dev_priv->chipset > 0xa0 && dev_priv->chipset < 0xaa) | 2001 | xf_emit(ctx, 1, 0xf); /* ffffffff VP_ATTR_EN */ |
1588 | xf_emit(ctx, 0xa1, 0); | 2002 | xf_emit(ctx, (acnt/8)-1, 0); /* ffffffff VP_ATTR_EN */ |
2003 | xf_emit(ctx, 1, 1); /* 1 UNK0DEC */ | ||
2004 | /* SEEK */ | ||
2005 | xf_emit(ctx, acnt*4, 0); /* ffffffff VTX_ATTR */ | ||
2006 | xf_emit(ctx, 4, 0); /* f/1f, 0, 0, 0 */ | ||
2007 | /* SEEK */ | ||
2008 | if (IS_NVA3F(dev_priv->chipset)) | ||
2009 | xf_emit(ctx, 0x1d, 0); /* RO */ | ||
1589 | else | 2010 | else |
1590 | xf_emit(ctx, 0x5a, 0); | 2011 | xf_emit(ctx, 0x16, 0); /* RO */ |
1591 | xf_emit(ctx, 1, 0xf); | 2012 | /* SEEK */ |
2013 | xf_emit(ctx, 1, 0xf); /* ffffffff VP_ATTR_EN */ | ||
2014 | xf_emit(ctx, (acnt/8)-1, 0); /* ffffffff VP_ATTR_EN */ | ||
2015 | /* SEEK */ | ||
1592 | if (dev_priv->chipset < 0xa0) | 2016 | if (dev_priv->chipset < 0xa0) |
1593 | xf_emit(ctx, 0x834, 0); | 2017 | xf_emit(ctx, 8, 0); /* RO */ |
1594 | else if (dev_priv->chipset == 0xa0) | 2018 | else if (IS_NVA3F(dev_priv->chipset)) |
1595 | xf_emit(ctx, 0x1873, 0); | 2019 | xf_emit(ctx, 0xc, 0); /* RO */ |
1596 | else if (dev_priv->chipset > 0xa0 && dev_priv->chipset < 0xaa) | 2020 | else |
1597 | xf_emit(ctx, 0x8ba, 0); | 2021 | xf_emit(ctx, 7, 0); /* RO */ |
2022 | /* SEEK */ | ||
2023 | xf_emit(ctx, 0xa, 0); /* RO */ | ||
2024 | if (dev_priv->chipset == 0xa0) | ||
2025 | rep = 0xc; | ||
2026 | else | ||
2027 | rep = 4; | ||
2028 | for (i = 0; i < rep; i++) { | ||
2029 | /* SEEK */ | ||
2030 | if (IS_NVA3F(dev_priv->chipset)) | ||
2031 | xf_emit(ctx, 0x20, 0); /* ffffffff */ | ||
2032 | xf_emit(ctx, 0x200, 0); /* ffffffff */ | ||
2033 | xf_emit(ctx, 4, 0); /* 7f/ff, 0, 0, 0 */ | ||
2034 | xf_emit(ctx, 4, 0); /* ffffffff */ | ||
2035 | } | ||
2036 | /* SEEK */ | ||
2037 | xf_emit(ctx, 1, 0); /* 113/111 */ | ||
2038 | xf_emit(ctx, 1, 0xf); /* ffffffff VP_ATTR_EN */ | ||
2039 | xf_emit(ctx, (acnt/8)-1, 0); /* ffffffff VP_ATTR_EN */ | ||
2040 | xf_emit(ctx, acnt/8, 0); /* ffffffff VTX_ATTR_MASK_UNK0DD0 */ | ||
2041 | xf_emit(ctx, 1, 0); /* 0000000f VP_GP_BUILTIN_ATTR_EN */ | ||
2042 | xf_emit(ctx, 1, 0); /* ffffffff tesla UNK1A30 */ | ||
2043 | /* SEEK */ | ||
2044 | if (IS_NVA3F(dev_priv->chipset)) | ||
2045 | xf_emit(ctx, 7, 0); /* weird... */ | ||
1598 | else | 2046 | else |
1599 | xf_emit(ctx, 0x833, 0); | 2047 | xf_emit(ctx, 5, 0); /* weird... */ |
1600 | xf_emit(ctx, 1, 0xf); | ||
1601 | xf_emit(ctx, 0xf, 0); | ||
1602 | } | 2048 | } |
1603 | 2049 | ||
1604 | static void | 2050 | static void |
1605 | nv50_graph_construct_gene_unk7(struct nouveau_grctx *ctx) | 2051 | nv50_graph_construct_gene_eng2d(struct nouveau_grctx *ctx) |
1606 | { | 2052 | { |
1607 | struct drm_nouveau_private *dev_priv = ctx->dev->dev_private; | 2053 | struct drm_nouveau_private *dev_priv = ctx->dev->dev_private; |
1608 | /* middle of area 1 on pre-NVA0 [after m2mf], middle of area 6 on NVAx */ | 2054 | /* middle of strand 1 on pre-NVA0 [after vfetch], middle of strand 6 on NVAx */ |
1609 | xf_emit(ctx, 2, 0); | 2055 | /* SEEK */ |
1610 | if (dev_priv->chipset == 0x50) | 2056 | xf_emit(ctx, 2, 0); /* 0001ffff CLIP_X, CLIP_Y */ |
1611 | xf_emit(ctx, 2, 1); | 2057 | xf_emit(ctx, 2, 0); /* 0000ffff CLIP_W, CLIP_H */ |
1612 | else | 2058 | xf_emit(ctx, 1, 0); /* 00000001 CLIP_ENABLE */ |
1613 | xf_emit(ctx, 2, 0); | 2059 | if (dev_priv->chipset < 0xa0) { |
1614 | xf_emit(ctx, 1, 0); | 2060 | /* this is useless on everything but the original NV50, |
1615 | xf_emit(ctx, 1, 1); | 2061 | * guess they forgot to nuke it. Or just didn't bother. */ |
1616 | xf_emit(ctx, 2, 0x100); | 2062 | xf_emit(ctx, 2, 0); /* 0000ffff IFC_CLIP_X, Y */ |
1617 | xf_emit(ctx, 1, 0x11); | 2063 | xf_emit(ctx, 2, 1); /* 0000ffff IFC_CLIP_W, H */ |
1618 | xf_emit(ctx, 1, 0); | 2064 | xf_emit(ctx, 1, 0); /* 00000001 IFC_CLIP_ENABLE */ |
1619 | xf_emit(ctx, 1, 8); | 2065 | } |
1620 | xf_emit(ctx, 5, 0); | 2066 | xf_emit(ctx, 1, 1); /* 00000001 DST_LINEAR */ |
1621 | xf_emit(ctx, 1, 1); | 2067 | xf_emit(ctx, 1, 0x100); /* 0001ffff DST_WIDTH */ |
1622 | xf_emit(ctx, 1, 0); | 2068 | xf_emit(ctx, 1, 0x100); /* 0001ffff DST_HEIGHT */ |
1623 | xf_emit(ctx, 3, 1); | 2069 | xf_emit(ctx, 1, 0x11); /* 3f[NV50]/7f[NV84+] DST_FORMAT */ |
1624 | xf_emit(ctx, 1, 0xcf); | 2070 | xf_emit(ctx, 1, 0); /* 0001ffff DRAW_POINT_X */ |
1625 | xf_emit(ctx, 1, 2); | 2071 | xf_emit(ctx, 1, 8); /* 0000000f DRAW_UNK58C */ |
1626 | xf_emit(ctx, 6, 0); | 2072 | xf_emit(ctx, 1, 0); /* 000fffff SIFC_DST_X_FRACT */ |
1627 | xf_emit(ctx, 1, 1); | 2073 | xf_emit(ctx, 1, 0); /* 0001ffff SIFC_DST_X_INT */ |
1628 | xf_emit(ctx, 1, 0); | 2074 | xf_emit(ctx, 1, 0); /* 000fffff SIFC_DST_Y_FRACT */ |
1629 | xf_emit(ctx, 3, 1); | 2075 | xf_emit(ctx, 1, 0); /* 0001ffff SIFC_DST_Y_INT */ |
1630 | xf_emit(ctx, 4, 0); | 2076 | xf_emit(ctx, 1, 0); /* 000fffff SIFC_DX_DU_FRACT */ |
1631 | xf_emit(ctx, 1, 4); | 2077 | xf_emit(ctx, 1, 1); /* 0001ffff SIFC_DX_DU_INT */ |
1632 | xf_emit(ctx, 1, 0); | 2078 | xf_emit(ctx, 1, 0); /* 000fffff SIFC_DY_DV_FRACT */ |
1633 | xf_emit(ctx, 1, 1); | 2079 | xf_emit(ctx, 1, 1); /* 0001ffff SIFC_DY_DV_INT */ |
1634 | xf_emit(ctx, 1, 0x15); | 2080 | xf_emit(ctx, 1, 1); /* 0000ffff SIFC_WIDTH */ |
1635 | xf_emit(ctx, 3, 0); | 2081 | xf_emit(ctx, 1, 1); /* 0000ffff SIFC_HEIGHT */ |
1636 | xf_emit(ctx, 1, 0x4444480); | 2082 | xf_emit(ctx, 1, 0xcf); /* 000000ff SIFC_FORMAT */ |
1637 | xf_emit(ctx, 0x37, 0); | 2083 | xf_emit(ctx, 1, 2); /* 00000003 SIFC_BITMAP_UNK808 */ |
2084 | xf_emit(ctx, 1, 0); /* 00000003 SIFC_BITMAP_LINE_PACK_MODE */ | ||
2085 | xf_emit(ctx, 1, 0); /* 00000001 SIFC_BITMAP_LSB_FIRST */ | ||
2086 | xf_emit(ctx, 1, 0); /* 00000001 SIFC_BITMAP_ENABLE */ | ||
2087 | xf_emit(ctx, 1, 0); /* 0000ffff BLIT_DST_X */ | ||
2088 | xf_emit(ctx, 1, 0); /* 0000ffff BLIT_DST_Y */ | ||
2089 | xf_emit(ctx, 1, 0); /* 000fffff BLIT_DU_DX_FRACT */ | ||
2090 | xf_emit(ctx, 1, 1); /* 0001ffff BLIT_DU_DX_INT */ | ||
2091 | xf_emit(ctx, 1, 0); /* 000fffff BLIT_DV_DY_FRACT */ | ||
2092 | xf_emit(ctx, 1, 1); /* 0001ffff BLIT_DV_DY_INT */ | ||
2093 | xf_emit(ctx, 1, 1); /* 0000ffff BLIT_DST_W */ | ||
2094 | xf_emit(ctx, 1, 1); /* 0000ffff BLIT_DST_H */ | ||
2095 | xf_emit(ctx, 1, 0); /* 000fffff BLIT_SRC_X_FRACT */ | ||
2096 | xf_emit(ctx, 1, 0); /* 0001ffff BLIT_SRC_X_INT */ | ||
2097 | xf_emit(ctx, 1, 0); /* 000fffff BLIT_SRC_Y_FRACT */ | ||
2098 | xf_emit(ctx, 1, 0); /* 00000001 UNK888 */ | ||
2099 | xf_emit(ctx, 1, 4); /* 0000003f UNK884 */ | ||
2100 | xf_emit(ctx, 1, 0); /* 00000007 UNK880 */ | ||
2101 | xf_emit(ctx, 1, 1); /* 0000001f tesla UNK0FB8 */ | ||
2102 | xf_emit(ctx, 1, 0x15); /* 000000ff tesla UNK128C */ | ||
2103 | xf_emit(ctx, 2, 0); /* 00000007, ffff0ff3 */ | ||
2104 | xf_emit(ctx, 1, 0); /* 00000001 UNK260 */ | ||
2105 | xf_emit(ctx, 1, 0x4444480); /* 1fffffff UNK870 */ | ||
2106 | /* SEEK */ | ||
2107 | xf_emit(ctx, 0x10, 0); | ||
2108 | /* SEEK */ | ||
2109 | xf_emit(ctx, 0x27, 0); | ||
1638 | } | 2110 | } |
1639 | 2111 | ||
1640 | static void | 2112 | static void |
1641 | nv50_graph_construct_gene_unk8(struct nouveau_grctx *ctx) | 2113 | nv50_graph_construct_gene_csched(struct nouveau_grctx *ctx) |
1642 | { | 2114 | { |
1643 | /* middle of area 1 on pre-NVA0 [after m2mf], middle of area 0 on NVAx */ | 2115 | struct drm_nouveau_private *dev_priv = ctx->dev->dev_private; |
1644 | xf_emit(ctx, 4, 0); | 2116 | /* middle of strand 1 on pre-NVA0 [after eng2d], middle of strand 0 on NVAx */ |
1645 | xf_emit(ctx, 1, 0x8100c12); | 2117 | /* SEEK */ |
1646 | xf_emit(ctx, 4, 0); | 2118 | xf_emit(ctx, 2, 0); /* 00007fff WINDOW_OFFSET_XY... what is it doing here??? */ |
1647 | xf_emit(ctx, 1, 0x100); | 2119 | xf_emit(ctx, 1, 0); /* 00000001 tesla UNK1924 */ |
1648 | xf_emit(ctx, 2, 0); | 2120 | xf_emit(ctx, 1, 0); /* 00000003 WINDOW_ORIGIN */ |
1649 | xf_emit(ctx, 1, 0x10001); | 2121 | xf_emit(ctx, 1, 0x8100c12); /* 1fffffff FP_INTERPOLANT_CTRL */ |
1650 | xf_emit(ctx, 1, 0); | 2122 | xf_emit(ctx, 1, 0); /* 000003ff */ |
1651 | xf_emit(ctx, 1, 0x10001); | 2123 | /* SEEK */ |
1652 | xf_emit(ctx, 1, 1); | 2124 | xf_emit(ctx, 1, 0); /* ffffffff turing UNK364 */ |
1653 | xf_emit(ctx, 1, 0x10001); | 2125 | xf_emit(ctx, 1, 0); /* 0000000f turing UNK36C */ |
1654 | xf_emit(ctx, 1, 1); | 2126 | xf_emit(ctx, 1, 0); /* 0000ffff USER_PARAM_COUNT */ |
1655 | xf_emit(ctx, 1, 4); | 2127 | xf_emit(ctx, 1, 0x100); /* 00ffffff turing UNK384 */ |
1656 | xf_emit(ctx, 1, 2); | 2128 | xf_emit(ctx, 1, 0); /* 0000000f turing UNK2A0 */ |
2129 | xf_emit(ctx, 1, 0); /* 0000ffff GRIDID */ | ||
2130 | xf_emit(ctx, 1, 0x10001); /* ffffffff GRIDDIM_XY */ | ||
2131 | xf_emit(ctx, 1, 0); /* ffffffff */ | ||
2132 | xf_emit(ctx, 1, 0x10001); /* ffffffff BLOCKDIM_XY */ | ||
2133 | xf_emit(ctx, 1, 1); /* 0000ffff BLOCKDIM_Z */ | ||
2134 | xf_emit(ctx, 1, 0x10001); /* 00ffffff BLOCK_ALLOC */ | ||
2135 | xf_emit(ctx, 1, 1); /* 00000001 LANES32 */ | ||
2136 | xf_emit(ctx, 1, 4); /* 000000ff FP_REG_ALLOC_TEMP */ | ||
2137 | xf_emit(ctx, 1, 2); /* 00000003 REG_MODE */ | ||
2138 | /* SEEK */ | ||
2139 | xf_emit(ctx, 0x40, 0); /* ffffffff USER_PARAM */ | ||
2140 | switch (dev_priv->chipset) { | ||
2141 | case 0x50: | ||
2142 | case 0x92: | ||
2143 | xf_emit(ctx, 8, 0); /* 7, 0, 0, 0, ... */ | ||
2144 | xf_emit(ctx, 0x80, 0); /* fff */ | ||
2145 | xf_emit(ctx, 2, 0); /* ff, fff */ | ||
2146 | xf_emit(ctx, 0x10*2, 0); /* ffffffff, 1f */ | ||
2147 | break; | ||
2148 | case 0x84: | ||
2149 | xf_emit(ctx, 8, 0); /* 7, 0, 0, 0, ... */ | ||
2150 | xf_emit(ctx, 0x60, 0); /* fff */ | ||
2151 | xf_emit(ctx, 2, 0); /* ff, fff */ | ||
2152 | xf_emit(ctx, 0xc*2, 0); /* ffffffff, 1f */ | ||
2153 | break; | ||
2154 | case 0x94: | ||
2155 | case 0x96: | ||
2156 | xf_emit(ctx, 8, 0); /* 7, 0, 0, 0, ... */ | ||
2157 | xf_emit(ctx, 0x40, 0); /* fff */ | ||
2158 | xf_emit(ctx, 2, 0); /* ff, fff */ | ||
2159 | xf_emit(ctx, 8*2, 0); /* ffffffff, 1f */ | ||
2160 | break; | ||
2161 | case 0x86: | ||
2162 | case 0x98: | ||
2163 | xf_emit(ctx, 4, 0); /* f, 0, 0, 0 */ | ||
2164 | xf_emit(ctx, 0x10, 0); /* fff */ | ||
2165 | xf_emit(ctx, 2, 0); /* ff, fff */ | ||
2166 | xf_emit(ctx, 2*2, 0); /* ffffffff, 1f */ | ||
2167 | break; | ||
2168 | case 0xa0: | ||
2169 | xf_emit(ctx, 8, 0); /* 7, 0, 0, 0, ... */ | ||
2170 | xf_emit(ctx, 0xf0, 0); /* fff */ | ||
2171 | xf_emit(ctx, 2, 0); /* ff, fff */ | ||
2172 | xf_emit(ctx, 0x1e*2, 0); /* ffffffff, 1f */ | ||
2173 | break; | ||
2174 | case 0xa3: | ||
2175 | xf_emit(ctx, 8, 0); /* 7, 0, 0, 0, ... */ | ||
2176 | xf_emit(ctx, 0x60, 0); /* fff */ | ||
2177 | xf_emit(ctx, 2, 0); /* ff, fff */ | ||
2178 | xf_emit(ctx, 0xc*2, 0); /* ffffffff, 1f */ | ||
2179 | break; | ||
2180 | case 0xa5: | ||
2181 | case 0xaf: | ||
2182 | xf_emit(ctx, 8, 0); /* 7, 0, 0, 0, ... */ | ||
2183 | xf_emit(ctx, 0x30, 0); /* fff */ | ||
2184 | xf_emit(ctx, 2, 0); /* ff, fff */ | ||
2185 | xf_emit(ctx, 6*2, 0); /* ffffffff, 1f */ | ||
2186 | break; | ||
2187 | case 0xaa: | ||
2188 | xf_emit(ctx, 0x12, 0); | ||
2189 | break; | ||
2190 | case 0xa8: | ||
2191 | case 0xac: | ||
2192 | xf_emit(ctx, 4, 0); /* f, 0, 0, 0 */ | ||
2193 | xf_emit(ctx, 0x10, 0); /* fff */ | ||
2194 | xf_emit(ctx, 2, 0); /* ff, fff */ | ||
2195 | xf_emit(ctx, 2*2, 0); /* ffffffff, 1f */ | ||
2196 | break; | ||
2197 | } | ||
2198 | xf_emit(ctx, 1, 0); /* 0000000f */ | ||
2199 | xf_emit(ctx, 1, 0); /* 00000000 */ | ||
2200 | xf_emit(ctx, 1, 0); /* ffffffff */ | ||
2201 | xf_emit(ctx, 1, 0); /* 0000001f */ | ||
2202 | xf_emit(ctx, 4, 0); /* ffffffff */ | ||
2203 | xf_emit(ctx, 1, 0); /* 00000003 turing UNK35C */ | ||
2204 | xf_emit(ctx, 1, 0); /* ffffffff */ | ||
2205 | xf_emit(ctx, 4, 0); /* ffffffff */ | ||
2206 | xf_emit(ctx, 1, 0); /* 00000003 turing UNK35C */ | ||
2207 | xf_emit(ctx, 1, 0); /* ffffffff */ | ||
2208 | xf_emit(ctx, 1, 0); /* 000000ff */ | ||
1657 | } | 2209 | } |
1658 | 2210 | ||
1659 | static void | 2211 | static void |
1660 | nv50_graph_construct_gene_unk9(struct nouveau_grctx *ctx) | 2212 | nv50_graph_construct_gene_unk1cxx(struct nouveau_grctx *ctx) |
1661 | { | 2213 | { |
1662 | struct drm_nouveau_private *dev_priv = ctx->dev->dev_private; | 2214 | struct drm_nouveau_private *dev_priv = ctx->dev->dev_private; |
1663 | /* middle of area 2 on pre-NVA0 [after m2mf], end of area 0 on NVAx */ | 2215 | xf_emit(ctx, 2, 0); /* 00007fff WINDOW_OFFSET_XY */ |
1664 | xf_emit(ctx, 1, 0x3f800000); | 2216 | xf_emit(ctx, 1, 0x3f800000); /* ffffffff LINE_WIDTH */ |
1665 | xf_emit(ctx, 6, 0); | 2217 | xf_emit(ctx, 1, 0); /* 00000001 LINE_SMOOTH_ENABLE */ |
1666 | xf_emit(ctx, 1, 4); | 2218 | xf_emit(ctx, 1, 0); /* 00000001 tesla UNK1658 */ |
1667 | xf_emit(ctx, 1, 0x1a); | 2219 | xf_emit(ctx, 1, 0); /* 00000001 POLYGON_SMOOTH_ENABLE */ |
1668 | xf_emit(ctx, 2, 0); | 2220 | xf_emit(ctx, 3, 0); /* 00000001 POLYGON_OFFSET_*_ENABLE */ |
1669 | xf_emit(ctx, 1, 1); | 2221 | xf_emit(ctx, 1, 4); /* 0000000f CULL_MODE */ |
1670 | xf_emit(ctx, 0x12, 0); | 2222 | xf_emit(ctx, 1, 0x1a); /* 0000001f POLYGON_MODE */ |
1671 | xf_emit(ctx, 1, 0x00ffff00); | 2223 | xf_emit(ctx, 1, 0); /* 0000000f ZETA_FORMAT */ |
1672 | xf_emit(ctx, 6, 0); | 2224 | xf_emit(ctx, 1, 0); /* 00000001 POINT_SPRITE_ENABLE */ |
1673 | xf_emit(ctx, 1, 0xf); | 2225 | xf_emit(ctx, 1, 1); /* 00000001 tesla UNK165C */ |
1674 | xf_emit(ctx, 7, 0); | 2226 | xf_emit(ctx, 0x10, 0); /* 00000001 SCISSOR_ENABLE */ |
1675 | xf_emit(ctx, 1, 0x0fac6881); | 2227 | xf_emit(ctx, 1, 0); /* 00000001 tesla UNK1534 */ |
1676 | xf_emit(ctx, 1, 0x11); | 2228 | xf_emit(ctx, 1, 0); /* 00000001 LINE_STIPPLE_ENABLE */ |
1677 | xf_emit(ctx, 0xf, 0); | 2229 | xf_emit(ctx, 1, 0x00ffff00); /* 00ffffff LINE_STIPPLE_PATTERN */ |
1678 | xf_emit(ctx, 1, 4); | 2230 | xf_emit(ctx, 1, 0); /* ffffffff POLYGON_OFFSET_UNITS */ |
1679 | xf_emit(ctx, 2, 0); | 2231 | xf_emit(ctx, 1, 0); /* ffffffff POLYGON_OFFSET_FACTOR */ |
1680 | if (dev_priv->chipset > 0xa0 && dev_priv->chipset < 0xaa) | 2232 | xf_emit(ctx, 1, 0); /* 00000003 tesla UNK1668 */ |
1681 | xf_emit(ctx, 1, 3); | 2233 | xf_emit(ctx, 2, 0); /* 07ffffff SCREEN_SCISSOR */ |
2234 | xf_emit(ctx, 1, 0); /* 00000001 tesla UNK1900 */ | ||
2235 | xf_emit(ctx, 1, 0xf); /* 0000000f COLOR_MASK */ | ||
2236 | xf_emit(ctx, 7, 0); /* 0000000f COLOR_MASK */ | ||
2237 | xf_emit(ctx, 1, 0x0fac6881); /* 0fffffff RT_CONTROL */ | ||
2238 | xf_emit(ctx, 1, 0x11); /* 0000007f RT_FORMAT */ | ||
2239 | xf_emit(ctx, 7, 0); /* 0000007f RT_FORMAT */ | ||
2240 | xf_emit(ctx, 8, 0); /* 00000001 RT_HORIZ_LINEAR */ | ||
2241 | xf_emit(ctx, 1, 4); /* 00000007 FP_CONTROL */ | ||
2242 | xf_emit(ctx, 1, 0); /* 00000001 ALPHA_TEST_ENABLE */ | ||
2243 | xf_emit(ctx, 1, 0); /* 00000007 ALPHA_TEST_FUNC */ | ||
2244 | if (IS_NVA3F(dev_priv->chipset)) | ||
2245 | xf_emit(ctx, 1, 3); /* 00000003 UNK16B4 */ | ||
1682 | else if (dev_priv->chipset >= 0xa0) | 2246 | else if (dev_priv->chipset >= 0xa0) |
1683 | xf_emit(ctx, 1, 1); | 2247 | xf_emit(ctx, 1, 1); /* 00000001 UNK16B4 */ |
1684 | xf_emit(ctx, 2, 0); | 2248 | xf_emit(ctx, 1, 0); /* 00000003 MULTISAMPLE_CTRL */ |
1685 | xf_emit(ctx, 1, 2); | 2249 | xf_emit(ctx, 1, 0); /* 00000003 tesla UNK0F90 */ |
1686 | xf_emit(ctx, 2, 0x04000000); | 2250 | xf_emit(ctx, 1, 2); /* 00000003 tesla UNK143C */ |
1687 | xf_emit(ctx, 3, 0); | 2251 | xf_emit(ctx, 2, 0x04000000); /* 07ffffff tesla UNK0D6C */ |
1688 | xf_emit(ctx, 1, 5); | 2252 | xf_emit(ctx, 1, 0); /* 000000ff STENCIL_FRONT_MASK */ |
1689 | xf_emit(ctx, 1, 0x52); | 2253 | xf_emit(ctx, 1, 0); /* 00000001 DEPTH_WRITE_ENABLE */ |
1690 | if (dev_priv->chipset == 0x50) { | 2254 | xf_emit(ctx, 1, 0); /* 00000001 SAMPLECNT_ENABLE */ |
1691 | xf_emit(ctx, 0x13, 0); | 2255 | xf_emit(ctx, 1, 5); /* 0000000f UNK1408 */ |
1692 | } else { | 2256 | xf_emit(ctx, 1, 0x52); /* 000001ff SEMANTIC_PTSZ */ |
1693 | xf_emit(ctx, 4, 0); | 2257 | xf_emit(ctx, 1, 0); /* ffffffff POINT_SIZE */ |
1694 | xf_emit(ctx, 1, 1); | 2258 | xf_emit(ctx, 1, 0); /* 00000001 */ |
1695 | if (dev_priv->chipset > 0xa0 && dev_priv->chipset < 0xaa) | 2259 | xf_emit(ctx, 1, 0); /* 00000007 tesla UNK0FB4 */ |
1696 | xf_emit(ctx, 0x11, 0); | 2260 | if (dev_priv->chipset != 0x50) { |
1697 | else | 2261 | xf_emit(ctx, 1, 0); /* 3ff */ |
1698 | xf_emit(ctx, 0x10, 0); | 2262 | xf_emit(ctx, 1, 1); /* 00000001 tesla UNK1110 */ |
1699 | } | 2263 | } |
1700 | xf_emit(ctx, 0x10, 0x3f800000); | 2264 | if (IS_NVA3F(dev_priv->chipset)) |
1701 | xf_emit(ctx, 1, 0x10); | 2265 | xf_emit(ctx, 1, 0); /* 00000003 tesla UNK1928 */ |
1702 | xf_emit(ctx, 0x26, 0); | 2266 | xf_emit(ctx, 0x10, 0); /* ffffffff DEPTH_RANGE_NEAR */ |
1703 | xf_emit(ctx, 1, 0x8100c12); | 2267 | xf_emit(ctx, 0x10, 0x3f800000); /* ffffffff DEPTH_RANGE_FAR */ |
1704 | xf_emit(ctx, 1, 5); | 2268 | xf_emit(ctx, 1, 0x10); /* 000000ff VIEW_VOLUME_CLIP_CTRL */ |
1705 | xf_emit(ctx, 2, 0); | 2269 | xf_emit(ctx, 0x20, 0); /* 07ffffff VIEWPORT_HORIZ, then VIEWPORT_VERT. (W&0x3fff)<<13 | (X&0x1fff). */ |
1706 | xf_emit(ctx, 1, 1); | 2270 | xf_emit(ctx, 1, 0); /* ffffffff tesla UNK187C */ |
1707 | xf_emit(ctx, 1, 0); | 2271 | xf_emit(ctx, 1, 0); /* 00000003 WINDOW_ORIGIN */ |
1708 | xf_emit(ctx, 4, 0xffff); | 2272 | xf_emit(ctx, 1, 0); /* 00000001 STENCIL_FRONT_ENABLE */ |
2273 | xf_emit(ctx, 1, 0); /* 00000001 DEPTH_TEST_ENABLE */ | ||
2274 | xf_emit(ctx, 1, 0); /* 00000001 STENCIL_BACK_ENABLE */ | ||
2275 | xf_emit(ctx, 1, 0); /* 000000ff STENCIL_BACK_MASK */ | ||
2276 | xf_emit(ctx, 1, 0x8100c12); /* 1fffffff FP_INTERPOLANT_CTRL */ | ||
2277 | xf_emit(ctx, 1, 5); /* 0000000f tesla UNK1220 */ | ||
2278 | xf_emit(ctx, 1, 0); /* 00000007 MULTISAMPLE_SAMPLES_LOG2 */ | ||
2279 | xf_emit(ctx, 1, 0); /* 000000ff tesla UNK1A20 */ | ||
2280 | xf_emit(ctx, 1, 1); /* 00000001 ZETA_ENABLE */ | ||
2281 | xf_emit(ctx, 1, 0); /* 00000001 VERTEX_TWO_SIDE_ENABLE */ | ||
2282 | xf_emit(ctx, 4, 0xffff); /* 0000ffff MSAA_MASK */ | ||
1709 | if (dev_priv->chipset != 0x50) | 2283 | if (dev_priv->chipset != 0x50) |
1710 | xf_emit(ctx, 1, 3); | 2284 | xf_emit(ctx, 1, 3); /* 00000003 tesla UNK1100 */ |
1711 | if (dev_priv->chipset < 0xa0) | 2285 | if (dev_priv->chipset < 0xa0) |
1712 | xf_emit(ctx, 0x1f, 0); | 2286 | xf_emit(ctx, 0x1c, 0); /* RO */ |
1713 | else if (dev_priv->chipset > 0xa0 && dev_priv->chipset < 0xaa) | 2287 | else if (IS_NVA3F(dev_priv->chipset)) |
1714 | xf_emit(ctx, 0xc, 0); | 2288 | xf_emit(ctx, 0x9, 0); |
1715 | else | 2289 | xf_emit(ctx, 1, 0); /* 00000001 UNK1534 */ |
1716 | xf_emit(ctx, 3, 0); | 2290 | xf_emit(ctx, 1, 0); /* 00000001 LINE_SMOOTH_ENABLE */ |
1717 | xf_emit(ctx, 1, 0x00ffff00); | 2291 | xf_emit(ctx, 1, 0); /* 00000001 LINE_STIPPLE_ENABLE */ |
1718 | xf_emit(ctx, 1, 0x1a); | 2292 | xf_emit(ctx, 1, 0x00ffff00); /* 00ffffff LINE_STIPPLE_PATTERN */ |
2293 | xf_emit(ctx, 1, 0x1a); /* 0000001f POLYGON_MODE */ | ||
2294 | xf_emit(ctx, 1, 0); /* 00000003 WINDOW_ORIGIN */ | ||
1719 | if (dev_priv->chipset != 0x50) { | 2295 | if (dev_priv->chipset != 0x50) { |
1720 | xf_emit(ctx, 1, 0); | 2296 | xf_emit(ctx, 1, 3); /* 00000003 tesla UNK1100 */ |
1721 | xf_emit(ctx, 1, 3); | 2297 | xf_emit(ctx, 1, 0); /* 3ff */ |
1722 | } | 2298 | } |
2299 | /* XXX: the following block could belong either to unk1cxx, or | ||
2300 | * to STRMOUT. Rather hard to tell. */ | ||
1723 | if (dev_priv->chipset < 0xa0) | 2301 | if (dev_priv->chipset < 0xa0) |
1724 | xf_emit(ctx, 0x26, 0); | 2302 | xf_emit(ctx, 0x25, 0); |
1725 | else | 2303 | else |
1726 | xf_emit(ctx, 0x3c, 0); | 2304 | xf_emit(ctx, 0x3b, 0); |
1727 | xf_emit(ctx, 1, 0x102); | 2305 | } |
1728 | xf_emit(ctx, 1, 0); | 2306 | |
1729 | xf_emit(ctx, 4, 4); | 2307 | static void |
1730 | if (dev_priv->chipset >= 0xa0) | 2308 | nv50_graph_construct_gene_strmout(struct nouveau_grctx *ctx) |
1731 | xf_emit(ctx, 8, 0); | 2309 | { |
1732 | xf_emit(ctx, 2, 4); | 2310 | struct drm_nouveau_private *dev_priv = ctx->dev->dev_private; |
1733 | xf_emit(ctx, 1, 0); | 2311 | xf_emit(ctx, 1, 0x102); /* 0000ffff STRMOUT_BUFFER_CTRL */ |
2312 | xf_emit(ctx, 1, 0); /* ffffffff STRMOUT_PRIMITIVE_COUNT */ | ||
2313 | xf_emit(ctx, 4, 4); /* 000000ff STRMOUT_NUM_ATTRIBS */ | ||
2314 | if (dev_priv->chipset >= 0xa0) { | ||
2315 | xf_emit(ctx, 4, 0); /* ffffffff UNK1A8C */ | ||
2316 | xf_emit(ctx, 4, 0); /* ffffffff UNK1780 */ | ||
2317 | } | ||
2318 | xf_emit(ctx, 1, 4); /* 000000ff GP_RESULT_MAP_SIZE */ | ||
2319 | xf_emit(ctx, 1, 4); /* 0000007f VP_RESULT_MAP_SIZE */ | ||
2320 | xf_emit(ctx, 1, 0); /* 00000001 GP_ENABLE */ | ||
1734 | if (dev_priv->chipset == 0x50) | 2321 | if (dev_priv->chipset == 0x50) |
1735 | xf_emit(ctx, 1, 0x3ff); | 2322 | xf_emit(ctx, 1, 0x3ff); /* 000003ff tesla UNK0D68 */ |
1736 | else | 2323 | else |
1737 | xf_emit(ctx, 1, 0x7ff); | 2324 | xf_emit(ctx, 1, 0x7ff); /* 000007ff tesla UNK0D68 */ |
1738 | xf_emit(ctx, 1, 0); | 2325 | xf_emit(ctx, 1, 0); /* ffffffff tesla UNK1A30 */ |
1739 | xf_emit(ctx, 1, 0x102); | 2326 | /* SEEK */ |
1740 | xf_emit(ctx, 9, 0); | 2327 | xf_emit(ctx, 1, 0x102); /* 0000ffff STRMOUT_BUFFER_CTRL */ |
1741 | xf_emit(ctx, 4, 4); | 2328 | xf_emit(ctx, 1, 0); /* ffffffff STRMOUT_PRIMITIVE_COUNT */ |
1742 | xf_emit(ctx, 0x2c, 0); | 2329 | xf_emit(ctx, 4, 0); /* 000000ff STRMOUT_ADDRESS_HIGH */ |
2330 | xf_emit(ctx, 4, 0); /* ffffffff STRMOUT_ADDRESS_LOW */ | ||
2331 | xf_emit(ctx, 4, 4); /* 000000ff STRMOUT_NUM_ATTRIBS */ | ||
2332 | if (dev_priv->chipset >= 0xa0) { | ||
2333 | xf_emit(ctx, 4, 0); /* ffffffff UNK1A8C */ | ||
2334 | xf_emit(ctx, 4, 0); /* ffffffff UNK1780 */ | ||
2335 | } | ||
2336 | xf_emit(ctx, 1, 0); /* 0000ffff DMA_STRMOUT */ | ||
2337 | xf_emit(ctx, 1, 0); /* 0000ffff DMA_QUERY */ | ||
2338 | xf_emit(ctx, 1, 0); /* 000000ff QUERY_ADDRESS_HIGH */ | ||
2339 | xf_emit(ctx, 2, 0); /* ffffffff QUERY_ADDRESS_LOW QUERY_COUNTER */ | ||
2340 | xf_emit(ctx, 2, 0); /* ffffffff */ | ||
2341 | xf_emit(ctx, 1, 0); /* ffffffff tesla UNK1A30 */ | ||
2342 | /* SEEK */ | ||
2343 | xf_emit(ctx, 0x20, 0); /* ffffffff STRMOUT_MAP */ | ||
2344 | xf_emit(ctx, 1, 0); /* 0000000f */ | ||
2345 | xf_emit(ctx, 1, 0); /* 00000000? */ | ||
2346 | xf_emit(ctx, 2, 0); /* ffffffff */ | ||
2347 | } | ||
2348 | |||
2349 | static void | ||
2350 | nv50_graph_construct_gene_ropm1(struct nouveau_grctx *ctx) | ||
2351 | { | ||
2352 | struct drm_nouveau_private *dev_priv = ctx->dev->dev_private; | ||
2353 | xf_emit(ctx, 1, 0x4e3bfdf); /* ffffffff UNK0D64 */ | ||
2354 | xf_emit(ctx, 1, 0x4e3bfdf); /* ffffffff UNK0DF4 */ | ||
2355 | xf_emit(ctx, 1, 0); /* 00000007 */ | ||
2356 | xf_emit(ctx, 1, 0); /* 000003ff */ | ||
2357 | if (IS_NVA3F(dev_priv->chipset)) | ||
2358 | xf_emit(ctx, 1, 0x11); /* 000000ff tesla UNK1968 */ | ||
2359 | xf_emit(ctx, 1, 0); /* ffffffff tesla UNK1A3C */ | ||
2360 | } | ||
2361 | |||
2362 | static void | ||
2363 | nv50_graph_construct_gene_ropm2(struct nouveau_grctx *ctx) | ||
2364 | { | ||
2365 | struct drm_nouveau_private *dev_priv = ctx->dev->dev_private; | ||
2366 | /* SEEK */ | ||
2367 | xf_emit(ctx, 1, 0); /* 0000ffff DMA_QUERY */ | ||
2368 | xf_emit(ctx, 1, 0x0fac6881); /* 0fffffff RT_CONTROL */ | ||
2369 | xf_emit(ctx, 2, 0); /* ffffffff */ | ||
2370 | xf_emit(ctx, 1, 0); /* 000000ff QUERY_ADDRESS_HIGH */ | ||
2371 | xf_emit(ctx, 2, 0); /* ffffffff QUERY_ADDRESS_LOW, COUNTER */ | ||
2372 | xf_emit(ctx, 1, 0); /* 00000001 SAMPLECNT_ENABLE */ | ||
2373 | xf_emit(ctx, 1, 0); /* 7 */ | ||
2374 | /* SEEK */ | ||
2375 | xf_emit(ctx, 1, 0); /* 0000ffff DMA_QUERY */ | ||
2376 | xf_emit(ctx, 1, 0); /* 000000ff QUERY_ADDRESS_HIGH */ | ||
2377 | xf_emit(ctx, 2, 0); /* ffffffff QUERY_ADDRESS_LOW, COUNTER */ | ||
2378 | xf_emit(ctx, 1, 0x4e3bfdf); /* ffffffff UNK0D64 */ | ||
2379 | xf_emit(ctx, 1, 0x4e3bfdf); /* ffffffff UNK0DF4 */ | ||
2380 | xf_emit(ctx, 1, 0); /* 00000001 eng2d UNK260 */ | ||
2381 | xf_emit(ctx, 1, 0); /* ff/3ff */ | ||
2382 | xf_emit(ctx, 1, 0); /* 00000007 */ | ||
2383 | if (IS_NVA3F(dev_priv->chipset)) | ||
2384 | xf_emit(ctx, 1, 0x11); /* 000000ff tesla UNK1968 */ | ||
2385 | xf_emit(ctx, 1, 0); /* ffffffff tesla UNK1A3C */ | ||
1743 | } | 2386 | } |
1744 | 2387 | ||
1745 | static void | 2388 | static void |
@@ -1749,443 +2392,709 @@ nv50_graph_construct_gene_ropc(struct nouveau_grctx *ctx) | |||
1749 | int magic2; | 2392 | int magic2; |
1750 | if (dev_priv->chipset == 0x50) { | 2393 | if (dev_priv->chipset == 0x50) { |
1751 | magic2 = 0x00003e60; | 2394 | magic2 = 0x00003e60; |
1752 | } else if (dev_priv->chipset <= 0xa0 || dev_priv->chipset >= 0xaa) { | 2395 | } else if (!IS_NVA3F(dev_priv->chipset)) { |
1753 | magic2 = 0x001ffe67; | 2396 | magic2 = 0x001ffe67; |
1754 | } else { | 2397 | } else { |
1755 | magic2 = 0x00087e67; | 2398 | magic2 = 0x00087e67; |
1756 | } | 2399 | } |
1757 | xf_emit(ctx, 8, 0); | 2400 | xf_emit(ctx, 1, 0); /* f/7 MUTISAMPLE_SAMPLES_LOG2 */ |
1758 | xf_emit(ctx, 1, 2); | 2401 | xf_emit(ctx, 1, 0); /* 00000001 tesla UNK1534 */ |
1759 | xf_emit(ctx, 1, 0); | 2402 | xf_emit(ctx, 1, 0); /* 00000007 STENCIL_BACK_FUNC_FUNC */ |
1760 | xf_emit(ctx, 1, magic2); | 2403 | xf_emit(ctx, 1, 0); /* 000000ff STENCIL_BACK_FUNC_MASK */ |
1761 | xf_emit(ctx, 4, 0); | 2404 | xf_emit(ctx, 1, 0); /* 000000ff STENCIL_BACK_MASK */ |
1762 | if (dev_priv->chipset > 0xa0 && dev_priv->chipset < 0xaa) | 2405 | xf_emit(ctx, 3, 0); /* 00000007 STENCIL_BACK_OP_FAIL, ZFAIL, ZPASS */ |
1763 | xf_emit(ctx, 1, 1); | 2406 | xf_emit(ctx, 1, 2); /* 00000003 tesla UNK143C */ |
1764 | xf_emit(ctx, 7, 0); | 2407 | xf_emit(ctx, 1, 0); /* ffff0ff3 */ |
1765 | if (dev_priv->chipset >= 0xa0 && dev_priv->chipset < 0xaa) | 2408 | xf_emit(ctx, 1, magic2); /* 001fffff tesla UNK0F78 */ |
1766 | xf_emit(ctx, 1, 0x15); | 2409 | xf_emit(ctx, 1, 0); /* 00000001 DEPTH_BOUNDS_EN */ |
1767 | xf_emit(ctx, 1, 0); | 2410 | xf_emit(ctx, 1, 0); /* 00000007 DEPTH_TEST_FUNC */ |
1768 | xf_emit(ctx, 1, 1); | 2411 | xf_emit(ctx, 1, 0); /* 00000001 DEPTH_TEST_ENABLE */ |
1769 | xf_emit(ctx, 1, 0x10); | 2412 | xf_emit(ctx, 1, 0); /* 00000001 DEPTH_WRITE_ENABLE */ |
1770 | xf_emit(ctx, 2, 0); | 2413 | if (IS_NVA3F(dev_priv->chipset)) |
1771 | xf_emit(ctx, 1, 1); | 2414 | xf_emit(ctx, 1, 1); /* 0000001f tesla UNK169C */ |
1772 | xf_emit(ctx, 4, 0); | 2415 | xf_emit(ctx, 1, 0); /* 00000007 STENCIL_FRONT_FUNC_FUNC */ |
2416 | xf_emit(ctx, 1, 0); /* 000000ff STENCIL_FRONT_FUNC_MASK */ | ||
2417 | xf_emit(ctx, 1, 0); /* 000000ff STENCIL_FRONT_MASK */ | ||
2418 | xf_emit(ctx, 3, 0); /* 00000007 STENCIL_FRONT_OP_FAIL, ZFAIL, ZPASS */ | ||
2419 | xf_emit(ctx, 1, 0); /* 00000001 STENCIL_FRONT_ENABLE */ | ||
2420 | if (dev_priv->chipset >= 0xa0 && !IS_NVAAF(dev_priv->chipset)) | ||
2421 | xf_emit(ctx, 1, 0x15); /* 000000ff */ | ||
2422 | xf_emit(ctx, 1, 0); /* 00000001 STENCIL_BACK_ENABLE */ | ||
2423 | xf_emit(ctx, 1, 1); /* 00000001 tesla UNK15B4 */ | ||
2424 | xf_emit(ctx, 1, 0x10); /* 3ff/ff VIEW_VOLUME_CLIP_CTRL */ | ||
2425 | xf_emit(ctx, 1, 0); /* ffffffff CLEAR_DEPTH */ | ||
2426 | xf_emit(ctx, 1, 0); /* 0000000f ZETA_FORMAT */ | ||
2427 | xf_emit(ctx, 1, 1); /* 00000001 ZETA_ENABLE */ | ||
2428 | xf_emit(ctx, 1, 0); /* ffffffff tesla UNK1A3C */ | ||
1773 | if (dev_priv->chipset == 0x86 || dev_priv->chipset == 0x92 || dev_priv->chipset == 0x98 || dev_priv->chipset >= 0xa0) { | 2429 | if (dev_priv->chipset == 0x86 || dev_priv->chipset == 0x92 || dev_priv->chipset == 0x98 || dev_priv->chipset >= 0xa0) { |
1774 | xf_emit(ctx, 1, 4); | 2430 | xf_emit(ctx, 3, 0); /* ff, ffffffff, ffffffff */ |
1775 | xf_emit(ctx, 1, 0x400); | 2431 | xf_emit(ctx, 1, 4); /* 7 */ |
1776 | xf_emit(ctx, 1, 0x300); | 2432 | xf_emit(ctx, 1, 0x400); /* fffffff */ |
1777 | xf_emit(ctx, 1, 0x1001); | 2433 | xf_emit(ctx, 1, 0x300); /* ffff */ |
2434 | xf_emit(ctx, 1, 0x1001); /* 1fff */ | ||
1778 | if (dev_priv->chipset != 0xa0) { | 2435 | if (dev_priv->chipset != 0xa0) { |
1779 | if (dev_priv->chipset > 0xa0 && dev_priv->chipset < 0xaa) | 2436 | if (IS_NVA3F(dev_priv->chipset)) |
1780 | xf_emit(ctx, 1, 0); | 2437 | xf_emit(ctx, 1, 0); /* 0000000f UNK15C8 */ |
1781 | else | 2438 | else |
1782 | xf_emit(ctx, 1, 0x15); | 2439 | xf_emit(ctx, 1, 0x15); /* ff */ |
1783 | } | 2440 | } |
1784 | xf_emit(ctx, 3, 0); | ||
1785 | } | 2441 | } |
1786 | xf_emit(ctx, 2, 0); | 2442 | xf_emit(ctx, 1, 0); /* 00000007 MULTISAMPLE_SAMPLES_LOG2 */ |
1787 | xf_emit(ctx, 1, 2); | 2443 | xf_emit(ctx, 1, 0); /* 00000001 tesla UNK1534 */ |
1788 | xf_emit(ctx, 8, 0); | 2444 | xf_emit(ctx, 1, 0); /* 00000007 STENCIL_BACK_FUNC_FUNC */ |
1789 | xf_emit(ctx, 1, 1); | 2445 | xf_emit(ctx, 1, 0); /* 000000ff STENCIL_BACK_FUNC_MASK */ |
1790 | xf_emit(ctx, 1, 0x10); | 2446 | xf_emit(ctx, 1, 0); /* ffff0ff3 */ |
1791 | xf_emit(ctx, 1, 0); | 2447 | xf_emit(ctx, 1, 2); /* 00000003 tesla UNK143C */ |
1792 | xf_emit(ctx, 1, 1); | 2448 | xf_emit(ctx, 1, 0); /* 00000001 DEPTH_BOUNDS_EN */ |
1793 | xf_emit(ctx, 0x13, 0); | 2449 | xf_emit(ctx, 1, 0); /* 00000007 DEPTH_TEST_FUNC */ |
1794 | xf_emit(ctx, 1, 0x10); | 2450 | xf_emit(ctx, 1, 0); /* 00000001 DEPTH_TEST_ENABLE */ |
1795 | xf_emit(ctx, 0x10, 0); | 2451 | xf_emit(ctx, 1, 0); /* 00000001 DEPTH_WRITE_ENABLE */ |
1796 | xf_emit(ctx, 0x10, 0x3f800000); | 2452 | xf_emit(ctx, 1, 0); /* 00000007 STENCIL_FRONT_FUNC_FUNC */ |
1797 | xf_emit(ctx, 0x19, 0); | 2453 | xf_emit(ctx, 1, 0); /* 000000ff STENCIL_FRONT_FUNC_MASK */ |
1798 | xf_emit(ctx, 1, 0x10); | 2454 | xf_emit(ctx, 1, 0); /* 00000001 STENCIL_FRONT_ENABLE */ |
1799 | xf_emit(ctx, 1, 0); | 2455 | xf_emit(ctx, 1, 0); /* 00000001 STENCIL_BACK_ENABLE */ |
1800 | xf_emit(ctx, 1, 0x3f); | 2456 | xf_emit(ctx, 1, 1); /* 00000001 tesla UNK15B4 */ |
1801 | xf_emit(ctx, 6, 0); | 2457 | xf_emit(ctx, 1, 0x10); /* 7f/ff VIEW_VOLUME_CLIP_CTRL */ |
1802 | xf_emit(ctx, 1, 1); | 2458 | xf_emit(ctx, 1, 0); /* 0000000f ZETA_FORMAT */ |
1803 | xf_emit(ctx, 1, 0); | 2459 | xf_emit(ctx, 1, 1); /* 00000001 ZETA_ENABLE */ |
1804 | xf_emit(ctx, 1, 1); | 2460 | xf_emit(ctx, 1, 0); /* ffffffff tesla UNK1A3C */ |
1805 | xf_emit(ctx, 1, 0); | 2461 | xf_emit(ctx, 1, 0); /* 00000001 tesla UNK1534 */ |
1806 | xf_emit(ctx, 1, 1); | 2462 | xf_emit(ctx, 1, 0); /* 00000001 tesla UNK1900 */ |
2463 | xf_emit(ctx, 1, 0); /* 00000007 STENCIL_BACK_FUNC_FUNC */ | ||
2464 | xf_emit(ctx, 1, 0); /* 000000ff STENCIL_BACK_FUNC_MASK */ | ||
2465 | xf_emit(ctx, 1, 0); /* 000000ff STENCIL_BACK_FUNC_REF */ | ||
2466 | xf_emit(ctx, 2, 0); /* ffffffff DEPTH_BOUNDS */ | ||
2467 | xf_emit(ctx, 1, 0); /* 00000001 DEPTH_BOUNDS_EN */ | ||
2468 | xf_emit(ctx, 1, 0); /* 00000007 DEPTH_TEST_FUNC */ | ||
2469 | xf_emit(ctx, 1, 0); /* 00000001 DEPTH_TEST_ENABLE */ | ||
2470 | xf_emit(ctx, 1, 0); /* 00000001 DEPTH_WRITE_ENABLE */ | ||
2471 | xf_emit(ctx, 1, 0); /* 0000000f */ | ||
2472 | xf_emit(ctx, 1, 0); /* 00000001 tesla UNK0FB0 */ | ||
2473 | xf_emit(ctx, 1, 0); /* 00000007 STENCIL_FRONT_FUNC_FUNC */ | ||
2474 | xf_emit(ctx, 1, 0); /* 000000ff STENCIL_FRONT_FUNC_MASK */ | ||
2475 | xf_emit(ctx, 1, 0); /* 000000ff STENCIL_FRONT_FUNC_REF */ | ||
2476 | xf_emit(ctx, 1, 0); /* 00000001 STENCIL_FRONT_ENABLE */ | ||
2477 | xf_emit(ctx, 1, 0); /* 00000001 STENCIL_BACK_ENABLE */ | ||
2478 | xf_emit(ctx, 1, 0x10); /* 7f/ff VIEW_VOLUME_CLIP_CTRL */ | ||
2479 | xf_emit(ctx, 0x10, 0); /* ffffffff DEPTH_RANGE_NEAR */ | ||
2480 | xf_emit(ctx, 0x10, 0x3f800000); /* ffffffff DEPTH_RANGE_FAR */ | ||
2481 | xf_emit(ctx, 1, 0); /* 0000000f ZETA_FORMAT */ | ||
2482 | xf_emit(ctx, 1, 0); /* 00000007 MULTISAMPLE_SAMPLES_LOG2 */ | ||
2483 | xf_emit(ctx, 1, 0); /* 00000007 STENCIL_BACK_FUNC_FUNC */ | ||
2484 | xf_emit(ctx, 1, 0); /* 000000ff STENCIL_BACK_FUNC_MASK */ | ||
2485 | xf_emit(ctx, 1, 0); /* 000000ff STENCIL_BACK_FUNC_REF */ | ||
2486 | xf_emit(ctx, 1, 0); /* 000000ff STENCIL_BACK_MASK */ | ||
2487 | xf_emit(ctx, 3, 0); /* 00000007 STENCIL_BACK_OP_FAIL, ZFAIL, ZPASS */ | ||
2488 | xf_emit(ctx, 2, 0); /* ffffffff DEPTH_BOUNDS */ | ||
2489 | xf_emit(ctx, 1, 0); /* 00000001 DEPTH_BOUNDS_EN */ | ||
2490 | xf_emit(ctx, 1, 0); /* 00000007 DEPTH_TEST_FUNC */ | ||
2491 | xf_emit(ctx, 1, 0); /* 00000001 DEPTH_TEST_ENABLE */ | ||
2492 | xf_emit(ctx, 1, 0); /* 00000001 DEPTH_WRITE_ENABLE */ | ||
2493 | xf_emit(ctx, 1, 0); /* 000000ff CLEAR_STENCIL */ | ||
2494 | xf_emit(ctx, 1, 0); /* 00000007 STENCIL_FRONT_FUNC_FUNC */ | ||
2495 | xf_emit(ctx, 1, 0); /* 000000ff STENCIL_FRONT_FUNC_MASK */ | ||
2496 | xf_emit(ctx, 1, 0); /* 000000ff STENCIL_FRONT_FUNC_REF */ | ||
2497 | xf_emit(ctx, 1, 0); /* 000000ff STENCIL_FRONT_MASK */ | ||
2498 | xf_emit(ctx, 3, 0); /* 00000007 STENCIL_FRONT_OP_FAIL, ZFAIL, ZPASS */ | ||
2499 | xf_emit(ctx, 1, 0); /* 00000001 STENCIL_FRONT_ENABLE */ | ||
2500 | xf_emit(ctx, 1, 0); /* 00000001 STENCIL_BACK_ENABLE */ | ||
2501 | xf_emit(ctx, 1, 0x10); /* 7f/ff VIEW_VOLUME_CLIP_CTRL */ | ||
2502 | xf_emit(ctx, 1, 0); /* 0000000f ZETA_FORMAT */ | ||
2503 | xf_emit(ctx, 1, 0x3f); /* 0000003f UNK1590 */ | ||
2504 | xf_emit(ctx, 1, 0); /* 00000007 MULTISAMPLE_SAMPLES_LOG2 */ | ||
2505 | xf_emit(ctx, 1, 0); /* 00000001 tesla UNK1534 */ | ||
2506 | xf_emit(ctx, 2, 0); /* ffff0ff3, ffff */ | ||
2507 | xf_emit(ctx, 1, 0); /* 00000001 tesla UNK0FB0 */ | ||
2508 | xf_emit(ctx, 1, 0); /* 0001ffff GP_BUILTIN_RESULT_EN */ | ||
2509 | xf_emit(ctx, 1, 1); /* 00000001 tesla UNK15B4 */ | ||
2510 | xf_emit(ctx, 1, 0); /* 0000000f ZETA_FORMAT */ | ||
2511 | xf_emit(ctx, 1, 1); /* 00000001 ZETA_ENABLE */ | ||
2512 | xf_emit(ctx, 1, 0); /* ffffffff CLEAR_DEPTH */ | ||
2513 | xf_emit(ctx, 1, 1); /* 00000001 tesla UNK19CC */ | ||
1807 | if (dev_priv->chipset >= 0xa0) { | 2514 | if (dev_priv->chipset >= 0xa0) { |
1808 | xf_emit(ctx, 2, 0); | 2515 | xf_emit(ctx, 2, 0); |
1809 | xf_emit(ctx, 1, 0x1001); | 2516 | xf_emit(ctx, 1, 0x1001); |
1810 | xf_emit(ctx, 0xb, 0); | 2517 | xf_emit(ctx, 0xb, 0); |
1811 | } else { | 2518 | } else { |
1812 | xf_emit(ctx, 0xc, 0); | 2519 | xf_emit(ctx, 1, 0); /* 00000007 */ |
2520 | xf_emit(ctx, 1, 0); /* 00000001 tesla UNK1534 */ | ||
2521 | xf_emit(ctx, 1, 0); /* 00000007 MULTISAMPLE_SAMPLES_LOG2 */ | ||
2522 | xf_emit(ctx, 8, 0); /* 00000001 BLEND_ENABLE */ | ||
2523 | xf_emit(ctx, 1, 0); /* ffff0ff3 */ | ||
1813 | } | 2524 | } |
1814 | xf_emit(ctx, 1, 0x11); | 2525 | xf_emit(ctx, 1, 0x11); /* 3f/7f RT_FORMAT */ |
1815 | xf_emit(ctx, 7, 0); | 2526 | xf_emit(ctx, 7, 0); /* 3f/7f RT_FORMAT */ |
1816 | xf_emit(ctx, 1, 0xf); | 2527 | xf_emit(ctx, 1, 0xf); /* 0000000f COLOR_MASK */ |
1817 | xf_emit(ctx, 7, 0); | 2528 | xf_emit(ctx, 7, 0); /* 0000000f COLOR_MASK */ |
1818 | xf_emit(ctx, 1, 0x11); | 2529 | xf_emit(ctx, 1, 0x11); /* 3f/7f */ |
1819 | if (dev_priv->chipset == 0x50) | 2530 | xf_emit(ctx, 1, 0); /* 00000001 LOGIC_OP_ENABLE */ |
1820 | xf_emit(ctx, 4, 0); | 2531 | if (dev_priv->chipset != 0x50) { |
1821 | else | 2532 | xf_emit(ctx, 1, 0); /* 0000000f LOGIC_OP */ |
1822 | xf_emit(ctx, 6, 0); | 2533 | xf_emit(ctx, 1, 0); /* 000000ff */ |
1823 | xf_emit(ctx, 3, 1); | 2534 | } |
1824 | xf_emit(ctx, 1, 2); | 2535 | xf_emit(ctx, 1, 0); /* 00000007 OPERATION */ |
1825 | xf_emit(ctx, 1, 1); | 2536 | xf_emit(ctx, 1, 0); /* ff/3ff */ |
1826 | xf_emit(ctx, 1, 2); | 2537 | xf_emit(ctx, 1, 0); /* 00000003 UNK0F90 */ |
1827 | xf_emit(ctx, 1, 1); | 2538 | xf_emit(ctx, 2, 1); /* 00000007 BLEND_EQUATION_RGB, ALPHA */ |
1828 | xf_emit(ctx, 1, 0); | 2539 | xf_emit(ctx, 1, 1); /* 00000001 UNK133C */ |
1829 | xf_emit(ctx, 1, magic2); | 2540 | xf_emit(ctx, 1, 2); /* 0000001f BLEND_FUNC_SRC_RGB */ |
1830 | xf_emit(ctx, 1, 0); | 2541 | xf_emit(ctx, 1, 1); /* 0000001f BLEND_FUNC_DST_RGB */ |
1831 | xf_emit(ctx, 1, 0x0fac6881); | 2542 | xf_emit(ctx, 1, 2); /* 0000001f BLEND_FUNC_SRC_ALPHA */ |
1832 | if (dev_priv->chipset > 0xa0 && dev_priv->chipset < 0xaa) { | 2543 | xf_emit(ctx, 1, 1); /* 0000001f BLEND_FUNC_DST_ALPHA */ |
1833 | xf_emit(ctx, 1, 0); | 2544 | xf_emit(ctx, 1, 0); /* 00000001 */ |
1834 | xf_emit(ctx, 0x18, 1); | 2545 | xf_emit(ctx, 1, magic2); /* 001fffff tesla UNK0F78 */ |
1835 | xf_emit(ctx, 8, 2); | 2546 | xf_emit(ctx, 1, 0); /* ffffffff tesla UNK1A3C */ |
1836 | xf_emit(ctx, 8, 1); | 2547 | xf_emit(ctx, 1, 0x0fac6881); /* 0fffffff RT_CONTROL */ |
1837 | xf_emit(ctx, 8, 2); | 2548 | if (IS_NVA3F(dev_priv->chipset)) { |
1838 | xf_emit(ctx, 8, 1); | 2549 | xf_emit(ctx, 1, 0); /* 00000001 tesla UNK12E4 */ |
1839 | xf_emit(ctx, 3, 0); | 2550 | xf_emit(ctx, 8, 1); /* 00000007 IBLEND_EQUATION_RGB */ |
1840 | xf_emit(ctx, 1, 1); | 2551 | xf_emit(ctx, 8, 1); /* 00000007 IBLEND_EQUATION_ALPHA */ |
1841 | xf_emit(ctx, 5, 0); | 2552 | xf_emit(ctx, 8, 1); /* 00000001 IBLEND_UNK00 */ |
1842 | xf_emit(ctx, 1, 1); | 2553 | xf_emit(ctx, 8, 2); /* 0000001f IBLEND_FUNC_SRC_RGB */ |
1843 | xf_emit(ctx, 0x16, 0); | 2554 | xf_emit(ctx, 8, 1); /* 0000001f IBLEND_FUNC_DST_RGB */ |
2555 | xf_emit(ctx, 8, 2); /* 0000001f IBLEND_FUNC_SRC_ALPHA */ | ||
2556 | xf_emit(ctx, 8, 1); /* 0000001f IBLEND_FUNC_DST_ALPHA */ | ||
2557 | xf_emit(ctx, 1, 0); /* 00000001 tesla UNK1140 */ | ||
2558 | xf_emit(ctx, 2, 0); /* 00000001 */ | ||
2559 | xf_emit(ctx, 1, 1); /* 0000001f tesla UNK169C */ | ||
2560 | xf_emit(ctx, 1, 0); /* 0000000f */ | ||
2561 | xf_emit(ctx, 1, 0); /* 00000003 */ | ||
2562 | xf_emit(ctx, 1, 0); /* ffffffff */ | ||
2563 | xf_emit(ctx, 2, 0); /* 00000001 */ | ||
2564 | xf_emit(ctx, 1, 1); /* 0000001f tesla UNK169C */ | ||
2565 | xf_emit(ctx, 1, 0); /* 00000001 */ | ||
2566 | xf_emit(ctx, 1, 0); /* 000003ff */ | ||
2567 | } else if (dev_priv->chipset >= 0xa0) { | ||
2568 | xf_emit(ctx, 2, 0); /* 00000001 */ | ||
2569 | xf_emit(ctx, 1, 0); /* 00000007 */ | ||
2570 | xf_emit(ctx, 1, 0); /* 00000003 */ | ||
2571 | xf_emit(ctx, 1, 0); /* ffffffff */ | ||
2572 | xf_emit(ctx, 2, 0); /* 00000001 */ | ||
1844 | } else { | 2573 | } else { |
1845 | if (dev_priv->chipset >= 0xa0) | 2574 | xf_emit(ctx, 1, 0); /* 00000007 MULTISAMPLE_SAMPLES_LOG2 */ |
1846 | xf_emit(ctx, 0x1b, 0); | 2575 | xf_emit(ctx, 1, 0); /* 00000003 tesla UNK1430 */ |
1847 | else | 2576 | xf_emit(ctx, 1, 0); /* ffffffff tesla UNK1A3C */ |
1848 | xf_emit(ctx, 0x15, 0); | ||
1849 | } | 2577 | } |
1850 | xf_emit(ctx, 1, 1); | 2578 | xf_emit(ctx, 4, 0); /* ffffffff CLEAR_COLOR */ |
1851 | xf_emit(ctx, 1, 2); | 2579 | xf_emit(ctx, 4, 0); /* ffffffff BLEND_COLOR A R G B */ |
1852 | xf_emit(ctx, 2, 1); | 2580 | xf_emit(ctx, 1, 0); /* 00000fff eng2d UNK2B0 */ |
1853 | xf_emit(ctx, 1, 2); | ||
1854 | xf_emit(ctx, 2, 1); | ||
1855 | if (dev_priv->chipset >= 0xa0) | 2581 | if (dev_priv->chipset >= 0xa0) |
1856 | xf_emit(ctx, 4, 0); | 2582 | xf_emit(ctx, 2, 0); /* 00000001 */ |
1857 | else | 2583 | xf_emit(ctx, 1, 0); /* 000003ff */ |
1858 | xf_emit(ctx, 3, 0); | 2584 | xf_emit(ctx, 8, 0); /* 00000001 BLEND_ENABLE */ |
1859 | if (dev_priv->chipset > 0xa0 && dev_priv->chipset < 0xaa) { | 2585 | xf_emit(ctx, 1, 1); /* 00000001 UNK133C */ |
1860 | xf_emit(ctx, 0x10, 1); | 2586 | xf_emit(ctx, 1, 2); /* 0000001f BLEND_FUNC_SRC_RGB */ |
1861 | xf_emit(ctx, 8, 2); | 2587 | xf_emit(ctx, 1, 1); /* 0000001f BLEND_FUNC_DST_RGB */ |
1862 | xf_emit(ctx, 0x10, 1); | 2588 | xf_emit(ctx, 1, 1); /* 00000007 BLEND_EQUATION_RGB */ |
1863 | xf_emit(ctx, 8, 2); | 2589 | xf_emit(ctx, 1, 2); /* 0000001f BLEND_FUNC_SRC_ALPHA */ |
1864 | xf_emit(ctx, 8, 1); | 2590 | xf_emit(ctx, 1, 1); /* 0000001f BLEND_FUNC_DST_ALPHA */ |
1865 | xf_emit(ctx, 3, 0); | 2591 | xf_emit(ctx, 1, 1); /* 00000007 BLEND_EQUATION_ALPHA */ |
2592 | xf_emit(ctx, 1, 0); /* 00000001 UNK19C0 */ | ||
2593 | xf_emit(ctx, 1, 0); /* 00000001 LOGIC_OP_ENABLE */ | ||
2594 | xf_emit(ctx, 1, 0); /* 0000000f LOGIC_OP */ | ||
2595 | if (dev_priv->chipset >= 0xa0) | ||
2596 | xf_emit(ctx, 1, 0); /* 00000001 UNK12E4? NVA3+ only? */ | ||
2597 | if (IS_NVA3F(dev_priv->chipset)) { | ||
2598 | xf_emit(ctx, 8, 1); /* 00000001 IBLEND_UNK00 */ | ||
2599 | xf_emit(ctx, 8, 1); /* 00000007 IBLEND_EQUATION_RGB */ | ||
2600 | xf_emit(ctx, 8, 2); /* 0000001f IBLEND_FUNC_SRC_RGB */ | ||
2601 | xf_emit(ctx, 8, 1); /* 0000001f IBLEND_FUNC_DST_RGB */ | ||
2602 | xf_emit(ctx, 8, 1); /* 00000007 IBLEND_EQUATION_ALPHA */ | ||
2603 | xf_emit(ctx, 8, 2); /* 0000001f IBLEND_FUNC_SRC_ALPHA */ | ||
2604 | xf_emit(ctx, 8, 1); /* 0000001f IBLEND_FUNC_DST_ALPHA */ | ||
2605 | xf_emit(ctx, 1, 0); /* 00000001 tesla UNK15C4 */ | ||
2606 | xf_emit(ctx, 1, 0); /* 00000001 */ | ||
2607 | xf_emit(ctx, 1, 0); /* 00000001 tesla UNK1140 */ | ||
1866 | } | 2608 | } |
1867 | xf_emit(ctx, 1, 0x11); | 2609 | xf_emit(ctx, 1, 0x11); /* 3f/7f DST_FORMAT */ |
1868 | xf_emit(ctx, 1, 1); | 2610 | xf_emit(ctx, 1, 1); /* 00000001 DST_LINEAR */ |
1869 | xf_emit(ctx, 0x5b, 0); | 2611 | xf_emit(ctx, 1, 0); /* 00000007 PATTERN_COLOR_FORMAT */ |
2612 | xf_emit(ctx, 2, 0); /* ffffffff PATTERN_MONO_COLOR */ | ||
2613 | xf_emit(ctx, 1, 0); /* 00000001 PATTERN_MONO_FORMAT */ | ||
2614 | xf_emit(ctx, 2, 0); /* ffffffff PATTERN_MONO_BITMAP */ | ||
2615 | xf_emit(ctx, 1, 0); /* 00000003 PATTERN_SELECT */ | ||
2616 | xf_emit(ctx, 1, 0); /* 000000ff ROP */ | ||
2617 | xf_emit(ctx, 1, 0); /* ffffffff BETA1 */ | ||
2618 | xf_emit(ctx, 1, 0); /* ffffffff BETA4 */ | ||
2619 | xf_emit(ctx, 1, 0); /* 00000007 OPERATION */ | ||
2620 | xf_emit(ctx, 0x50, 0); /* 10x ffffff, ffffff, ffffff, ffffff, 3 PATTERN */ | ||
1870 | } | 2621 | } |
1871 | 2622 | ||
1872 | static void | 2623 | static void |
1873 | nv50_graph_construct_xfer_tp_x1(struct nouveau_grctx *ctx) | 2624 | nv50_graph_construct_xfer_unk84xx(struct nouveau_grctx *ctx) |
1874 | { | 2625 | { |
1875 | struct drm_nouveau_private *dev_priv = ctx->dev->dev_private; | 2626 | struct drm_nouveau_private *dev_priv = ctx->dev->dev_private; |
1876 | int magic3; | 2627 | int magic3; |
1877 | if (dev_priv->chipset == 0x50) | 2628 | switch (dev_priv->chipset) { |
2629 | case 0x50: | ||
1878 | magic3 = 0x1000; | 2630 | magic3 = 0x1000; |
1879 | else if (dev_priv->chipset == 0x86 || dev_priv->chipset == 0x98 || dev_priv->chipset >= 0xa8) | 2631 | break; |
2632 | case 0x86: | ||
2633 | case 0x98: | ||
2634 | case 0xa8: | ||
2635 | case 0xaa: | ||
2636 | case 0xac: | ||
2637 | case 0xaf: | ||
1880 | magic3 = 0x1e00; | 2638 | magic3 = 0x1e00; |
1881 | else | 2639 | break; |
2640 | default: | ||
1882 | magic3 = 0; | 2641 | magic3 = 0; |
1883 | xf_emit(ctx, 1, 0); | 2642 | } |
1884 | xf_emit(ctx, 1, 4); | 2643 | xf_emit(ctx, 1, 0); /* 00000001 GP_ENABLE */ |
1885 | if (dev_priv->chipset > 0xa0 && dev_priv->chipset < 0xaa) | 2644 | xf_emit(ctx, 1, 4); /* 7f/ff[NVA0+] VP_REG_ALLOC_RESULT */ |
1886 | xf_emit(ctx, 0x24, 0); | 2645 | xf_emit(ctx, 1, 0); /* 00000001 GP_ENABLE */ |
2646 | xf_emit(ctx, 1, 0); /* ffffffff tesla UNK1A30 */ | ||
2647 | xf_emit(ctx, 1, 0); /* 111/113[NVA0+] */ | ||
2648 | if (IS_NVA3F(dev_priv->chipset)) | ||
2649 | xf_emit(ctx, 0x1f, 0); /* ffffffff */ | ||
1887 | else if (dev_priv->chipset >= 0xa0) | 2650 | else if (dev_priv->chipset >= 0xa0) |
1888 | xf_emit(ctx, 0x14, 0); | 2651 | xf_emit(ctx, 0x0f, 0); /* ffffffff */ |
1889 | else | 2652 | else |
1890 | xf_emit(ctx, 0x15, 0); | 2653 | xf_emit(ctx, 0x10, 0); /* fffffff VP_RESULT_MAP_1 up */ |
1891 | xf_emit(ctx, 2, 4); | 2654 | xf_emit(ctx, 2, 0); /* f/1f[NVA3], fffffff/ffffffff[NVA0+] */ |
2655 | xf_emit(ctx, 1, 4); /* 7f/ff VP_REG_ALLOC_RESULT */ | ||
2656 | xf_emit(ctx, 1, 4); /* 7f/ff VP_RESULT_MAP_SIZE */ | ||
1892 | if (dev_priv->chipset >= 0xa0) | 2657 | if (dev_priv->chipset >= 0xa0) |
1893 | xf_emit(ctx, 1, 0x03020100); | 2658 | xf_emit(ctx, 1, 0x03020100); /* ffffffff */ |
1894 | else | 2659 | else |
1895 | xf_emit(ctx, 1, 0x00608080); | 2660 | xf_emit(ctx, 1, 0x00608080); /* fffffff VP_RESULT_MAP_0 */ |
1896 | xf_emit(ctx, 4, 0); | 2661 | xf_emit(ctx, 1, 0); /* 00000001 GP_ENABLE */ |
1897 | xf_emit(ctx, 1, 4); | 2662 | xf_emit(ctx, 1, 0); /* ffffffff tesla UNK1A30 */ |
1898 | xf_emit(ctx, 2, 0); | 2663 | xf_emit(ctx, 2, 0); /* 111/113, 7f/ff */ |
1899 | xf_emit(ctx, 2, 4); | 2664 | xf_emit(ctx, 1, 4); /* 7f/ff VP_RESULT_MAP_SIZE */ |
1900 | xf_emit(ctx, 1, 0x80); | 2665 | xf_emit(ctx, 1, 0); /* ffffffff tesla UNK1A30 */ |
2666 | xf_emit(ctx, 1, 0); /* 00000001 GP_ENABLE */ | ||
2667 | xf_emit(ctx, 1, 4); /* 000000ff GP_REG_ALLOC_RESULT */ | ||
2668 | xf_emit(ctx, 1, 4); /* 000000ff GP_RESULT_MAP_SIZE */ | ||
2669 | xf_emit(ctx, 1, 0x80); /* 0000ffff GP_VERTEX_OUTPUT_COUNT */ | ||
1901 | if (magic3) | 2670 | if (magic3) |
1902 | xf_emit(ctx, 1, magic3); | 2671 | xf_emit(ctx, 1, magic3); /* 00007fff tesla UNK141C */ |
1903 | xf_emit(ctx, 1, 4); | 2672 | xf_emit(ctx, 1, 4); /* 7f/ff VP_RESULT_MAP_SIZE */ |
1904 | xf_emit(ctx, 0x24, 0); | 2673 | xf_emit(ctx, 1, 0); /* ffffffff tesla UNK1A30 */ |
1905 | xf_emit(ctx, 1, 4); | 2674 | xf_emit(ctx, 1, 0); /* 111/113 */ |
1906 | xf_emit(ctx, 1, 0x80); | 2675 | xf_emit(ctx, 0x1f, 0); /* ffffffff GP_RESULT_MAP_1 up */ |
1907 | xf_emit(ctx, 1, 4); | 2676 | xf_emit(ctx, 1, 0); /* 0000001f */ |
1908 | xf_emit(ctx, 1, 0x03020100); | 2677 | xf_emit(ctx, 1, 0); /* ffffffff */ |
1909 | xf_emit(ctx, 1, 3); | 2678 | xf_emit(ctx, 1, 0); /* 00000001 GP_ENABLE */ |
2679 | xf_emit(ctx, 1, 4); /* 000000ff GP_REG_ALLOC_RESULT */ | ||
2680 | xf_emit(ctx, 1, 0x80); /* 0000ffff GP_VERTEX_OUTPUT_COUNT */ | ||
2681 | xf_emit(ctx, 1, 4); /* 000000ff GP_RESULT_MAP_SIZE */ | ||
2682 | xf_emit(ctx, 1, 0x03020100); /* ffffffff GP_RESULT_MAP_0 */ | ||
2683 | xf_emit(ctx, 1, 3); /* 00000003 GP_OUTPUT_PRIMITIVE_TYPE */ | ||
1910 | if (magic3) | 2684 | if (magic3) |
1911 | xf_emit(ctx, 1, magic3); | 2685 | xf_emit(ctx, 1, magic3); /* 7fff tesla UNK141C */ |
1912 | xf_emit(ctx, 1, 4); | 2686 | xf_emit(ctx, 1, 4); /* 7f/ff VP_RESULT_MAP_SIZE */ |
1913 | xf_emit(ctx, 4, 0); | 2687 | xf_emit(ctx, 1, 0); /* 00000001 PROVOKING_VERTEX_LAST */ |
1914 | xf_emit(ctx, 1, 4); | 2688 | xf_emit(ctx, 1, 0); /* ffffffff tesla UNK1A30 */ |
1915 | xf_emit(ctx, 1, 3); | 2689 | xf_emit(ctx, 1, 0); /* 111/113 */ |
1916 | xf_emit(ctx, 3, 0); | 2690 | xf_emit(ctx, 1, 0); /* 00000001 GP_ENABLE */ |
1917 | xf_emit(ctx, 1, 4); | 2691 | xf_emit(ctx, 1, 4); /* 000000ff GP_RESULT_MAP_SIZE */ |
2692 | xf_emit(ctx, 1, 3); /* 00000003 GP_OUTPUT_PRIMITIVE_TYPE */ | ||
2693 | xf_emit(ctx, 1, 0); /* 00000001 PROVOKING_VERTEX_LAST */ | ||
2694 | xf_emit(ctx, 1, 0); /* ffffffff tesla UNK1A30 */ | ||
2695 | xf_emit(ctx, 1, 0); /* 00000003 tesla UNK13A0 */ | ||
2696 | xf_emit(ctx, 1, 4); /* 7f/ff VP_REG_ALLOC_RESULT */ | ||
2697 | xf_emit(ctx, 1, 0); /* 00000001 GP_ENABLE */ | ||
2698 | xf_emit(ctx, 1, 0); /* ffffffff tesla UNK1A30 */ | ||
2699 | xf_emit(ctx, 1, 0); /* 111/113 */ | ||
1918 | if (dev_priv->chipset == 0x94 || dev_priv->chipset == 0x96) | 2700 | if (dev_priv->chipset == 0x94 || dev_priv->chipset == 0x96) |
1919 | xf_emit(ctx, 0x1024, 0); | 2701 | xf_emit(ctx, 0x1020, 0); /* 4 x (0x400 x 0xffffffff, ff, 0, 0, 0, 4 x ffffffff) */ |
1920 | else if (dev_priv->chipset < 0xa0) | 2702 | else if (dev_priv->chipset < 0xa0) |
1921 | xf_emit(ctx, 0xa24, 0); | 2703 | xf_emit(ctx, 0xa20, 0); /* 4 x (0x280 x 0xffffffff, ff, 0, 0, 0, 4 x ffffffff) */ |
1922 | else if (dev_priv->chipset == 0xa0 || dev_priv->chipset >= 0xaa) | 2704 | else if (!IS_NVA3F(dev_priv->chipset)) |
1923 | xf_emit(ctx, 0x214, 0); | 2705 | xf_emit(ctx, 0x210, 0); /* ffffffff */ |
1924 | else | 2706 | else |
1925 | xf_emit(ctx, 0x414, 0); | 2707 | xf_emit(ctx, 0x410, 0); /* ffffffff */ |
1926 | xf_emit(ctx, 1, 4); | 2708 | xf_emit(ctx, 1, 0); /* 00000001 GP_ENABLE */ |
1927 | xf_emit(ctx, 1, 3); | 2709 | xf_emit(ctx, 1, 4); /* 000000ff GP_RESULT_MAP_SIZE */ |
1928 | xf_emit(ctx, 2, 0); | 2710 | xf_emit(ctx, 1, 3); /* 00000003 GP_OUTPUT_PRIMITIVE_TYPE */ |
2711 | xf_emit(ctx, 1, 0); /* 00000001 PROVOKING_VERTEX_LAST */ | ||
2712 | xf_emit(ctx, 1, 0); /* ffffffff tesla UNK1A30 */ | ||
1929 | } | 2713 | } |
1930 | 2714 | ||
1931 | static void | 2715 | static void |
1932 | nv50_graph_construct_xfer_tp_x2(struct nouveau_grctx *ctx) | 2716 | nv50_graph_construct_xfer_tprop(struct nouveau_grctx *ctx) |
1933 | { | 2717 | { |
1934 | struct drm_nouveau_private *dev_priv = ctx->dev->dev_private; | 2718 | struct drm_nouveau_private *dev_priv = ctx->dev->dev_private; |
1935 | int magic1, magic2; | 2719 | int magic1, magic2; |
1936 | if (dev_priv->chipset == 0x50) { | 2720 | if (dev_priv->chipset == 0x50) { |
1937 | magic1 = 0x3ff; | 2721 | magic1 = 0x3ff; |
1938 | magic2 = 0x00003e60; | 2722 | magic2 = 0x00003e60; |
1939 | } else if (dev_priv->chipset <= 0xa0 || dev_priv->chipset >= 0xaa) { | 2723 | } else if (!IS_NVA3F(dev_priv->chipset)) { |
1940 | magic1 = 0x7ff; | 2724 | magic1 = 0x7ff; |
1941 | magic2 = 0x001ffe67; | 2725 | magic2 = 0x001ffe67; |
1942 | } else { | 2726 | } else { |
1943 | magic1 = 0x7ff; | 2727 | magic1 = 0x7ff; |
1944 | magic2 = 0x00087e67; | 2728 | magic2 = 0x00087e67; |
1945 | } | 2729 | } |
1946 | xf_emit(ctx, 3, 0); | 2730 | xf_emit(ctx, 1, 0); /* 00000007 ALPHA_TEST_FUNC */ |
1947 | if (dev_priv->chipset > 0xa0 && dev_priv->chipset < 0xaa) | 2731 | xf_emit(ctx, 1, 0); /* ffffffff ALPHA_TEST_REF */ |
1948 | xf_emit(ctx, 1, 1); | 2732 | xf_emit(ctx, 1, 0); /* 00000001 ALPHA_TEST_ENABLE */ |
1949 | xf_emit(ctx, 0xc, 0); | 2733 | if (IS_NVA3F(dev_priv->chipset)) |
1950 | xf_emit(ctx, 1, 0xf); | 2734 | xf_emit(ctx, 1, 1); /* 0000000f UNK16A0 */ |
1951 | xf_emit(ctx, 0xb, 0); | 2735 | xf_emit(ctx, 1, 0); /* 7/f MULTISAMPLE_SAMPLES_LOG2 */ |
1952 | xf_emit(ctx, 1, 4); | 2736 | xf_emit(ctx, 1, 0); /* 00000001 tesla UNK1534 */ |
1953 | xf_emit(ctx, 4, 0xffff); | 2737 | xf_emit(ctx, 1, 0); /* 000000ff STENCIL_BACK_MASK */ |
1954 | xf_emit(ctx, 8, 0); | 2738 | xf_emit(ctx, 3, 0); /* 00000007 STENCIL_BACK_OP_FAIL, ZFAIL, ZPASS */ |
1955 | xf_emit(ctx, 1, 1); | 2739 | xf_emit(ctx, 4, 0); /* ffffffff BLEND_COLOR */ |
1956 | xf_emit(ctx, 3, 0); | 2740 | xf_emit(ctx, 1, 0); /* 00000001 UNK19C0 */ |
1957 | xf_emit(ctx, 1, 1); | 2741 | xf_emit(ctx, 1, 0); /* 00000001 UNK0FDC */ |
1958 | xf_emit(ctx, 5, 0); | 2742 | xf_emit(ctx, 1, 0xf); /* 0000000f COLOR_MASK */ |
1959 | xf_emit(ctx, 1, 1); | 2743 | xf_emit(ctx, 7, 0); /* 0000000f COLOR_MASK */ |
1960 | xf_emit(ctx, 2, 0); | 2744 | xf_emit(ctx, 1, 0); /* 00000001 DEPTH_TEST_ENABLE */ |
1961 | if (dev_priv->chipset > 0xa0 && dev_priv->chipset < 0xaa) { | 2745 | xf_emit(ctx, 1, 0); /* 00000001 DEPTH_WRITE_ENABLE */ |
1962 | xf_emit(ctx, 1, 3); | 2746 | xf_emit(ctx, 1, 0); /* 00000001 LOGIC_OP_ENABLE */ |
1963 | xf_emit(ctx, 1, 0); | 2747 | xf_emit(ctx, 1, 0); /* ff[NV50]/3ff[NV84+] */ |
1964 | } else if (dev_priv->chipset >= 0xa0) | 2748 | xf_emit(ctx, 1, 4); /* 00000007 FP_CONTROL */ |
1965 | xf_emit(ctx, 1, 1); | 2749 | xf_emit(ctx, 4, 0xffff); /* 0000ffff MSAA_MASK */ |
1966 | xf_emit(ctx, 0xa, 0); | 2750 | xf_emit(ctx, 1, 0); /* 000000ff STENCIL_FRONT_MASK */ |
1967 | xf_emit(ctx, 2, 1); | 2751 | xf_emit(ctx, 3, 0); /* 00000007 STENCIL_FRONT_OP_FAIL, ZFAIL, ZPASS */ |
1968 | xf_emit(ctx, 1, 2); | 2752 | xf_emit(ctx, 1, 0); /* 00000001 STENCIL_FRONT_ENABLE */ |
1969 | xf_emit(ctx, 2, 1); | 2753 | xf_emit(ctx, 1, 0); /* 00000001 STENCIL_BACK_ENABLE */ |
1970 | xf_emit(ctx, 1, 2); | 2754 | xf_emit(ctx, 2, 0); /* 00007fff WINDOW_OFFSET_XY */ |
1971 | if (dev_priv->chipset > 0xa0 && dev_priv->chipset < 0xaa) { | 2755 | xf_emit(ctx, 1, 1); /* 00000001 tesla UNK19CC */ |
1972 | xf_emit(ctx, 1, 0); | 2756 | xf_emit(ctx, 1, 0); /* 7 */ |
1973 | xf_emit(ctx, 0x18, 1); | 2757 | xf_emit(ctx, 1, 0); /* 00000001 SAMPLECNT_ENABLE */ |
1974 | xf_emit(ctx, 8, 2); | 2758 | xf_emit(ctx, 1, 0); /* 0000000f ZETA_FORMAT */ |
1975 | xf_emit(ctx, 8, 1); | 2759 | xf_emit(ctx, 1, 1); /* 00000001 ZETA_ENABLE */ |
1976 | xf_emit(ctx, 8, 2); | 2760 | xf_emit(ctx, 1, 0); /* ffffffff COLOR_KEY */ |
1977 | xf_emit(ctx, 8, 1); | 2761 | xf_emit(ctx, 1, 0); /* 00000001 COLOR_KEY_ENABLE */ |
1978 | xf_emit(ctx, 1, 0); | 2762 | xf_emit(ctx, 1, 0); /* 00000007 COLOR_KEY_FORMAT */ |
2763 | xf_emit(ctx, 2, 0); /* ffffffff SIFC_BITMAP_COLOR */ | ||
2764 | xf_emit(ctx, 1, 1); /* 00000001 SIFC_BITMAP_WRITE_BIT0_ENABLE */ | ||
2765 | xf_emit(ctx, 1, 0); /* 00000007 ALPHA_TEST_FUNC */ | ||
2766 | xf_emit(ctx, 1, 0); /* 00000001 ALPHA_TEST_ENABLE */ | ||
2767 | if (IS_NVA3F(dev_priv->chipset)) { | ||
2768 | xf_emit(ctx, 1, 3); /* 00000003 tesla UNK16B4 */ | ||
2769 | xf_emit(ctx, 1, 0); /* 00000003 */ | ||
2770 | xf_emit(ctx, 1, 0); /* 00000003 tesla UNK1298 */ | ||
2771 | } else if (dev_priv->chipset >= 0xa0) { | ||
2772 | xf_emit(ctx, 1, 1); /* 00000001 tesla UNK16B4 */ | ||
2773 | xf_emit(ctx, 1, 0); /* 00000003 */ | ||
2774 | } else { | ||
2775 | xf_emit(ctx, 1, 0); /* 00000003 MULTISAMPLE_CTRL */ | ||
1979 | } | 2776 | } |
1980 | xf_emit(ctx, 1, 1); | 2777 | xf_emit(ctx, 1, 0); /* 00000001 tesla UNK1534 */ |
1981 | xf_emit(ctx, 1, 0); | 2778 | xf_emit(ctx, 8, 0); /* 00000001 BLEND_ENABLE */ |
1982 | xf_emit(ctx, 1, 0x11); | 2779 | xf_emit(ctx, 1, 1); /* 0000001f BLEND_FUNC_DST_ALPHA */ |
1983 | xf_emit(ctx, 7, 0); | 2780 | xf_emit(ctx, 1, 1); /* 00000007 BLEND_EQUATION_ALPHA */ |
1984 | xf_emit(ctx, 1, 0x0fac6881); | 2781 | xf_emit(ctx, 1, 2); /* 0000001f BLEND_FUNC_SRC_ALPHA */ |
1985 | xf_emit(ctx, 2, 0); | 2782 | xf_emit(ctx, 1, 1); /* 0000001f BLEND_FUNC_DST_RGB */ |
1986 | xf_emit(ctx, 1, 4); | 2783 | xf_emit(ctx, 1, 1); /* 00000007 BLEND_EQUATION_RGB */ |
1987 | xf_emit(ctx, 3, 0); | 2784 | xf_emit(ctx, 1, 2); /* 0000001f BLEND_FUNC_SRC_RGB */ |
1988 | xf_emit(ctx, 1, 0x11); | 2785 | if (IS_NVA3F(dev_priv->chipset)) { |
1989 | xf_emit(ctx, 1, 1); | 2786 | xf_emit(ctx, 1, 0); /* 00000001 UNK12E4 */ |
1990 | xf_emit(ctx, 1, 0); | 2787 | xf_emit(ctx, 8, 1); /* 00000007 IBLEND_EQUATION_RGB */ |
1991 | xf_emit(ctx, 3, 0xcf); | 2788 | xf_emit(ctx, 8, 1); /* 00000007 IBLEND_EQUATION_ALPHA */ |
1992 | if (dev_priv->chipset > 0xa0 && dev_priv->chipset < 0xaa) | 2789 | xf_emit(ctx, 8, 1); /* 00000001 IBLEND_UNK00 */ |
1993 | xf_emit(ctx, 1, 1); | 2790 | xf_emit(ctx, 8, 2); /* 0000001f IBLEND_SRC_RGB */ |
1994 | xf_emit(ctx, 0xa, 0); | 2791 | xf_emit(ctx, 8, 1); /* 0000001f IBLEND_DST_RGB */ |
1995 | xf_emit(ctx, 2, 1); | 2792 | xf_emit(ctx, 8, 2); /* 0000001f IBLEND_SRC_ALPHA */ |
1996 | xf_emit(ctx, 1, 2); | 2793 | xf_emit(ctx, 8, 1); /* 0000001f IBLEND_DST_ALPHA */ |
1997 | xf_emit(ctx, 2, 1); | 2794 | xf_emit(ctx, 1, 0); /* 00000001 UNK1140 */ |
1998 | xf_emit(ctx, 1, 2); | 2795 | } |
1999 | xf_emit(ctx, 1, 1); | 2796 | xf_emit(ctx, 1, 1); /* 00000001 UNK133C */ |
2000 | xf_emit(ctx, 1, 0); | 2797 | xf_emit(ctx, 1, 0); /* ffff0ff3 */ |
2001 | xf_emit(ctx, 8, 1); | 2798 | xf_emit(ctx, 1, 0x11); /* 3f/7f RT_FORMAT */ |
2002 | xf_emit(ctx, 1, 0x11); | 2799 | xf_emit(ctx, 7, 0); /* 3f/7f RT_FORMAT */ |
2003 | xf_emit(ctx, 7, 0); | 2800 | xf_emit(ctx, 1, 0x0fac6881); /* 0fffffff RT_CONTROL */ |
2004 | xf_emit(ctx, 1, 0x0fac6881); | 2801 | xf_emit(ctx, 1, 0); /* 00000001 LOGIC_OP_ENABLE */ |
2005 | xf_emit(ctx, 1, 0xf); | 2802 | xf_emit(ctx, 1, 0); /* ff/3ff */ |
2006 | xf_emit(ctx, 7, 0); | 2803 | xf_emit(ctx, 1, 4); /* 00000007 FP_CONTROL */ |
2007 | xf_emit(ctx, 1, magic2); | 2804 | xf_emit(ctx, 1, 0); /* 00000003 UNK0F90 */ |
2008 | xf_emit(ctx, 2, 0); | 2805 | xf_emit(ctx, 1, 0); /* 00000001 FRAMEBUFFER_SRGB */ |
2009 | xf_emit(ctx, 1, 0x11); | 2806 | xf_emit(ctx, 1, 0); /* 7 */ |
2010 | if (dev_priv->chipset > 0xa0 && dev_priv->chipset < 0xaa) | 2807 | xf_emit(ctx, 1, 0x11); /* 3f/7f DST_FORMAT */ |
2011 | xf_emit(ctx, 2, 1); | 2808 | xf_emit(ctx, 1, 1); /* 00000001 DST_LINEAR */ |
2012 | else | 2809 | xf_emit(ctx, 1, 0); /* 00000007 OPERATION */ |
2013 | xf_emit(ctx, 1, 1); | 2810 | xf_emit(ctx, 1, 0xcf); /* 000000ff SIFC_FORMAT */ |
2811 | xf_emit(ctx, 1, 0xcf); /* 000000ff DRAW_COLOR_FORMAT */ | ||
2812 | xf_emit(ctx, 1, 0xcf); /* 000000ff SRC_FORMAT */ | ||
2813 | if (IS_NVA3F(dev_priv->chipset)) | ||
2814 | xf_emit(ctx, 1, 1); /* 0000001f tesla UNK169C */ | ||
2815 | xf_emit(ctx, 1, 0); /* ffffffff tesla UNK1A3C */ | ||
2816 | xf_emit(ctx, 1, 0); /* 7/f[NVA3] MULTISAMPLE_SAMPLES_LOG2 */ | ||
2817 | xf_emit(ctx, 8, 0); /* 00000001 BLEND_ENABLE */ | ||
2818 | xf_emit(ctx, 1, 1); /* 0000001f BLEND_FUNC_DST_ALPHA */ | ||
2819 | xf_emit(ctx, 1, 1); /* 00000007 BLEND_EQUATION_ALPHA */ | ||
2820 | xf_emit(ctx, 1, 2); /* 0000001f BLEND_FUNC_SRC_ALPHA */ | ||
2821 | xf_emit(ctx, 1, 1); /* 0000001f BLEND_FUNC_DST_RGB */ | ||
2822 | xf_emit(ctx, 1, 1); /* 00000007 BLEND_EQUATION_RGB */ | ||
2823 | xf_emit(ctx, 1, 2); /* 0000001f BLEND_FUNC_SRC_RGB */ | ||
2824 | xf_emit(ctx, 1, 1); /* 00000001 UNK133C */ | ||
2825 | xf_emit(ctx, 1, 0); /* ffff0ff3 */ | ||
2826 | xf_emit(ctx, 8, 1); /* 00000001 UNK19E0 */ | ||
2827 | xf_emit(ctx, 1, 0x11); /* 3f/7f RT_FORMAT */ | ||
2828 | xf_emit(ctx, 7, 0); /* 3f/7f RT_FORMAT */ | ||
2829 | xf_emit(ctx, 1, 0x0fac6881); /* 0fffffff RT_CONTROL */ | ||
2830 | xf_emit(ctx, 1, 0xf); /* 0000000f COLOR_MASK */ | ||
2831 | xf_emit(ctx, 7, 0); /* 0000000f COLOR_MASK */ | ||
2832 | xf_emit(ctx, 1, magic2); /* 001fffff tesla UNK0F78 */ | ||
2833 | xf_emit(ctx, 1, 0); /* 00000001 DEPTH_BOUNDS_EN */ | ||
2834 | xf_emit(ctx, 1, 0); /* 00000001 DEPTH_TEST_ENABLE */ | ||
2835 | xf_emit(ctx, 1, 0x11); /* 3f/7f DST_FORMAT */ | ||
2836 | xf_emit(ctx, 1, 1); /* 00000001 DST_LINEAR */ | ||
2837 | if (IS_NVA3F(dev_priv->chipset)) | ||
2838 | xf_emit(ctx, 1, 1); /* 0000001f tesla UNK169C */ | ||
2014 | if(dev_priv->chipset == 0x50) | 2839 | if(dev_priv->chipset == 0x50) |
2015 | xf_emit(ctx, 1, 0); | 2840 | xf_emit(ctx, 1, 0); /* ff */ |
2016 | else | 2841 | else |
2017 | xf_emit(ctx, 3, 0); | 2842 | xf_emit(ctx, 3, 0); /* 1, 7, 3ff */ |
2018 | xf_emit(ctx, 1, 4); | 2843 | xf_emit(ctx, 1, 4); /* 00000007 FP_CONTROL */ |
2019 | xf_emit(ctx, 5, 0); | 2844 | xf_emit(ctx, 1, 0); /* 00000003 UNK0F90 */ |
2020 | xf_emit(ctx, 1, 1); | 2845 | xf_emit(ctx, 1, 0); /* 00000001 STENCIL_FRONT_ENABLE */ |
2021 | xf_emit(ctx, 4, 0); | 2846 | xf_emit(ctx, 1, 0); /* 00000007 */ |
2022 | xf_emit(ctx, 1, 0x11); | 2847 | xf_emit(ctx, 1, 0); /* 00000001 SAMPLECNT_ENABLE */ |
2023 | xf_emit(ctx, 7, 0); | 2848 | xf_emit(ctx, 1, 0); /* 0000000f ZETA_FORMAT */ |
2024 | xf_emit(ctx, 1, 0x0fac6881); | 2849 | xf_emit(ctx, 1, 1); /* 00000001 ZETA_ENABLE */ |
2025 | xf_emit(ctx, 3, 0); | 2850 | xf_emit(ctx, 1, 0); /* ffffffff tesla UNK1A3C */ |
2026 | xf_emit(ctx, 1, 0x11); | 2851 | xf_emit(ctx, 1, 0); /* 7/f MULTISAMPLE_SAMPLES_LOG2 */ |
2027 | xf_emit(ctx, 1, 1); | 2852 | xf_emit(ctx, 1, 0); /* 00000001 tesla UNK1534 */ |
2028 | xf_emit(ctx, 1, 0); | 2853 | xf_emit(ctx, 1, 0); /* ffff0ff3 */ |
2029 | xf_emit(ctx, 1, 1); | 2854 | xf_emit(ctx, 1, 0x11); /* 3f/7f RT_FORMAT */ |
2030 | xf_emit(ctx, 1, 0); | 2855 | xf_emit(ctx, 7, 0); /* 3f/7f RT_FORMAT */ |
2031 | xf_emit(ctx, 1, 1); | 2856 | xf_emit(ctx, 1, 0x0fac6881); /* 0fffffff RT_CONTROL */ |
2032 | xf_emit(ctx, 1, 0); | 2857 | xf_emit(ctx, 1, 0); /* 00000001 DEPTH_BOUNDS_EN */ |
2033 | xf_emit(ctx, 1, magic1); | 2858 | xf_emit(ctx, 1, 0); /* 00000001 DEPTH_TEST_ENABLE */ |
2034 | xf_emit(ctx, 1, 0); | 2859 | xf_emit(ctx, 1, 0); /* 00000001 DEPTH_WRITE_ENABLE */ |
2035 | xf_emit(ctx, 1, 1); | 2860 | xf_emit(ctx, 1, 0x11); /* 3f/7f DST_FORMAT */ |
2036 | xf_emit(ctx, 1, 0); | 2861 | xf_emit(ctx, 1, 1); /* 00000001 DST_LINEAR */ |
2037 | xf_emit(ctx, 1, 1); | 2862 | xf_emit(ctx, 1, 0); /* 000fffff BLIT_DU_DX_FRACT */ |
2038 | xf_emit(ctx, 2, 0); | 2863 | xf_emit(ctx, 1, 1); /* 0001ffff BLIT_DU_DX_INT */ |
2039 | if (dev_priv->chipset > 0xa0 && dev_priv->chipset < 0xaa) | 2864 | xf_emit(ctx, 1, 0); /* 000fffff BLIT_DV_DY_FRACT */ |
2040 | xf_emit(ctx, 1, 1); | 2865 | xf_emit(ctx, 1, 1); /* 0001ffff BLIT_DV_DY_INT */ |
2041 | xf_emit(ctx, 0x28, 0); | 2866 | xf_emit(ctx, 1, 0); /* ff/3ff */ |
2042 | xf_emit(ctx, 8, 8); | 2867 | xf_emit(ctx, 1, magic1); /* 3ff/7ff tesla UNK0D68 */ |
2043 | xf_emit(ctx, 1, 0x11); | 2868 | xf_emit(ctx, 1, 0); /* 00000001 STENCIL_FRONT_ENABLE */ |
2044 | xf_emit(ctx, 7, 0); | 2869 | xf_emit(ctx, 1, 1); /* 00000001 tesla UNK15B4 */ |
2045 | xf_emit(ctx, 1, 0x0fac6881); | 2870 | xf_emit(ctx, 1, 0); /* 0000000f ZETA_FORMAT */ |
2046 | xf_emit(ctx, 8, 0x400); | 2871 | xf_emit(ctx, 1, 1); /* 00000001 ZETA_ENABLE */ |
2047 | xf_emit(ctx, 8, 0x300); | 2872 | xf_emit(ctx, 1, 0); /* 00000007 */ |
2048 | xf_emit(ctx, 1, 1); | 2873 | xf_emit(ctx, 1, 0); /* ffffffff tesla UNK1A3C */ |
2049 | xf_emit(ctx, 1, 0xf); | 2874 | if (IS_NVA3F(dev_priv->chipset)) |
2050 | xf_emit(ctx, 7, 0); | 2875 | xf_emit(ctx, 1, 1); /* 0000001f tesla UNK169C */ |
2051 | xf_emit(ctx, 1, 0x20); | 2876 | xf_emit(ctx, 8, 0); /* 0000ffff DMA_COLOR */ |
2052 | xf_emit(ctx, 1, 0x11); | 2877 | xf_emit(ctx, 1, 0); /* 0000ffff DMA_GLOBAL */ |
2053 | xf_emit(ctx, 1, 0x100); | 2878 | xf_emit(ctx, 1, 0); /* 0000ffff DMA_LOCAL */ |
2054 | xf_emit(ctx, 1, 0); | 2879 | xf_emit(ctx, 1, 0); /* 0000ffff DMA_STACK */ |
2055 | xf_emit(ctx, 1, 1); | 2880 | xf_emit(ctx, 1, 0); /* ff/3ff */ |
2056 | xf_emit(ctx, 2, 0); | 2881 | xf_emit(ctx, 1, 0); /* 0000ffff DMA_DST */ |
2057 | xf_emit(ctx, 1, 0x40); | 2882 | xf_emit(ctx, 1, 0); /* 7 */ |
2058 | xf_emit(ctx, 1, 0x100); | 2883 | xf_emit(ctx, 1, 0); /* 7/f MULTISAMPLE_SAMPLES_LOG2 */ |
2059 | xf_emit(ctx, 1, 0); | 2884 | xf_emit(ctx, 1, 0); /* ffff0ff3 */ |
2060 | xf_emit(ctx, 1, 3); | 2885 | xf_emit(ctx, 8, 0); /* 000000ff RT_ADDRESS_HIGH */ |
2061 | xf_emit(ctx, 4, 0); | 2886 | xf_emit(ctx, 8, 0); /* ffffffff RT_LAYER_STRIDE */ |
2062 | if (dev_priv->chipset > 0xa0 && dev_priv->chipset < 0xaa) | 2887 | xf_emit(ctx, 8, 0); /* ffffffff RT_ADDRESS_LOW */ |
2063 | xf_emit(ctx, 1, 1); | 2888 | xf_emit(ctx, 8, 8); /* 0000007f RT_TILE_MODE */ |
2064 | xf_emit(ctx, 1, magic2); | 2889 | xf_emit(ctx, 1, 0x11); /* 3f/7f RT_FORMAT */ |
2065 | xf_emit(ctx, 3, 0); | 2890 | xf_emit(ctx, 7, 0); /* 3f/7f RT_FORMAT */ |
2066 | xf_emit(ctx, 1, 2); | 2891 | xf_emit(ctx, 1, 0x0fac6881); /* 0fffffff RT_CONTROL */ |
2067 | xf_emit(ctx, 1, 0x0fac6881); | 2892 | xf_emit(ctx, 8, 0x400); /* 0fffffff RT_HORIZ */ |
2068 | xf_emit(ctx, 9, 0); | 2893 | xf_emit(ctx, 8, 0x300); /* 0000ffff RT_VERT */ |
2069 | xf_emit(ctx, 1, 1); | 2894 | xf_emit(ctx, 1, 1); /* 00001fff RT_ARRAY_MODE */ |
2070 | xf_emit(ctx, 4, 0); | 2895 | xf_emit(ctx, 1, 0xf); /* 0000000f COLOR_MASK */ |
2071 | xf_emit(ctx, 1, 4); | 2896 | xf_emit(ctx, 7, 0); /* 0000000f COLOR_MASK */ |
2072 | xf_emit(ctx, 1, 0); | 2897 | xf_emit(ctx, 1, 0x20); /* 00000fff DST_TILE_MODE */ |
2073 | xf_emit(ctx, 1, 1); | 2898 | xf_emit(ctx, 1, 0x11); /* 3f/7f DST_FORMAT */ |
2074 | xf_emit(ctx, 1, 0x400); | 2899 | xf_emit(ctx, 1, 0x100); /* 0001ffff DST_HEIGHT */ |
2075 | xf_emit(ctx, 1, 0x300); | 2900 | xf_emit(ctx, 1, 0); /* 000007ff DST_LAYER */ |
2076 | xf_emit(ctx, 1, 0x1001); | 2901 | xf_emit(ctx, 1, 1); /* 00000001 DST_LINEAR */ |
2077 | if (dev_priv->chipset > 0xa0 && dev_priv->chipset < 0xaa) | 2902 | xf_emit(ctx, 1, 0); /* ffffffff DST_ADDRESS_LOW */ |
2078 | xf_emit(ctx, 4, 0); | 2903 | xf_emit(ctx, 1, 0); /* 000000ff DST_ADDRESS_HIGH */ |
2079 | else | 2904 | xf_emit(ctx, 1, 0x40); /* 0007ffff DST_PITCH */ |
2080 | xf_emit(ctx, 3, 0); | 2905 | xf_emit(ctx, 1, 0x100); /* 0001ffff DST_WIDTH */ |
2081 | xf_emit(ctx, 1, 0x11); | 2906 | xf_emit(ctx, 1, 0); /* 0000ffff */ |
2082 | xf_emit(ctx, 7, 0); | 2907 | xf_emit(ctx, 1, 3); /* 00000003 tesla UNK15AC */ |
2083 | xf_emit(ctx, 1, 0x0fac6881); | 2908 | xf_emit(ctx, 1, 0); /* ff/3ff */ |
2084 | xf_emit(ctx, 1, 0xf); | 2909 | xf_emit(ctx, 1, 0); /* 0001ffff GP_BUILTIN_RESULT_EN */ |
2085 | if (dev_priv->chipset > 0xa0 && dev_priv->chipset < 0xaa) { | 2910 | xf_emit(ctx, 1, 0); /* 00000003 UNK0F90 */ |
2086 | xf_emit(ctx, 0x15, 0); | 2911 | xf_emit(ctx, 1, 0); /* 00000007 */ |
2087 | xf_emit(ctx, 1, 1); | 2912 | if (IS_NVA3F(dev_priv->chipset)) |
2088 | xf_emit(ctx, 3, 0); | 2913 | xf_emit(ctx, 1, 1); /* 0000001f tesla UNK169C */ |
2089 | } else | 2914 | xf_emit(ctx, 1, magic2); /* 001fffff tesla UNK0F78 */ |
2090 | xf_emit(ctx, 0x17, 0); | 2915 | xf_emit(ctx, 1, 0); /* 7/f MULTISAMPLE_SAMPLES_LOG2 */ |
2916 | xf_emit(ctx, 1, 0); /* 00000001 tesla UNK1534 */ | ||
2917 | xf_emit(ctx, 1, 0); /* ffff0ff3 */ | ||
2918 | xf_emit(ctx, 1, 2); /* 00000003 tesla UNK143C */ | ||
2919 | xf_emit(ctx, 1, 0x0fac6881); /* 0fffffff RT_CONTROL */ | ||
2920 | xf_emit(ctx, 1, 0); /* 0000ffff DMA_ZETA */ | ||
2921 | xf_emit(ctx, 1, 0); /* 00000001 DEPTH_BOUNDS_EN */ | ||
2922 | xf_emit(ctx, 1, 0); /* 00000001 DEPTH_TEST_ENABLE */ | ||
2923 | xf_emit(ctx, 1, 0); /* 00000001 DEPTH_WRITE_ENABLE */ | ||
2924 | xf_emit(ctx, 2, 0); /* ffff, ff/3ff */ | ||
2925 | xf_emit(ctx, 1, 0); /* 0001ffff GP_BUILTIN_RESULT_EN */ | ||
2926 | xf_emit(ctx, 1, 0); /* 00000001 STENCIL_FRONT_ENABLE */ | ||
2927 | xf_emit(ctx, 1, 0); /* 000000ff STENCIL_FRONT_MASK */ | ||
2928 | xf_emit(ctx, 1, 1); /* 00000001 tesla UNK15B4 */ | ||
2929 | xf_emit(ctx, 1, 0); /* 00000007 */ | ||
2930 | xf_emit(ctx, 1, 0); /* ffffffff ZETA_LAYER_STRIDE */ | ||
2931 | xf_emit(ctx, 1, 0); /* 000000ff ZETA_ADDRESS_HIGH */ | ||
2932 | xf_emit(ctx, 1, 0); /* ffffffff ZETA_ADDRESS_LOW */ | ||
2933 | xf_emit(ctx, 1, 4); /* 00000007 ZETA_TILE_MODE */ | ||
2934 | xf_emit(ctx, 1, 0); /* 0000000f ZETA_FORMAT */ | ||
2935 | xf_emit(ctx, 1, 1); /* 00000001 ZETA_ENABLE */ | ||
2936 | xf_emit(ctx, 1, 0x400); /* 0fffffff ZETA_HORIZ */ | ||
2937 | xf_emit(ctx, 1, 0x300); /* 0000ffff ZETA_VERT */ | ||
2938 | xf_emit(ctx, 1, 0x1001); /* 00001fff ZETA_ARRAY_MODE */ | ||
2939 | xf_emit(ctx, 1, 0); /* ffffffff tesla UNK1A3C */ | ||
2940 | xf_emit(ctx, 1, 0); /* 7/f MULTISAMPLE_SAMPLES_LOG2 */ | ||
2941 | if (IS_NVA3F(dev_priv->chipset)) | ||
2942 | xf_emit(ctx, 1, 0); /* 00000001 */ | ||
2943 | xf_emit(ctx, 1, 0); /* ffff0ff3 */ | ||
2944 | xf_emit(ctx, 1, 0x11); /* 3f/7f RT_FORMAT */ | ||
2945 | xf_emit(ctx, 7, 0); /* 3f/7f RT_FORMAT */ | ||
2946 | xf_emit(ctx, 1, 0x0fac6881); /* 0fffffff RT_CONTROL */ | ||
2947 | xf_emit(ctx, 1, 0xf); /* 0000000f COLOR_MASK */ | ||
2948 | xf_emit(ctx, 7, 0); /* 0000000f COLOR_MASK */ | ||
2949 | xf_emit(ctx, 1, 0); /* ff/3ff */ | ||
2950 | xf_emit(ctx, 8, 0); /* 00000001 BLEND_ENABLE */ | ||
2951 | xf_emit(ctx, 1, 0); /* 00000003 UNK0F90 */ | ||
2952 | xf_emit(ctx, 1, 0); /* 00000001 FRAMEBUFFER_SRGB */ | ||
2953 | xf_emit(ctx, 1, 0); /* 7 */ | ||
2954 | xf_emit(ctx, 1, 0); /* 00000001 LOGIC_OP_ENABLE */ | ||
2955 | if (IS_NVA3F(dev_priv->chipset)) { | ||
2956 | xf_emit(ctx, 1, 0); /* 00000001 UNK1140 */ | ||
2957 | xf_emit(ctx, 1, 1); /* 0000001f tesla UNK169C */ | ||
2958 | } | ||
2959 | xf_emit(ctx, 1, 0); /* 7/f MULTISAMPLE_SAMPLES_LOG2 */ | ||
2960 | xf_emit(ctx, 1, 0); /* 00000001 UNK1534 */ | ||
2961 | xf_emit(ctx, 1, 0); /* ffff0ff3 */ | ||
2091 | if (dev_priv->chipset >= 0xa0) | 2962 | if (dev_priv->chipset >= 0xa0) |
2092 | xf_emit(ctx, 1, 0x0fac6881); | 2963 | xf_emit(ctx, 1, 0x0fac6881); /* fffffff */ |
2093 | xf_emit(ctx, 1, magic2); | 2964 | xf_emit(ctx, 1, magic2); /* 001fffff tesla UNK0F78 */ |
2094 | xf_emit(ctx, 3, 0); | 2965 | xf_emit(ctx, 1, 0); /* 00000001 DEPTH_BOUNDS_EN */ |
2095 | xf_emit(ctx, 1, 0x11); | 2966 | xf_emit(ctx, 1, 0); /* 00000001 DEPTH_TEST_ENABLE */ |
2096 | xf_emit(ctx, 2, 0); | 2967 | xf_emit(ctx, 1, 0); /* 00000001 DEPTH_WRITE_ENABLE */ |
2097 | xf_emit(ctx, 1, 4); | 2968 | xf_emit(ctx, 1, 0x11); /* 3f/7f DST_FORMAT */ |
2098 | xf_emit(ctx, 1, 0); | 2969 | xf_emit(ctx, 1, 0); /* 00000001 tesla UNK0FB0 */ |
2099 | xf_emit(ctx, 2, 1); | 2970 | xf_emit(ctx, 1, 0); /* ff/3ff */ |
2100 | xf_emit(ctx, 3, 0); | 2971 | xf_emit(ctx, 1, 4); /* 00000007 FP_CONTROL */ |
2101 | if (dev_priv->chipset > 0xa0 && dev_priv->chipset < 0xaa) | 2972 | xf_emit(ctx, 1, 0); /* 00000001 STENCIL_FRONT_ENABLE */ |
2102 | xf_emit(ctx, 2, 1); | 2973 | xf_emit(ctx, 1, 1); /* 00000001 tesla UNK15B4 */ |
2103 | else | 2974 | xf_emit(ctx, 1, 1); /* 00000001 tesla UNK19CC */ |
2104 | xf_emit(ctx, 1, 1); | 2975 | xf_emit(ctx, 1, 0); /* 00000007 */ |
2105 | if (dev_priv->chipset > 0xa0 && dev_priv->chipset < 0xaa) | 2976 | xf_emit(ctx, 1, 0); /* 00000001 SAMPLECNT_ENABLE */ |
2106 | xf_emit(ctx, 2, 0); | 2977 | xf_emit(ctx, 1, 0); /* 0000000f ZETA_FORMAT */ |
2107 | else if (dev_priv->chipset != 0x50) | 2978 | xf_emit(ctx, 1, 1); /* 00000001 ZETA_ENABLE */ |
2108 | xf_emit(ctx, 1, 0); | 2979 | if (IS_NVA3F(dev_priv->chipset)) { |
2980 | xf_emit(ctx, 1, 1); /* 0000001f tesla UNK169C */ | ||
2981 | xf_emit(ctx, 1, 0); /* 0000000f tesla UNK15C8 */ | ||
2982 | } | ||
2983 | xf_emit(ctx, 1, 0); /* ffffffff tesla UNK1A3C */ | ||
2984 | if (dev_priv->chipset >= 0xa0) { | ||
2985 | xf_emit(ctx, 3, 0); /* 7/f, 1, ffff0ff3 */ | ||
2986 | xf_emit(ctx, 1, 0xfac6881); /* fffffff */ | ||
2987 | xf_emit(ctx, 4, 0); /* 1, 1, 1, 3ff */ | ||
2988 | xf_emit(ctx, 1, 4); /* 7 */ | ||
2989 | xf_emit(ctx, 1, 0); /* 1 */ | ||
2990 | xf_emit(ctx, 2, 1); /* 1 */ | ||
2991 | xf_emit(ctx, 2, 0); /* 7, f */ | ||
2992 | xf_emit(ctx, 1, 1); /* 1 */ | ||
2993 | xf_emit(ctx, 1, 0); /* 7/f */ | ||
2994 | if (IS_NVA3F(dev_priv->chipset)) | ||
2995 | xf_emit(ctx, 0x9, 0); /* 1 */ | ||
2996 | else | ||
2997 | xf_emit(ctx, 0x8, 0); /* 1 */ | ||
2998 | xf_emit(ctx, 1, 0); /* ffff0ff3 */ | ||
2999 | xf_emit(ctx, 8, 1); /* 1 */ | ||
3000 | xf_emit(ctx, 1, 0x11); /* 7f */ | ||
3001 | xf_emit(ctx, 7, 0); /* 7f */ | ||
3002 | xf_emit(ctx, 1, 0xfac6881); /* fffffff */ | ||
3003 | xf_emit(ctx, 1, 0xf); /* f */ | ||
3004 | xf_emit(ctx, 7, 0); /* f */ | ||
3005 | xf_emit(ctx, 1, 0x11); /* 7f */ | ||
3006 | xf_emit(ctx, 1, 1); /* 1 */ | ||
3007 | xf_emit(ctx, 5, 0); /* 1, 7, 3ff, 3, 7 */ | ||
3008 | if (IS_NVA3F(dev_priv->chipset)) { | ||
3009 | xf_emit(ctx, 1, 0); /* 00000001 UNK1140 */ | ||
3010 | xf_emit(ctx, 1, 1); /* 0000001f tesla UNK169C */ | ||
3011 | } | ||
3012 | } | ||
2109 | } | 3013 | } |
2110 | 3014 | ||
2111 | static void | 3015 | static void |
2112 | nv50_graph_construct_xfer_tp_x3(struct nouveau_grctx *ctx) | 3016 | nv50_graph_construct_xfer_tex(struct nouveau_grctx *ctx) |
2113 | { | 3017 | { |
2114 | struct drm_nouveau_private *dev_priv = ctx->dev->dev_private; | 3018 | struct drm_nouveau_private *dev_priv = ctx->dev->dev_private; |
2115 | xf_emit(ctx, 3, 0); | 3019 | xf_emit(ctx, 2, 0); /* 1 LINKED_TSC. yes, 2. */ |
2116 | xf_emit(ctx, 1, 1); | 3020 | if (dev_priv->chipset != 0x50) |
2117 | xf_emit(ctx, 1, 0); | 3021 | xf_emit(ctx, 1, 0); /* 3 */ |
2118 | xf_emit(ctx, 1, 1); | 3022 | xf_emit(ctx, 1, 1); /* 1ffff BLIT_DU_DX_INT */ |
3023 | xf_emit(ctx, 1, 0); /* fffff BLIT_DU_DX_FRACT */ | ||
3024 | xf_emit(ctx, 1, 1); /* 1ffff BLIT_DV_DY_INT */ | ||
3025 | xf_emit(ctx, 1, 0); /* fffff BLIT_DV_DY_FRACT */ | ||
2119 | if (dev_priv->chipset == 0x50) | 3026 | if (dev_priv->chipset == 0x50) |
2120 | xf_emit(ctx, 2, 0); | 3027 | xf_emit(ctx, 1, 0); /* 3 BLIT_CONTROL */ |
2121 | else | 3028 | else |
2122 | xf_emit(ctx, 3, 0); | 3029 | xf_emit(ctx, 2, 0); /* 3ff, 1 */ |
2123 | xf_emit(ctx, 1, 0x2a712488); | 3030 | xf_emit(ctx, 1, 0x2a712488); /* ffffffff SRC_TIC_0 */ |
2124 | xf_emit(ctx, 1, 0); | 3031 | xf_emit(ctx, 1, 0); /* ffffffff SRC_TIC_1 */ |
2125 | xf_emit(ctx, 1, 0x4085c000); | 3032 | xf_emit(ctx, 1, 0x4085c000); /* ffffffff SRC_TIC_2 */ |
2126 | xf_emit(ctx, 1, 0x40); | 3033 | xf_emit(ctx, 1, 0x40); /* ffffffff SRC_TIC_3 */ |
2127 | xf_emit(ctx, 1, 0x100); | 3034 | xf_emit(ctx, 1, 0x100); /* ffffffff SRC_TIC_4 */ |
2128 | xf_emit(ctx, 1, 0x10100); | 3035 | xf_emit(ctx, 1, 0x10100); /* ffffffff SRC_TIC_5 */ |
2129 | xf_emit(ctx, 1, 0x02800000); | 3036 | xf_emit(ctx, 1, 0x02800000); /* ffffffff SRC_TIC_6 */ |
3037 | xf_emit(ctx, 1, 0); /* ffffffff SRC_TIC_7 */ | ||
3038 | if (dev_priv->chipset == 0x50) { | ||
3039 | xf_emit(ctx, 1, 0); /* 00000001 turing UNK358 */ | ||
3040 | xf_emit(ctx, 1, 0); /* ffffffff tesla UNK1A34? */ | ||
3041 | xf_emit(ctx, 1, 0); /* 00000003 turing UNK37C tesla UNK1690 */ | ||
3042 | xf_emit(ctx, 1, 0); /* 00000003 BLIT_CONTROL */ | ||
3043 | xf_emit(ctx, 1, 0); /* 00000001 turing UNK32C tesla UNK0F94 */ | ||
3044 | } else if (!IS_NVAAF(dev_priv->chipset)) { | ||
3045 | xf_emit(ctx, 1, 0); /* ffffffff tesla UNK1A34? */ | ||
3046 | xf_emit(ctx, 1, 0); /* 00000003 */ | ||
3047 | xf_emit(ctx, 1, 0); /* 000003ff */ | ||
3048 | xf_emit(ctx, 1, 0); /* 00000003 */ | ||
3049 | xf_emit(ctx, 1, 0); /* 000003ff */ | ||
3050 | xf_emit(ctx, 1, 0); /* 00000003 tesla UNK1664 / turing UNK03E8 */ | ||
3051 | xf_emit(ctx, 1, 0); /* 00000003 */ | ||
3052 | xf_emit(ctx, 1, 0); /* 000003ff */ | ||
3053 | } else { | ||
3054 | xf_emit(ctx, 0x6, 0); | ||
3055 | } | ||
3056 | xf_emit(ctx, 1, 0); /* ffffffff tesla UNK1A34 */ | ||
3057 | xf_emit(ctx, 1, 0); /* 0000ffff DMA_TEXTURE */ | ||
3058 | xf_emit(ctx, 1, 0); /* 0000ffff DMA_SRC */ | ||
2130 | } | 3059 | } |
2131 | 3060 | ||
2132 | static void | 3061 | static void |
2133 | nv50_graph_construct_xfer_tp_x4(struct nouveau_grctx *ctx) | 3062 | nv50_graph_construct_xfer_unk8cxx(struct nouveau_grctx *ctx) |
2134 | { | 3063 | { |
2135 | struct drm_nouveau_private *dev_priv = ctx->dev->dev_private; | 3064 | struct drm_nouveau_private *dev_priv = ctx->dev->dev_private; |
2136 | xf_emit(ctx, 2, 0x04e3bfdf); | 3065 | xf_emit(ctx, 1, 0); /* 00000001 UNK1534 */ |
2137 | xf_emit(ctx, 1, 1); | 3066 | xf_emit(ctx, 1, 0); /* 7/f MULTISAMPLE_SAMPLES_LOG2 */ |
2138 | xf_emit(ctx, 1, 0); | 3067 | xf_emit(ctx, 2, 0); /* 7, ffff0ff3 */ |
2139 | xf_emit(ctx, 1, 0x00ffff00); | 3068 | xf_emit(ctx, 1, 0); /* 00000001 DEPTH_TEST_ENABLE */ |
2140 | if (dev_priv->chipset > 0xa0 && dev_priv->chipset < 0xaa) | 3069 | xf_emit(ctx, 1, 0); /* 00000001 DEPTH_WRITE */ |
2141 | xf_emit(ctx, 2, 1); | 3070 | xf_emit(ctx, 1, 0x04e3bfdf); /* ffffffff UNK0D64 */ |
2142 | else | 3071 | xf_emit(ctx, 1, 0x04e3bfdf); /* ffffffff UNK0DF4 */ |
2143 | xf_emit(ctx, 1, 1); | 3072 | xf_emit(ctx, 1, 1); /* 00000001 UNK15B4 */ |
2144 | xf_emit(ctx, 2, 0); | 3073 | xf_emit(ctx, 1, 0); /* 00000001 LINE_STIPPLE_ENABLE */ |
2145 | xf_emit(ctx, 1, 0x00ffff00); | 3074 | xf_emit(ctx, 1, 0x00ffff00); /* 00ffffff LINE_STIPPLE_PATTERN */ |
2146 | xf_emit(ctx, 8, 0); | 3075 | xf_emit(ctx, 1, 1); /* 00000001 tesla UNK0F98 */ |
2147 | xf_emit(ctx, 1, 1); | 3076 | if (IS_NVA3F(dev_priv->chipset)) |
2148 | xf_emit(ctx, 1, 0); | 3077 | xf_emit(ctx, 1, 1); /* 0000001f tesla UNK169C */ |
2149 | xf_emit(ctx, 1, 1); | 3078 | xf_emit(ctx, 1, 0); /* 00000003 tesla UNK1668 */ |
2150 | xf_emit(ctx, 1, 0x30201000); | 3079 | xf_emit(ctx, 1, 0); /* 00000001 LINE_STIPPLE_ENABLE */ |
2151 | xf_emit(ctx, 1, 0x70605040); | 3080 | xf_emit(ctx, 1, 0x00ffff00); /* 00ffffff LINE_STIPPLE_PATTERN */ |
2152 | xf_emit(ctx, 1, 0xb8a89888); | 3081 | xf_emit(ctx, 1, 0); /* 00000001 POLYGON_SMOOTH_ENABLE */ |
2153 | xf_emit(ctx, 1, 0xf8e8d8c8); | 3082 | xf_emit(ctx, 1, 0); /* 00000001 UNK1534 */ |
2154 | xf_emit(ctx, 1, 0); | 3083 | xf_emit(ctx, 1, 0); /* 7/f MULTISAMPLE_SAMPLES_LOG2 */ |
2155 | xf_emit(ctx, 1, 0x1a); | 3084 | xf_emit(ctx, 1, 0); /* 00000001 tesla UNK1658 */ |
2156 | } | 3085 | xf_emit(ctx, 1, 0); /* 00000001 LINE_SMOOTH_ENABLE */ |
2157 | 3086 | xf_emit(ctx, 1, 0); /* ffff0ff3 */ | |
2158 | static void | 3087 | xf_emit(ctx, 1, 0); /* 00000001 DEPTH_TEST_ENABLE */ |
2159 | nv50_graph_construct_xfer_tp_x5(struct nouveau_grctx *ctx) | 3088 | xf_emit(ctx, 1, 0); /* 00000001 DEPTH_WRITE */ |
2160 | { | 3089 | xf_emit(ctx, 1, 1); /* 00000001 UNK15B4 */ |
2161 | struct drm_nouveau_private *dev_priv = ctx->dev->dev_private; | 3090 | xf_emit(ctx, 1, 0); /* 00000001 POINT_SPRITE_ENABLE */ |
2162 | xf_emit(ctx, 3, 0); | 3091 | xf_emit(ctx, 1, 1); /* 00000001 tesla UNK165C */ |
2163 | xf_emit(ctx, 1, 0xfac6881); | 3092 | xf_emit(ctx, 1, 0x30201000); /* ffffffff tesla UNK1670 */ |
2164 | xf_emit(ctx, 4, 0); | 3093 | xf_emit(ctx, 1, 0x70605040); /* ffffffff tesla UNK1670 */ |
2165 | xf_emit(ctx, 1, 4); | 3094 | xf_emit(ctx, 1, 0xb8a89888); /* ffffffff tesla UNK1670 */ |
2166 | xf_emit(ctx, 1, 0); | 3095 | xf_emit(ctx, 1, 0xf8e8d8c8); /* ffffffff tesla UNK1670 */ |
2167 | xf_emit(ctx, 2, 1); | 3096 | xf_emit(ctx, 1, 0); /* 00000001 VERTEX_TWO_SIDE_ENABLE */ |
2168 | xf_emit(ctx, 2, 0); | 3097 | xf_emit(ctx, 1, 0x1a); /* 0000001f POLYGON_MODE */ |
2169 | xf_emit(ctx, 1, 1); | ||
2170 | if (dev_priv->chipset > 0xa0 && dev_priv->chipset < 0xaa) | ||
2171 | xf_emit(ctx, 0xb, 0); | ||
2172 | else | ||
2173 | xf_emit(ctx, 0xa, 0); | ||
2174 | xf_emit(ctx, 8, 1); | ||
2175 | xf_emit(ctx, 1, 0x11); | ||
2176 | xf_emit(ctx, 7, 0); | ||
2177 | xf_emit(ctx, 1, 0xfac6881); | ||
2178 | xf_emit(ctx, 1, 0xf); | ||
2179 | xf_emit(ctx, 7, 0); | ||
2180 | xf_emit(ctx, 1, 0x11); | ||
2181 | xf_emit(ctx, 1, 1); | ||
2182 | if (dev_priv->chipset > 0xa0 && dev_priv->chipset < 0xaa) { | ||
2183 | xf_emit(ctx, 6, 0); | ||
2184 | xf_emit(ctx, 1, 1); | ||
2185 | xf_emit(ctx, 6, 0); | ||
2186 | } else { | ||
2187 | xf_emit(ctx, 0xb, 0); | ||
2188 | } | ||
2189 | } | 3098 | } |
2190 | 3099 | ||
2191 | static void | 3100 | static void |
@@ -2193,108 +3102,136 @@ nv50_graph_construct_xfer_tp(struct nouveau_grctx *ctx) | |||
2193 | { | 3102 | { |
2194 | struct drm_nouveau_private *dev_priv = ctx->dev->dev_private; | 3103 | struct drm_nouveau_private *dev_priv = ctx->dev->dev_private; |
2195 | if (dev_priv->chipset < 0xa0) { | 3104 | if (dev_priv->chipset < 0xa0) { |
2196 | nv50_graph_construct_xfer_tp_x1(ctx); | 3105 | nv50_graph_construct_xfer_unk84xx(ctx); |
2197 | nv50_graph_construct_xfer_tp_x2(ctx); | 3106 | nv50_graph_construct_xfer_tprop(ctx); |
2198 | nv50_graph_construct_xfer_tp_x3(ctx); | 3107 | nv50_graph_construct_xfer_tex(ctx); |
2199 | if (dev_priv->chipset == 0x50) | 3108 | nv50_graph_construct_xfer_unk8cxx(ctx); |
2200 | xf_emit(ctx, 0xf, 0); | ||
2201 | else | ||
2202 | xf_emit(ctx, 0x12, 0); | ||
2203 | nv50_graph_construct_xfer_tp_x4(ctx); | ||
2204 | } else { | 3109 | } else { |
2205 | nv50_graph_construct_xfer_tp_x3(ctx); | 3110 | nv50_graph_construct_xfer_tex(ctx); |
2206 | if (dev_priv->chipset < 0xaa) | 3111 | nv50_graph_construct_xfer_tprop(ctx); |
2207 | xf_emit(ctx, 0xc, 0); | 3112 | nv50_graph_construct_xfer_unk8cxx(ctx); |
2208 | else | 3113 | nv50_graph_construct_xfer_unk84xx(ctx); |
2209 | xf_emit(ctx, 0xa, 0); | ||
2210 | nv50_graph_construct_xfer_tp_x2(ctx); | ||
2211 | nv50_graph_construct_xfer_tp_x5(ctx); | ||
2212 | nv50_graph_construct_xfer_tp_x4(ctx); | ||
2213 | nv50_graph_construct_xfer_tp_x1(ctx); | ||
2214 | } | 3114 | } |
2215 | } | 3115 | } |
2216 | 3116 | ||
2217 | static void | 3117 | static void |
2218 | nv50_graph_construct_xfer_tp2(struct nouveau_grctx *ctx) | 3118 | nv50_graph_construct_xfer_mpc(struct nouveau_grctx *ctx) |
2219 | { | 3119 | { |
2220 | struct drm_nouveau_private *dev_priv = ctx->dev->dev_private; | 3120 | struct drm_nouveau_private *dev_priv = ctx->dev->dev_private; |
2221 | int i, mpcnt; | 3121 | int i, mpcnt = 2; |
2222 | if (dev_priv->chipset == 0x98 || dev_priv->chipset == 0xaa) | 3122 | switch (dev_priv->chipset) { |
2223 | mpcnt = 1; | 3123 | case 0x98: |
2224 | else if (dev_priv->chipset < 0xa0 || dev_priv->chipset >= 0xa8) | 3124 | case 0xaa: |
2225 | mpcnt = 2; | 3125 | mpcnt = 1; |
2226 | else | 3126 | break; |
2227 | mpcnt = 3; | 3127 | case 0x50: |
3128 | case 0x84: | ||
3129 | case 0x86: | ||
3130 | case 0x92: | ||
3131 | case 0x94: | ||
3132 | case 0x96: | ||
3133 | case 0xa8: | ||
3134 | case 0xac: | ||
3135 | mpcnt = 2; | ||
3136 | break; | ||
3137 | case 0xa0: | ||
3138 | case 0xa3: | ||
3139 | case 0xa5: | ||
3140 | case 0xaf: | ||
3141 | mpcnt = 3; | ||
3142 | break; | ||
3143 | } | ||
2228 | for (i = 0; i < mpcnt; i++) { | 3144 | for (i = 0; i < mpcnt; i++) { |
2229 | xf_emit(ctx, 1, 0); | 3145 | xf_emit(ctx, 1, 0); /* ff */ |
2230 | xf_emit(ctx, 1, 0x80); | 3146 | xf_emit(ctx, 1, 0x80); /* ffffffff tesla UNK1404 */ |
2231 | xf_emit(ctx, 1, 0x80007004); | 3147 | xf_emit(ctx, 1, 0x80007004); /* ffffffff tesla UNK12B0 */ |
2232 | xf_emit(ctx, 1, 0x04000400); | 3148 | xf_emit(ctx, 1, 0x04000400); /* ffffffff */ |
2233 | if (dev_priv->chipset >= 0xa0) | 3149 | if (dev_priv->chipset >= 0xa0) |
2234 | xf_emit(ctx, 1, 0xc0); | 3150 | xf_emit(ctx, 1, 0xc0); /* 00007fff tesla UNK152C */ |
2235 | xf_emit(ctx, 1, 0x1000); | 3151 | xf_emit(ctx, 1, 0x1000); /* 0000ffff tesla UNK0D60 */ |
2236 | xf_emit(ctx, 2, 0); | 3152 | xf_emit(ctx, 1, 0); /* ff/3ff */ |
2237 | if (dev_priv->chipset == 0x86 || dev_priv->chipset == 0x98 || dev_priv->chipset >= 0xa8) { | 3153 | xf_emit(ctx, 1, 0); /* ffffffff tesla UNK1A30 */ |
2238 | xf_emit(ctx, 1, 0xe00); | 3154 | if (dev_priv->chipset == 0x86 || dev_priv->chipset == 0x98 || dev_priv->chipset == 0xa8 || IS_NVAAF(dev_priv->chipset)) { |
2239 | xf_emit(ctx, 1, 0x1e00); | 3155 | xf_emit(ctx, 1, 0xe00); /* 7fff */ |
3156 | xf_emit(ctx, 1, 0x1e00); /* 7fff */ | ||
2240 | } | 3157 | } |
2241 | xf_emit(ctx, 1, 1); | 3158 | xf_emit(ctx, 1, 1); /* 000000ff VP_REG_ALLOC_TEMP */ |
2242 | xf_emit(ctx, 2, 0); | 3159 | xf_emit(ctx, 1, 0); /* 00000001 LINKED_TSC */ |
3160 | xf_emit(ctx, 1, 0); /* 00000001 GP_ENABLE */ | ||
2243 | if (dev_priv->chipset == 0x50) | 3161 | if (dev_priv->chipset == 0x50) |
2244 | xf_emit(ctx, 2, 0x1000); | 3162 | xf_emit(ctx, 2, 0x1000); /* 7fff tesla UNK141C */ |
2245 | xf_emit(ctx, 1, 1); | 3163 | xf_emit(ctx, 1, 1); /* 000000ff GP_REG_ALLOC_TEMP */ |
2246 | xf_emit(ctx, 1, 0); | 3164 | xf_emit(ctx, 1, 0); /* 00000001 GP_ENABLE */ |
2247 | xf_emit(ctx, 1, 4); | 3165 | xf_emit(ctx, 1, 4); /* 000000ff FP_REG_ALLOC_TEMP */ |
2248 | xf_emit(ctx, 1, 2); | 3166 | xf_emit(ctx, 1, 2); /* 00000003 REG_MODE */ |
2249 | if (dev_priv->chipset >= 0xaa) | 3167 | if (IS_NVAAF(dev_priv->chipset)) |
2250 | xf_emit(ctx, 0xb, 0); | 3168 | xf_emit(ctx, 0xb, 0); /* RO */ |
2251 | else if (dev_priv->chipset >= 0xa0) | 3169 | else if (dev_priv->chipset >= 0xa0) |
2252 | xf_emit(ctx, 0xc, 0); | 3170 | xf_emit(ctx, 0xc, 0); /* RO */ |
2253 | else | 3171 | else |
2254 | xf_emit(ctx, 0xa, 0); | 3172 | xf_emit(ctx, 0xa, 0); /* RO */ |
2255 | } | 3173 | } |
2256 | xf_emit(ctx, 1, 0x08100c12); | 3174 | xf_emit(ctx, 1, 0x08100c12); /* 1fffffff FP_INTERPOLANT_CTRL */ |
2257 | xf_emit(ctx, 1, 0); | 3175 | xf_emit(ctx, 1, 0); /* ff/3ff */ |
2258 | if (dev_priv->chipset >= 0xa0) { | 3176 | if (dev_priv->chipset >= 0xa0) { |
2259 | xf_emit(ctx, 1, 0x1fe21); | 3177 | xf_emit(ctx, 1, 0x1fe21); /* 0003ffff tesla UNK0FAC */ |
2260 | } | 3178 | } |
2261 | xf_emit(ctx, 5, 0); | 3179 | xf_emit(ctx, 3, 0); /* 7fff, 0, 0 */ |
2262 | xf_emit(ctx, 4, 0xffff); | 3180 | xf_emit(ctx, 1, 0); /* 00000001 tesla UNK1534 */ |
2263 | xf_emit(ctx, 1, 1); | 3181 | xf_emit(ctx, 1, 0); /* 7/f MULTISAMPLE_SAMPLES_LOG2 */ |
2264 | xf_emit(ctx, 2, 0x10001); | 3182 | xf_emit(ctx, 4, 0xffff); /* 0000ffff MSAA_MASK */ |
2265 | xf_emit(ctx, 1, 1); | 3183 | xf_emit(ctx, 1, 1); /* 00000001 LANES32 */ |
2266 | xf_emit(ctx, 1, 0); | 3184 | xf_emit(ctx, 1, 0x10001); /* 00ffffff BLOCK_ALLOC */ |
2267 | xf_emit(ctx, 1, 0x1fe21); | 3185 | xf_emit(ctx, 1, 0x10001); /* ffffffff BLOCKDIM_XY */ |
2268 | xf_emit(ctx, 1, 0); | 3186 | xf_emit(ctx, 1, 1); /* 0000ffff BLOCKDIM_Z */ |
2269 | if (dev_priv->chipset > 0xa0 && dev_priv->chipset < 0xaa) | 3187 | xf_emit(ctx, 1, 0); /* ffffffff SHARED_SIZE */ |
2270 | xf_emit(ctx, 1, 1); | 3188 | xf_emit(ctx, 1, 0x1fe21); /* 1ffff/3ffff[NVA0+] tesla UNk0FAC */ |
2271 | xf_emit(ctx, 4, 0); | 3189 | xf_emit(ctx, 1, 0); /* ffffffff tesla UNK1A34 */ |
2272 | xf_emit(ctx, 1, 0x08100c12); | 3190 | if (IS_NVA3F(dev_priv->chipset)) |
2273 | xf_emit(ctx, 1, 4); | 3191 | xf_emit(ctx, 1, 1); /* 0000001f tesla UNK169C */ |
2274 | xf_emit(ctx, 1, 0); | 3192 | xf_emit(ctx, 1, 0); /* ff/3ff */ |
2275 | xf_emit(ctx, 1, 2); | 3193 | xf_emit(ctx, 1, 0); /* 1 LINKED_TSC */ |
2276 | xf_emit(ctx, 1, 0x11); | 3194 | xf_emit(ctx, 1, 0); /* ff FP_ADDRESS_HIGH */ |
2277 | xf_emit(ctx, 8, 0); | 3195 | xf_emit(ctx, 1, 0); /* ffffffff FP_ADDRESS_LOW */ |
2278 | xf_emit(ctx, 1, 0xfac6881); | 3196 | xf_emit(ctx, 1, 0x08100c12); /* 1fffffff FP_INTERPOLANT_CTRL */ |
2279 | xf_emit(ctx, 1, 0); | 3197 | xf_emit(ctx, 1, 4); /* 00000007 FP_CONTROL */ |
2280 | if (dev_priv->chipset > 0xa0 && dev_priv->chipset < 0xaa) | 3198 | xf_emit(ctx, 1, 0); /* 000000ff FRAG_COLOR_CLAMP_EN */ |
2281 | xf_emit(ctx, 1, 3); | 3199 | xf_emit(ctx, 1, 2); /* 00000003 REG_MODE */ |
2282 | xf_emit(ctx, 3, 0); | 3200 | xf_emit(ctx, 1, 0x11); /* 0000007f RT_FORMAT */ |
2283 | xf_emit(ctx, 1, 4); | 3201 | xf_emit(ctx, 7, 0); /* 0000007f RT_FORMAT */ |
2284 | xf_emit(ctx, 9, 0); | 3202 | xf_emit(ctx, 1, 0); /* 00000007 */ |
2285 | xf_emit(ctx, 1, 2); | 3203 | xf_emit(ctx, 1, 0xfac6881); /* 0fffffff RT_CONTROL */ |
2286 | xf_emit(ctx, 2, 1); | 3204 | xf_emit(ctx, 1, 0); /* 00000003 MULTISAMPLE_CTRL */ |
2287 | xf_emit(ctx, 1, 2); | 3205 | if (IS_NVA3F(dev_priv->chipset)) |
2288 | xf_emit(ctx, 3, 1); | 3206 | xf_emit(ctx, 1, 3); /* 00000003 tesla UNK16B4 */ |
2289 | xf_emit(ctx, 1, 0); | 3207 | xf_emit(ctx, 1, 0); /* 00000001 ALPHA_TEST_ENABLE */ |
2290 | if (dev_priv->chipset > 0xa0 && dev_priv->chipset < 0xaa) { | 3208 | xf_emit(ctx, 1, 0); /* 00000007 ALPHA_TEST_FUNC */ |
2291 | xf_emit(ctx, 8, 2); | 3209 | xf_emit(ctx, 1, 0); /* 00000001 FRAMEBUFFER_SRGB */ |
2292 | xf_emit(ctx, 0x10, 1); | 3210 | xf_emit(ctx, 1, 4); /* ffffffff tesla UNK1400 */ |
2293 | xf_emit(ctx, 8, 2); | 3211 | xf_emit(ctx, 8, 0); /* 00000001 BLEND_ENABLE */ |
2294 | xf_emit(ctx, 0x18, 1); | 3212 | xf_emit(ctx, 1, 0); /* 00000001 LOGIC_OP_ENABLE */ |
2295 | xf_emit(ctx, 3, 0); | 3213 | xf_emit(ctx, 1, 2); /* 0000001f BLEND_FUNC_SRC_RGB */ |
3214 | xf_emit(ctx, 1, 1); /* 0000001f BLEND_FUNC_DST_RGB */ | ||
3215 | xf_emit(ctx, 1, 1); /* 00000007 BLEND_EQUATION_RGB */ | ||
3216 | xf_emit(ctx, 1, 2); /* 0000001f BLEND_FUNC_SRC_ALPHA */ | ||
3217 | xf_emit(ctx, 1, 1); /* 0000001f BLEND_FUNC_DST_ALPHA */ | ||
3218 | xf_emit(ctx, 1, 1); /* 00000007 BLEND_EQUATION_ALPHA */ | ||
3219 | xf_emit(ctx, 1, 1); /* 00000001 UNK133C */ | ||
3220 | if (IS_NVA3F(dev_priv->chipset)) { | ||
3221 | xf_emit(ctx, 1, 0); /* 00000001 UNK12E4 */ | ||
3222 | xf_emit(ctx, 8, 2); /* 0000001f IBLEND_FUNC_SRC_RGB */ | ||
3223 | xf_emit(ctx, 8, 1); /* 0000001f IBLEND_FUNC_DST_RGB */ | ||
3224 | xf_emit(ctx, 8, 1); /* 00000007 IBLEND_EQUATION_RGB */ | ||
3225 | xf_emit(ctx, 8, 2); /* 0000001f IBLEND_FUNC_SRC_ALPHA */ | ||
3226 | xf_emit(ctx, 8, 1); /* 0000001f IBLEND_FUNC_DST_ALPHA */ | ||
3227 | xf_emit(ctx, 8, 1); /* 00000007 IBLEND_EQUATION_ALPHA */ | ||
3228 | xf_emit(ctx, 8, 1); /* 00000001 IBLEND_UNK00 */ | ||
3229 | xf_emit(ctx, 1, 0); /* 00000003 tesla UNK1928 */ | ||
3230 | xf_emit(ctx, 1, 0); /* 00000001 UNK1140 */ | ||
2296 | } | 3231 | } |
2297 | xf_emit(ctx, 1, 4); | 3232 | xf_emit(ctx, 1, 0); /* 00000003 tesla UNK0F90 */ |
3233 | xf_emit(ctx, 1, 4); /* 000000ff FP_RESULT_COUNT */ | ||
3234 | /* XXX: demagic this part some day */ | ||
2298 | if (dev_priv->chipset == 0x50) | 3235 | if (dev_priv->chipset == 0x50) |
2299 | xf_emit(ctx, 0x3a0, 0); | 3236 | xf_emit(ctx, 0x3a0, 0); |
2300 | else if (dev_priv->chipset < 0x94) | 3237 | else if (dev_priv->chipset < 0x94) |
@@ -2303,9 +3240,9 @@ nv50_graph_construct_xfer_tp2(struct nouveau_grctx *ctx) | |||
2303 | xf_emit(ctx, 0x39f, 0); | 3240 | xf_emit(ctx, 0x39f, 0); |
2304 | else | 3241 | else |
2305 | xf_emit(ctx, 0x3a3, 0); | 3242 | xf_emit(ctx, 0x3a3, 0); |
2306 | xf_emit(ctx, 1, 0x11); | 3243 | xf_emit(ctx, 1, 0x11); /* 3f/7f DST_FORMAT */ |
2307 | xf_emit(ctx, 1, 0); | 3244 | xf_emit(ctx, 1, 0); /* 7 OPERATION */ |
2308 | xf_emit(ctx, 1, 1); | 3245 | xf_emit(ctx, 1, 1); /* 1 DST_LINEAR */ |
2309 | xf_emit(ctx, 0x2d, 0); | 3246 | xf_emit(ctx, 0x2d, 0); |
2310 | } | 3247 | } |
2311 | 3248 | ||
@@ -2323,52 +3260,56 @@ nv50_graph_construct_xfer2(struct nouveau_grctx *ctx) | |||
2323 | if (dev_priv->chipset < 0xa0) { | 3260 | if (dev_priv->chipset < 0xa0) { |
2324 | for (i = 0; i < 8; i++) { | 3261 | for (i = 0; i < 8; i++) { |
2325 | ctx->ctxvals_pos = offset + i; | 3262 | ctx->ctxvals_pos = offset + i; |
3263 | /* that little bugger belongs to csched. No idea | ||
3264 | * what it's doing here. */ | ||
2326 | if (i == 0) | 3265 | if (i == 0) |
2327 | xf_emit(ctx, 1, 0x08100c12); | 3266 | xf_emit(ctx, 1, 0x08100c12); /* FP_INTERPOLANT_CTRL */ |
2328 | if (units & (1 << i)) | 3267 | if (units & (1 << i)) |
2329 | nv50_graph_construct_xfer_tp2(ctx); | 3268 | nv50_graph_construct_xfer_mpc(ctx); |
2330 | if ((ctx->ctxvals_pos-offset)/8 > size) | 3269 | if ((ctx->ctxvals_pos-offset)/8 > size) |
2331 | size = (ctx->ctxvals_pos-offset)/8; | 3270 | size = (ctx->ctxvals_pos-offset)/8; |
2332 | } | 3271 | } |
2333 | } else { | 3272 | } else { |
2334 | /* Strand 0: TPs 0, 1 */ | 3273 | /* Strand 0: TPs 0, 1 */ |
2335 | ctx->ctxvals_pos = offset; | 3274 | ctx->ctxvals_pos = offset; |
2336 | xf_emit(ctx, 1, 0x08100c12); | 3275 | /* that little bugger belongs to csched. No idea |
3276 | * what it's doing here. */ | ||
3277 | xf_emit(ctx, 1, 0x08100c12); /* FP_INTERPOLANT_CTRL */ | ||
2337 | if (units & (1 << 0)) | 3278 | if (units & (1 << 0)) |
2338 | nv50_graph_construct_xfer_tp2(ctx); | 3279 | nv50_graph_construct_xfer_mpc(ctx); |
2339 | if (units & (1 << 1)) | 3280 | if (units & (1 << 1)) |
2340 | nv50_graph_construct_xfer_tp2(ctx); | 3281 | nv50_graph_construct_xfer_mpc(ctx); |
2341 | if ((ctx->ctxvals_pos-offset)/8 > size) | 3282 | if ((ctx->ctxvals_pos-offset)/8 > size) |
2342 | size = (ctx->ctxvals_pos-offset)/8; | 3283 | size = (ctx->ctxvals_pos-offset)/8; |
2343 | 3284 | ||
2344 | /* Strand 0: TPs 2, 3 */ | 3285 | /* Strand 1: TPs 2, 3 */ |
2345 | ctx->ctxvals_pos = offset + 1; | 3286 | ctx->ctxvals_pos = offset + 1; |
2346 | if (units & (1 << 2)) | 3287 | if (units & (1 << 2)) |
2347 | nv50_graph_construct_xfer_tp2(ctx); | 3288 | nv50_graph_construct_xfer_mpc(ctx); |
2348 | if (units & (1 << 3)) | 3289 | if (units & (1 << 3)) |
2349 | nv50_graph_construct_xfer_tp2(ctx); | 3290 | nv50_graph_construct_xfer_mpc(ctx); |
2350 | if ((ctx->ctxvals_pos-offset)/8 > size) | 3291 | if ((ctx->ctxvals_pos-offset)/8 > size) |
2351 | size = (ctx->ctxvals_pos-offset)/8; | 3292 | size = (ctx->ctxvals_pos-offset)/8; |
2352 | 3293 | ||
2353 | /* Strand 0: TPs 4, 5, 6 */ | 3294 | /* Strand 2: TPs 4, 5, 6 */ |
2354 | ctx->ctxvals_pos = offset + 2; | 3295 | ctx->ctxvals_pos = offset + 2; |
2355 | if (units & (1 << 4)) | 3296 | if (units & (1 << 4)) |
2356 | nv50_graph_construct_xfer_tp2(ctx); | 3297 | nv50_graph_construct_xfer_mpc(ctx); |
2357 | if (units & (1 << 5)) | 3298 | if (units & (1 << 5)) |
2358 | nv50_graph_construct_xfer_tp2(ctx); | 3299 | nv50_graph_construct_xfer_mpc(ctx); |
2359 | if (units & (1 << 6)) | 3300 | if (units & (1 << 6)) |
2360 | nv50_graph_construct_xfer_tp2(ctx); | 3301 | nv50_graph_construct_xfer_mpc(ctx); |
2361 | if ((ctx->ctxvals_pos-offset)/8 > size) | 3302 | if ((ctx->ctxvals_pos-offset)/8 > size) |
2362 | size = (ctx->ctxvals_pos-offset)/8; | 3303 | size = (ctx->ctxvals_pos-offset)/8; |
2363 | 3304 | ||
2364 | /* Strand 0: TPs 7, 8, 9 */ | 3305 | /* Strand 3: TPs 7, 8, 9 */ |
2365 | ctx->ctxvals_pos = offset + 3; | 3306 | ctx->ctxvals_pos = offset + 3; |
2366 | if (units & (1 << 7)) | 3307 | if (units & (1 << 7)) |
2367 | nv50_graph_construct_xfer_tp2(ctx); | 3308 | nv50_graph_construct_xfer_mpc(ctx); |
2368 | if (units & (1 << 8)) | 3309 | if (units & (1 << 8)) |
2369 | nv50_graph_construct_xfer_tp2(ctx); | 3310 | nv50_graph_construct_xfer_mpc(ctx); |
2370 | if (units & (1 << 9)) | 3311 | if (units & (1 << 9)) |
2371 | nv50_graph_construct_xfer_tp2(ctx); | 3312 | nv50_graph_construct_xfer_mpc(ctx); |
2372 | if ((ctx->ctxvals_pos-offset)/8 > size) | 3313 | if ((ctx->ctxvals_pos-offset)/8 > size) |
2373 | size = (ctx->ctxvals_pos-offset)/8; | 3314 | size = (ctx->ctxvals_pos-offset)/8; |
2374 | } | 3315 | } |