Mesa (master): r600g: add workaround for buggy hw scissor on eg/cayman.
Dave Airlie
airlied at kemper.freedesktop.org
Wed May 25 01:50:49 UTC 2011
Module: Mesa
Branch: master
Commit: 868c04205c3859a816593595aa513ee603f736ad
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=868c04205c3859a816593595aa513ee603f736ad
Author: Dave Airlie <airlied at redhat.com>
Date: Wed May 25 09:25:03 2011 +1000
r600g: add workaround for buggy hw scissor on eg/cayman.
This is ported from the same fix to the DDX.
Signed-off-by: Dave Airlie <airlied at redhat.com>
---
src/gallium/drivers/r600/evergreen_state.c | 15 ++++++++++++++-
1 files changed, 14 insertions(+), 1 deletions(-)
diff --git a/src/gallium/drivers/r600/evergreen_state.c b/src/gallium/drivers/r600/evergreen_state.c
index dcb2806..adf9366 100644
--- a/src/gallium/drivers/r600/evergreen_state.c
+++ b/src/gallium/drivers/r600/evergreen_state.c
@@ -861,6 +861,7 @@ static void evergreen_set_framebuffer_state(struct pipe_context *ctx,
struct r600_pipe_state *rstate = CALLOC_STRUCT(r600_pipe_state);
u32 shader_mask, tl, br, target_mask;
enum radeon_family family;
+ int scissor_width, scissor_height;
if (rstate == NULL)
return;
@@ -891,8 +892,20 @@ static void evergreen_set_framebuffer_state(struct pipe_context *ctx,
target_mask ^= 0xf << (i * 4);
shader_mask |= 0xf << (i * 4);
}
+ scissor_width = state->width;
+ scissor_height = state->height;
+ /* EG hw workaround */
+ if (scissor_width == 0)
+ scissor_width = 1;
+ if (scissor_height == 0)
+ scissor_height = 1;
+ /* cayman hw workaround */
+ if (family == CHIP_CAYMAN) {
+ if (scissor_width == 1 && scissor_height == 1)
+ scissor_width = 2;
+ }
tl = S_028240_TL_X(0) | S_028240_TL_Y(0);
- br = S_028244_BR_X(state->width) | S_028244_BR_Y(state->height);
+ br = S_028244_BR_X(scissor_width) | S_028244_BR_Y(scissor_height);
r600_pipe_state_add_reg(rstate,
R_028240_PA_SC_GENERIC_SCISSOR_TL, tl,
More information about the mesa-commit
mailing list