summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2016-07-27 23:19:41 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2016-07-27 23:23:12 +0100
commitd199ad8c7e7e016da1cda7e104a2f048d88168ce (patch)
tree7982937a5f6c272bf2cc767f62df30b365b8cadd /tests
parent9315399e6d0f99ef52a2b14385ce0bc1f2fac1b8 (diff)
igt/gem_concurrent_all: Fix up copy sizes
The copy size passed to the CPU copy routines were only for a single row not the full bo. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'tests')
-rw-r--r--tests/gem_concurrent_all.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/tests/gem_concurrent_all.c b/tests/gem_concurrent_all.c
index 34086a405..9b3364905 100644
--- a/tests/gem_concurrent_all.c
+++ b/tests/gem_concurrent_all.c
@@ -81,7 +81,7 @@ struct buffers {
drm_intel_bo **src, **dst;
drm_intel_bo *snoop, *spare;
uint32_t *tmp;
- int width, height, npixels;
+ int width, height, npixels, page_size;
int count, num_buffers;
};
@@ -258,8 +258,7 @@ userptr_create_bo(const struct buffers *b)
void *ptr;
memset(&userptr, 0, sizeof(userptr));
- userptr.user_size = b->npixels * 4;
- userptr.user_size = (userptr.user_size + 4095) & -4096;
+ userptr.user_size = b->page_size;
ptr = mmap(NULL, userptr.user_size,
PROT_READ | PROT_WRITE, MAP_ANON | MAP_SHARED, -1, 0);
@@ -357,8 +356,7 @@ dmabuf_create_bo(const struct buffers *b)
struct dmabuf *dmabuf;
int size;
- size = 4*b->npixels;
- size = (size + 4095) & -4096;
+ size = b->page_size;
memset(&args, 0, sizeof(args));
args.handle = gem_create(fd, size);
@@ -755,7 +753,9 @@ static void buffers_init(struct buffers *b,
b->width = size->width;
b->height = size->height;
b->npixels = size->width * size->height;
- b->tmp = malloc(4*b->npixels);
+ b->page_size = 4*b->npixels;
+ b->page_size = (b->page_size + 4095) & -4096;
+ b->tmp = malloc(b->page_size);
igt_assert(b->tmp);
b->bufmgr = drm_intel_bufmgr_gem_init(_fd, 4096);
@@ -892,7 +892,7 @@ static void blt_copy_bo(struct buffers *b, drm_intel_bo *dst, drm_intel_bo *src)
static void cpu_copy_bo(struct buffers *b, drm_intel_bo *dst, drm_intel_bo *src)
{
- const int size = b->npixels * sizeof(uint32_t);
+ const int size = b->page_size;
void *d, *s;
gem_set_domain(fd, src->handle, I915_GEM_DOMAIN_CPU, 0);
@@ -908,7 +908,7 @@ static void cpu_copy_bo(struct buffers *b, drm_intel_bo *dst, drm_intel_bo *src)
static void gtt_copy_bo(struct buffers *b, drm_intel_bo *dst, drm_intel_bo *src)
{
- const int size = b->npixels * sizeof(uint32_t);
+ const int size = b->page_size;
void *d, *s;
gem_set_domain(fd, src->handle, I915_GEM_DOMAIN_GTT, 0);
@@ -925,7 +925,7 @@ static void gtt_copy_bo(struct buffers *b, drm_intel_bo *dst, drm_intel_bo *src)
static void wc_copy_bo(struct buffers *b, drm_intel_bo *dst, drm_intel_bo *src)
{
- const int size = b->width * sizeof(uint32_t);
+ const int size = b->page_size;
void *d, *s;
gem_set_domain(fd, src->handle, I915_GEM_DOMAIN_GTT, 0);