public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: "Michał Winiarski" <michal.winiarski@intel.com>
To: intel-gfx@lists.freedesktop.org
Subject: [RFC 03/11] drm/i915/preempt: Add information needed to track engine preempt state
Date: Thu, 23 Feb 2017 20:08:25 +0100	[thread overview]
Message-ID: <20170223190833.2888-4-michal.winiarski@intel.com> (raw)
In-Reply-To: <20170223190833.2888-1-michal.winiarski@intel.com>

We're using engine->preempt_requested to mark that preemption has
started, and new hws entry allowing HW to mark that preemption has
finished and the engine is idle, allowing us to do the postprocessing.

Signed-off-by: Michał Winiarski <michal.winiarski@intel.com>
---
 drivers/gpu/drm/i915/intel_ringbuffer.h | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.h b/drivers/gpu/drm/i915/intel_ringbuffer.h
index 9c7f36e..637a83c 100644
--- a/drivers/gpu/drm/i915/intel_ringbuffer.h
+++ b/drivers/gpu/drm/i915/intel_ringbuffer.h
@@ -392,6 +392,8 @@ struct intel_engine_cs {
 	struct rb_node *execlist_first;
 	unsigned int fw_domains;
 
+	bool preempt_requested;
+
 	/* Contexts are pinned whilst they are active on the GPU. The last
 	 * context executed remains active whilst the GPU is idle - the
 	 * switch away and write to the context object only occurs on the
@@ -486,9 +488,17 @@ intel_write_status_page(struct intel_engine_cs *engine,
  */
 #define I915_GEM_HWS_INDEX		0x30
 #define I915_GEM_HWS_INDEX_ADDR (I915_GEM_HWS_INDEX << MI_STORE_DWORD_INDEX_SHIFT)
+#define I915_GEM_HWS_PREEMPT_INDEX	0x32
+#define I915_GEM_HWS_PREEMPT_ADDR (I915_GEM_HWS_PREEMPT_INDEX << MI_STORE_DWORD_INDEX_SHIFT)
 #define I915_GEM_HWS_SCRATCH_INDEX	0x40
 #define I915_GEM_HWS_SCRATCH_ADDR (I915_GEM_HWS_SCRATCH_INDEX << MI_STORE_DWORD_INDEX_SHIFT)
 
+static inline bool
+intel_engine_is_preempt_finished(struct intel_engine_cs *engine)
+{
+	return intel_read_status_page(engine, I915_GEM_HWS_PREEMPT_INDEX);
+}
+
 struct intel_ring *
 intel_engine_create_ring(struct intel_engine_cs *engine, int size);
 int intel_ring_pin(struct intel_ring *ring, unsigned int offset_bias);
-- 
2.9.3

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

  parent reply	other threads:[~2017-02-23 19:09 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-23 19:08 [RFC] GuC based preemption Michał Winiarski
2017-02-23 19:08 ` [RFC 01/11] drm/i915/scheduler: Remember request priority throughout its lifetime Michał Winiarski
2017-02-23 21:29   ` Chris Wilson
2017-02-23 19:08 ` [RFC 02/11] drm/i915/preempt: Add module parameter for preemption Michał Winiarski
2017-02-23 19:08 ` Michał Winiarski [this message]
2017-02-23 19:08 ` [RFC 04/11] drm/i915/preempt: Implement null preemption method Michał Winiarski
2017-02-23 21:37   ` Chris Wilson
2017-02-23 19:14 ` [RFC 05/11] drm/i915/preempt: Handle preemption event in guc tasklet Michał Winiarski
2017-03-01 12:57   ` Chris Wilson
2017-03-06 10:53     ` Chris Wilson
2017-02-23 19:14 ` [RFC 06/11] drm/i915/guc: Remove extra arguments from guc_client_alloc Michał Winiarski
2017-02-23 16:38   ` Oscar Mateo
2017-02-24  1:39     ` Daniele Ceraolo Spurio
2017-02-23 19:14 ` [RFC 07/11] drm/i915/guc: Add a second client, to be used for preemption Michał Winiarski
2017-02-23 19:14 ` [RFC 08/11] drm/i915/guc: Add preemption action to GuC firmware interface Michał Winiarski
2017-02-23 19:14 ` [RFC 09/11] HACK drm/i915/preempt: Actually send the preemption request Michał Winiarski
2017-02-23 19:14 ` [RFC 10/11] drm/i915/preempt: Emit MI_ARB_CHECK before the start of user batch Michał Winiarski
2017-03-01 12:53   ` Chris Wilson
2017-02-23 19:14 ` [RFC 11/11] drm/i915/preempt: Show engine preempt state in engine_info debugfs Michał Winiarski

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=20170223190833.2888-4-michal.winiarski@intel.com \
    --to=michal.winiarski@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox