aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2013-07-01 00:32:42 -0400
committerBen Skeggs <bskeggs@redhat.com>2013-07-04 23:42:57 -0400
commit5ee86c4190f9e19a9e13906389069c73d7f75bfb (patch)
tree29d57627c2078d8f36a09ea792046a84690fcd45
parentc03ff9e8fa5fc0186158b99a89f613325ff352cf (diff)
drm/nve0-/gr: some new gpc registers can have multiple copies
GK110 exposes more than one, and needs to be dealt with in the ctxsw ucode just like the TPC sets are. Broadcast is at +0xe00. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
-rw-r--r--drivers/gpu/drm/nouveau/core/engine/graph/fuc/gpc.fuc35
-rw-r--r--drivers/gpu/drm/nouveau/core/engine/graph/fuc/gpcnvc0.fuc.h40
-rw-r--r--drivers/gpu/drm/nouveau/core/engine/graph/fuc/gpcnve0.fuc16
-rw-r--r--drivers/gpu/drm/nouveau/core/engine/graph/fuc/gpcnve0.fuc.h316
4 files changed, 227 insertions, 180 deletions
diff --git a/drivers/gpu/drm/nouveau/core/engine/graph/fuc/gpc.fuc b/drivers/gpu/drm/nouveau/core/engine/graph/fuc/gpc.fuc
index 4770e8c99432..3d7599d5cca6 100644
--- a/drivers/gpu/drm/nouveau/core/engine/graph/fuc/gpc.fuc
+++ b/drivers/gpu/drm/nouveau/core/engine/graph/fuc/gpc.fuc
@@ -38,6 +38,13 @@ tpc_mask: .b32 0
38tpc_mmio_list_head: .b32 0 38tpc_mmio_list_head: .b32 0
39tpc_mmio_list_tail: .b32 0 39tpc_mmio_list_tail: .b32 0
40 40
41#ifdef NVGK
42unk_count: .b32 1
43unk_mask: .b32 1
44unk_mmio_list_head: .b32 #nve4_unk_mmio_head
45unk_mmio_list_tail: .b32 #nve4_unk_mmio_tail
46#endif
47
41cmd_queue: queue_init 48cmd_queue: queue_init
42#endif 49#endif
43 50
@@ -160,6 +167,17 @@ init:
160 add b32 $r2 $r14 167 add b32 $r2 $r14
161 add b32 $r3 $r14 168 add b32 $r3 $r14
162 169
170#ifdef NVGK
171 // calculate per-UNK mmio context size
172 ld b32 $r14 D[$r0 + #unk_mmio_list_head]
173 ld b32 $r15 D[$r0 + #unk_mmio_list_tail]
174 call #mmctx_size
175 ld b32 $r14 D[$r0 + #unk_count]
176 mulu $r14 $r15
177 add b32 $r2 $r14
178 add b32 $r3 $r14
179#endif
180
163 // round up base/size to 256 byte boundary (for strand SWBASE) 181 // round up base/size to 256 byte boundary (for strand SWBASE)
164 add b32 $r4 0x1300 182 add b32 $r4 0x1300
165 shr b32 $r3 2 183 shr b32 $r3 2
@@ -335,7 +353,6 @@ ctx_xfer:
335 353
336 // per-TPC mmio context 354 // per-TPC mmio context
337 xbit $r10 $flags $p1 // direction 355 xbit $r10 $flags $p1 // direction
338 or $r10 4 // last
339 mov $r11 0x4000 356 mov $r11 0x4000
340 sethi $r11 0x500000 // base = NV_PGRAPH_GPC0_TPC0 357 sethi $r11 0x500000 // base = NV_PGRAPH_GPC0_TPC0
341 ld b32 $r12 D[$r0 + #gpc_id] 358 ld b32 $r12 D[$r0 + #gpc_id]
@@ -347,6 +364,22 @@ ctx_xfer:
347 mov $r14 0x800 // stride = 0x800 364 mov $r14 0x800 // stride = 0x800
348 call #mmctx_xfer 365 call #mmctx_xfer
349 366
367#ifdef NVGK
368 // per-UNK mmio context
369 xbit $r10 $flags $p1 // direction
370 or $r10 4 // last
371 mov $r11 0x3000
372 sethi $r11 0x500000 // base = NV_PGRAPH_GPC0_UNK0
373 ld b32 $r12 D[$r0 + #gpc_id]
374 shl b32 $r12 15
375 add b32 $r11 $r12 // base = NV_PGRAPH_GPCn_UNK0
376 ld b32 $r12 D[$r0 + #unk_mmio_list_head]
377 ld b32 $r13 D[$r0 + #unk_mmio_list_tail]
378 ld b32 $r15 D[$r0 + #unk_mask]
379 mov $r14 0x200 // stride = 0x200
380 call #mmctx_xfer
381#endif
382
350 // wait for strands to finish 383 // wait for strands to finish
351 call #strand_wait 384 call #strand_wait
352 385
diff --git a/drivers/gpu/drm/nouveau/core/engine/graph/fuc/gpcnvc0.fuc.h b/drivers/gpu/drm/nouveau/core/engine/graph/fuc/gpcnvc0.fuc.h
index 66ec1acaadee..2744ed7d86a9 100644
--- a/drivers/gpu/drm/nouveau/core/engine/graph/fuc/gpcnvc0.fuc.h
+++ b/drivers/gpu/drm/nouveau/core/engine/graph/fuc/gpcnvc0.fuc.h
@@ -496,26 +496,26 @@ uint32_t nvc0_grgpc_code[] = {
496 0xf0020d98, 496 0xf0020d98,
497 0x21f500e7, 497 0x21f500e7,
498 0xacf0015c, 498 0xacf0015c,
499 0x04a5f001, 499 0x00b7f101,
500 0x4000b7f1, 500 0x50b3f040,
501 0x9850b3f0, 501 0xb6000c98,
502 0xc4b6000c, 502 0xbcbb0fc4,
503 0x00bcbb0f, 503 0x050c9800,
504 0x98050c98, 504 0x98060d98,
505 0x0f98060d, 505 0xe7f1040f,
506 0x00e7f104, 506 0x21f50800,
507 0x5c21f508, 507 0x21f5015c,
508 0x0721f501, 508 0x01f40207,
509 0x0601f402, 509 0x1412f406,
510/* 0x054b: ctx_xfer_post */ 510/* 0x0548: ctx_xfer_post */
511 0xf11412f4, 511 0x4afc17f1,
512 0xf04afc17, 512 0xf00213f0,
513 0x27f00213, 513 0x12d00d27,
514 0x0012d00d, 514 0x0721f500,
515 0x020721f5, 515/* 0x0559: ctx_xfer_done */
516/* 0x055c: ctx_xfer_done */ 516 0x8f21f502,
517 0x048f21f5, 517 0x0000f804,
518 0x000000f8, 518 0x00000000,
519 0x00000000, 519 0x00000000,
520 0x00000000, 520 0x00000000,
521 0x00000000, 521 0x00000000,
diff --git a/drivers/gpu/drm/nouveau/core/engine/graph/fuc/gpcnve0.fuc b/drivers/gpu/drm/nouveau/core/engine/graph/fuc/gpcnve0.fuc
index 2fc585eeff95..056f0d374897 100644
--- a/drivers/gpu/drm/nouveau/core/engine/graph/fuc/gpcnve0.fuc
+++ b/drivers/gpu/drm/nouveau/core/engine/graph/fuc/gpcnve0.fuc
@@ -82,12 +82,6 @@ mmctx_data(0x000c80, 1)
82mmctx_data(0x000c8c, 1) 82mmctx_data(0x000c8c, 1)
83mmctx_data(0x001000, 3) 83mmctx_data(0x001000, 3)
84mmctx_data(0x001014, 1) 84mmctx_data(0x001014, 1)
85mmctx_data(0x003024, 1)
86mmctx_data(0x0030c0, 2)
87mmctx_data(0x0030e4, 1)
88mmctx_data(0x003100, 6)
89mmctx_data(0x0031d0, 1)
90mmctx_data(0x0031e0, 2)
91nve4_gpc_mmio_tail: 85nve4_gpc_mmio_tail:
92 86
93nvf0_gpc_mmio_head: 87nvf0_gpc_mmio_head:
@@ -166,6 +160,16 @@ mmctx_data(0x000758, 1)
166mmctx_data(0x000770, 1) 160mmctx_data(0x000770, 1)
167mmctx_data(0x000778, 2) 161mmctx_data(0x000778, 2)
168nvf0_tpc_mmio_tail: 162nvf0_tpc_mmio_tail:
163
164// UNK mmio lists
165nve4_unk_mmio_head:
166mmctx_data(0x000024, 1)
167mmctx_data(0x0000c0, 2)
168mmctx_data(0x0000e4, 1)
169mmctx_data(0x000100, 6)
170mmctx_data(0x0001d0, 1)
171mmctx_data(0x0001e0, 2)
172nve4_unk_mmio_tail:
169#undef INCLUDE_DATA 173#undef INCLUDE_DATA
170 174
171.section #nve0_grgpc_code 175.section #nve0_grgpc_code
diff --git a/drivers/gpu/drm/nouveau/core/engine/graph/fuc/gpcnve0.fuc.h b/drivers/gpu/drm/nouveau/core/engine/graph/fuc/gpcnve0.fuc.h
index 504ae96cd3dd..08c0f4731681 100644
--- a/drivers/gpu/drm/nouveau/core/engine/graph/fuc/gpcnve0.fuc.h
+++ b/drivers/gpu/drm/nouveau/core/engine/graph/fuc/gpcnve0.fuc.h
@@ -13,7 +13,15 @@ uint32_t nve0_grgpc_data[] = {
13 0x00000000, 13 0x00000000,
14/* 0x0018: tpc_mmio_list_tail */ 14/* 0x0018: tpc_mmio_list_tail */
15 0x00000000, 15 0x00000000,
16/* 0x001c: cmd_queue */ 16/* 0x001c: unk_count */
17 0x00000001,
18/* 0x0020: unk_mask */
19 0x00000001,
20/* 0x0024: unk_mmio_list_head */
21 0x00000220,
22/* 0x0028: unk_mmio_list_tail */
23 0x00000238,
24/* 0x002c: cmd_queue */
17 0x00000000, 25 0x00000000,
18 0x00000000, 26 0x00000000,
19 0x00000000, 27 0x00000000,
@@ -32,21 +40,21 @@ uint32_t nve0_grgpc_data[] = {
32 0x00000000, 40 0x00000000,
33 0x00000000, 41 0x00000000,
34 0x00000000, 42 0x00000000,
35/* 0x0064: chipsets */ 43/* 0x0074: chipsets */
36 0x000000e4, 44 0x000000e4,
37 0x011c0098, 45 0x011400a8,
38 0x01d8018c, 46 0x01d00184,
39 0x000000e7, 47 0x000000e7,
40 0x011c0098, 48 0x011400a8,
41 0x01d8018c, 49 0x01d00184,
42 0x000000e6, 50 0x000000e6,
43 0x011c0098, 51 0x011400a8,
44 0x01d8018c, 52 0x01d00184,
45 0x000000f0, 53 0x000000f0,
46 0x018c011c, 54 0x01840114,
47 0x022801d8, 55 0x022001d0,
48 0x00000000, 56 0x00000000,
49/* 0x0098: nve4_gpc_mmio_head */ 57/* 0x00a8: nve4_gpc_mmio_head */
50 0x00000380, 58 0x00000380,
51 0x04000400, 59 0x04000400,
52 0x0800040c, 60 0x0800040c,
@@ -74,14 +82,8 @@ uint32_t nve0_grgpc_data[] = {
74 0x00000c8c, 82 0x00000c8c,
75 0x08001000, 83 0x08001000,
76 0x00001014, 84 0x00001014,
77 0x00003024, 85/* 0x0114: nve4_gpc_mmio_tail */
78 0x040030c0, 86/* 0x0114: nvf0_gpc_mmio_head */
79 0x000030e4,
80 0x14003100,
81 0x000031d0,
82 0x040031e0,
83/* 0x011c: nve4_gpc_mmio_tail */
84/* 0x011c: nvf0_gpc_mmio_head */
85 0x00000380, 87 0x00000380,
86 0x04000400, 88 0x04000400,
87 0x0800040c, 89 0x0800040c,
@@ -110,8 +112,8 @@ uint32_t nve0_grgpc_data[] = {
110 0x00000d24, 112 0x00000d24,
111 0x08001000, 113 0x08001000,
112 0x00001014, 114 0x00001014,
113/* 0x018c: nvf0_gpc_mmio_tail */ 115/* 0x0184: nvf0_gpc_mmio_tail */
114/* 0x018c: nve4_tpc_mmio_head */ 116/* 0x0184: nve4_tpc_mmio_head */
115 0x00000048, 117 0x00000048,
116 0x00000064, 118 0x00000064,
117 0x00000088, 119 0x00000088,
@@ -131,8 +133,8 @@ uint32_t nve0_grgpc_data[] = {
131 0x00000758, 133 0x00000758,
132 0x00000770, 134 0x00000770,
133 0x04000778, 135 0x04000778,
134/* 0x01d8: nve4_tpc_mmio_tail */ 136/* 0x01d0: nve4_tpc_mmio_tail */
135/* 0x01d8: nvf0_tpc_mmio_head */ 137/* 0x01d0: nvf0_tpc_mmio_head */
136 0x00000048, 138 0x00000048,
137 0x00000064, 139 0x00000064,
138 0x00000088, 140 0x00000088,
@@ -153,6 +155,14 @@ uint32_t nve0_grgpc_data[] = {
153 0x00000758, 155 0x00000758,
154 0x00000770, 156 0x00000770,
155 0x04000778, 157 0x04000778,
158/* 0x0220: nvf0_tpc_mmio_tail */
159/* 0x0220: nve4_unk_mmio_head */
160 0x00000024,
161 0x040000c0,
162 0x000000e4,
163 0x14000100,
164 0x000001d0,
165 0x040001e0,
156}; 166};
157 167
158uint32_t nve0_grgpc_code[] = { 168uint32_t nve0_grgpc_code[] = {
@@ -386,7 +396,7 @@ uint32_t nve0_grgpc_code[] = {
386 0xf10004fe, 396 0xf10004fe,
387 0xf0120017, 397 0xf0120017,
388 0x12d00227, 398 0x12d00227,
389 0x3e17f100, 399 0x5417f100,
390 0x0010fe04, 400 0x0010fe04,
391 0x040017f1, 401 0x040017f1,
392 0xf0c010d0, 402 0xf0c010d0,
@@ -405,7 +415,7 @@ uint32_t nve0_grgpc_code[] = {
405 0x24b60800, 415 0x24b60800,
406 0x0022cf06, 416 0x0022cf06,
407/* 0x035f: init_find_chipset */ 417/* 0x035f: init_find_chipset */
408 0xb65817f0, 418 0xb66817f0,
409 0x13980c10, 419 0x13980c10,
410 0x0432b800, 420 0x0432b800,
411 0xb00b0bf4, 421 0xb00b0bf4,
@@ -432,135 +442,135 @@ uint32_t nve0_grgpc_code[] = {
432 0x030e9801, 442 0x030e9801,
433 0xbb00effd, 443 0xbb00effd,
434 0x3ebb002e, 444 0x3ebb002e,
435 0x0040b700, 445 0x090e9800,
436 0x0235b613, 446 0xf50a0f98,
437 0xb60043d0, 447 0x98013d21,
438 0x35b60825, 448 0xeffd070e,
439 0x0120b606, 449 0x002ebb00,
440 0xb60130b6, 450 0xb7003ebb,
441 0x34b60824, 451 0xb6130040,
442 0x022fb908, 452 0x43d00235,
443 0x026321f5, 453 0x0825b600,
444 0xf1003fbb, 454 0xb60635b6,
445 0xb6080017, 455 0x30b60120,
446 0x13d00614, 456 0x0824b601,
447 0x0010b740, 457 0xb90834b6,
448 0xf024bd08, 458 0x21f5022f,
449 0x12d01f29, 459 0x3fbb0263,
450/* 0x0401: main */ 460 0x0017f100,
451 0x0031f400, 461 0x0614b608,
452 0xf00028f4, 462 0xb74013d0,
453 0x21f41cd7, 463 0xbd080010,
454 0xf401f439, 464 0x1f29f024,
455 0xf404e4b0, 465/* 0x0417: main */
456 0x81fe1e18, 466 0xf40012d0,
457 0x0627f001, 467 0x28f40031,
458 0x12fd20bd, 468 0x2cd7f000,
459 0x01e4b604, 469 0xf43921f4,
460 0xfe051efd, 470 0xe4b0f401,
461 0x21f50018, 471 0x1e18f404,
462 0x0ef404c3, 472 0xf00181fe,
463/* 0x0431: main_not_ctx_xfer */ 473 0x20bd0627,
464 0x10ef94d3, 474 0xb60412fd,
465 0xf501f5f0, 475 0x1efd01e4,
466 0xf402ec21, 476 0x0018fe05,
467/* 0x043e: ih */ 477 0x04d921f5,
468 0x80f9c60e, 478/* 0x0447: main_not_ctx_xfer */
469 0xf90188fe, 479 0x94d30ef4,
470 0xf990f980, 480 0xf5f010ef,
471 0xf9b0f9a0, 481 0xec21f501,
472 0xf9e0f9d0, 482 0xc60ef402,
473 0x800acff0, 483/* 0x0454: ih */
474 0xf404abc4, 484 0x88fe80f9,
475 0xb7f11d0b, 485 0xf980f901,
476 0xd7f01900, 486 0xf9a0f990,
477 0x40becf1c, 487 0xf9d0f9b0,
478 0xf400bfcf, 488 0xcff0f9e0,
479 0xb0b70421, 489 0xabc4800a,
480 0xe7f00400, 490 0x1d0bf404,
481 0x00bed001, 491 0x1900b7f1,
482/* 0x0474: ih_no_fifo */ 492 0xcf2cd7f0,
483 0xfc400ad0, 493 0xbfcf40be,
484 0xfce0fcf0, 494 0x0421f400,
485 0xfcb0fcd0, 495 0x0400b0b7,
486 0xfc90fca0, 496 0xd001e7f0,
487 0x0088fe80, 497/* 0x048a: ih_no_fifo */
488 0x32f480fc, 498 0x0ad000be,
489/* 0x048f: hub_barrier_done */ 499 0xfcf0fc40,
490 0xf001f800, 500 0xfcd0fce0,
491 0x0e9801f7, 501 0xfca0fcb0,
492 0x04febb00, 502 0xfe80fc90,
493 0x9418e7f1, 503 0x80fc0088,
494 0xf440e3f0, 504 0xf80032f4,
495 0x00f88d21, 505/* 0x04a5: hub_barrier_done */
496/* 0x04a4: ctx_redswitch */ 506 0x01f7f001,
497 0x0614e7f1, 507 0xbb000e98,
498 0xf006e4b6, 508 0xe7f104fe,
499 0xefd020f7, 509 0xe3f09418,
500 0x08f7f000, 510 0x8d21f440,
501/* 0x04b4: ctx_redswitch_delay */ 511/* 0x04ba: ctx_redswitch */
502 0xf401f2b6, 512 0xe7f100f8,
503 0xf7f1fd1b, 513 0xe4b60614,
504 0xefd00a20, 514 0x20f7f006,
505/* 0x04c3: ctx_xfer */ 515 0xf000efd0,
506 0xf100f800, 516/* 0x04ca: ctx_redswitch_delay */
507 0xb60a0417, 517 0xf2b608f7,
508 0x1fd00614, 518 0xfd1bf401,
509 0x0711f400, 519 0x0a20f7f1,
510 0x04a421f5, 520 0xf800efd0,
511/* 0x04d4: ctx_xfer_not_load */ 521/* 0x04d9: ctx_xfer */
512 0x4afc17f1, 522 0x0417f100,
513 0xf00213f0, 523 0x0614b60a,
514 0x12d00c27, 524 0xf4001fd0,
515 0x0721f500, 525 0x21f50711,
516 0xfc27f102, 526/* 0x04ea: ctx_xfer_not_load */
517 0x0223f047, 527 0x17f104ba,
518 0xf00020d0, 528 0x13f04afc,
519 0x20b6012c, 529 0x0c27f002,
520 0x0012d003, 530 0xf50012d0,
531 0xf1020721,
532 0xf047fc27,
533 0x20d00223,
534 0x012cf000,
535 0xd00320b6,
536 0xacf00012,
537 0x02a5f001,
538 0xf000b7f0,
539 0x0c9850b3,
540 0x0fc4b600,
541 0x9800bcbb,
542 0x0d98010c,
543 0x00e7f002,
544 0x015c21f5,
545 0xf101acf0,
546 0xf04000b7,
547 0x0c9850b3,
548 0x0fc4b600,
549 0x9800bcbb,
550 0x0d98050c,
551 0x040f9806,
552 0x0800e7f1,
553 0x015c21f5,
521 0xf001acf0, 554 0xf001acf0,
522 0xb7f002a5, 555 0xb7f104a5,
523 0x50b3f000, 556 0xb3f03000,
524 0xb6000c98, 557 0x000c9850,
525 0xbcbb0fc4, 558 0xbb0fc4b6,
526 0x010c9800, 559 0x0c9800bc,
527 0xf0020d98, 560 0x0a0d9809,
528 0x21f500e7, 561 0xf1080f98,
529 0xacf0015c, 562 0xf50200e7,
530 0x04a5f001, 563 0xf5015c21,
531 0x4000b7f1, 564 0xf4020721,
532 0x9850b3f0, 565 0x12f40601,
533 0xc4b6000c, 566/* 0x0585: ctx_xfer_post */
534 0x00bcbb0f, 567 0xfc17f114,
535 0x98050c98, 568 0x0213f04a,
536 0x0f98060d, 569 0xd00d27f0,
537 0x00e7f104, 570 0x21f50012,
538 0x5c21f508, 571/* 0x0596: ctx_xfer_done */
539 0x0721f501, 572 0x21f50207,
540 0x0601f402, 573 0x00f804a5,
541/* 0x054b: ctx_xfer_post */
542 0xf11412f4,
543 0xf04afc17,
544 0x27f00213,
545 0x0012d00d,
546 0x020721f5,
547/* 0x055c: ctx_xfer_done */
548 0x048f21f5,
549 0x000000f8,
550 0x00000000,
551 0x00000000,
552 0x00000000,
553 0x00000000,
554 0x00000000,
555 0x00000000,
556 0x00000000,
557 0x00000000,
558 0x00000000,
559 0x00000000,
560 0x00000000,
561 0x00000000,
562 0x00000000,
563 0x00000000,
564 0x00000000, 574 0x00000000,
565 0x00000000, 575 0x00000000,
566 0x00000000, 576 0x00000000,