Quoting Antonio Argenziano (2017-10-13 21:49:28)
>  static void gem_require_context(int fd)
>  {
> -       igt_require(__gem_context_create(fd));
> +       uint32_t ctx_id = 0;
> +       __gem_context_create(fd, &ctx_id);
> +       igt_require(ctx_id);

Still that leaks.

uint32_t has_contexts = 0;
__gem_context_create(fd, &has_contexts);
if (has_contexts)
        gem_context_destroy(fd, has_contexts);
igt_require(has_contexts);

Note that before we can drop the require from gem_context_create() we
have to go throw and teach all users to do the manual
gem_require_context() first.

Second note,

static bool gem_has_contexts(int fd)
{
        uint32_t ctx_id = 0;
        __gem_context_create(fd, &ctx_id);
        if (ctx_id)
                gem_context_destroy(fd, ctx_id);
        return ctx_id;
}

void gem_require_contexts(int fd)
{
        igt_require(gem_has_contexts(fd));
}
-Chris
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

Reply via email to