From 130221b3b5be3ad03bd0ac2b12d8b009eaf540d4 Mon Sep 17 00:00:00 2001 From: Damien Lespiau Date: Tue, 3 Mar 2015 14:10:58 +0000 Subject: lib: Don't give a struct igt_buf * to fast_copy_pitch() So we can use this function in a "raw" (ie without igt_buf) version. Signed-off-by: Damien Lespiau --- lib/intel_batchbuffer.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'lib/intel_batchbuffer.c') diff --git a/lib/intel_batchbuffer.c b/lib/intel_batchbuffer.c index f26bee15..2d1a23fa 100644 --- a/lib/intel_batchbuffer.c +++ b/lib/intel_batchbuffer.c @@ -461,12 +461,12 @@ unsigned igt_buf_height(struct igt_buf *buf) * pitches are in bytes if the surfaces are linear, number of dwords * otherwise */ -static uint32_t fast_copy_pitch(struct igt_buf *buf) +static uint32_t fast_copy_pitch(unsigned int stride, enum i915_tiling tiling) { - if (buf->tiling != I915_TILING_NONE) - return buf->stride / 4; + if (tiling != I915_TILING_NONE) + return stride / 4; else - return buf->stride; + return stride; } /** @@ -494,8 +494,8 @@ void igt_blitter_fast_copy(struct intel_batchbuffer *batch, uint32_t src_pitch, dst_pitch; uint32_t dword0 = 0, dword1 = 0; - src_pitch = fast_copy_pitch(src); - dst_pitch = fast_copy_pitch(dst); + src_pitch = fast_copy_pitch(src->stride, src->tiling); + dst_pitch = fast_copy_pitch(dst->stride, src->tiling); #define CHECK_RANGE(x) ((x) >= 0 && (x) < (1 << 15)) assert(CHECK_RANGE(src_x) && CHECK_RANGE(src_y) && -- cgit v1.2.3