[Mesa-dev] [PATCH 1/2] r600: define registers required for tessellation

2015-11-23 Thread Dave Airlie
From: Dave Airlie 

This adds the defines for a bunch of registers and shader
values that are required to implement tessellation.

Signed-off-by: Dave Airlie 
---
 src/gallium/drivers/r600/evergreend.h | 123 +++---
 src/gallium/drivers/r600/r600_sq.h|   8 +++
 2 files changed, 108 insertions(+), 23 deletions(-)

diff --git a/src/gallium/drivers/r600/evergreend.h 
b/src/gallium/drivers/r600/evergreend.h
index 25237c6..dbee9d5 100644
--- a/src/gallium/drivers/r600/evergreend.h
+++ b/src/gallium/drivers/r600/evergreend.h
@@ -463,6 +463,39 @@
 #define R_0286EC_SPI_COMPUTE_NUM_THREAD_X0x0286EC
 #define R_0286F0_SPI_COMPUTE_NUM_THREAD_Y0x0286F0
 #define R_0286F4_SPI_COMPUTE_NUM_THREAD_Z0x0286F4
+#define R_028B6C_VGT_TF_PARAM0x028B6C
+#define   S_028B6C_TYPE(x)(((x) & 
0x03) << 0)
+#define   G_028B6C_TYPE(x)(((x) >> 
0) & 0x03)
+#define   C_028B6C_TYPE   
0xFFFC
+#define V_028B6C_TESS_ISOLINE   0x00
+#define V_028B6C_TESS_TRIANGLE  0x01
+#define V_028B6C_TESS_QUAD  0x02
+#define   S_028B6C_PARTITIONING(x)(((x) & 
0x07) << 2)
+#define   G_028B6C_PARTITIONING(x)(((x) >> 
2) & 0x07)
+#define   C_028B6C_PARTITIONING   
0xFFE3
+#define V_028B6C_PART_INTEGER   0x00
+#define V_028B6C_PART_POW2  0x01
+#define V_028B6C_PART_FRAC_ODD  0x02
+#define V_028B6C_PART_FRAC_EVEN 0x03
+#define   S_028B6C_TOPOLOGY(x)(((x) & 
0x07) << 5)
+#define   G_028B6C_TOPOLOGY(x)(((x) >> 
5) & 0x07)
+#define   C_028B6C_TOPOLOGY   
0xFF1F
+#define V_028B6C_OUTPUT_POINT   0x00
+#define V_028B6C_OUTPUT_LINE0x01
+#define V_028B6C_OUTPUT_TRIANGLE_CW 0x02
+#define V_028B6C_OUTPUT_TRIANGLE_CCW0x03
+#define   S_028B6C_RESERVED_REDUC_AXIS(x) (((x) & 
0x1) << 8)
+#define   G_028B6C_RESERVED_REDUC_AXIS(x) (((x) >> 
8) & 0x1)
+#define   C_028B6C_RESERVED_REDUC_AXIS
0xFEFF
+#define   S_028B6C_BUFFER_ACCESS_MODE(x)  (((x) & 
0x1) << 9)
+#define   G_028B6C_BUFFER_ACCESS_MODE(x)  (((x) >> 
9) & 0x1)
+#define   C_028B6C_BUFFER_ACCESS_MODE 
0xFDFF
+#define V_028B6C_PATCH_MAJOR0x00
+#define V_028B6C_TF_MAJOR   0x01
+#define   S_028B6C_NUM_DS_WAVES_PER_SIMD  (((x) & 
0xf) << 10)
+#define   G_028B6C_NUM_DS_WAVES_PER_SIMD  (((x) >> 
10) & 0xF)
+#define   C_028B6C_NUM_DS_WAVES_PER_SIMD  
0xC3FF
+
 #define R_028B74_VGT_DISPATCH_INITIATOR  0x028B74
 
 #define R_028800_DB_DEPTH_CONTROL0x028800
@@ -1260,6 +1293,16 @@
 #define R_00A430_TD_GS_SAMPLER0_BORDER_GREEN 0x00A430
 #define R_00A434_TD_GS_SAMPLER0_BORDER_BLUE  0x00A434
 #define R_00A438_TD_GS_SAMPLER0_BORDER_ALPHA 0x00A438
+#define R_00A43C_TD_HS_SAMPLER0_BORDER_COLOR_INDEX   0x00A43C
+#define R_00A440_TD_HS_SAMPLER0_BORDER_COLOR_RED 0x00A440
+#define R_00A444_TD_HS_SAMPLER0_BORDER_COLOR_GREEN   0x00A444
+#define R_00A448_TD_HS_SAMPLER0_BORDER_COLOR_BLUE0x00A448
+#define R_00A44C_TD_HS_SAMPLER0_BORDER_COLOR_ALPHA   0x00A44C
+#define R_00A450_TD_LS_SAMPLER0_BORDER_COLOR_INDEX   0x00A450
+#define R_00A454_TD_LS_SAMPLER0_BORDER_COLOR_RED 0x00A454
+#define R_00A458_TD_LS_SAMPLER0_BORDER_COLOR_GREEN   0x00A458
+#define R_00A45C_TD_LS_SAMPLER0_BORDER_COLOR_BLUE0x00A45C
+#define R_00A460_TD_LS_SAMPLER0_BORDER_COLOR_ALPHA   0x00A460
 #define R_00A464_TD_CS_SAMPLER0_BORDER_INDEX 0x00A464
 #define R_00A468_TD_CS_SAMPLER0_BORDER_RED   0x00A468
 #define R_00A46C_TD_CS_SAMPLER0_BORDER_GREEN 0x00A46C
@@ -1383,7 +1426,7 @@
 #define V_008958_DI_PT_TRISTRIP0x0006
 #define V_008958_DI_PT_UNUSED_00x0007
 #define V_008958_DI_PT_UNUSED_10x0008
-#define V_008958_DI_PT_UNUSED_20x0009
+#define V_008958_DI_PT_PATCH   0x0009
 #define V_008958_DI_PT_LINELIST_ADJ

Re: [Mesa-dev] [PATCH 1/2] r600: define registers required for tessellation

2015-11-23 Thread Glenn Kennard

On Mon, 23 Nov 2015 23:46:24 +0100, Dave Airlie  wrote:


From: Dave Airlie 

This adds the defines for a bunch of registers and shader
values that are required to implement tessellation.

Signed-off-by: Dave Airlie 
---
 src/gallium/drivers/r600/evergreend.h | 123 +++---
 src/gallium/drivers/r600/r600_sq.h|   8 +++
 2 files changed, 108 insertions(+), 23 deletions(-)

diff --git a/src/gallium/drivers/r600/evergreend.h 
b/src/gallium/drivers/r600/evergreend.h
index 25237c6..dbee9d5 100644
--- a/src/gallium/drivers/r600/evergreend.h
+++ b/src/gallium/drivers/r600/evergreend.h
@@ -463,6 +463,39 @@
 #define R_0286EC_SPI_COMPUTE_NUM_THREAD_X0x0286EC
 #define R_0286F0_SPI_COMPUTE_NUM_THREAD_Y0x0286F0
 #define R_0286F4_SPI_COMPUTE_NUM_THREAD_Z0x0286F4
+#define R_028B6C_VGT_TF_PARAM0x028B6C
+#define   S_028B6C_TYPE(x)(((x) & 0x03) 
<< 0)
+#define   G_028B6C_TYPE(x)(((x) >> 0) 
& 0x03)
+#define   C_028B6C_TYPE   
0xFFFC
+#define V_028B6C_TESS_ISOLINE   0x00
+#define V_028B6C_TESS_TRIANGLE  0x01
+#define V_028B6C_TESS_QUAD  0x02
+#define   S_028B6C_PARTITIONING(x)(((x) & 0x07) 
<< 2)
+#define   G_028B6C_PARTITIONING(x)(((x) >> 2) 
& 0x07)
+#define   C_028B6C_PARTITIONING   
0xFFE3
+#define V_028B6C_PART_INTEGER   0x00
+#define V_028B6C_PART_POW2  0x01
+#define V_028B6C_PART_FRAC_ODD  0x02
+#define V_028B6C_PART_FRAC_EVEN 0x03
+#define   S_028B6C_TOPOLOGY(x)(((x) & 0x07) 
<< 5)
+#define   G_028B6C_TOPOLOGY(x)(((x) >> 5) 
& 0x07)
+#define   C_028B6C_TOPOLOGY   
0xFF1F
+#define V_028B6C_OUTPUT_POINT   0x00
+#define V_028B6C_OUTPUT_LINE0x01
+#define V_028B6C_OUTPUT_TRIANGLE_CW 0x02
+#define V_028B6C_OUTPUT_TRIANGLE_CCW0x03
+#define   S_028B6C_RESERVED_REDUC_AXIS(x) (((x) & 0x1) 
<< 8)
+#define   G_028B6C_RESERVED_REDUC_AXIS(x) (((x) >> 8) 
& 0x1)
+#define   C_028B6C_RESERVED_REDUC_AXIS
0xFEFF
+#define   S_028B6C_BUFFER_ACCESS_MODE(x)  (((x) & 0x1) 
<< 9)
+#define   G_028B6C_BUFFER_ACCESS_MODE(x)  (((x) >> 9) 
& 0x1)
+#define   C_028B6C_BUFFER_ACCESS_MODE 
0xFDFF
+#define V_028B6C_PATCH_MAJOR0x00
+#define V_028B6C_TF_MAJOR   0x01
+#define   S_028B6C_NUM_DS_WAVES_PER_SIMD  (((x) & 0xf) 
<< 10)
+#define   G_028B6C_NUM_DS_WAVES_PER_SIMD  (((x) >> 10) 
& 0xF)
+#define   C_028B6C_NUM_DS_WAVES_PER_SIMD  
0xC3FF
+
 #define R_028B74_VGT_DISPATCH_INITIATOR  0x028B74
#define R_028800_DB_DEPTH_CONTROL0x028800
@@ -1260,6 +1293,16 @@
 #define R_00A430_TD_GS_SAMPLER0_BORDER_GREEN 0x00A430
 #define R_00A434_TD_GS_SAMPLER0_BORDER_BLUE  0x00A434
 #define R_00A438_TD_GS_SAMPLER0_BORDER_ALPHA 0x00A438
+#define R_00A43C_TD_HS_SAMPLER0_BORDER_COLOR_INDEX   0x00A43C
+#define R_00A440_TD_HS_SAMPLER0_BORDER_COLOR_RED 0x00A440
+#define R_00A444_TD_HS_SAMPLER0_BORDER_COLOR_GREEN   0x00A444
+#define R_00A448_TD_HS_SAMPLER0_BORDER_COLOR_BLUE0x00A448
+#define R_00A44C_TD_HS_SAMPLER0_BORDER_COLOR_ALPHA   0x00A44C
+#define R_00A450_TD_LS_SAMPLER0_BORDER_COLOR_INDEX   0x00A450
+#define R_00A454_TD_LS_SAMPLER0_BORDER_COLOR_RED 0x00A454
+#define R_00A458_TD_LS_SAMPLER0_BORDER_COLOR_GREEN   0x00A458
+#define R_00A45C_TD_LS_SAMPLER0_BORDER_COLOR_BLUE0x00A45C
+#define R_00A460_TD_LS_SAMPLER0_BORDER_COLOR_ALPHA   0x00A460
 #define R_00A464_TD_CS_SAMPLER0_BORDER_INDEX 0x00A464
 #define R_00A468_TD_CS_SAMPLER0_BORDER_RED   0x00A468
 #define R_00A46C_TD_CS_SAMPLER0_BORDER_GREEN 0x00A46C
@@ -1383,7 +1426,7 @@
 #define V_008958_DI_PT_TRISTRIP0x0006
 #define V_008958_DI_PT_UNUSED_00x0007
 #define V_008958_DI_PT_UNUSED_10x0008
-#define V_008958_DI_PT_UNUSED_20x0009
+#define V_008958_DI_PT_PATCH