intel-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Chris Wilson <chris@chris-wilson.co.uk>
To: intel-gfx@lists.freedesktop.org
Subject: [PATCH v2 7/9] drm/i915: Report whether we have true context isolation
Date: Fri,  3 Nov 2017 13:34:47 +0000	[thread overview]
Message-ID: <20171103133449.11267-7-chris@chris-wilson.co.uk> (raw)
In-Reply-To: <20171103133449.11267-1-chris@chris-wilson.co.uk>

Let userspace know if they can trust that new contexts are created using
HW default values; and avoid inheriting state from existing contexts.

Note: I intend to squash this into the bugfix once we agree on the uabi.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
---
 drivers/gpu/drm/i915/i915_drv.c | 11 +++++++++++
 include/uapi/drm/i915_drm.h     | 14 ++++++++++++++
 2 files changed, 25 insertions(+)

diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
index 1b440f2b90a5..fa4839bcdd63 100644
--- a/drivers/gpu/drm/i915/i915_drv.c
+++ b/drivers/gpu/drm/i915/i915_drv.c
@@ -406,6 +406,17 @@ static int i915_getparam(struct drm_device *dev, void *data,
 		 */
 		value = 1;
 		break;
+	case I915_PARAM_HAS_CONTEXT_ISOLATION:
+		{
+			struct intel_engine_cs *engine;
+			enum intel_engine_id id;
+
+			value = 0;
+			for_each_engine(engine, dev_priv, id)
+				if (engine->default_state)
+					value |= BIT(engine->uabi_class);
+		}
+		break;
 	case I915_PARAM_SLICE_MASK:
 		value = INTEL_INFO(dev_priv)->sseu.slice_mask;
 		if (!value)
diff --git a/include/uapi/drm/i915_drm.h b/include/uapi/drm/i915_drm.h
index efbed4860794..f1159cb787d5 100644
--- a/include/uapi/drm/i915_drm.h
+++ b/include/uapi/drm/i915_drm.h
@@ -459,6 +459,20 @@ typedef struct drm_i915_irq_wait {
  */
 #define I915_PARAM_HAS_EXEC_FENCE_ARRAY  49
 
+/*
+ * Query whether every context (both per-file default and user created) is
+ * isolated (insofar as HW supports). If this parameter is not true, then
+ * freshly created contexts may inherit values from an existing context,
+ * rather than default HW values. If true, it also ensures (insofar as HW
+ * supports) that all state set by this context will not leak to any other
+ * context.
+ *
+ * As not every engine support contexts, the returned value reports the
+ * support of context isolation for individual engines by returning
+ * a bitmask of each HW ID set to true if that engine supports isolation.
+ */
+#define I915_PARAM_HAS_CONTEXT_ISOLATION 50
+
 typedef struct drm_i915_getparam {
 	__s32 param;
 	/*
-- 
2.15.0

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

  parent reply	other threads:[~2017-11-03 13:35 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-03 13:34 [PATCH v2 1/9] drm/i915: Define an engine class enum for the uABI Chris Wilson
2017-11-03 13:34 ` [PATCH v2 2/9] drm/i915: Force the switch to the i915->kernel_context Chris Wilson
2017-11-03 14:03   ` Mika Kuoppala
2017-11-03 14:07     ` Chris Wilson
2017-11-03 14:13       ` Mika Kuoppala
2017-11-03 13:34 ` [PATCH v2 3/9] drm/i915: Move GT powersaving init to i915_gem_init() Chris Wilson
2017-11-03 13:34 ` [PATCH v2 4/9] drm/i915: Inline intel_modeset_gem_init() Chris Wilson
2017-11-03 14:06   ` Mika Kuoppala
2017-11-03 13:34 ` [PATCH v2 5/9] drm/i915: Mark the context state as dirty/written Chris Wilson
2017-11-03 14:29   ` Mika Kuoppala
2017-11-03 13:34 ` [PATCH v2 6/9] drm/i915: Record the default hw state after reset upon load Chris Wilson
2017-11-03 13:34 ` Chris Wilson [this message]
2017-11-03 13:34 ` [PATCH v2 8/9] drm/i915: Remove redundant intel_autoenable_gt_powersave() Chris Wilson
2017-11-03 13:34 ` [PATCH v2 9/9] drm/i915: Stop caching the "golden" renderstate Chris Wilson
2017-11-03 14:01 ` ✗ Fi.CI.BAT: warning for series starting with [v2,1/9] drm/i915: Define an engine class enum for the uABI Patchwork
2017-11-03 14:08 ` [PATCH v3] " Chris Wilson
2017-11-03 14:58 ` ✓ Fi.CI.BAT: success for series starting with [v3] drm/i915: Define an engine class enum for the uABI (rev2) Patchwork
2017-11-03 18:06 ` ✗ Fi.CI.IGT: failure " 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=20171103133449.11267-7-chris@chris-wilson.co.uk \
    --to=chris@chris-wilson.co.uk \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).