diff options
author | Zbigniew Kempczyński <zbigniew.kempczynski@intel.com> | 2020-07-06 15:08:42 +0200 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2020-07-06 18:35:17 +0100 |
commit | 41e2dcb9bfd83f9a04dfb78073d25bc0d868a896 (patch) | |
tree | efad9d19ae0ad43a6cec3af3766405f40a5b774f /tests | |
parent | a4d83701bd493a43747780321d404dc2163378df (diff) |
lib/bufops: add surface array to cover ccs pgtable
Rendercopy for gen12+ requires additional aux pgtable. Alter bufops
and tests to use surface[] and ccs[] instead aux. This step is
required to properly rewrite handling aux pgtable to use with
intel_bb.
Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/i915/api_intel_bb.c | 58 | ||||
-rw-r--r-- | tests/i915/gem_gpgpu_fill.c | 14 | ||||
-rw-r--r-- | tests/i915/gem_media_fill.c | 12 | ||||
-rw-r--r-- | tests/i915/gem_media_vme.c | 2 | ||||
-rw-r--r-- | tests/i915/i915_pm_sseu.c | 9 |
5 files changed, 48 insertions, 47 deletions
diff --git a/tests/i915/api_intel_bb.c b/tests/i915/api_intel_bb.c index d16b558c5..6967fc5d0 100644 --- a/tests/i915/api_intel_bb.c +++ b/tests/i915/api_intel_bb.c @@ -74,13 +74,13 @@ static void fill_buf(struct intel_buf *buf, uint8_t color) int i915 = buf_ops_get_fd(buf->bops); int i; - ptr = gem_mmap__device_coherent(i915, buf->handle, 0, buf->size, - PROT_WRITE); + ptr = gem_mmap__device_coherent(i915, buf->handle, 0, + buf->surface[0].size, PROT_WRITE); - for (i = 0; i < buf->size; i++) + for (i = 0; i < buf->surface[0].size; i++) ptr[i] = color; - munmap(ptr, buf->size); + munmap(ptr, buf->surface[0].size); } static void check_buf(struct intel_buf *buf, uint8_t color) @@ -89,13 +89,13 @@ static void check_buf(struct intel_buf *buf, uint8_t color) int i915 = buf_ops_get_fd(buf->bops); int i; - ptr = gem_mmap__device_coherent(i915, buf->handle, 0, buf->size, - PROT_READ); + ptr = gem_mmap__device_coherent(i915, buf->handle, 0, + buf->surface[0].size, PROT_READ); - for (i = 0; i < buf->size; i++) + for (i = 0; i < buf->surface[0].size; i++) igt_assert(ptr[i] == color); - munmap(ptr, buf->size); + munmap(ptr, buf->surface[0].size); } @@ -118,12 +118,12 @@ static void print_buf(struct intel_buf *buf, const char *name) uint8_t *ptr; int i915 = buf_ops_get_fd(buf->bops); - ptr = gem_mmap__device_coherent(i915, buf->handle, 0, buf->size, - PROT_READ); + ptr = gem_mmap__device_coherent(i915, buf->handle, 0, + buf->surface[0].size, PROT_READ); igt_debug("[%s] Buf handle: %d, size: %d, v: 0x%02x, presumed_addr: %p\n", - name, buf->handle, buf->size, ptr[0], + name, buf->handle, buf->surface[0].size, ptr[0], from_user_pointer(buf->addr.offset)); - munmap(ptr, buf->size); + munmap(ptr, buf->surface[0].size); } static void simple_bb(struct buf_ops *bops, bool use_context) @@ -194,7 +194,7 @@ static void __emit_blit(struct intel_bb *ibb, XY_SRC_COPY_BLT_WRITE_ALPHA | XY_SRC_COPY_BLT_WRITE_RGB | (6 + 2 * has_64b_reloc)); - intel_bb_out(ibb, 3 << 24 | 0xcc << 16 | dst->stride); + intel_bb_out(ibb, 3 << 24 | 0xcc << 16 | dst->surface[0].stride); intel_bb_out(ibb, 0); intel_bb_out(ibb, intel_buf_height(dst) << 16 | intel_buf_width(dst)); intel_bb_emit_reloc_fenced(ibb, dst->handle, @@ -202,7 +202,7 @@ static void __emit_blit(struct intel_bb *ibb, I915_GEM_DOMAIN_RENDER, 0, dst->addr.offset); intel_bb_out(ibb, 0); - intel_bb_out(ibb, src->stride); + intel_bb_out(ibb, src->surface[0].stride); intel_bb_emit_reloc_fenced(ibb, src->handle, I915_GEM_DOMAIN_RENDER, 0, 0, src->addr.offset); @@ -351,13 +351,13 @@ static void scratch_buf_draw_pattern(struct buf_ops *bops, cairo_t *cr; void *linear; - linear = alloc_aligned(buf->size); + linear = alloc_aligned(buf->surface[0].size); surface = cairo_image_surface_create_for_data(linear, CAIRO_FORMAT_RGB24, intel_buf_width(buf), intel_buf_height(buf), - buf->stride); + buf->surface[0].stride); cr = cairo_create(surface); @@ -435,21 +435,21 @@ static int compare_bufs(struct intel_buf *buf1, struct intel_buf *buf2, void *ptr1, *ptr2; int fd1, fd2, ret; - igt_assert(buf1->size == buf2->size); + igt_assert(buf1->surface[0].size == buf2->surface[0].size); fd1 = buf_ops_get_fd(buf1->bops); fd2 = buf_ops_get_fd(buf2->bops); - ptr1 = gem_mmap__device_coherent(fd1, buf1->handle, 0, buf1->size, - PROT_READ); - ptr2 = gem_mmap__device_coherent(fd2, buf2->handle, 0, buf2->size, - PROT_READ); - ret = memcmp(ptr1, ptr2, buf1->size); + ptr1 = gem_mmap__device_coherent(fd1, buf1->handle, 0, + buf1->surface[0].size, PROT_READ); + ptr2 = gem_mmap__device_coherent(fd2, buf2->handle, 0, + buf2->surface[0].size, PROT_READ); + ret = memcmp(ptr1, ptr2, buf1->surface[0].size); if (detail_compare) - ret = compare_detail(ptr1, ptr2, buf1->size); + ret = compare_detail(ptr1, ptr2, buf1->surface[0].size); - munmap(ptr1, buf1->size); - munmap(ptr2, buf2->size); + munmap(ptr1, buf1->surface[0].size); + munmap(ptr2, buf2->surface[0].size); return ret; } @@ -484,15 +484,15 @@ static int __do_intel_bb_blit(struct buf_ops *bops, uint32_t tiling) 0, 0, width, height, 0); intel_bb_blt_copy(ibb, - &src, 0, 0, src.stride, - &dst, 0, 0, dst.stride, + &src, 0, 0, src.surface[0].stride, + &dst, 0, 0, dst.surface[0].stride, intel_buf_width(&dst), intel_buf_height(&dst), dst.bpp); intel_bb_blt_copy(ibb, - &dst, 0, 0, dst.stride, - &final, 0, 0, final.stride, + &dst, 0, 0, dst.surface[0].stride, + &final, 0, 0, final.surface[0].stride, intel_buf_width(&dst), intel_buf_height(&dst), dst.bpp); diff --git a/tests/i915/gem_gpgpu_fill.c b/tests/i915/gem_gpgpu_fill.c index e1d3a2881..c605629f0 100644 --- a/tests/i915/gem_gpgpu_fill.c +++ b/tests/i915/gem_gpgpu_fill.c @@ -78,13 +78,13 @@ create_buf(data_t *data, int width, int height, uint8_t color) intel_buf_init(data->bops, buf, width/4, height, 32, 0, I915_TILING_NONE, 0); - ptr = gem_mmap__cpu_coherent(data->drm_fd, - buf->handle, 0, buf->size, PROT_WRITE); + ptr = gem_mmap__cpu_coherent(data->drm_fd, buf->handle, 0, + buf->surface[0].size, PROT_WRITE); - for (i = 0; i < buf->size; i++) + for (i = 0; i < buf->surface[0].size; i++) ptr[i] = color; - munmap(ptr, buf->size); + munmap(ptr, buf->surface[0].size); return buf; } @@ -106,8 +106,8 @@ static void gpgpu_fill(data_t *data, igt_fillfunc_t fill) int i, j; buf = create_buf(data, WIDTH, HEIGHT, COLOR_C4); - ptr = gem_mmap__device_coherent(data->drm_fd, buf->handle, - 0, buf->size, PROT_READ); + ptr = gem_mmap__device_coherent(data->drm_fd, buf->handle, 0, + buf->surface[0].size, PROT_READ); for (i = 0; i < WIDTH; i++) for (j = 0; j < HEIGHT; j++) buf_check(ptr, i, j, COLOR_C4); @@ -121,7 +121,7 @@ static void gpgpu_fill(data_t *data, igt_fillfunc_t fill) else buf_check(ptr, i, j, COLOR_C4); - munmap(ptr, buf->size); + munmap(ptr, buf->surface[0].size); } igt_simple_main diff --git a/tests/i915/gem_media_fill.c b/tests/i915/gem_media_fill.c index 934a9402b..24d17fabb 100644 --- a/tests/i915/gem_media_fill.c +++ b/tests/i915/gem_media_fill.c @@ -80,13 +80,13 @@ create_buf(data_t *data, int width, int height, uint8_t color) intel_buf_init(data->bops, buf, width/4, height, 32, 0, I915_TILING_NONE, 0); - ptr = gem_mmap__cpu_coherent(data->drm_fd, - buf->handle, 0, buf->size, PROT_WRITE); + ptr = gem_mmap__cpu_coherent(data->drm_fd, buf->handle, 0, + buf->surface[0].size, PROT_WRITE); - for (i = 0; i < buf->size; i++) + for (i = 0; i < buf->surface[0].size; i++) ptr[i] = color; - munmap(ptr, buf->size); + munmap(ptr, buf->surface[0].size); return buf; } @@ -109,7 +109,7 @@ static void media_fill(data_t *data, igt_fillfunc_t fill) buf = create_buf(data, WIDTH, HEIGHT, COLOR_C4); ptr = gem_mmap__device_coherent(data->drm_fd, buf->handle, - 0, buf->size, PROT_READ); + 0, buf->surface[0].size, PROT_READ); for (i = 0; i < WIDTH; i++) for (j = 0; j < HEIGHT; j++) buf_check(ptr, i, j, COLOR_C4); @@ -123,7 +123,7 @@ static void media_fill(data_t *data, igt_fillfunc_t fill) else buf_check(ptr, i, j, COLOR_C4); - munmap(ptr, buf->size); + munmap(ptr, buf->surface[0].size); } igt_simple_main diff --git a/tests/i915/gem_media_vme.c b/tests/i915/gem_media_vme.c index 391a76d9a..3ea70386c 100644 --- a/tests/i915/gem_media_vme.c +++ b/tests/i915/gem_media_vme.c @@ -116,7 +116,7 @@ igt_simple_main /* This comes from OUTPUT_SIZE requirements */ intel_buf_init(bops, &dst, 56, sizeof(int), 8, 56, I915_TILING_NONE, 0); - dst.stride = 1; + dst.surface[0].stride = 1; ctx = gem_context_create(drm_fd); igt_assert(ctx); diff --git a/tests/i915/i915_pm_sseu.c b/tests/i915/i915_pm_sseu.c index 30b7cfec4..1b428c9ba 100644 --- a/tests/i915/i915_pm_sseu.c +++ b/tests/i915/i915_pm_sseu.c @@ -258,13 +258,14 @@ gem_get_target_spins(double dt) I915_GEM_DOMAIN_CPU, I915_GEM_DOMAIN_CPU); ptr = gem_mmap__device_coherent(gem.drm_fd, gem.buf.handle, - 0, gem.buf.size, PROT_READ); + 0, gem.buf.surface[0].size, + PROT_READ); clock_gettime(CLOCK_MONOTONIC, &tdone); gem_check_spin(ptr, spins); - munmap(ptr, gem.buf.size); + munmap(ptr, gem.buf.surface[0].size); cur_dt = to_dt(&tstart, &tdone); if (cur_dt > dt) @@ -361,9 +362,9 @@ full_enable(void) gem_set_domain(gem.drm_fd, gem.buf.handle, I915_GEM_DOMAIN_CPU, I915_GEM_DOMAIN_CPU); ptr = gem_mmap__device_coherent(gem.drm_fd, gem.buf.handle, - 0, gem.buf.size, PROT_READ); + 0, gem.buf.surface[0].size, PROT_READ); gem_check_spin(ptr, spins); - munmap(ptr, gem.buf.size); + munmap(ptr, gem.buf.surface[0].size); check_full_enable(&stat); } |