summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPauli Nieminen <[email protected]>2009-08-28 20:41:15 +0300
committerPauli Nieminen <[email protected]>2009-08-28 22:05:15 +0300
commit4f644e58d455cbc70fe856576321f868e36b6346 (patch)
treeb137f3b9621d228dea21a1232739e864db7f85c8
parentdbe58d7f9f48ba57d5c56265bc5a6dce0dfa11b0 (diff)
radeon: Fix scissors for dri1.
DRI1 has to set scissors in framebuffer coordinates.
-rw-r--r--src/mesa/drivers/dri/radeon/radeon_common.c25
1 files changed, 21 insertions, 4 deletions
diff --git a/src/mesa/drivers/dri/radeon/radeon_common.c b/src/mesa/drivers/dri/radeon/radeon_common.c
index e14a4190453..ee0cbf65ca1 100644
--- a/src/mesa/drivers/dri/radeon/radeon_common.c
+++ b/src/mesa/drivers/dri/radeon/radeon_common.c
@@ -234,9 +234,13 @@ void radeonUpdateScissor( GLcontext *ctx )
GLint x = ctx->Scissor.X, y = ctx->Scissor.Y;
GLsizei w = ctx->Scissor.Width, h = ctx->Scissor.Height;
int x1, y1, x2, y2;
+ int min_x, min_y, max_x, max_y;
if (!ctx->DrawBuffer)
return;
+ min_x = min_y = 0;
+ max_x = ctx->DrawBuffer->Width - 1;
+ max_y = ctx->DrawBuffer->Height - 1;
if ( !ctx->DrawBuffer->Name ) {
x1 = x;
@@ -250,11 +254,24 @@ void radeonUpdateScissor( GLcontext *ctx )
y2 = y + h - 1;
}
+ if (!rmesa->radeonScreen->kernel_mm) {
+ /* Fix scissors for dri 1 */
+
+ __DRIdrawablePrivate *dPriv = radeon_get_drawable(rmesa);
+ x1 += dPriv->x;
+ x2 += dPriv->x + 1;
+ min_x += dPriv->x;
+ max_x += dPriv->x + 1;
+ y1 += dPriv->y;
+ y2 += dPriv->y + 1;
+ min_y += dPriv->y;
+ max_y += dPriv->y + 1;
+ }
- rmesa->state.scissor.rect.x1 = CLAMP(x1, 0, ctx->DrawBuffer->Width - 1);
- rmesa->state.scissor.rect.y1 = CLAMP(y1, 0, ctx->DrawBuffer->Height - 1);
- rmesa->state.scissor.rect.x2 = CLAMP(x2, 0, ctx->DrawBuffer->Width - 1);
- rmesa->state.scissor.rect.y2 = CLAMP(y2, 0, ctx->DrawBuffer->Height - 1);
+ rmesa->state.scissor.rect.x1 = CLAMP(x1, min_x, max_x);
+ rmesa->state.scissor.rect.y1 = CLAMP(y1, min_y, max_y);
+ rmesa->state.scissor.rect.x2 = CLAMP(x2, min_x, max_x);
+ rmesa->state.scissor.rect.y2 = CLAMP(y2, min_y, max_y);
radeonRecalcScissorRects( rmesa );
}