All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Wilson <chris@chris-wilson.co.uk>
To: Antonio Argenziano <antonio.argenziano@intel.com>,
	intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH i-g-t v2 1/2] lib: Move __gem_context_create to common ioctl wrapper library.
Date: Fri, 13 Oct 2017 21:56:02 +0100	[thread overview]
Message-ID: <150792816205.18662.3083934955272964431@mail.alporthouse.com> (raw)
In-Reply-To: <20171013204929.1748-1-antonio.argenziano@intel.com>

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
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  parent reply	other threads:[~2017-10-13 20:56 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-13 20:49 [PATCH i-g-t v2 1/2] lib: Move __gem_context_create to common ioctl wrapper library Antonio Argenziano
2017-10-13 20:49 ` [PATCH i-g-t v2 2/2] tests/gem_reset_stats: Add client ban test Antonio Argenziano
2017-10-13 21:23   ` Chris Wilson
2017-10-13 20:56 ` Chris Wilson [this message]
2017-10-13 21:49 ` ✗ Fi.CI.BAT: failure for series starting with [v2,1/2] lib: Move __gem_context_create to common ioctl wrapper library Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=150792816205.18662.3083934955272964431@mail.alporthouse.com \
    --to=chris@chris-wilson.co.uk \
    --cc=antonio.argenziano@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.