[igt-dev] [PATCH i-g-t] tests/i915/gem_exec_nop: Update poll sequential

Matthew Auld matthew.william.auld at gmail.com
Fri Oct 1 09:38:35 UTC 2021


On Thu, 30 Sept 2021 at 06:29, <priyanka.dandamudi at intel.com> wrote:
>
> From: Priyanka Dandamudi <priyanka.dandamudi at intel.com>
>
> The set_caching ioctl returns -ENODEV for discrete.
> So,updated the poll sequential test case accordingly.
>
> Signed-off-by: Priyanka Dandamudi <priyanka.dandamudi at intel.com>
> Cc: Matthew Auld <matthew.auld at intel.com>
> ---
>  tests/i915/gem_exec_nop.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/tests/i915/gem_exec_nop.c b/tests/i915/gem_exec_nop.c
> index c435335b..9123f9f5 100644
> --- a/tests/i915/gem_exec_nop.c
> +++ b/tests/i915/gem_exec_nop.c
> @@ -232,6 +232,7 @@ static void poll_sequential(int fd, const intel_ctx_t *ctx,
>         unsigned long cycles;
>         uint64_t elapsed;
>         bool cached;
> +       int expect;
>
>         flags = I915_EXEC_NO_RELOC;
>         if (gen == 4 || gen == 5)
> @@ -251,7 +252,8 @@ static void poll_sequential(int fd, const intel_ctx_t *ctx,
>         memset(obj, 0, sizeof(obj));
>         obj[0].handle = gem_create(fd, 4096);
>         obj[0].flags = EXEC_OBJECT_WRITE;
> -       cached = __gem_set_caching(fd, obj[0].handle, 1) == 0;
> +       expect = __gem_set_caching(fd, obj[0].handle, 1);
> +       cached = gem_has_lmem(fd)? expect == -ENODEV: expect == 0;

Could maybe also just write this as:

cached = true;
if (!gem_has_lmem(fd))
       cached = __gem_set_caching(fd, obj[0].handle, 1);

>         obj[1].handle = gem_create(fd, 4096);
>         obj[1].relocs_ptr = to_user_pointer(reloc);
>         obj[1].relocation_count = ARRAY_SIZE(reloc);
> --
> 2.25.1
>


More information about the igt-dev mailing list