All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andi Shyti <andi.shyti@intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>,
	intel-gfx@lists.freedesktop.org, igt-dev@lists.freedesktop.org,
	Jon Bloomfield <jon.bloomfield@intel.com>
Subject: Re: [igt-dev] [PATCH i-g-t 2/2] Add i915/gem_ctx_persistence
Date: Tue, 15 Oct 2019 16:05:46 +0300	[thread overview]
Message-ID: <20191015130528.GA12764@intel.intel> (raw)
In-Reply-To: <20191010073258.24519-2-chris@chris-wilson.co.uk>

Hi Chris,

On Thu, Oct 10, 2019 at 08:32:58AM +0100, Chris Wilson wrote:
> Sanity test existing persistence and new exciting non-persistent context
> behaviour.
> 
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> Cc: Michał Winiarski <michal.winiarski@intel.com>
> Cc: Jon Bloomfield <jon.bloomfield@intel.com>
> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> Cc: Andi Shyti <andi.shyti@intel.com>
> ---
>  lib/i915/gem_context.c           |  37 +++
>  lib/i915/gem_context.h           |   8 +
>  lib/igt_dummyload.c              |   3 +-
>  lib/ioctl_wrappers.c             |   1 +
>  tests/Makefile.sources           |   3 +
>  tests/i915/gem_ctx_persistence.c | 407 +++++++++++++++++++++++++++++++
>  tests/meson.build                |   1 +
>  7 files changed, 459 insertions(+), 1 deletion(-)
>  create mode 100644 tests/i915/gem_ctx_persistence.c

I think this patch should be split as ioctl_wrappers,
igt_dummyload have changes that are not related to "Sanity test
existing persistence and new exciting non-persistent context
behaviour"

I think they don't affect the test itself.

Without those changes:

Reviewed-by: Andi Shyti <andi.shyti@intel.com>

Still one question.

> +static bool enable_hangcheck(int i915)

how about adding here a boolean and use this function also for
the test_nohangcheck_hostile() case?

> +{
> +	int enabled = -1;
> +	int dir;
> +
> +	dir = igt_sysfs_open_parameters(i915);
> +	if (dir < 0) /* no parameters, must be default! */
> +		return enabled;
> +
> +	/* If i915.hangcheck is removed, assume the default is good */
> +	igt_sysfs_set(dir, "enable_hangcheck", "1");
> +	igt_sysfs_scanf(dir, "enable_hangcheck", "%d", &enabled);
> +
> +	close(dir);
> +
> +	return enabled;
> +}
> +
> +static void test_idempotent(int i915)
> +{
> +	struct drm_i915_gem_context_param p = {
> +		.param = I915_CONTEXT_PARAM_PERSISTENCE,
> +	};
> +	int expected;
> +
> +	/*
> +	 * Simple test to verify that we are able to read back the same boolean
> +	 * value as we set.
> +	 *
> +	 * Each time we invert the current value so that at the end of the test,
> +	 * if successful, we leave the context in the original state.
> +	 */
> +
> +	gem_context_get_param(i915, &p);
> +	expected = !!p.value;
> +
> +	expected = !expected;

mmhhh... looks familiar :)

Andi
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

WARNING: multiple messages have this Message-ID (diff)
From: Andi Shyti <andi.shyti@intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>
Cc: intel-gfx@lists.freedesktop.org, igt-dev@lists.freedesktop.org
Subject: Re: [PATCH i-g-t 2/2] Add i915/gem_ctx_persistence
Date: Tue, 15 Oct 2019 16:05:46 +0300	[thread overview]
Message-ID: <20191015130528.GA12764@intel.intel> (raw)
In-Reply-To: <20191010073258.24519-2-chris@chris-wilson.co.uk>

Hi Chris,

On Thu, Oct 10, 2019 at 08:32:58AM +0100, Chris Wilson wrote:
> Sanity test existing persistence and new exciting non-persistent context
> behaviour.
> 
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> Cc: Michał Winiarski <michal.winiarski@intel.com>
> Cc: Jon Bloomfield <jon.bloomfield@intel.com>
> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> Cc: Andi Shyti <andi.shyti@intel.com>
> ---
>  lib/i915/gem_context.c           |  37 +++
>  lib/i915/gem_context.h           |   8 +
>  lib/igt_dummyload.c              |   3 +-
>  lib/ioctl_wrappers.c             |   1 +
>  tests/Makefile.sources           |   3 +
>  tests/i915/gem_ctx_persistence.c | 407 +++++++++++++++++++++++++++++++
>  tests/meson.build                |   1 +
>  7 files changed, 459 insertions(+), 1 deletion(-)
>  create mode 100644 tests/i915/gem_ctx_persistence.c

I think this patch should be split as ioctl_wrappers,
igt_dummyload have changes that are not related to "Sanity test
existing persistence and new exciting non-persistent context
behaviour"

I think they don't affect the test itself.

Without those changes:

Reviewed-by: Andi Shyti <andi.shyti@intel.com>

Still one question.

> +static bool enable_hangcheck(int i915)

how about adding here a boolean and use this function also for
the test_nohangcheck_hostile() case?

> +{
> +	int enabled = -1;
> +	int dir;
> +
> +	dir = igt_sysfs_open_parameters(i915);
> +	if (dir < 0) /* no parameters, must be default! */
> +		return enabled;
> +
> +	/* If i915.hangcheck is removed, assume the default is good */
> +	igt_sysfs_set(dir, "enable_hangcheck", "1");
> +	igt_sysfs_scanf(dir, "enable_hangcheck", "%d", &enabled);
> +
> +	close(dir);
> +
> +	return enabled;
> +}
> +
> +static void test_idempotent(int i915)
> +{
> +	struct drm_i915_gem_context_param p = {
> +		.param = I915_CONTEXT_PARAM_PERSISTENCE,
> +	};
> +	int expected;
> +
> +	/*
> +	 * Simple test to verify that we are able to read back the same boolean
> +	 * value as we set.
> +	 *
> +	 * Each time we invert the current value so that at the end of the test,
> +	 * if successful, we leave the context in the original state.
> +	 */
> +
> +	gem_context_get_param(i915, &p);
> +	expected = !!p.value;
> +
> +	expected = !expected;

mmhhh... looks familiar :)

Andi
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2019-10-15 13:05 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-10  7:32 [igt-dev] [PATCH i-g-t 1/2] i915_drm.h sync Chris Wilson
2019-10-10  7:32 ` Chris Wilson
2019-10-10  7:32 ` [igt-dev] [PATCH i-g-t 2/2] Add i915/gem_ctx_persistence Chris Wilson
2019-10-10  7:32   ` Chris Wilson
2019-10-15 13:05   ` Andi Shyti [this message]
2019-10-15 13:05     ` Andi Shyti
2019-10-10  7:59 ` [igt-dev] ✗ GitLab.Pipeline: warning for series starting with [i-g-t,1/2] i915_drm.h sync Patchwork
2019-10-10  8:23 ` [igt-dev] ✓ Fi.CI.BAT: success " Patchwork
2019-10-10 15:30 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
  -- strict thread matches above, loose matches on Subject: below --
2019-09-25 13:45 [igt-dev] [PATCH i-g-t 1/2] " Chris Wilson
2019-09-25 13:45 ` [igt-dev] [PATCH i-g-t 2/2] Add i915/gem_ctx_persistence Chris Wilson

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=20191015130528.GA12764@intel.intel \
    --to=andi.shyti@intel.com \
    --cc=chris@chris-wilson.co.uk \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jon.bloomfield@intel.com \
    --cc=tvrtko.ursulin@intel.com \
    /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.