r600g: don't run with scissors.
authorDave Airlie <airlied@redhat.com>
Mon, 11 Oct 2010 06:20:56 +0000 (16:20 +1000)
committerDave Airlie <airlied@redhat.com>
Mon, 11 Oct 2010 06:23:23 +0000 (16:23 +1000)
This could probably be done much nicer, I've spent a day chasing
a coherency problem in the kernel, that turned out to be incorrect
scissor setup.

src/gallium/drivers/r600/evergreen_state.c
src/gallium/drivers/r600/r600_state.c

index 323509f6402e108d1fc8b36bf27d60f5f7428c49..99085647a75c3235661daf5a231232aab8827906 100644 (file)
@@ -899,6 +899,51 @@ static void evergreen_set_framebuffer_state(struct pipe_context *ctx,
        r600_pipe_state_add_reg(rstate,
                                R_028254_PA_SC_VPORT_SCISSOR_0_BR, br,
                                0xFFFFFFFF, NULL);
+       r600_pipe_state_add_reg(rstate,
+                               R_028030_PA_SC_SCREEN_SCISSOR_TL, tl,
+                               0xFFFFFFFF, NULL);
+       r600_pipe_state_add_reg(rstate,
+                               R_028034_PA_SC_SCREEN_SCISSOR_BR, br,
+                               0xFFFFFFFF, NULL);
+       r600_pipe_state_add_reg(rstate,
+                               R_028204_PA_SC_WINDOW_SCISSOR_TL, tl,
+                               0xFFFFFFFF, NULL);
+       r600_pipe_state_add_reg(rstate,
+                               R_028208_PA_SC_WINDOW_SCISSOR_BR, br,
+                               0xFFFFFFFF, NULL);
+       r600_pipe_state_add_reg(rstate,
+                               R_028210_PA_SC_CLIPRECT_0_TL, tl,
+                               0xFFFFFFFF, NULL);
+       r600_pipe_state_add_reg(rstate,
+                               R_028214_PA_SC_CLIPRECT_0_BR, br,
+                               0xFFFFFFFF, NULL);
+       r600_pipe_state_add_reg(rstate,
+                               R_028218_PA_SC_CLIPRECT_1_TL, tl,
+                               0xFFFFFFFF, NULL);
+       r600_pipe_state_add_reg(rstate,
+                               R_02821C_PA_SC_CLIPRECT_1_BR, br,
+                               0xFFFFFFFF, NULL);
+       r600_pipe_state_add_reg(rstate,
+                               R_028220_PA_SC_CLIPRECT_2_TL, tl,
+                               0xFFFFFFFF, NULL);
+       r600_pipe_state_add_reg(rstate,
+                               R_028224_PA_SC_CLIPRECT_2_BR, br,
+                               0xFFFFFFFF, NULL);
+       r600_pipe_state_add_reg(rstate,
+                               R_028228_PA_SC_CLIPRECT_3_TL, tl,
+                               0xFFFFFFFF, NULL);
+       r600_pipe_state_add_reg(rstate,
+                               R_02822C_PA_SC_CLIPRECT_3_BR, br,
+                               0xFFFFFFFF, NULL);
+       r600_pipe_state_add_reg(rstate,
+                               R_028200_PA_SC_WINDOW_OFFSET, 0x00000000,
+                               0xFFFFFFFF, NULL);
+       r600_pipe_state_add_reg(rstate,
+                               R_02820C_PA_SC_CLIPRECT_RULE, 0x0000FFFF,
+                               0xFFFFFFFF, NULL);
+       r600_pipe_state_add_reg(rstate,
+                               R_028230_PA_SC_EDGERULE, 0xAAAAAAAA,
+                               0xFFFFFFFF, NULL);
 
        r600_pipe_state_add_reg(rstate, R_028238_CB_TARGET_MASK,
                                0x00000000, target_mask, NULL);
index 29d9d154a2416c75e18f199d53fc3f2982e9bb7b..a2a76cdeb7577b9db050c0f34ffc2241c7f891cf 100644 (file)
@@ -1074,6 +1074,18 @@ static void r600_set_framebuffer_state(struct pipe_context *ctx,
        tl = S_028240_TL_X(0) | S_028240_TL_Y(0) | S_028240_WINDOW_OFFSET_DISABLE(1);
        br = S_028244_BR_X(state->width) | S_028244_BR_Y(state->height);
 
+       r600_pipe_state_add_reg(rstate,
+                               R_028030_PA_SC_SCREEN_SCISSOR_TL, tl,
+                               0xFFFFFFFF, NULL);
+       r600_pipe_state_add_reg(rstate,
+                               R_028034_PA_SC_SCREEN_SCISSOR_BR, br,
+                               0xFFFFFFFF, NULL);
+       r600_pipe_state_add_reg(rstate,
+                               R_028204_PA_SC_WINDOW_SCISSOR_TL, tl,
+                               0xFFFFFFFF, NULL);
+       r600_pipe_state_add_reg(rstate,
+                               R_028208_PA_SC_WINDOW_SCISSOR_BR, br,
+                               0xFFFFFFFF, NULL);
        r600_pipe_state_add_reg(rstate,
                                R_028240_PA_SC_GENERIC_SCISSOR_TL, tl,
                                0xFFFFFFFF, NULL);
@@ -1086,6 +1098,41 @@ static void r600_set_framebuffer_state(struct pipe_context *ctx,
        r600_pipe_state_add_reg(rstate,
                                R_028254_PA_SC_VPORT_SCISSOR_0_BR, br,
                                0xFFFFFFFF, NULL);
+       r600_pipe_state_add_reg(rstate,
+                               R_028210_PA_SC_CLIPRECT_0_TL, tl,
+                               0xFFFFFFFF, NULL);
+       r600_pipe_state_add_reg(rstate,
+                               R_028214_PA_SC_CLIPRECT_0_BR, br,
+                               0xFFFFFFFF, NULL);
+       r600_pipe_state_add_reg(rstate,
+                               R_028218_PA_SC_CLIPRECT_1_TL, tl,
+                               0xFFFFFFFF, NULL);
+       r600_pipe_state_add_reg(rstate,
+                               R_02821C_PA_SC_CLIPRECT_1_BR, br,
+                               0xFFFFFFFF, NULL);
+       r600_pipe_state_add_reg(rstate,
+                               R_028220_PA_SC_CLIPRECT_2_TL, tl,
+                               0xFFFFFFFF, NULL);
+       r600_pipe_state_add_reg(rstate,
+                               R_028224_PA_SC_CLIPRECT_2_BR, br,
+                               0xFFFFFFFF, NULL);
+       r600_pipe_state_add_reg(rstate,
+                               R_028228_PA_SC_CLIPRECT_3_TL, tl,
+                               0xFFFFFFFF, NULL);
+       r600_pipe_state_add_reg(rstate,
+                               R_02822C_PA_SC_CLIPRECT_3_BR, br,
+                               0xFFFFFFFF, NULL);
+       r600_pipe_state_add_reg(rstate,
+                               R_028200_PA_SC_WINDOW_OFFSET, 0x00000000,
+                               0xFFFFFFFF, NULL);
+       r600_pipe_state_add_reg(rstate,
+                               R_02820C_PA_SC_CLIPRECT_RULE, 0x0000FFFF,
+                               0xFFFFFFFF, NULL);
+       if (rctx->family >= CHIP_RV770) {
+               r600_pipe_state_add_reg(rstate,
+                                       R_028230_PA_SC_EDGERULE, 0xAAAAAAAA,
+                                       0xFFFFFFFF, NULL);
+       }
 
        r600_pipe_state_add_reg(rstate, R_0287A0_CB_SHADER_CONTROL,
                                shader_control, 0xFFFFFFFF, NULL);