summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/nouveau/nvc0/mme
diff options
context:
space:
mode:
authorIlia Mirkin <[email protected]>2016-01-02 11:38:42 -0500
committerIlia Mirkin <[email protected]>2016-01-07 18:38:46 -0500
commit67b31b3c59a3b950897709d6c472348c4e12951c (patch)
treedeec380fa55e3d9b78bc21953e8a09b19390c1bc /src/gallium/drivers/nouveau/nvc0/mme
parent9a54ccf30a1342a0ec55c30358b88ee5df5080ce (diff)
nvc0: add ARB_indirect_parameters support
I chose to make separate macros for this due to the additional complexity and extra scratch usage. Signed-off-by: Ilia Mirkin <[email protected]>
Diffstat (limited to 'src/gallium/drivers/nouveau/nvc0/mme')
-rw-r--r--src/gallium/drivers/nouveau/nvc0/mme/com9097.mme157
-rw-r--r--src/gallium/drivers/nouveau/nvc0/mme/com9097.mme.h125
2 files changed, 282 insertions, 0 deletions
diff --git a/src/gallium/drivers/nouveau/nvc0/mme/com9097.mme b/src/gallium/drivers/nouveau/nvc0/mme/com9097.mme
index 35355edf2e7..4daa57d47bb 100644
--- a/src/gallium/drivers/nouveau/nvc0/mme/com9097.mme
+++ b/src/gallium/drivers/nouveau/nvc0/mme/com9097.mme
@@ -334,3 +334,160 @@ dai_end:
mov $r6 (add $r6 1)
exit maddr 0x50e /* VB_INSTANCE_BASE to restore */
send $r5
+
+/* NVC0_3D_MACRO_DRAW_ELEMENTS_INDIRECT_COUNT
+ *
+ * NOTE: Saves and restores VB_ELEMENT,INSTANCE_BASE.
+ * Forcefully sets VERTEX_ID_BASE to the value of VB_ELEMENT_BASE.
+ *
+ * arg = mode
+ * parm[0] = start_drawid
+ * parm[1] = numparams
+ * parm[2] = totaldraws
+ * parm[3 + 5n + 0] = count
+ * parm[3 + 5n + 1] = instance_count
+ * parm[3 + 5n + 2] = start
+ * parm[3 + 5n + 3] = index_bias
+ * parm[3 + 5n + 4] = start_instance
+ *
+ * SCRATCH[0] = saved VB_ELEMENT_BASE
+ * SCRATCH[1] = saved VB_INSTANCE_BASE
+ * SCRATCH[2] = draws left
+ */
+.section #mme9097_draw_elts_indirect_count
+ read $r6 0x50d /* VB_ELEMENT_BASE */
+ read $r7 0x50e /* VB_INSTANCE_BASE */
+ maddr 0x1d00
+ send $r6 /* SCRATCH[0] = VB_ELEMENT_BASE */
+ send $r7 /* SCRATCH[1] = VB_INSTANCE_BASE */
+ parm $r6 /* start_drawid */
+ parm $r7 /* numparams */
+ parm $r5 /* totaldraws */
+ mov $r5 (sub $r5 $r6) /* draws left */
+ braz $r5 #deic_runout
+ mov $r3 (extrinsrt 0x0 $r5 31 1 0) /* extract high bit */
+ branz $r3 #deic_runout
+ send $r5
+deic_draw_again:
+ parm $r3 /* count */
+ parm $r2 /* instance_count */
+ parm $r4 maddr 0x5f7 /* INDEX_BATCH_FIRST, start */
+ parm $r4 send $r4 /* index_bias, send start */
+ maddr 0x18e3 /* CB_POS */
+ send 0x180 /* 256 + 128 */
+ braz $r2 #deic_end
+ parm $r5 send $r4 /* start_instance, send index_bias */
+ send $r5 /* send start_instance */
+ send $r6 /* draw id */
+ maddr 0x150d /* VB_ELEMENT,INSTANCE_BASE */
+ send $r4
+ send $r5
+ maddr 0x446
+ send $r4
+ mov $r4 0x1
+ mov $r1 (extrinsrt $r1 0x0 0 1 26) /* clear INSTANCE_NEXT */
+deic_again:
+ maddr 0x586 /* VERTEX_BEGIN_GL */
+ send $r1 /* mode */
+ maddr 0x5f8 /* INDEX_BATCH_COUNT */
+ send $r3 /* count */
+ mov $r2 (sub $r2 $r4)
+ maddrsend 0x585 /* VERTEX_END_GL */
+ branz $r2 #deic_again
+ mov $r1 (extrinsrt $r1 $r4 0 1 26) /* set INSTANCE_NEXT */
+deic_end:
+ read $r5 0xd02
+ mov $r5 (add $r5 -1)
+ braz $r5 #deic_runout_check
+ mov $r7 (add $r7 -1)
+ maddr 0xd02
+ send $r5
+ branz $r7 #deic_draw_again
+ mov $r6 (add $r6 1)
+deic_restore:
+ read $r6 0xd00
+ read $r7 0xd01
+ maddr 0x150d /* VB_ELEMENT,INSTANCE_BASE */
+ send $r6
+ send $r7
+ exit maddr 0x446
+ send $r6
+deic_runout:
+ parm $r2
+ parm $r2
+ parm $r2
+ parm $r2
+ parm $r2
+ mov $r7 (add $r7 -1)
+deic_runout_check:
+ branz annul $r7 #deic_runout
+ bra annul #deic_restore
+
+/* NVC0_3D_MACRO_DRAW_ARRAYS_INDIRECT_COUNT:
+ *
+ * NOTE: Saves and restores VB_INSTANCE_BASE.
+ *
+ * arg = mode
+ * parm[0] = start_drawid
+ * parm[1] = numparams
+ * parm[2] = totaldraws
+ * parm[3 + 4n + 0] = count
+ * parm[3 + 4n + 1] = instance_count
+ * parm[3 + 4n + 2] = start
+ * parm[3 + 4n + 3] = start_instance
+ *
+ * SCRATCH[0] = VB_INSTANCE_BASE
+ */
+.section #mme9097_draw_arrays_indirect_count
+ read $r5 0x50e /* VB_INSTANCE_BASE */
+ maddr 0xd00
+ parm $r6 send $r5 /* start_drawid, save VB_INSTANCE_BASE */
+ parm $r7 /* numparams */
+ parm $r5 /* totaldraws */
+ mov $r5 (sub $r5 $r6) /* draws left */
+ braz $r5 #daic_runout
+ mov $r3 (extrinsrt 0x0 $r5 31 1 0) /* extract high bit */
+ branz annul $r3 #daic_runout
+daic_draw_again:
+ parm $r2 /* count */
+ parm $r3 /* instance_count */
+ parm $r4 maddr 0x35d /* VERTEX_BUFFER_FIRST, start */
+ braz $r3 #daic_end
+ parm $r4 send $r4 /* start_instance */
+ maddr 0x18e3 /* CB_POS */
+ send 0x180 /* 256 + 128 */
+ send 0x0 /* send 0 as base_vertex */
+ send $r4 /* send start_instance */
+ send $r6 /* draw id */
+ maddr 0x50e /* VB_INSTANCE_BASE */
+ send $r4
+ mov $r4 0x1
+ mov $r1 (extrinsrt $r1 0x0 0 1 26) /* clear INSTANCE_NEXT */
+daic_again:
+ maddr 0x586 /* VERTEX_BEGIN_GL */
+ send $r1 /* mode */
+ maddr 0x35e /* VERTEX_BUFFER_COUNT */
+ send $r2
+ mov $r3 (sub $r3 $r4)
+ maddrsend 0x585 /* VERTEX_END_GL */
+ branz $r3 #daic_again
+ mov $r1 (extrinsrt $r1 $r4 0 1 26) /* set INSTANCE_NEXT */
+daic_end:
+ mov $r5 (add $r5 -1)
+ braz $r5 #daic_runout_check
+ mov $r7 (add $r7 -1)
+ branz $r7 #daic_draw_again
+ mov $r6 (add $r6 1)
+daic_restore:
+ read $r5 0xd00
+ exit maddr 0x50e /* VB_INSTANCE_BASE to restore */
+ send $r5
+daic_runout:
+ parm $r2
+ parm $r2
+ parm $r2
+ parm $r2
+ mov $r7 (add $r7 -1)
+daic_runout_check:
+ branz annul $r7 #daic_runout
+ bra annul #daic_restore
diff --git a/src/gallium/drivers/nouveau/nvc0/mme/com9097.mme.h b/src/gallium/drivers/nouveau/nvc0/mme/com9097.mme.h
index 0aebeeb6e66..bf8625e0584 100644
--- a/src/gallium/drivers/nouveau/nvc0/mme/com9097.mme.h
+++ b/src/gallium/drivers/nouveau/nvc0/mme/com9097.mme.h
@@ -207,3 +207,128 @@ uint32_t mme9097_draw_arrays_indirect[] = {
0x014380a1,
0x00002841,
};
+
+uint32_t mme9097_draw_elts_indirect_count[] = {
+ 0x01434615,
+ 0x01438715,
+ 0x07400021,
+/* 0x000d: deic_draw_again */
+ 0x00003041,
+ 0x00003841,
+ 0x00000601,
+ 0x00000701,
+/* 0x001e: deic_again */
+ 0x00000501,
+ 0x0005ad10,
+/* 0x0026: deic_end */
+ 0x000b2807,
+ 0x007f4312,
+/* 0x002e: deic_restore */
+ 0x000a9817,
+ 0x00002841,
+/* 0x0035: deic_runout */
+ 0x00000301,
+/* 0x003b: deic_runout_check */
+ 0x00000201,
+ 0x017dc451,
+ 0x00002431,
+ 0x0638c021,
+ 0x00600041,
+ 0x0004d007,
+ 0x00002531,
+ 0x00002841,
+ 0x00003041,
+ 0x05434021,
+ 0x00002041,
+ 0x00002841,
+ 0x01118021,
+ 0x00002041,
+ 0x00004411,
+ 0xd0400912,
+ 0x01618021,
+ 0x00000841,
+ 0x017e0021,
+ 0x00001841,
+ 0x00051210,
+ 0x01614071,
+ 0xfffe9017,
+ 0xd0410912,
+ 0x03408515,
+ 0xffffed11,
+ 0x0004e807,
+ 0xffffff11,
+ 0x03408021,
+ 0x00002841,
+ 0xfff87817,
+ 0x00007611,
+ 0x03400615,
+ 0x03404715,
+ 0x05434021,
+ 0x00003041,
+ 0x00003841,
+ 0x011180a1,
+ 0x00003041,
+ 0x00000201,
+ 0x00000201,
+ 0x00000201,
+ 0x00000201,
+ 0x00000201,
+ 0xffffff11,
+ 0xfffeb837,
+ 0xfffc8027,
+};
+
+uint32_t mme9097_draw_arrays_indirect_count[] = {
+ 0x01438515,
+ 0x03400021,
+/* 0x0009: daic_draw_again */
+ 0x00002e31,
+ 0x00000701,
+ 0x00000501,
+/* 0x0017: daic_again */
+ 0x0005ad10,
+ 0x00086807,
+/* 0x001f: daic_end */
+ 0x007f4312,
+ 0x0007d837,
+/* 0x0024: daic_restore */
+/* 0x0027: daic_runout */
+ 0x00000201,
+ 0x00000301,
+/* 0x002c: daic_runout_check */
+ 0x00d74451,
+ 0x0004d807,
+ 0x00002431,
+ 0x0638c021,
+ 0x00600041,
+ 0x00000041,
+ 0x00002041,
+ 0x00003041,
+ 0x01438021,
+ 0x00002041,
+ 0x00004411,
+ 0xd0400912,
+ 0x01618021,
+ 0x00000841,
+ 0x00d78021,
+ 0x00001041,
+ 0x00051b10,
+ 0x01614071,
+ 0xfffe9817,
+ 0xd0410912,
+ 0xffffed11,
+ 0x00032807,
+ 0xffffff11,
+ 0xfff9f817,
+ 0x00007611,
+ 0x03400515,
+ 0x014380a1,
+ 0x00002841,
+ 0x00000201,
+ 0x00000201,
+ 0x00000201,
+ 0x00000201,
+ 0xffffff11,
+ 0xfffef837,
+ 0xfffdc027,
+};