The drawing rectangle is given in *inclusive* pixel values, so the range
is only [0,2047]. Hence when rendering to a 2048 wide target, such as an
extended desktop, we would issue an illegal instruction zeroing the draw
area.
Fixes:
Bug 27408: Primary and Secondary display blanks in extended
desktop mode with Compiz enabled
https://bugs.freedesktop.org/show_bug.cgi?id=27408
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
state->Buffer[I915_DESTREG_DRAWRECT2] = 0;
state->Buffer[I915_DESTREG_DRAWRECT3] = (draw_y << 16) | draw_x;
state->Buffer[I915_DESTREG_DRAWRECT4] =
- ((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[I915_DESTREG_DRAWRECT5] = (draw_y << 16) | draw_x;
I915_STATECHANGE(i915, I915_UPLOAD_BUFFERS);