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

Matthew Auld matthew.william.auld at gmail.com
Wed Oct 6 11:12:49 UTC 2021


On Wed, 6 Oct 2021 at 11:02, <priyanka.dandamudi at intel.com> wrote:
>
> From: Priyanka Dandamudi <priyanka.dandamudi at intel.com>
>
> set_caching ioctl will get skipped for discrete
> and mmap__cpu gets used by default.
>
> 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 03adc9ee..5ea815f6 100644
> --- a/tests/i915/gem_exec_nop.c
> +++ b/tests/i915/gem_exec_nop.c
> @@ -238,6 +238,7 @@ static void poll_sequential(int fd, const intel_ctx_t *ctx,
>                 flags |= I915_EXEC_SECURE;
>
>         nengine = 0;
> +       cached = true;
>         for_each_ctx_engine(fd, ctx, e) {
>                 if (!gem_class_can_store_dword(fd, e->class) ||
>                     !gem_class_has_mutable_submission(fd, e->class))
> @@ -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;
> +       if(!gem_has_lmem(fd))
> +               cached = __gem_set_caching(fd, obj[0].handle, 1) == 0;

For better readability, the cached = true should probably be placed here, i.e:

cached = true;
if (!has_lmem())
        cached = ...

Reviewed-by: Matthew Auld <matthew.auld at intel.com>


>         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