public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
To: Intel-gfx@lists.freedesktop.org
Subject: [RFC 11/14] drm/i915: Consolidate some open coded mmio rmw
Date: Mon, 10 Jun 2019 16:54:16 +0100	[thread overview]
Message-ID: <20190610155419.23723-12-tvrtko.ursulin@linux.intel.com> (raw)
In-Reply-To: <20190610155419.23723-1-tvrtko.ursulin@linux.intel.com>

From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

Replace some gen6/7 open coded rmw with intel_uncore_rmw.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
---
 drivers/gpu/drm/i915/i915_gem_gtt.c | 41 +++++++++++++----------------
 1 file changed, 18 insertions(+), 23 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c b/drivers/gpu/drm/i915/i915_gem_gtt.c
index 7d0b7a47f761..979305343ac3 100644
--- a/drivers/gpu/drm/i915/i915_gem_gtt.c
+++ b/drivers/gpu/drm/i915/i915_gem_gtt.c
@@ -1699,13 +1699,10 @@ static void gen7_ppgtt_enable(struct intel_gt *gt)
 	struct drm_i915_private *i915 = gt_to_i915(gt);
 	struct intel_uncore *uncore = gt_to_uncore(gt);
 	struct intel_engine_cs *engine;
-	u32 ecochk, ecobits;
 	enum intel_engine_id id;
+	u32 ecochk;
 
-	ecobits = intel_uncore_read(uncore, GAC_ECO_BITS);
-	intel_uncore_write(uncore,
-			   GAC_ECO_BITS,
-			   ecobits | ECOBITS_PPGTT_CACHE64B);
+	intel_uncore_rmw(uncore, GAC_ECO_BITS, 0, ECOBITS_PPGTT_CACHE64B);
 
 	ecochk = intel_uncore_read(uncore, GAM_ECOCHK);
 	if (IS_HASWELL(i915)) {
@@ -1727,22 +1724,21 @@ static void gen7_ppgtt_enable(struct intel_gt *gt)
 static void gen6_ppgtt_enable(struct intel_gt *gt)
 {
 	struct intel_uncore *uncore = gt_to_uncore(gt);
-	u32 ecochk, gab_ctl, ecobits;
 
-	ecobits = intel_uncore_read(uncore, GAC_ECO_BITS);
-	intel_uncore_write(uncore,
-			   GAC_ECO_BITS,
-			   ecobits | ECOBITS_SNB_BIT | ECOBITS_PPGTT_CACHE64B);
+	intel_uncore_rmw(uncore,
+			 GAC_ECO_BITS,
+			 0,
+			 ECOBITS_SNB_BIT | ECOBITS_PPGTT_CACHE64B);
 
-	gab_ctl = intel_uncore_read(uncore, GAB_CTL);
-	intel_uncore_write(uncore,
-			   GAB_CTL,
-			   gab_ctl | GAB_CTL_CONT_AFTER_PAGEFAULT);
+	intel_uncore_rmw(uncore,
+			 GAB_CTL,
+			 0,
+			 GAB_CTL_CONT_AFTER_PAGEFAULT);
 
-	ecochk = intel_uncore_read(uncore, GAM_ECOCHK);
-	intel_uncore_write(uncore,
-			   GAM_ECOCHK,
-			   ecochk | ECOCHK_SNB_BIT | ECOCHK_PPGTT_CACHE64B);
+	intel_uncore_rmw(uncore,
+			 GAM_ECOCHK,
+			 0,
+			 ECOCHK_SNB_BIT | ECOCHK_PPGTT_CACHE64B);
 
 	if (HAS_PPGTT(uncore_to_i915(uncore))) /* may be disabled for VT-d */
 		intel_uncore_write(uncore,
@@ -2239,11 +2235,10 @@ static void gtt_write_workarounds(struct intel_gt *gt)
 	 */
 	if (HAS_PAGE_SIZES(i915, I915_GTT_PAGE_SIZE_64K) &&
 	    INTEL_GEN(i915) <= 10)
-		intel_uncore_write(uncore,
-				   GEN8_GAMW_ECO_DEV_RW_IA,
-				   intel_uncore_read(uncore,
-						     GEN8_GAMW_ECO_DEV_RW_IA) |
-				   GAMW_ECO_ENABLE_64K_IPS_FIELD);
+		intel_uncore_rmw(uncore,
+				 GEN8_GAMW_ECO_DEV_RW_IA,
+				 0,
+				 GAMW_ECO_ENABLE_64K_IPS_FIELD);
 }
 
 int i915_ppgtt_init_hw(struct intel_gt *gt)
-- 
2.20.1

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

  parent reply	other threads:[~2019-06-10 15:54 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-10 15:54 [RFC v2 00/14] Implicit dev_priv removal Tvrtko Ursulin
2019-06-10 15:54 ` [RFC 01/14] drm/i915: Make i915_check_and_clear_faults take uncore Tvrtko Ursulin
2019-06-10 16:26   ` Chris Wilson
2019-06-11  8:35     ` Tvrtko Ursulin
2019-06-11  8:52       ` Chris Wilson
2019-06-11 12:05         ` Tvrtko Ursulin
2019-06-11 12:12           ` Chris Wilson
2019-06-10 15:54 ` [RFC 02/14] drm/i915: Convert intel_vgt_(de)balloon to uncore Tvrtko Ursulin
2019-06-10 15:54 ` [RFC 03/14] drm/i915: Introduce struct intel_gt as replacement for anonymous i915->gt Tvrtko Ursulin
2019-06-10 15:54 ` [RFC 04/14] drm/i915: Add a couple intel_gt helpers Tvrtko Ursulin
2019-06-10 16:19   ` Chris Wilson
2019-06-10 15:54 ` [RFC 05/14] drm/i915: Convert i915_gem_init_swizzling to intel_gt Tvrtko Ursulin
2019-06-10 15:54 ` [RFC 06/14] drm/i915: Convert init_unused_rings " Tvrtko Ursulin
2019-06-10 15:54 ` [RFC 07/14] drm/i915: Convert gt workarounds " Tvrtko Ursulin
2019-06-10 15:54 ` [RFC 08/14] drm/i915: Store backpointer to intel_gt in the engine Tvrtko Ursulin
2019-06-10 16:16   ` Chris Wilson
2019-06-10 18:17     ` Daniele Ceraolo Spurio
2019-06-11  8:41       ` Tvrtko Ursulin
2019-06-11  9:36         ` Chris Wilson
2019-06-11 16:42           ` Daniele Ceraolo Spurio
2019-06-10 15:54 ` [RFC 09/14] drm/i915: Convert intel_mocs_init_l3cc_table to intel_gt Tvrtko Ursulin
2019-06-10 15:54 ` [RFC 10/14] drm/i915: Convert i915_ppgtt_init_hw " Tvrtko Ursulin
2019-06-10 15:54 ` Tvrtko Ursulin [this message]
2019-06-10 15:54 ` [RFC 12/14] drm/i915: Convert i915_gem_init_hw " Tvrtko Ursulin
2019-06-10 15:54 ` [RFC 13/14] drm/i915/guc: Move intel_guc_reserved_gtt_size to intel_wopcm_guc_size Tvrtko Ursulin
2019-06-10 18:29   ` Michal Wajdeczko
2019-06-10 15:54 ` [RFC 14/14] drm/i915: Make GuC GGTT reservation work on ggtt Tvrtko Ursulin
2019-06-10 18:43   ` Michal Wajdeczko
2019-06-10 17:42 ` ✗ Fi.CI.CHECKPATCH: warning for Implicit dev_priv removal (rev2) Patchwork
2019-06-10 17:48 ` ✗ Fi.CI.SPARSE: " Patchwork
2019-06-10 18:05 ` ✓ Fi.CI.BAT: success " Patchwork
2019-06-11 23:03 ` ✓ 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=20190610155419.23723-12-tvrtko.ursulin@linux.intel.com \
    --to=tvrtko.ursulin@linux.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