All of lore.kernel.org
 help / color / mirror / Atom feed
From: Zhao Yakui <yakui.zhao@intel.com>
To: intel-gfx@lists.freedesktop.org
Subject: [PATCH v2 1/2] drm/i915: Use 64-bit to Read/Write fence reg on SNB+
Date: Tue,  3 Jul 2018 10:56:16 +0800	[thread overview]
Message-ID: <1530586577-20605-2-git-send-email-yakui.zhao@intel.com> (raw)
In-Reply-To: <1530586577-20605-1-git-send-email-yakui.zhao@intel.com>

Based on HW spec the fence reg on SNB+ is defined as 64-bit. Just follow
the b-spec to  use 64-bit read/write mode.

Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
---
 drivers/gpu/drm/i915/i915_gem_fence_reg.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_gem_fence_reg.c b/drivers/gpu/drm/i915/i915_gem_fence_reg.c
index d548ac0..d92fe03 100644
--- a/drivers/gpu/drm/i915/i915_gem_fence_reg.c
+++ b/drivers/gpu/drm/i915/i915_gem_fence_reg.c
@@ -63,6 +63,7 @@ static void i965_write_fence_reg(struct drm_i915_fence_reg *fence,
 	i915_reg_t fence_reg_lo, fence_reg_hi;
 	int fence_pitch_shift;
 	u64 val;
+	struct drm_i915_private *dev_priv = fence->i915;
 
 	if (INTEL_GEN(fence->i915) >= 6) {
 		fence_reg_lo = FENCE_REG_GEN6_LO(fence->id);
@@ -92,9 +93,14 @@ static void i965_write_fence_reg(struct drm_i915_fence_reg *fence,
 		val |= I965_FENCE_REG_VALID;
 	}
 
-	if (!pipelined) {
-		struct drm_i915_private *dev_priv = fence->i915;
+	if (INTEL_GEN(fence->i915) >= 6) {
+		/* Use the 64-bit RW to read/write fence reg on SNB+ */
+		I915_WRITE64_FW(fence_reg_lo, 0);
+		I915_READ64(fence_reg_lo);
 
+		I915_WRITE64_FW(fence_reg_lo, val);
+		I915_READ64(fence_reg_lo);
+	} else {
 		/* To w/a incoherency with non-atomic 64-bit register updates,
 		 * we split the 64-bit update into two 32-bit writes. In order
 		 * for a partial fence not to be evaluated between writes, we
-- 
2.7.4

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

  reply	other threads:[~2018-07-03  2:56 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-03  2:56 [PATCH v2 0/2] drm/i915: Optimize the read/write fence_reg on SNB+ Zhao Yakui
2018-07-03  2:56 ` Zhao Yakui [this message]
2018-07-03  8:49   ` [PATCH v2 1/2] drm/i915: Use 64-bit to Read/Write fence reg " Daniel Vetter
2018-07-03  9:01     ` Chris Wilson
2018-07-03 10:11       ` Zhao, Yakui
2018-07-03  2:56 ` [PATCH v2 2/2] drm/i915: write fence reg only once on VGPU Zhao Yakui
2018-07-03  8:51   ` Daniel Vetter
2018-07-03  9:05     ` Chris Wilson
2018-07-03  9:52       ` Daniel Vetter
2018-07-03 12:47         ` Zhao, Yakui
2018-07-03 13:24           ` Chris Wilson
2018-07-03 13:58             ` Zhao, Yakui
2018-07-03 14:07               ` Chris Wilson
2018-07-04  2:09                 ` Zhao, Yakui
2018-07-04  9:40                   ` Chris Wilson
2018-07-03 10:14     ` Zhao, Yakui
2018-07-03  3:13 ` ✗ Fi.CI.CHECKPATCH: warning for drm/i915: Optimize the read/write fence_reg on SNB+ Patchwork
2018-07-03  3:30 ` ✓ Fi.CI.BAT: success " Patchwork
2018-07-03  4:22 ` ✓ Fi.CI.IGT: " 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=1530586577-20605-2-git-send-email-yakui.zhao@intel.com \
    --to=yakui.zhao@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 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.