[igt-dev] [PATCH i-g-t v31 08/32] tests/api_intel_bb: test flags are cleared on bb reset
Chris Wilson
chris at chris-wilson.co.uk
Wed Aug 26 15:59:12 UTC 2020
Quoting Zbigniew Kempczyński (2020-08-20 07:30:06)
> Current intel_bb implementation keeps objects in the bb cache
> so subsequent executions pass these objects also to execbuf.
> Check flags are cleaned after reset.
>
> Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski at intel.com>
> Cc: Dominik Grzegorzek <dominik.grzegorzek at intel.com>
> Cc: Chris Wilson <chris at chris-wilson.co.uk>
> ---
> tests/i915/api_intel_bb.c | 83 +++++++++++++++++++++++++++++++++++++++
> 1 file changed, 83 insertions(+)
>
> diff --git a/tests/i915/api_intel_bb.c b/tests/i915/api_intel_bb.c
> index 98872be8..a4b57b7c 100644
> --- a/tests/i915/api_intel_bb.c
> +++ b/tests/i915/api_intel_bb.c
> @@ -206,6 +206,86 @@ static void check_canonical(struct buf_ops *bops)
> intel_bb_destroy(ibb);
> }
>
> +/*
> + * Check flags are cleared after intel_bb_reset(ibb, false);
> + */
> +static void reset_flags(struct buf_ops *bops)
> +{
> + int i915 = buf_ops_get_fd(bops);
> + struct intel_bb *ibb;
> + struct intel_buf *src, *mid, *dst;
> + struct drm_i915_gem_exec_object2 *obj;
> + const uint32_t width = 512;
> + const uint32_t height = 512;
> +
> + ibb = intel_bb_create(i915, PAGE_SIZE);
> + if (debug_bb)
> + intel_bb_set_debug(ibb, true);
> +
> + src = intel_buf_create(bops, width, height, 32, 0,
> + I915_TILING_NONE, I915_COMPRESSION_NONE);
> + mid = intel_buf_create(bops, width, height, 32, 0,
> + I915_TILING_NONE, I915_COMPRESSION_NONE);
> + dst = intel_buf_create(bops, width, height, 32, 0,
> + I915_TILING_NONE, I915_COMPRESSION_NONE);
> +
> + intel_bb_add_intel_buf(ibb, src, false);
> + intel_bb_add_intel_buf(ibb, mid, true);
> +
> + /* Check src has no EXEC_OBJECT_WRITE */
> + obj = intel_bb_find_object(ibb, src->handle);
> + igt_assert(obj);
> + igt_assert((obj->flags & EXEC_OBJECT_WRITE) == 0);
> +
> + /* Check mid has EXEC_OBJECT_WRITE */
> + obj = intel_bb_find_object(ibb, mid->handle);
> + igt_assert(obj);
> + igt_assert(obj->flags & EXEC_OBJECT_WRITE);
> +
> + intel_bb_out(ibb, 0);
> + intel_bb_flush_blit(ibb);
> +
> + /* Check src has zeroed flags */
> + obj = intel_bb_find_object(ibb, src->handle);
> + igt_assert(obj);
> + igt_assert((obj->flags & EXEC_OBJECT_WRITE) == 0);
> +
> + /* Check mid has zeroed flags */
> + obj = intel_bb_find_object(ibb, mid->handle);
> + igt_assert(obj);
> + igt_assert((obj->flags & EXEC_OBJECT_WRITE) == 0);
> +
> + intel_bb_emit_blt_copy(ibb,
> + mid, 0, 0, mid->surface[0].stride,
> + dst, 0, 0, dst->surface[0].stride,
> + intel_buf_width(dst),
> + intel_buf_height(dst),
> + dst->bpp);
> +
> + /* Check mid has no EXEC_OBJECT_WRITE */
> + obj = intel_bb_find_object(ibb, mid->handle);
> + igt_assert(obj);
> + igt_assert((obj->flags & EXEC_OBJECT_WRITE) == 0);
> +
> + /* Check mid has no EXEC_OBJECT_WRITE */
> + obj = intel_bb_find_object(ibb, dst->handle);
> + igt_assert(obj);
> + igt_assert(obj->flags & EXEC_OBJECT_WRITE);
> +
> + intel_bb_flush_blit(ibb);
> +
> + /* Check mid has no EXEC_OBJECT_WRITE */
> + obj = intel_bb_find_object(ibb, dst->handle);
> + igt_assert(obj);
> + igt_assert((obj->flags & EXEC_OBJECT_WRITE) == 0);
> +
> + intel_buf_destroy(src);
> + intel_buf_destroy(mid);
> + intel_buf_destroy(dst);
> + intel_bb_destroy(ibb);
No check for "if high 48b address is used, SUPPORTS_48B_ADDRESS remains
set"?
-Chris
More information about the igt-dev
mailing list