summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlban Browaeys <prahal@yahoo.com>2012-02-02 19:20:22 +0100
committerIan Romanick <ian.d.romanick@intel.com>2012-05-17 22:13:49 -0700
commitc9aa4607c54affcec38d814cd9abc9b9056a5d47 (patch)
treede996e8c6f99f13034a66bc35ddc2d5f23561508
parenta164f23d093022cd2435a0bb781792998986a1b4 (diff)
dri/i915: Fix off-by-one in i830 clip region size.
The hardware, like i915, uses an inclusive bounds on min and max for the drawing rectangle, but we were providing a number for exclusive. The number of bits used by the hardware only covers this value going up to the maximum size, so when we programmed 2048 as the maximum inclusive X, it saw a maximum X of 0 and clipped all rendering. This caused rendering failures in gnome-shell. Fixes piglit fbo-maxsize. v2: dropped changes to the blitter, which does use an exclusive x2, y2. [change by anholt] Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=45558 Reviewed-by: Eric Anholt <eric@anholt.net> NOTE: This is a candidate for release branches. (cherry picked from commit 7d13a6e64bf88566875a8f68e0aac9b937e30feb)
-rw-r--r--src/mesa/drivers/dri/i915/i830_vtbl.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/mesa/drivers/dri/i915/i830_vtbl.c b/src/mesa/drivers/dri/i915/i830_vtbl.c
index 8acbc87186..28e95d97cc 100644
--- a/src/mesa/drivers/dri/i915/i830_vtbl.c
+++ b/src/mesa/drivers/dri/i915/i830_vtbl.c
@@ -692,8 +692,8 @@ i830_set_draw_region(struct intel_context *intel,
state->Buffer[I830_DESTREG_DRAWRECT1] = 0;
state->Buffer[I830_DESTREG_DRAWRECT2] = (draw_y << 16) | draw_x;
state->Buffer[I830_DESTREG_DRAWRECT3] =
- ((ctx->DrawBuffer->Width + draw_x) & 0xffff) |
- ((ctx->DrawBuffer->Height + draw_y) << 16);
+ ((ctx->DrawBuffer->Width + draw_x - 1) & 0xffff) |
+ ((ctx->DrawBuffer->Height + draw_y - 1) << 16);
state->Buffer[I830_DESTREG_DRAWRECT4] = (draw_y << 16) | draw_x;
state->Buffer[I830_DESTREG_DRAWRECT5] = MI_NOOP;