From: oscar.mateo@intel.com
To: intel-gfx@lists.freedesktop.org
Subject: [PATCH 4/8] drm/i915: Split PPGTT enabling from Aliasing PPGTT switching
Date: Wed, 18 Jun 2014 17:15:38 +0100 [thread overview]
Message-ID: <1403108138-6366-4-git-send-email-oscar.mateo@intel.com> (raw)
In-Reply-To: <1403108138-6366-1-git-send-email-oscar.mateo@intel.com>
From: Oscar Mateo <oscar.mateo@intel.com>
At this point, I could simply kill the sync_switch_mm function pointer
off and just transform it into some static functions belonging to
i915_gem_gtt.c
But I have a problem with Execlists: enabling the PPGTT is still needed,
but switching to it the old way (writing to the PDP registers) is not.
So, instead, use this as a preparatory patch to give me the option to do
one without the other.
Signed-off-by: Oscar Mateo <oscar.mateo@intel.com>
---
drivers/gpu/drm/i915/i915_gem_gtt.c | 28 ----------------------------
drivers/gpu/drm/i915/intel_ringbuffer.c | 8 ++++++++
2 files changed, 8 insertions(+), 28 deletions(-)
diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c b/drivers/gpu/drm/i915/i915_gem_gtt.c
index 63507eb..707cbb8 100644
--- a/drivers/gpu/drm/i915/i915_gem_gtt.c
+++ b/drivers/gpu/drm/i915/i915_gem_gtt.c
@@ -934,23 +934,10 @@ static int gen8_ppgtt_enable(struct i915_hw_ppgtt *ppgtt,
{
struct drm_device *dev = ppgtt->base.dev;
struct drm_i915_private *dev_priv = dev->dev_private;
- int ret;
I915_WRITE(RING_MODE_GEN7(ring),
_MASKED_BIT_ENABLE(GFX_PPGTT_ENABLE));
- /* We promise to do a switch later with FULL PPGTT. If this is
- * aliasing, this is the one and only switch we'll do */
- if (USES_FULL_PPGTT(dev))
- return 0;
-
- ret = ppgtt->sync_switch_mm(ppgtt, ring);
- if (ret) {
- I915_WRITE(RING_MODE_GEN7(ring),
- _MASKED_BIT_DISABLE(GFX_PPGTT_ENABLE));
- return ret;
- }
-
return 0;
}
@@ -960,7 +947,6 @@ static int gen7_ppgtt_enable(struct i915_hw_ppgtt *ppgtt,
struct drm_device *dev = ppgtt->base.dev;
struct drm_i915_private *dev_priv = dev->dev_private;
uint32_t ecochk, ecobits;
- int ret;
ecobits = I915_READ(GAC_ECO_BITS);
I915_WRITE(GAC_ECO_BITS, ecobits | ECOBITS_PPGTT_CACHE64B);
@@ -978,15 +964,6 @@ static int gen7_ppgtt_enable(struct i915_hw_ppgtt *ppgtt,
I915_WRITE(RING_MODE_GEN7(ring),
_MASKED_BIT_ENABLE(GFX_PPGTT_ENABLE));
- /* We promise to do a switch later with FULL PPGTT. If this is
- * aliasing, this is the one and only switch we'll do */
- if (USES_FULL_PPGTT(dev))
- return 0;
-
- ret = ppgtt->sync_switch_mm(ppgtt, ring);
- if (ret)
- return ret;
-
return 0;
}
@@ -996,7 +973,6 @@ static int gen6_ppgtt_enable(struct i915_hw_ppgtt *ppgtt,
struct drm_device *dev = ppgtt->base.dev;
struct drm_i915_private *dev_priv = dev->dev_private;
uint32_t ecochk, gab_ctl, ecobits;
- int ret;
ecobits = I915_READ(GAC_ECO_BITS);
I915_WRITE(GAC_ECO_BITS, ecobits | ECOBITS_SNB_BIT |
@@ -1010,10 +986,6 @@ static int gen6_ppgtt_enable(struct i915_hw_ppgtt *ppgtt,
I915_WRITE(GFX_MODE, _MASKED_BIT_ENABLE(GFX_PPGTT_ENABLE));
- ret = ppgtt->sync_switch_mm(ppgtt, ring);
- if (ret)
- return ret;
-
return 0;
}
diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.c b/drivers/gpu/drm/i915/intel_ringbuffer.c
index e53e32e..8050c70 100644
--- a/drivers/gpu/drm/i915/intel_ringbuffer.c
+++ b/drivers/gpu/drm/i915/intel_ringbuffer.c
@@ -1481,6 +1481,14 @@ static int intel_init_ring_buffer(struct drm_device *dev,
if (dev_priv->mm.aliasing_ppgtt) {
struct i915_hw_ppgtt *ppgtt = dev_priv->mm.aliasing_ppgtt;
ppgtt->enable(ppgtt, ring);
+
+ /* We promise to do a switch later with FULL PPGTT. If this is
+ * aliasing, this is the one and only switch we'll do */
+ if (!USES_FULL_PPGTT(dev)) {
+ ret = ppgtt->sync_switch_mm(ppgtt, ring);
+ if (ret)
+ goto error;
+ }
}
return 0;
--
1.9.0
next prev parent reply other threads:[~2014-06-18 16:20 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-18 16:15 [PATCH 1/8] drm/i915: Get rid of the synchronous flag in switch_mm oscar.mateo
2014-06-18 16:15 ` [PATCH 2/8] drm/i915/bdw: If we are in reset, switch the GEN8 ppgtt synchronously oscar.mateo
2014-06-18 16:15 ` [PATCH 3/8] drm/i915: Enable the PPGTT in the ring init oscar.mateo
2014-06-18 16:15 ` oscar.mateo [this message]
2014-06-18 16:27 ` [PATCH 1/8] drm/i915: Get rid of the synchronous flag in switch_mm Mateo Lozano, Oscar
2014-06-18 19:50 ` Daniel Vetter
2014-06-19 14:00 ` Mateo Lozano, Oscar
2014-06-19 16:03 ` Daniel Vetter
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=1403108138-6366-4-git-send-email-oscar.mateo@intel.com \
--to=oscar.mateo@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