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

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


Quoting Zbigniew Kempczyński (2020-08-20 07:30:15)
> From: Dominik Grzegorzek <dominik.grzegorzek at intel.com>
> 
> Use intel_bb / intel_buf to remove libdrm dependency.
> 
> Signed-off-by: Dominik Grzegorzek <dominik.grzegorzek at intel.com>
> Cc: Zbigniew Kempczyński <zbigniew.kempczynski at intel.com>
> Cc: Chris Wilson <chris at chris-wilson.co.uk>
> ---
>  tests/i915/gem_ppgtt.c | 189 +++++++++++++++++++----------------------
>  1 file changed, 87 insertions(+), 102 deletions(-)
> 
> diff --git a/tests/i915/gem_ppgtt.c b/tests/i915/gem_ppgtt.c
> index 8c02e4af..e4b1fe45 100644
> --- a/tests/i915/gem_ppgtt.c
> +++ b/tests/i915/gem_ppgtt.c
> @@ -38,56 +38,50 @@
>  #include "i915/gem.h"
>  #include "igt.h"
>  #include "igt_debugfs.h"
> -#include "intel_bufmgr.h"
>  
>  #define WIDTH 512
>  #define STRIDE (WIDTH*4)
>  #define HEIGHT 512
>  #define SIZE (HEIGHT*STRIDE)
>  
> -static drm_intel_bo *create_bo(drm_intel_bufmgr *bufmgr,
> -                              uint32_t pixel)
> +static struct intel_buf *create_bo(struct buf_ops *bops, uint32_t pixel)
>  {
>         uint64_t value = (uint64_t)pixel << 32 | pixel, *v;
> -       drm_intel_bo *bo;
> +       struct intel_buf *buf;
> +       int i915 = buf_ops_get_fd(bops);
>  
> -       bo = drm_intel_bo_alloc(bufmgr, "surface", SIZE, 4096);
> -       igt_assert(bo);
> +       buf = intel_buf_create(bops, WIDTH, HEIGHT, 32, 0, I915_TILING_NONE, 0);
> +
> +       if (gem_has_llc(i915))
> +               v = intel_buf_cpu_map(buf, true);
> +       else
> +               v = intel_buf_device_map(buf, true);

That's not a strict replacement. I'd prefer not to have behavioural
change outside of tests that try to look at coherency, so when in doubt
just use intel_buf_device_map(). Especially if we are doing a simple
write, we should be able to stream to WC fast enough.
-Chris


More information about the igt-dev mailing list