From: "Zbigniew Kempczyński" <zbigniew.kempczynski@intel.com>
To: Dominik Grzegorzek <dominik.grzegorzek@intel.com>
Cc: igt-dev@lists.freedesktop.org, Chris Wilson <chris@chris-wilson.co.uk>
Subject: Re: [igt-dev] [PATCH i-g-t v3 06/15] i915/gem_tiled_blits: Remove libdrm dependency
Date: Fri, 23 Oct 2020 10:19:03 +0200 [thread overview]
Message-ID: <20201023081903.GA3039@zkempczy-mobl2> (raw)
In-Reply-To: <20201002065442.30037-7-dominik.grzegorzek@intel.com>
On Fri, Oct 02, 2020 at 08:54:33AM +0200, Dominik Grzegorzek wrote:
> Use intel_bb / intel_buf to remove libdrm dependency.
>
> Signed-off-by: Dominik Grzegorzek <dominik.grzegorzek@intel.com>
> Cc: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
> Cc: Chris Wilson <chris@chris-wilson.co.uk>
> ---
> tests/i915/gem_tiled_blits.c | 75 ++++++++++++++++++------------------
> 1 file changed, 38 insertions(+), 37 deletions(-)
Remove this test from series and try to adopt it on top of:
https://patchwork.freedesktop.org/series/82954/
--
Zbigniew
>
> diff --git a/tests/i915/gem_tiled_blits.c b/tests/i915/gem_tiled_blits.c
> index 36e96785..2149f27f 100644
> --- a/tests/i915/gem_tiled_blits.c
> +++ b/tests/i915/gem_tiled_blits.c
> @@ -60,49 +60,51 @@ IGT_TEST_DESCRIPTION("Test doing many tiled blits, with a working set larger"
>
> static int width = 512, height = 512;
>
> -static drm_intel_bo *
> -create_bo(drm_intel_bufmgr *bufmgr, struct intel_batchbuffer *batch, uint32_t x)
> +static struct intel_buf *
> +create_bo(struct buf_ops *bops, struct intel_bb *ibb, uint32_t x)
> {
> - drm_intel_bo *bo, *linear_bo;
> + struct intel_buf *buf, *linear_buf;
> uint32_t *linear;
> uint32_t tiling = I915_TILING_X;
> int i;
>
> - bo = drm_intel_bo_alloc(bufmgr, "tiled bo", 1024 * 1024, 4096);
> - do_or_die(drm_intel_bo_set_tiling(bo, &tiling, width * 4));
> - igt_assert(tiling == I915_TILING_X);
> + buf = intel_buf_create(bops, width, height, 32, 0, tiling,
> + I915_COMPRESSION_NONE);
>
> - linear_bo = drm_intel_bo_alloc(bufmgr, "linear src", 1024 * 1024, 4096);
> + linear_buf = intel_buf_create(bops, width, height, 32, 0,
> + I915_TILING_NONE, I915_COMPRESSION_NONE);
>
> /* Fill the BO with dwords starting at start_val */
> - do_or_die(drm_intel_bo_map(linear_bo, 1));
> - linear = linear_bo->virtual;
> + intel_buf_cpu_map(linear_buf, 1);
> + linear = linear_buf->ptr;
> for (i = 0; i < 1024 * 1024 / 4; i++)
> linear[i] = x++;
> - drm_intel_bo_unmap(linear_bo);
> + intel_buf_unmap(linear_buf);
>
> - intel_copy_bo (batch, bo, linear_bo, width*height*4);
> + intel_bb_copy_intel_buf(ibb, linear_buf, buf, width*height*4);
> + intel_bb_reset(ibb, true);
>
> - drm_intel_bo_unreference(linear_bo);
> + intel_buf_destroy(linear_buf);
>
> - return bo;
> + return buf;
> }
>
> static void
> -check_bo(drm_intel_bo *bo, uint32_t val, struct intel_batchbuffer *batch)
> +check_bo(struct intel_buf *buf, uint32_t val, struct intel_bb *ibb)
> {
> - drm_intel_bo *linear_bo;
> + struct intel_buf *linear_buf;
> uint32_t *linear;
> int num_errors;
> int i;
>
> - linear_bo = drm_intel_bo_alloc(bo->bufmgr, "linear dst",
> - 1024 * 1024, 4096);
> + linear_buf = intel_buf_create(buf->bops, width, height, 32, 0,
> + I915_TILING_NONE, I915_COMPRESSION_NONE);
>
> - intel_copy_bo(batch, linear_bo, bo, width*height*4);
> + intel_bb_copy_intel_buf(ibb, buf, linear_buf, width*height*4);
> + intel_bb_reset(ibb, true);
>
> - do_or_die(drm_intel_bo_map(linear_bo, 0));
> - linear = linear_bo->virtual;
> + intel_buf_cpu_map(linear_buf, 0);
> + linear = linear_buf->ptr;
>
> num_errors = 0;
> for (i = 0; i < 1024 * 1024 / 4; i++) {
> @@ -112,31 +114,28 @@ check_bo(drm_intel_bo *bo, uint32_t val, struct intel_batchbuffer *batch)
> val++;
> }
> igt_assert_eq(num_errors, 0);
> - drm_intel_bo_unmap(linear_bo);
> + intel_buf_unmap(linear_buf);
>
> - drm_intel_bo_unreference(linear_bo);
> + intel_buf_destroy(linear_buf);
> }
>
> static void run_test(int fd, int count)
> {
> - struct intel_batchbuffer *batch;
> - drm_intel_bufmgr *bufmgr;
> - drm_intel_bo **bo;
> + struct intel_bb *ibb;
> + struct buf_ops *bops;
> + struct intel_buf **bo;
> uint32_t *bo_start_val;
> uint32_t start = 0;
> int i;
>
> - bufmgr = drm_intel_bufmgr_gem_init(fd, 4096);
> - drm_intel_bufmgr_gem_set_vma_cache_size(bufmgr, 32);
> - drm_intel_bufmgr_gem_enable_reuse(bufmgr);
> - batch = intel_batchbuffer_alloc(bufmgr, intel_get_drm_devid(fd));
> + bops = buf_ops_create(fd);
> + ibb = intel_bb_create(fd, 4096);
>
> -
> - bo = malloc(sizeof(drm_intel_bo *)*count);
> + bo = malloc(sizeof(struct intel_buf *)*count);
> bo_start_val = malloc(sizeof(uint32_t)*count);
>
> for (i = 0; i < count; i++) {
> - bo[i] = create_bo(bufmgr, batch, start);
> + bo[i] = create_bo(bops, ibb, start);
> bo_start_val[i] = start;
> start += 1024 * 1024 / 4;
> }
> @@ -148,20 +147,22 @@ static void run_test(int fd, int count)
> if (src == dst)
> continue;
>
> - intel_copy_bo(batch, bo[dst], bo[src], width*height*4);
> + intel_bb_copy_intel_buf(ibb, bo[src], bo[dst], width*height*4);
> + intel_bb_reset(ibb, true);
> +
> bo_start_val[dst] = bo_start_val[src];
> }
>
> for (i = 0; i < count; i++) {
> - check_bo(bo[i], bo_start_val[i], batch);
> - drm_intel_bo_unreference(bo[i]);
> + check_bo(bo[i], bo_start_val[i], ibb);
> + intel_buf_destroy(bo[i]);
> }
>
> free(bo_start_val);
> free(bo);
>
> - intel_batchbuffer_free(batch);
> - drm_intel_bufmgr_destroy(bufmgr);
> + intel_bb_destroy(ibb);
> + buf_ops_destroy(bops);
> }
>
> #define MAX_32b ((1ull << 32) - 4096)
> --
> 2.20.1
>
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
next prev parent reply other threads:[~2020-10-23 8:19 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-02 6:54 [igt-dev] [PATCH i-g-t v3 00/15] tests: Remove libdrm dependency Dominik Grzegorzek
2020-10-02 6:54 ` [igt-dev] [PATCH i-g-t v3 01/15] lib/intel_batchbuffer: add intel_bb_blit_copy wrapper Dominik Grzegorzek
2020-10-02 6:54 ` [igt-dev] [PATCH i-g-t v3 02/15] Remove unused intel_bufmgr.h headers Dominik Grzegorzek
2020-10-02 6:54 ` [igt-dev] [PATCH i-g-t v3 03/15] i915/gem_pwrite_snooped: Remove libdrm dependency Dominik Grzegorzek
2020-10-02 6:54 ` [igt-dev] [PATCH i-g-t v3 04/15] i915/gem_pread_after_blit.c: " Dominik Grzegorzek
2020-10-02 6:54 ` [igt-dev] [PATCH i-g-t v3 05/15] i915/gem_threaded_access_tiled.c: " Dominik Grzegorzek
2020-10-02 6:54 ` [igt-dev] [PATCH i-g-t v3 06/15] i915/gem_tiled_blits: " Dominik Grzegorzek
2020-10-23 8:19 ` Zbigniew Kempczyński [this message]
2020-10-02 6:54 ` [igt-dev] [PATCH i-g-t v3 07/15] i915/gem_unfence_active_buffers.c: Remove librdm dependency Dominik Grzegorzek
2020-10-02 6:54 ` [igt-dev] [PATCH i-g-t v3 08/15] i915/gem_unref_active_buffers.c: Remove libdrm dependency Dominik Grzegorzek
2020-10-02 6:54 ` [igt-dev] [PATCH i-g-t v3 09/15] i915/gem_tiled_partial_pwrite_pread: " Dominik Grzegorzek
2020-10-02 6:54 ` [igt-dev] [PATCH i-g-t v3 10/15] i915/gem_set_tiling_vs_blit.c: " Dominik Grzegorzek
2020-10-02 6:54 ` [igt-dev] [PATCH i-g-t v3 11/15] tests/kms_fence_pin_leak.c: " Dominik Grzegorzek
2020-10-02 6:54 ` [igt-dev] [PATCH i-g-t v3 12/15] tests/kms_flip.c: " Dominik Grzegorzek
2020-10-02 6:54 ` [igt-dev] [PATCH i-g-t v3 13/15] tests/kms_psr2_su.c: Get rid of unused bufmgr Dominik Grzegorzek
2020-10-02 6:54 ` [igt-dev] [PATCH i-g-t v3 14/15] tests/i915/gem_ppgtt: make copying more readable Dominik Grzegorzek
2020-10-23 8:23 ` Zbigniew Kempczyński
2020-10-02 6:54 ` [igt-dev] [PATCH i-g-t v3 15/15] HAX: don't run failing test in BAT Dominik Grzegorzek
2020-10-02 7:37 ` [igt-dev] ✓ Fi.CI.BAT: success for tests: Remove libdrm dependency (rev3) Patchwork
2020-10-02 8:35 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2020-10-02 10:27 ` Grzegorzek, Dominik
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20201023081903.GA3039@zkempczy-mobl2 \
--to=zbigniew.kempczynski@intel.com \
--cc=chris@chris-wilson.co.uk \
--cc=dominik.grzegorzek@intel.com \
--cc=igt-dev@lists.freedesktop.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox