From 8b2c19da0bf5d6f9c7b78f8cd6f5000bf49862cd Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Tue, 2 Oct 2012 20:50:17 +0100 Subject: [PATCH] gem_cpu_reloc: Fix for running on SNB+ I work with these everyday and I still made a basic mistake. Signed-off-by: Chris Wilson --- tests/gem_cpu_reloc.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/gem_cpu_reloc.c b/tests/gem_cpu_reloc.c index 27784717..00202651 100644 --- a/tests/gem_cpu_reloc.c +++ b/tests/gem_cpu_reloc.c @@ -61,6 +61,8 @@ #include "intel_batchbuffer.h" #include "intel_gpu_tools.h" +static uint32_t use_blt; + static void copy(int fd, uint32_t batch, uint32_t src, uint32_t dst) { struct drm_i915_gem_execbuffer2 execbuf; @@ -92,6 +94,7 @@ static void copy(int fd, uint32_t batch, uint32_t src, uint32_t dst) execbuf.buffers_ptr = (uintptr_t)gem_exec; execbuf.buffer_count = 3; execbuf.batch_len = 4096; + execbuf.flags = use_blt; do_or_die(drmIoctl(fd, DRM_IOCTL_I915_GEM_EXECBUFFER2, &execbuf)); } @@ -136,6 +139,12 @@ int main(int argc, char **argv) int fd, i, count; fd = drm_open_any(); + noop = intel_get_drm_devid(fd); + + use_blt = 0; + if (intel_gen(noop) >= 6) + use_blt = I915_EXEC_BLT; + aper_size = gem_aperture_size(fd); count = aper_size / 4096 * 2;