summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2011-12-27 17:22:30 -0800
committerEric Anholt <[email protected]>2012-01-04 09:51:17 -0800
commit8aa7fa770c4ae7660b37ea9d8f496bd6e62d3df8 (patch)
tree6d2d4748bdd848dd875f17f4b219c9988c06075b /src/mesa/drivers
parent15e309cf84444a8f9ce7f7c86f0a0f391721bc50 (diff)
intel: Fix pitch handling for linear blits.
The new assert in intelEmitCopyBlit() gets angry if we don't align to dwords. Rather than make the assert have a special case for height == 1 on the assumption that the hardware doesn't use it in that case, just supply a correct pitch. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=43214 Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/mesa/drivers')
-rw-r--r--src/mesa/drivers/dri/intel/intel_blit.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/mesa/drivers/dri/intel/intel_blit.c b/src/mesa/drivers/dri/intel/intel_blit.c
index b1a839ac706..1369e63ba55 100644
--- a/src/mesa/drivers/dri/intel/intel_blit.c
+++ b/src/mesa/drivers/dri/intel/intel_blit.c
@@ -491,7 +491,7 @@ intel_emit_linear_blit(struct intel_context *intel,
* we want width to match pitch. Max width is (1 << 15 - 1),
* rounding that down to the nearest DWORD is 1 << 15 - 4
*/
- pitch = MIN2(size, (1 << 15) - 4);
+ pitch = ROUND_DOWN_TO(MIN2(size, (1 << 15) - 1), 4);
height = size / pitch;
ok = intelEmitCopyBlit(intel, 1,
pitch, src_bo, src_offset, I915_TILING_NONE,
@@ -506,11 +506,11 @@ intel_emit_linear_blit(struct intel_context *intel,
dst_offset += pitch * height;
size -= pitch * height;
assert (size < (1 << 15));
- assert ((size & 3) == 0); /* Pitch must be DWORD aligned */
+ pitch = ALIGN(size, 4);
if (size != 0) {
ok = intelEmitCopyBlit(intel, 1,
- size, src_bo, src_offset, I915_TILING_NONE,
- size, dst_bo, dst_offset, I915_TILING_NONE,
+ pitch, src_bo, src_offset, I915_TILING_NONE,
+ pitch, dst_bo, dst_offset, I915_TILING_NONE,
0, 0, /* src x/y */
0, 0, /* dst x/y */
size, 1, /* w, h */