diff options
-rw-r--r-- | src/mesa/drivers/dri/i915/intel_blit.c | 12 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i915/intel_buffers.c | 15 |
2 files changed, 26 insertions, 1 deletions
diff --git a/src/mesa/drivers/dri/i915/intel_blit.c b/src/mesa/drivers/dri/i915/intel_blit.c index 6c0c666f559b..aa7a095c84f1 100644 --- a/src/mesa/drivers/dri/i915/intel_blit.c +++ b/src/mesa/drivers/dri/i915/intel_blit.c @@ -323,6 +323,18 @@ void intelClearWithBlit(GLcontext *ctx, GLbitfield mask, GLboolean all, drm_clip_rect_t clear; int i; + /* Refresh the cx/y/w/h values as they may have been invalidated + * by a new window position or size picked up when we did + * LOCK_HARDWARE above. The values passed by mesa are not + * reliable. + */ + { + cx = ctx->DrawBuffer->_Xmin; + cy = ctx->DrawBuffer->_Ymin; + ch = ctx->DrawBuffer->_Ymax - ctx->DrawBuffer->_Ymin; + cw = ctx->DrawBuffer->_Xmax - ctx->DrawBuffer->_Xmin; + } + if (intel->ctx.DrawBuffer->Name == 0) { /* clearing a window */ diff --git a/src/mesa/drivers/dri/i915/intel_buffers.c b/src/mesa/drivers/dri/i915/intel_buffers.c index 85ac41807904..d0347a543e60 100644 --- a/src/mesa/drivers/dri/i915/intel_buffers.c +++ b/src/mesa/drivers/dri/i915/intel_buffers.c @@ -282,7 +282,20 @@ static void intelClearWithTris(struct intel_context *intel, intel->vtbl.install_meta_state(intel); - /* note: regardless of 'all', cx, cy, cw, ch are correct */ + + /* Refresh the cx/y/w/h values as they may have been invalidated + * by a new window position or size picked up when we did + * LOCK_HARDWARE above. The values passed by mesa are not + * reliable. + */ + { + cx = ctx->DrawBuffer->_Xmin; + cy = ctx->DrawBuffer->_Ymin; + ch = ctx->DrawBuffer->_Ymax - ctx->DrawBuffer->_Ymin; + cw = ctx->DrawBuffer->_Xmax - ctx->DrawBuffer->_Xmin; + } + + /* note: regardless of 'all', cx, cy, cw, ch are now correct */ clear.x1 = cx; clear.y1 = cy; clear.x2 = cx + cw; |