Module: Mesa
Branch: master
Commit: 952222e4bfa957ec386e85909097c178829b6fd1
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=952222e4bfa957ec386e85909097c178829b6fd1

Author: Marek Olšák <mar...@gmail.com>
Date:   Tue Mar  1 19:02:29 2011 +0100

r300g: initialize some r500 PS3 regs

---

 src/gallium/drivers/r300/r300_context.c |   15 ++++++++++++---
 src/gallium/drivers/r300/r300_context.h |    4 ++--
 src/gallium/drivers/r300/r300_reg.h     |    4 ++++
 3 files changed, 18 insertions(+), 5 deletions(-)

diff --git a/src/gallium/drivers/r300/r300_context.c 
b/src/gallium/drivers/r300/r300_context.c
index db24901..f37e3ea 100644
--- a/src/gallium/drivers/r300/r300_context.c
+++ b/src/gallium/drivers/r300/r300_context.c
@@ -202,11 +202,11 @@ static boolean r300_setup_atoms(struct r300_context* r300)
     /* SC. */
     R300_INIT_ATOM(scissor_state, 3);
     /* GB, FG, GA, SU, SC, RB3D. */
-    R300_INIT_ATOM(invariant_state, 18 + (is_rv350 ? 4 : 0));
+    R300_INIT_ATOM(invariant_state, 18 + (is_rv350 ? 4 : 0) + (is_r500 ? 4 : 
0));
     /* VAP. */
     R300_INIT_ATOM(viewport_state, 9);
     R300_INIT_ATOM(pvs_flush, 2);
-    R300_INIT_ATOM(vap_invariant_state, 9);
+    R300_INIT_ATOM(vap_invariant_state, is_r500 ? 11 : 9);
     R300_INIT_ATOM(vertex_stream_state, 0);
     R300_INIT_ATOM(vs_state, 0);
     R300_INIT_ATOM(vs_constants, 0);
@@ -330,7 +330,7 @@ static void r300_init_states(struct pipe_context *pipe)
 
     /* Initialize the VAP invariant state. */
     {
-        BEGIN_CB(vap_invariant->cb, 9);
+        BEGIN_CB(vap_invariant->cb, r300->vap_invariant_state.size);
         OUT_CB_REG(VAP_PVS_VTX_TIMEOUT_REG, 0xffff);
         OUT_CB_REG_SEQ(R300_VAP_GB_VERT_CLIP_ADJ, 4);
         OUT_CB_32F(1.0);
@@ -338,6 +338,10 @@ static void r300_init_states(struct pipe_context *pipe)
         OUT_CB_32F(1.0);
         OUT_CB_32F(1.0);
         OUT_CB_REG(R300_VAP_PSC_SGN_NORM_CNTL, R300_SGN_NORM_NO_ZERO);
+
+        if (r300->screen->caps.is_r500) {
+            OUT_CB_REG(R500_VAP_TEX_TO_COLOR_CNTL, 0);
+        }
         END_CB;
     }
 
@@ -358,6 +362,11 @@ static void r300_init_states(struct pipe_context *pipe)
             OUT_CB_REG(R500_RB3D_DISCARD_SRC_PIXEL_LTE_THRESHOLD, 0x01010101);
             OUT_CB_REG(R500_RB3D_DISCARD_SRC_PIXEL_GTE_THRESHOLD, 0xFEFEFEFE);
         }
+
+        if (r300->screen->caps.is_r500) {
+            OUT_CB_REG(R500_GA_COLOR_CONTROL_PS3, 0);
+            OUT_CB_REG(R500_SU_TEX_WRAP_PS3, 0);
+        }
         END_CB;
     }
 
diff --git a/src/gallium/drivers/r300/r300_context.h 
b/src/gallium/drivers/r300/r300_context.h
index 64b06ca..6f2aab6 100644
--- a/src/gallium/drivers/r300/r300_context.h
+++ b/src/gallium/drivers/r300/r300_context.h
@@ -219,11 +219,11 @@ struct r300_vertex_stream_state {
 };
 
 struct r300_invariant_state {
-    uint32_t cb[22];
+    uint32_t cb[26];
 };
 
 struct r300_vap_invariant_state {
-    uint32_t cb[9];
+    uint32_t cb[11];
 };
 
 struct r300_viewport_state {
diff --git a/src/gallium/drivers/r300/r300_reg.h 
b/src/gallium/drivers/r300/r300_reg.h
index 1d93dab..bb30b1a 100644
--- a/src/gallium/drivers/r300/r300_reg.h
+++ b/src/gallium/drivers/r300/r300_reg.h
@@ -467,6 +467,8 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
  *
  * See bug #9871. 
http://bugs.freedesktop.org/attachment.cgi?id=10672&action=view
  */
+#define R500_VAP_TEX_TO_COLOR_CNTL             0x2218
+
 #define R300_VAP_CLIP_CNTL                       0x221C
 #       define R300_VAP_UCP_ENABLE_0             (1 << 0)
 #       define R300_VAP_UCP_ENABLE_1             (1 << 1)
@@ -857,6 +859,8 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
 #      define R500_TX_DIRECTION_HORIZONTAL      (0<<27)
 #      define R500_TX_DIRECTION_VERITCAL        (1<<27)
 
+#define R500_SU_TEX_WRAP_PS3               0x4114
+
 /* S Texture Coordinate of Vertex 0 for Point texture stuffing (LLC) */
 #define R300_GA_POINT_S0                              0x4200
 

_______________________________________________
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to