Change default RS settings so that glxgears will display something..
authorVladimir Dergachev <volodya@freedesktop.org>
Thu, 30 Dec 2004 07:50:15 +0000 (07:50 +0000)
committerVladimir Dergachev <volodya@freedesktop.org>
Thu, 30 Dec 2004 07:50:15 +0000 (07:50 +0000)
src/mesa/drivers/dri/r300/r300_cmdbuf.c
src/mesa/drivers/dri/r300/r300_context.h
src/mesa/drivers/dri/r300/r300_state.c

index e668e97da9af4c712b0929104be608e843f36d2e..841ad4ff4320b03bf5c1da6c4cc6e83293ad8e2f 100644 (file)
@@ -382,6 +382,8 @@ void r300InitCmdBuf(r300ContextPtr r300)
                r300->hw.unk4E50.cmd[0] = cmducs(0x4E50, 9);
        ALLOC_STATE( unk4E88, always, 2, "unk4E88", 0 );
                r300->hw.unk4E88.cmd[0] = cmducs(0x4E88, 1);
+       ALLOC_STATE( unk4EA0, always, 3, "unk4EA0 R350 only", 0 );
+               r300->hw.unk4EA0.cmd[0] = cmducs(0x4EA0, 2);
        ALLOC_STATE( zc, always, R300_ZC_CMDSIZE, "zc", 0 );
                r300->hw.zc.cmd[R300_ZC_CMD_0] = cmducs(R300_RB3D_ZCNTL_0, 2);
        ALLOC_STATE( unk4F08, always, 2, "unk4F08", 0 );
@@ -461,6 +463,7 @@ void r300InitCmdBuf(r300ContextPtr r300)
        insert_at_tail(&r300->hw.atomlist, &r300->hw.cb);
        insert_at_tail(&r300->hw.atomlist, &r300->hw.unk4E50);
        insert_at_tail(&r300->hw.atomlist, &r300->hw.unk4E88);
+       insert_at_tail(&r300->hw.atomlist, &r300->hw.unk4EA0);
        insert_at_tail(&r300->hw.atomlist, &r300->hw.zc);
        insert_at_tail(&r300->hw.atomlist, &r300->hw.unk4F08);
        insert_at_tail(&r300->hw.atomlist, &r300->hw.unk4F10);
index a548789fb2e8b9b2c098101bf698a7a6cf2da33d..6333f31a8cff318a388b41b2e2e5f7575ee153c5 100644 (file)
@@ -290,6 +290,7 @@ struct r300_hw_state {
        struct r300_state_atom cb;      /* colorbuffer (4E28) */
        struct r300_state_atom unk4E50; /* (4E50) */
        struct r300_state_atom unk4E88; /* (4E88) */
+       struct r300_state_atom unk4EA0; /* (4E88) I saw it only written on RV350 hardware..  */
        struct r300_state_atom zc;      /* z control (4F00) */
        struct r300_state_atom unk4F08; /* (4F08) */
        struct r300_state_atom unk4F10; /* (4F10) */
index f76056d6cb0bb0eef76745274edf60b611f6ac14..8724c9b9bf065f74562a25c16022101953223f66 100644 (file)
@@ -421,15 +421,20 @@ void r300ResetHwState(r300ContextPtr r300)
        r300->hw.unk42C0.cmd[1] = 0x4B7FFFFF;
        r300->hw.unk42C0.cmd[2] = 0x00000000;
 
-       r300->hw.rc.cmd[1] = R300_RS_CNTL_0_UNKNOWN_7;
+       /* The second constant is needed to get glxgears display anything .. */
+       r300->hw.rc.cmd[1] = R300_RS_CNTL_0_UNKNOWN_7 | R300_RS_CNTL_0_UNKNOWN_18;
        r300->hw.rc.cmd[2] = 0;
 
        for(i = 1; i <= 8; ++i)
-               r300->hw.ri.cmd[i] = 0;
+               r300->hw.ri.cmd[i] = 0x00d10000;
+       r300->hw.ri.cmd[R300_RI_INTERP_1] |= R300_RS_INTERP_1_UNKNOWN;
+       r300->hw.ri.cmd[R300_RI_INTERP_2] |= R300_RS_INTERP_2_UNKNOWN;
+       r300->hw.ri.cmd[R300_RI_INTERP_3] |= R300_RS_INTERP_3_UNKNOWN;
 
        ((drm_r300_cmd_header_t*)r300->hw.rr.cmd)->unchecked_state.count = 1;
        for(i = 1; i <= 8; ++i)
-               r300->hw.rr.cmd[1] = 0;
+               r300->hw.rr.cmd[i] = 0;
+       r300->hw.rr.cmd[R300_RR_ROUTE_0] = 0x4000;
 
        r300->hw.unk43A4.cmd[1] = 0x0000001C;
        r300->hw.unk43A4.cmd[2] = 0x2DA49525;
@@ -495,6 +500,9 @@ void r300ResetHwState(r300ContextPtr r300)
 
        r300->hw.unk4E88.cmd[1] = 0;
 
+       r300->hw.unk4EA0.cmd[1] = 0x00000000;
+       r300->hw.unk4EA0.cmd[2] = 0xffffffff;
+
        r300->hw.unk4F08.cmd[1] = 0x00FFFF00;
 
        r300->hw.unk4F10.cmd[1] = 0x00000002; // depthbuffer format?