summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/i915/i915_blit.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/drivers/i915/i915_blit.c')
-rw-r--r--src/gallium/drivers/i915/i915_blit.c23
1 files changed, 19 insertions, 4 deletions
diff --git a/src/gallium/drivers/i915/i915_blit.c b/src/gallium/drivers/i915/i915_blit.c
index 97c2566515..baaed3767f 100644
--- a/src/gallium/drivers/i915/i915_blit.c
+++ b/src/gallium/drivers/i915/i915_blit.c
@@ -49,6 +49,11 @@ i915_fill_blit(struct i915_context *i915,
I915_DBG(DBG_BLIT, "%s dst:buf(%p)/%d+%d %d,%d sz:%dx%d\n",
__FUNCTION__, dst_buffer, dst_pitch, dst_offset, x, y, w, h);
+ if(!i915_winsys_validate_buffers(i915->batch, &dst_buffer, 1)) {
+ FLUSH_BATCH(NULL);
+ assert(i915_winsys_validate_buffers(i915->batch, &dst_buffer, 1));
+ }
+
switch (cpp) {
case 1:
case 2:
@@ -66,9 +71,9 @@ i915_fill_blit(struct i915_context *i915,
return;
}
- if (!BEGIN_BATCH(6, 1)) {
+ if (!BEGIN_BATCH(6)) {
FLUSH_BATCH(NULL);
- assert(BEGIN_BATCH(6, 1));
+ assert(BEGIN_BATCH(6));
}
OUT_BATCH(CMD);
OUT_BATCH(BR13);
@@ -76,6 +81,8 @@ i915_fill_blit(struct i915_context *i915,
OUT_BATCH(((y + h) << 16) | (x + w));
OUT_RELOC_FENCED(dst_buffer, I915_USAGE_2D_TARGET, dst_offset);
OUT_BATCH(color);
+
+ i915_set_flush_dirty(i915, I915_FLUSH_CACHE);
}
void
@@ -94,6 +101,7 @@ i915_copy_blit(struct i915_context *i915,
unsigned CMD, BR13;
int dst_y2 = dst_y + h;
int dst_x2 = dst_x + w;
+ struct i915_winsys_buffer *buffers[2] = {src_buffer, dst_buffer};
I915_DBG(DBG_BLIT,
@@ -102,6 +110,11 @@ i915_copy_blit(struct i915_context *i915,
src_buffer, src_pitch, src_offset, src_x, src_y,
dst_buffer, dst_pitch, dst_offset, dst_x, dst_y, w, h);
+ if(!i915_winsys_validate_buffers(i915->batch, buffers, 2)) {
+ FLUSH_BATCH(NULL);
+ assert(i915_winsys_validate_buffers(i915->batch, buffers, 2));
+ }
+
switch (cpp) {
case 1:
case 2:
@@ -130,9 +143,9 @@ i915_copy_blit(struct i915_context *i915,
*/
assert (dst_pitch > 0 && src_pitch > 0);
- if (!BEGIN_BATCH(8, 2)) {
+ if (!BEGIN_BATCH(8)) {
FLUSH_BATCH(NULL);
- assert(BEGIN_BATCH(8, 2));
+ assert(BEGIN_BATCH(8));
}
OUT_BATCH(CMD);
OUT_BATCH(BR13);
@@ -142,4 +155,6 @@ i915_copy_blit(struct i915_context *i915,
OUT_BATCH((src_y << 16) | src_x);
OUT_BATCH(((int) src_pitch & 0xffff));
OUT_RELOC_FENCED(src_buffer, I915_USAGE_2D_SOURCE, src_offset);
+
+ i915_set_flush_dirty(i915, I915_FLUSH_CACHE);
}