summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/nouveau/nvc0/mme
diff options
context:
space:
mode:
authorRhys Perry <[email protected]>2018-04-07 16:15:00 -0600
committerBrian Paul <[email protected]>2018-04-30 21:13:53 -0600
commit07dac3e04056f7e90661eeb39aea66ba0b82538d (patch)
tree32e866e85a39b151a365fbe336935886447fb37e /src/gallium/drivers/nouveau/nvc0/mme
parent97f5f399ef79d72dc7bb6e7fe7b35c10b9000855 (diff)
nvc0: add conservative rasterization support
Subpixel precision bias, dilation and the post-snap mode are supported on GM200 and newer. The pre-snap mode is supported for triangle primitives on GP100. Signed-off-by: Rhys Perry <[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/com9097.mme30
-rw-r--r--src/gallium/drivers/nouveau/nvc0/mme/com9097.mme.h21
2 files changed, 51 insertions, 0 deletions
diff --git a/src/gallium/drivers/nouveau/nvc0/mme/com9097.mme b/src/gallium/drivers/nouveau/nvc0/mme/com9097.mme
index 7c5ec8f52b9..ecf99606672 100644
--- a/src/gallium/drivers/nouveau/nvc0/mme/com9097.mme
+++ b/src/gallium/drivers/nouveau/nvc0/mme/com9097.mme
@@ -550,3 +550,33 @@ qbw_postclamp:
qbw_done:
exit send (extrinsrt 0x0 $r4 0x0 0x10 0x10)
maddrsend 0x44
+
+/* NVC0_3D_MACRO_CONSERVATIVE_RASTER_STATE:
+ *
+ * This sets basically all the conservative rasterization state. It sets
+ * CONSERVATIVE_RASTER to one while doing so.
+ *
+ * arg = biasx | biasy<<4 | (dilation*4)<<8 | mode<<10
+ */
+.section #mme9097_conservative_raster_state
+ /* Mode and dilation */
+ maddr 0x1d00 /* SCRATCH[0] */
+ send 0x0 /* unknown */
+ send (extrinsrt 0x0 $r1 8 3 23) /* value */
+ mov $r2 0x7
+ send (extrinsrt 0x0 $r2 0 3 23) /* write mask */
+ maddr 0x18c4 /* FIRMWARE[4] */
+ mov $r2 0x831
+ send (extrinsrt 0x0 $r2 0 12 11) /* sends 0x418800 */
+ /* Subpixel precision */
+ mov $r2 (extrinsrt 0x0 $r1 0 3 0)
+ mov $r2 (extrinsrt $r2 $r1 4 4 8)
+ maddr 0x8287 /* SUBPIXEL_PRECISION[0] (incrementing by 8 methods) */
+ mov $r3 16 /* loop counter */
+crs_loop:
+ mov $r3 (add $r3 -1)
+ branz $r3 #crs_loop
+ send $r2
+ /* Enable */
+ exit maddr 0x1452 /* CONSERVATIVE_RASTER */
+ send 0x1
diff --git a/src/gallium/drivers/nouveau/nvc0/mme/com9097.mme.h b/src/gallium/drivers/nouveau/nvc0/mme/com9097.mme.h
index 9618da6e28c..3eacda9a27a 100644
--- a/src/gallium/drivers/nouveau/nvc0/mme/com9097.mme.h
+++ b/src/gallium/drivers/nouveau/nvc0/mme/com9097.mme.h
@@ -373,3 +373,24 @@ uint32_t mme9097_query_buffer_write[] = {
0x840100c2,
0x00110071,
};
+
+uint32_t mme9097_conservative_raster_state[] = {
+ 0x07400021,
+ 0x00000041,
+ 0xb8d04042,
+/* 0x000c: crs_loop */
+ 0x0001c211,
+ 0xb8c08042,
+ 0x06310021,
+ 0x020c4211,
+ 0x5b008042,
+ 0x00c04212,
+ 0x41085212,
+ 0x20a1c021,
+ 0x00040311,
+ 0xffffdb11,
+ 0xffffd817,
+ 0x00001041,
+ 0x051480a1,
+ 0x00004041,
+};