R3xx: more PVS cleanup
authorAlex Deucher <alex@botch2.com>
Tue, 13 May 2008 10:09:55 +0000 (06:09 -0400)
committerAlex Deucher <alex@botch2.com>
Tue, 13 May 2008 10:09:55 +0000 (06:09 -0400)
src/mesa/drivers/dri/r300/r300_cmdbuf.c
src/mesa/drivers/dri/r300/r300_ioctl.c
src/mesa/drivers/dri/r300/r300_reg.h
src/mesa/drivers/dri/r300/r300_state.c

index 8668dba9f05f65490d0d3ce64ff015e10e9bca40..08a616c33552f7f5d7804f5b9adca4ff830461d9 100644 (file)
@@ -353,7 +353,7 @@ void r300InitCmdBuf(r300ContextPtr r300)
        if (has_tcl) {
                ALLOC_STATE(pvs, always, R300_PVS_CMDSIZE, 0);
                r300->hw.pvs.cmd[R300_PVS_CMD_0] =
-                   cmdpacket0(R300_VAP_PVS_CNTL_1, 3);
+                   cmdpacket0(R300_VAP_PVS_CODE_CNTL_0, 3);
        }
 
        ALLOC_STATE(gb_enable, always, 2, 0);
index ffcde7ff35446a9cd7792b407f9969ae4189b9b8..68f2437b86ac02a0f89035058f48ef2e431b1649 100644 (file)
@@ -455,13 +455,14 @@ static void r300EmitClearState(GLcontext * ctx)
 
        if (has_tcl) {
                R300_STATECHANGE(r300, pvs);
-               reg_start(R300_VAP_PVS_CNTL_1, 2);
-
-               e32((0 << R300_PVS_CNTL_1_PROGRAM_START_SHIFT) |
-                   (0 << R300_PVS_CNTL_1_POS_END_SHIFT) |
-                   (1 << R300_PVS_CNTL_1_PROGRAM_END_SHIFT));
-               e32(0x0);
-               e32(1 << R300_PVS_CNTL_3_PROGRAM_UNKNOWN_SHIFT);
+               reg_start(R300_VAP_PVS_CODE_CNTL_0, 2);
+
+               e32((0 << R300_PVS_FIRST_INST_SHIFT) |
+                   (0 << R300_PVS_XYZW_VALID_INST_SHIFT) |
+                   (1 << R300_PVS_LAST_INST_SHIFT));
+               e32((0 << R300_PVS_CONST_BASE_OFFSET_SHIFT) |
+                   (0 << R300_PVS_MAX_CONST_ADDR_SHIFT));
+               e32(1 << R300_PVS_LAST_VTX_SRC_INST_SHIFT);
 
                R300_STATECHANGE(r300, vpi);
                vsf_start_fragment(0x0, 8);
index b404e515df851523f773b4308e1823c80c27906b..ff2fc155245e7294d6792bac584abbedd1a7ea8d 100644 (file)
@@ -444,7 +444,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
  * Therefore, I suspect writing zero to 0x2284 synchronizes the engine and
  * avoids bugs caused by still running shaders reading bad data from memory.
  */
-#define R300_VAP_PVS_WAITIDLE               0x2284 /* GUESS */
+#define R300_VAP_PVS_STATE_FLUSH_REG        0x2284
 
 /* This register is used to define the number of core clocks to wait for a
  * vertex to be received by the VAP input controller (while the primitive
@@ -474,17 +474,16 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
  * is sometimes accepted other instruction that have no relationship with
  * position calculations.
  */
-#define R300_VAP_PVS_CNTL_1                 0x22D0
-#       define R300_PVS_CNTL_1_PROGRAM_START_SHIFT   0
-#       define R300_PVS_CNTL_1_POS_END_SHIFT         10
-#       define R300_PVS_CNTL_1_PROGRAM_END_SHIFT     20
+#define R300_VAP_PVS_CODE_CNTL_0            0x22D0
+#       define R300_PVS_FIRST_INST_SHIFT         0
+#       define R300_PVS_XYZW_VALID_INST_SHIFT    10
+#       define R300_PVS_LAST_INST_SHIFT          20
 /* Addresses are relative the the vertex program parameters area. */
-#define R300_VAP_PVS_CNTL_2                 0x22D4
-#       define R300_PVS_CNTL_2_PARAM_OFFSET_SHIFT 0
-#       define R300_PVS_CNTL_2_PARAM_COUNT_SHIFT  16
-#define R300_VAP_PVS_CNTL_3               0x22D8
-#       define R300_PVS_CNTL_3_PROGRAM_UNKNOWN_SHIFT 10
-#       define R300_PVS_CNTL_3_PROGRAM_UNKNOWN2_SHIFT 0
+#define R300_VAP_PVS_CONST_CNTL             0x22D4
+#       define R300_PVS_CONST_BASE_OFFSET_SHIFT  0
+#       define R300_PVS_MAX_CONST_ADDR_SHIFT     16
+#define R300_VAP_PVS_CODE_CNTL_1           0x22D8
+#       define R300_PVS_LAST_VTX_SRC_INST_SHIFT  0
 
 /* The entire range from 0x2300 to 0x2AC inclusive seems to be used for
  * immediate vertices
index 298de096fbd8f0a115d955ce555af67583167744..012c8d5e3f4ff37a245ae5665f856771842615f0 100644 (file)
@@ -1849,7 +1849,7 @@ static void r300VapCntl(r300ContextPtr rmesa, GLuint input_count, GLuint output_
 
     /* Flush PVS engine before changing PVS_NUM_SLOTS, PVS_NUM_CNTRLS.
      * See r500 docs 6.5.2 */
-    reg_start(R300_VAP_PVS_WAITIDLE, 0);
+    reg_start(R300_VAP_PVS_STATE_FLUSH_REG, 0);
     e32(0x00000000);
 
     /* avoid division by zero */
@@ -1926,15 +1926,14 @@ static void r300SetupDefaultVertexProgram(r300ContextPtr rmesa)
 
        R300_STATECHANGE(rmesa, pvs);
        rmesa->hw.pvs.cmd[R300_PVS_CNTL_1] =
-           (0 << R300_PVS_CNTL_1_PROGRAM_START_SHIFT) |
-           (inst_count << R300_PVS_CNTL_1_POS_END_SHIFT) |
-           (inst_count << R300_PVS_CNTL_1_PROGRAM_END_SHIFT);
+           (0 << R300_PVS_FIRST_INST_SHIFT) |
+           (inst_count << R300_PVS_XYZW_VALID_INST_SHIFT) |
+           (inst_count << R300_PVS_LAST_INST_SHIFT);
        rmesa->hw.pvs.cmd[R300_PVS_CNTL_2] =
-           (0 << R300_PVS_CNTL_2_PARAM_OFFSET_SHIFT) |
-           (param_count << R300_PVS_CNTL_2_PARAM_COUNT_SHIFT);
+           (0 << R300_PVS_CONST_BASE_OFFSET_SHIFT) |
+           (param_count << R300_PVS_MAX_CONST_ADDR_SHIFT);
        rmesa->hw.pvs.cmd[R300_PVS_CNTL_3] =
-           (inst_count << R300_PVS_CNTL_3_PROGRAM_UNKNOWN_SHIFT) |
-           (inst_count << R300_PVS_CNTL_3_PROGRAM_UNKNOWN2_SHIFT);
+           (inst_count << R300_PVS_LAST_VTX_SRC_INST_SHIFT);
 }
 
 static int bit_count (int x)
@@ -1972,15 +1971,14 @@ static void r300SetupRealVertexProgram(r300ContextPtr rmesa)
 
        R300_STATECHANGE(rmesa, pvs);
        rmesa->hw.pvs.cmd[R300_PVS_CNTL_1] =
-         (0 << R300_PVS_CNTL_1_PROGRAM_START_SHIFT) |
-         (inst_count << R300_PVS_CNTL_1_POS_END_SHIFT) |
-         (inst_count << R300_PVS_CNTL_1_PROGRAM_END_SHIFT);
+         (0 << R300_PVS_FIRST_INST_SHIFT) |
+         (inst_count << R300_PVS_XYZW_VALID_INST_SHIFT) |
+         (inst_count << R300_PVS_LAST_INST_SHIFT);
        rmesa->hw.pvs.cmd[R300_PVS_CNTL_2] =
-         (0 << R300_PVS_CNTL_2_PARAM_OFFSET_SHIFT) |
-         (param_count << R300_PVS_CNTL_2_PARAM_COUNT_SHIFT);
+         (0 << R300_PVS_CONST_BASE_OFFSET_SHIFT) |
+         (param_count << R300_PVS_MAX_CONST_ADDR_SHIFT);
        rmesa->hw.pvs.cmd[R300_PVS_CNTL_3] =
-         (inst_count << R300_PVS_CNTL_3_PROGRAM_UNKNOWN_SHIFT) |
-         (inst_count << R300_PVS_CNTL_3_PROGRAM_UNKNOWN2_SHIFT);
+         (inst_count << R300_PVS_LAST_VTX_SRC_INST_SHIFT);
 }
 
 static void r300SetupVertexProgram(r300ContextPtr rmesa)