From: Thomas Daniel <thomas.daniel@intel.com>
To: intel-gfx@lists.freedesktop.org
Cc: shuang.he@linux.intel.com
Subject: [PATCH 2/4] drm/i915/bdw: Setup global hardware status page in execlists mode
Date: Wed, 29 Oct 2014 09:52:51 +0000 [thread overview]
Message-ID: <1414576373-25121-2-git-send-email-thomas.daniel@intel.com> (raw)
In-Reply-To: <1414576373-25121-1-git-send-email-thomas.daniel@intel.com>
Write HWS_PGA address even in execlists mode as the global hardware status
page is still required. This address was previously uninitialized and
HWSP writes would clobber whatever buffer happened to reside at GGTT
address 0.
v2: Break out hardware status page setup into a separate function.
Issue: VIZ-2020
Signed-off-by: Thomas Daniel <thomas.daniel@intel.com>
---
drivers/gpu/drm/i915/intel_lrc.c | 34 ++++++++++++++++++++++++++--------
1 file changed, 26 insertions(+), 8 deletions(-)
diff --git a/drivers/gpu/drm/i915/intel_lrc.c b/drivers/gpu/drm/i915/intel_lrc.c
index 87ce445..6b8bf0d 100644
--- a/drivers/gpu/drm/i915/intel_lrc.c
+++ b/drivers/gpu/drm/i915/intel_lrc.c
@@ -1657,6 +1657,27 @@ static uint32_t get_lr_context_size(struct intel_engine_cs *ring)
return ret;
}
+static int lrc_setup_hardware_status_page(struct intel_engine_cs *ring,
+ struct drm_i915_gem_object *default_ctx_obj)
+{
+ struct drm_i915_private *dev_priv = ring->dev->dev_private;
+
+ /* The status page is offset 0 from the default context object
+ * in LRC mode. */
+ ring->status_page.gfx_addr = i915_gem_obj_ggtt_offset(default_ctx_obj);
+ ring->status_page.page_addr =
+ kmap(sg_page(default_ctx_obj->pages->sgl));
+ if (ring->status_page.page_addr == NULL)
+ return -ENOMEM;
+ ring->status_page.obj = default_ctx_obj;
+
+ I915_WRITE(RING_HWS_PGA(ring->mmio_base),
+ (u32)ring->status_page.gfx_addr);
+ POSTING_READ(RING_HWS_PGA(ring->mmio_base));
+
+ return 0;
+}
+
/**
* intel_lr_context_deferred_create() - create the LRC specific bits of a context
* @ctx: LR context to create.
@@ -1742,14 +1763,11 @@ int intel_lr_context_deferred_create(struct intel_context *ctx,
ctx->engine[ring->id].state = ctx_obj;
if (ctx == ring->default_context) {
- /* The status page is offset 0 from the default context object
- * in LRC mode. */
- ring->status_page.gfx_addr = i915_gem_obj_ggtt_offset(ctx_obj);
- ring->status_page.page_addr =
- kmap(sg_page(ctx_obj->pages->sgl));
- if (ring->status_page.page_addr == NULL)
- return -ENOMEM;
- ring->status_page.obj = ctx_obj;
+ ret = lrc_setup_hardware_status_page(ring, ctx_obj);
+ if (ret) {
+ DRM_ERROR("Failed to setup hardware status page\n");
+ goto error;
+ }
}
if (ring->id == RCS && !ctx->rcs_initialized) {
--
1.7.9.5
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2014-10-29 9:53 UTC|newest]
Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-29 9:52 [PATCH 1/4] drm/i915/bdw: Clean up execlist queue items in retire_work Thomas Daniel
2014-10-29 9:52 ` Thomas Daniel [this message]
2014-11-03 15:47 ` [PATCH 2/4] drm/i915/bdw: Setup global hardware status page in execlists mode Daniel Vetter
2014-10-29 9:52 ` [PATCH 3/4] drm/i915/bdw: Pin the context backing objects to GGTT on-demand Thomas Daniel
2014-11-03 16:54 ` Daniel Vetter
2014-11-03 17:00 ` Daniel, Thomas
2014-11-03 17:11 ` Daniel Vetter
2014-11-03 21:04 ` Chris Wilson
2014-11-13 10:28 ` [PATCH v5 " Thomas Daniel
2014-11-17 14:38 ` akash goel
2014-11-17 14:55 ` Daniel, Thomas
2014-11-19 17:59 ` Daniel, Thomas
2014-11-17 18:09 ` Daniel Vetter
2014-11-18 9:27 ` Daniel, Thomas
2014-11-18 10:48 ` Daniel, Thomas
2014-11-18 14:33 ` Daniel Vetter
2014-11-18 14:51 ` Daniel, Thomas
2014-11-18 15:11 ` Daniel Vetter
2014-11-18 15:32 ` Daniel, Thomas
2014-11-19 9:53 ` Daniel Vetter
2014-11-18 6:40 ` Deepak S
2014-11-17 14:23 ` Daniel Vetter
2014-11-18 14:27 ` Deepak S
2014-11-24 14:24 ` Daniel Vetter
2014-11-24 17:14 ` Daniel, Thomas
2014-11-24 20:15 ` Daniel Vetter
2014-10-29 9:52 ` [PATCH 4/4] drm/i915/bdw: Pin the ringbuffer backing object " Thomas Daniel
2014-10-29 14:38 ` [PATCH 4/4] drm/i915/bdw: Pin the ringbuffer backing shuang.he
2014-11-13 10:28 ` [PATCH v5 4/4] drm/i915/bdw: Pin the ringbuffer backing object to GGTT on-demand Thomas Daniel
2014-11-18 5:18 ` akash goel
2014-11-18 6:37 ` Deepak S
2014-11-18 6:39 ` Deepak S
2014-11-17 14:29 ` Daniel Vetter
2014-11-18 14:30 ` Deepak S
2014-11-03 15:33 ` [PATCH 1/4] drm/i915/bdw: Clean up execlist queue items in retire_work Daniel Vetter
2014-11-03 16:05 ` Daniel, Thomas
2014-11-03 16:17 ` Daniel Vetter
2014-11-04 9:11 ` Chris Wilson
2014-11-07 14:55 ` [PATCH v4 " Thomas Daniel
2014-11-13 10:27 ` [PATCH v5 " Thomas Daniel
2014-11-18 6:29 ` Deepak S
2014-11-17 14:41 ` akash goel
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=1414576373-25121-2-git-send-email-thomas.daniel@intel.com \
--to=thomas.daniel@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=shuang.he@linux.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox