summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/nouveau/nvc0/mme
diff options
context:
space:
mode:
authorSamuel Pitoiset <[email protected]>2016-01-12 23:51:00 +0100
committerSamuel Pitoiset <[email protected]>2016-02-21 10:41:45 +0100
commitc6293877f0d2f69db122d351c14ab2d21b7b2964 (patch)
tree04f98030d41eead3e2ece7be139df97e7bdc99b2 /src/gallium/drivers/nouveau/nvc0/mme
parentfa7333a742d8f816c0502e79503a7ad33ab0a9a5 (diff)
nvc0: add support for indirect compute on Fermi
When indirect compute is used, the size of the grid (in blocks) is stored as three integers inside a buffer. This requires a macro to set up GRIDDIM_YX and GRIDDIM_Z. Changes from v2: - do not launch the grid if the number of groups for a dimension is 0 Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]>
Diffstat (limited to 'src/gallium/drivers/nouveau/nvc0/mme')
-rw-r--r--src/gallium/drivers/nouveau/nvc0/mme/Makefile2
-rw-r--r--src/gallium/drivers/nouveau/nvc0/mme/com90c0.mme24
-rw-r--r--src/gallium/drivers/nouveau/nvc0/mme/com90c0.mme.h19
3 files changed, 44 insertions, 1 deletions
diff --git a/src/gallium/drivers/nouveau/nvc0/mme/Makefile b/src/gallium/drivers/nouveau/nvc0/mme/Makefile
index 1c0f5835973..52fb0a54812 100644
--- a/src/gallium/drivers/nouveau/nvc0/mme/Makefile
+++ b/src/gallium/drivers/nouveau/nvc0/mme/Makefile
@@ -1,5 +1,5 @@
ENVYAS?=envyas
-TARGETS=com9097.mme.h
+TARGETS=com9097.mme.h com90c0.mme.h
all: $(TARGETS)
diff --git a/src/gallium/drivers/nouveau/nvc0/mme/com90c0.mme b/src/gallium/drivers/nouveau/nvc0/mme/com90c0.mme
new file mode 100644
index 00000000000..a3f1bdeebcd
--- /dev/null
+++ b/src/gallium/drivers/nouveau/nvc0/mme/com90c0.mme
@@ -0,0 +1,24 @@
+/* NVC0_COMPUTE_MACRO_LAUNCH_GRID_INDIRECT
+ *
+ * arg = num_groups_x
+ * parm[0] = num_groups_y
+ * parm[1] = num_groups_z
+ */
+.section #mme90c0_launch_grid_indirect
+ parm $r2 maddr 0x108e /* GRIDDIM_YX */
+ braz $r1 #fail
+ parm $r3
+ braz annul $r2 #fail
+ braz annul $r3 #fail
+ send (extrinsrt $r1 $r2 0x0 0x10 0x10) /* num_groups_y << 16 | num_groups_x */
+ send $r3
+ maddrsend 0xa7 /* COMPUTE_BEGIN */
+ maddrsend 0x282 /* UNKA08 */
+ maddr 0xda /* LAUNCH */
+ send 0x1000
+ maddrsend 0x281 /* COMPUTE_END */
+ exit maddr 0xd8 /* UNK360 */
+ send 0x1
+fail:
+ exit
+ nop
diff --git a/src/gallium/drivers/nouveau/nvc0/mme/com90c0.mme.h b/src/gallium/drivers/nouveau/nvc0/mme/com90c0.mme.h
new file mode 100644
index 00000000000..1dc06e5e690
--- /dev/null
+++ b/src/gallium/drivers/nouveau/nvc0/mme/com90c0.mme.h
@@ -0,0 +1,19 @@
+uint32_t mme90c0_launch_grid_indirect[] = {
+ 0x04238251,
+ 0x00034807,
+ 0x00000301,
+/* 0x000e: fail */
+ 0x0002d027,
+ 0x00029827,
+ 0x84008842,
+ 0x00001841,
+ 0x0029c071,
+ 0x00a08071,
+ 0x00368021,
+ 0x04000041,
+ 0x00a04071,
+ 0x003600a1,
+ 0x00004041,
+ 0x00000091,
+ 0x00000011,
+};