From: Damien Lespiau <damien.lesp...@intel.com>

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

Signed-off-by: Damien Lespiau <damien.lesp...@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 51552b0..cbe3520 100644
--- a/lib/intel_batchbuffer.c
+++ b/lib/intel_batchbuffer.c
@@ -486,12 +486,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;
 }
 
 /**
@@ -519,8 +519,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

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

Reply via email to