[igt-dev] [PATCH i-g-t v31 18/32] tests/gem_concurrent_all: remove libdrm dependency

Chris Wilson chris at chris-wilson.co.uk
Wed Aug 26 16:24:23 UTC 2020


Quoting Zbigniew Kempczyński (2020-08-20 07:30:16)
>  static void
> -cpu_set_bo(struct buffers *b, drm_intel_bo *bo, uint32_t val)
> +cpu_set_bo(struct buffers *b, struct intel_buf *buf, uint32_t val)
>  {
>         int size = b->npixels;
> +       int i915 = buf_ops_get_fd(buf->bops);
>         uint32_t *vaddr;
>  
> -       do_or_die(drm_intel_bo_map(bo, true));
> -       vaddr = bo->virtual;
> +       if (gem_has_llc(i915))
> +               intel_buf_cpu_map(buf, true);
> +       else
> +               intel_buf_device_map(buf, true);

If we don't support WB to the memory, we don't want do these tests.

Branching on llc makes the test ineffectual.

> -typedef void (*do_copy)(struct buffers *b, drm_intel_bo *dst, drm_intel_bo *src);
> +typedef void (*do_copy)(struct buffers *b, struct intel_buf *dst,
> +                       struct intel_buf *src);
>  typedef igt_hang_t (*do_hang)(void);
>  
> -static void render_copy_bo(struct buffers *b, drm_intel_bo *dst, drm_intel_bo *src)
> +static void render_copy_bo(struct buffers *b, struct intel_buf *dst,
> +                          struct intel_buf *src)
>  {
> -       struct igt_buf d = {
> -               .bo = dst,
> -               .num_tiles = b->npixels * 4,
> -               .surface[0] = {
> -                       .size = b->npixels * 4, .stride = b->width * 4,
> -               },
> -               .bpp = 32,
> -       }, s = {
> -               .bo = src,
> -               .num_tiles = b->npixels * 4,
> -               .surface[0] = {
> -                       .size = b->npixels * 4, .stride = b->width * 4,
> -               },
> -               .bpp = 32,
> -       };
> -       uint32_t swizzle;
> -
> -       drm_intel_bo_get_tiling(dst, &d.tiling, &swizzle);
> -       drm_intel_bo_get_tiling(src, &s.tiling, &swizzle);
> -
> -       rendercopy(b->batch, NULL,
> -                  &s, 0, 0,
> +       rendercopy(b->ibb, 0,
> +                  src, 0, 0,
>                    b->width, b->height,
> -                  &d, 0, 0);
> +                  dst, 0, 0);
> +       intel_bb_sync(b->ibb);
> +       intel_bb_reset(b->ibb, true);
>  }
>  
> -static void blt_copy_bo(struct buffers *b, drm_intel_bo *dst, drm_intel_bo *src)
> +static void blt_copy_bo(struct buffers *b, struct intel_buf *dst,
> +                       struct intel_buf *src)
>  {
> -       intel_blt_copy(b->batch,
> +       intel_bb_blt_copy(b->ibb,
>                        src, 0, 0, 4*b->width,
>                        dst, 0, 0, 4*b->width,
>                        b->width, b->height, 32);
> +       intel_bb_sync(b->ibb);
> +       intel_bb_reset(b->ibb, true);

Do not add random syncs! What's the point in trying to test the various
synchronisation points in read/write if you spoil the fun!
-Chris


More information about the igt-dev mailing list