[Intel-gfx] [PATCH i-g-t 05/13] lib: Don't give a struct igt_buf * to fast_copy_pitch()

Tvrtko Ursulin tvrtko.ursulin at linux.intel.com
Tue Mar 3 06:10:58 PST 2015


From: Damien Lespiau <damien.lespiau at intel.com>

So we can use this function in a "raw" (ie without igt_buf) version.

Signed-off-by: Damien Lespiau <damien.lespiau at intel.com>
---
 lib/intel_batchbuffer.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/lib/intel_batchbuffer.c b/lib/intel_batchbuffer.c
index 9b8ae0d..f964d12 100644
--- a/lib/intel_batchbuffer.c
+++ b/lib/intel_batchbuffer.c
@@ -487,12 +487,12 @@ void igt_buf_write_to_png(struct igt_buf *buf, const char *filename)
  * 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;
 }
 
 /**
@@ -520,8 +520,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) &&
-- 
2.3.0



More information about the Intel-gfx mailing list