Skip to contentSkip to conversation

drm/i915/gt: Replace I915_WRITE with its uncore counterpart

PATCH In review Andi Shyti 3 participants 4 messages Dec 6, 2019

Subsystems (2)
lore
Share & tools
lore

Andi Shyti

author
#0 lore raw

PATCH 1/1 drm/i915/gt: Replace I915_WRITE with its uncore counterpart

From: Andi Shyti <[email protected]>

Get rid of the last remaining I915_WRITEs and replace them with intel_uncore_write().

---
 .../gpu/drm/i915/gt/intel_ring_submission.c   | 48 ++++++++++---------
 1 file changed, 25 insertions(+), 23 deletions(-)
drivers/gpu/drm/i915/gt/intel_ring_submission.c +25 -23
index 9f27289b7249..f66220f3c0e6 100644
@@ -497,14 +497,13 @@ static void set_hwstam(struct intel_engine_cs *engine, u32 mask)
 
 static void set_hws_pga(struct intel_engine_cs *engine, phys_addr_t phys)
 {
-	struct drm_i915_private *dev_priv = engine->i915;
 	u32 addr;
 
 	addr = lower_32_bits(phys);
-	if (INTEL_GEN(dev_priv) >= 4)
+	if (INTEL_GEN(engine->i915) >= 4)
 		addr |= (phys >> 28) & 0xf0;
 
-	I915_WRITE(HWS_PGA, addr);
+	intel_uncore_write(engine->uncore, HWS_PGA, addr);
 }
 
 static struct page *status_page(struct intel_engine_cs *engine)
@@ -523,14 +522,13 @@ static void ring_setup_phys_status_page(struct intel_engine_cs *engine)
 
 static void set_hwsp(struct intel_engine_cs *engine, u32 offset)
 {
-	struct drm_i915_private *dev_priv = engine->i915;
 	i915_reg_t hwsp;
 
 	/*
 	 * The ring status page addresses are no longer next to the rest of
 	 * the ring registers as of gen7.
 	 */
-	if (IS_GEN(dev_priv, 7)) {
+	if (IS_GEN(engine->i915, 7)) {
 		switch (engine->id) {
 		/*
 		 * No more rings exist on Gen7. Default case is only to shut up
@@ -552,14 +550,14 @@ static void set_hwsp(struct intel_engine_cs *engine, u32 offset)
 			hwsp = VEBOX_HWS_PGA_GEN7;
 			break;
 		}
-	} else if (IS_GEN(dev_priv, 6)) {
+	} else if (IS_GEN(engine->i915, 6)) {
 		hwsp = RING_HWS_PGA_GEN6(engine->mmio_base);
 	} else {
 		hwsp = RING_HWS_PGA(engine->mmio_base);
 	}
 
-	I915_WRITE(hwsp, offset);
-	POSTING_READ(hwsp);
+	intel_uncore_write(engine->uncore, hwsp, offset);
+	intel_uncore_posting_read(engine->uncore, hwsp);
 }
 
 static void flush_cs_tlb(struct intel_engine_cs *engine)
@@ -843,7 +841,8 @@ static void reset_finish(struct intel_engine_cs *engine)
 
 static int rcs_resume(struct intel_engine_cs *engine)
 {
-	struct drm_i915_private *dev_priv = engine->i915;
+	struct drm_i915_private *i915 = engine->i915;
+	struct intel_uncore *uncore = engine->uncore;
 
 	/*
 	 * Disable CONSTANT_BUFFER before it is loaded from the context
@@ -855,13 +854,14 @@ static int rcs_resume(struct intel_engine_cs *engine)
 	 * they are already accustomed to from before contexts were
 	 * enabled.
 	 */
-	if (IS_GEN(dev_priv, 4))
-		I915_WRITE(ECOSKPD,
+	if (IS_GEN(i915, 4))
+		intel_uncore_write(uncore, ECOSKPD,
 			   _MASKED_BIT_ENABLE(ECO_CONSTANT_BUFFER_SR_DISABLE));
 
 	/* WaTimedSingleVertexDispatch:cl,bw,ctg,elk,ilk,snb */
-	if (IS_GEN_RANGE(dev_priv, 4, 6))
-		I915_WRITE(MI_MODE, _MASKED_BIT_ENABLE(VS_TIMER_DISPATCH));
+	if (IS_GEN_RANGE(i915, 4, 6))
+		intel_uncore_write(uncore, MI_MODE,
+				   _MASKED_BIT_ENABLE(VS_TIMER_DISPATCH));
 
 	/* We need to disable the AsyncFlip performance optimisations in order
 	 * to use MI_WAIT_FOR_EVENT within the CS. It should already be
@@ -869,33 +869,35 @@ static int rcs_resume(struct intel_engine_cs *engine)
 	 *
 	 * WaDisableAsyncFlipPerfMode:snb,ivb,hsw,vlv
 	 */
-	if (IS_GEN_RANGE(dev_priv, 6, 7))
-		I915_WRITE(MI_MODE, _MASKED_BIT_ENABLE(ASYNC_FLIP_PERF_DISABLE));
+	if (IS_GEN_RANGE(i915, 6, 7))
+		intel_uncore_write(uncore, MI_MODE,
+				   _MASKED_BIT_ENABLE(ASYNC_FLIP_PERF_DISABLE));
 
 	/* Required for the hardware to program scanline values for waiting */
 	/* WaEnableFlushTlbInvalidationMode:snb */
-	if (IS_GEN(dev_priv, 6))
-		I915_WRITE(GFX_MODE,
+	if (IS_GEN(i915, 6))
+		intel_uncore_write(uncore, GFX_MODE,
 			   _MASKED_BIT_ENABLE(GFX_TLB_INVALIDATE_EXPLICIT));
 
 	/* WaBCSVCSTlbInvalidationMode:ivb,vlv,hsw */
-	if (IS_GEN(dev_priv, 7))
-		I915_WRITE(GFX_MODE_GEN7,
+	if (IS_GEN(i915, 7))
+		intel_uncore_write(uncore, GFX_MODE_GEN7,
 			   _MASKED_BIT_ENABLE(GFX_TLB_INVALIDATE_EXPLICIT) |
 			   _MASKED_BIT_ENABLE(GFX_REPLAY_MODE));
 
-	if (IS_GEN(dev_priv, 6)) {
+	if (IS_GEN(i915, 6)) {
 		/* From the Sandybridge PRM, volume 1 part 3, page 24:
 		 * "If this bit is set, STCunit will have LRA as replacement
 		 *  policy. [...] This bit must be reset.  LRA replacement
 		 *  policy is not supported."
 		 */
-		I915_WRITE(CACHE_MODE_0,
+		intel_uncore_write(uncore, CACHE_MODE_0,
 			   _MASKED_BIT_DISABLE(CM0_STC_EVICT_DISABLE_LRA_SNB));
 	}
 
-	if (IS_GEN_RANGE(dev_priv, 6, 7))
-		I915_WRITE(INSTPM, _MASKED_BIT_ENABLE(INSTPM_FORCE_ORDERING));
+	if (IS_GEN_RANGE(i915, 6, 7))
+		intel_uncore_write(uncore, INSTPM,
+				   _MASKED_BIT_ENABLE(INSTPM_FORCE_ORDERING));
 
 	return xcs_resume(engine);
 }
Signature · 6 lines
2.24.0

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Reviewed-by on v1 1/1
#1 lore raw

Quoting Andi Shyti (2019-12-06 21:24:17)

Quoted 6 lines

From: Andi Shyti <[email protected]>

Get rid of the last remaining I915_WRITEs and replace them with intel_uncore_write().

Straightforward translation,

-Chris
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#2 lore raw

[Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/i915/gt: Replace I915_WRITE with its uncore counterpart

In reply to Andi Shyti
== Series Details ==

== Series Details ==

Series: drm/i915/gt: Replace I915_WRITE with its uncore counterpart
URL : https://patchwork.freedesktop.org/series/70575/
State : warning

== Summary ==

$ dim checkpatch origin/drm-tip
addcad6b8cf1 drm/i915/gt: Replace I915_WRITE with its uncore counterpart
-:84: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis
#84: FILE: drivers/gpu/drm/i915/gt/intel_ring_submission.c:859:
+		intel_uncore_write(uncore, ECOSKPD,
 			   _MASKED_BIT_ENABLE(ECO_CONSTANT_BUFFER_SR_DISABLE));

-:111: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #111: FILE: drivers/gpu/drm/i915/gt/intel_ring_submission.c:880:
+ intel_uncore_write(uncore, GFX_MODE,
_MASKED_BIT_ENABLE(GFX_TLB_INVALIDATE_EXPLICIT));

-:118: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #118: FILE: drivers/gpu/drm/i915/gt/intel_ring_submission.c:885:
+ intel_uncore_write(uncore, GFX_MODE_GEN7,
_MASKED_BIT_ENABLE(GFX_TLB_INVALIDATE_EXPLICIT) |

-:130: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #130: FILE: drivers/gpu/drm/i915/gt/intel_ring_submission.c:895:
+ intel_uncore_write(uncore, CACHE_MODE_0,
_MASKED_BIT_DISABLE(CM0_STC_EVICT_DISABLE_LRA_SNB));

total: 0 errors, 0 warnings, 4 checks, 120 lines checked

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#3 lore raw

[Intel-gfx] ✗ Fi.CI.BAT: failure for drm/i915/gt: Replace I915_WRITE with its uncore counterpart

In reply to Andi Shyti
== Series Details ==

== Series Details ==

Series: drm/i915/gt: Replace I915_WRITE with its uncore counterpart
URL : https://patchwork.freedesktop.org/series/70575/
State : failure

== Summary ==

CI Bug Log - changes from CI_DRM_7503 -> Patchwork_15634
====================================================

Summary
-------

**FAILURE**

Serious unknown changes coming with Patchwork_15634 absolutely need to be verified manually.

If you think the reported changes have nothing to do with the changes introduced in Patchwork_15634, please notify your bug team to allow them to document this new failure mode, which will reduce false positives in CI.

External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15634/index.html

Possible new issues
-------------------

Here are the unknown changes that may have been introduced in Patchwork_15634:

### IGT changes ###

#### Possible regressions ####

* igt@i915_selftest@live_blt:
- fi-ivb-3770: [PASS][1] -> [DMESG-FAIL][2]
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7503/fi-ivb-3770/igt@i915_selftest@live_blt.html
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15634/fi-ivb-3770/igt@i915_selftest@live_blt.html

Known issues
------------

Here are the changes found in Patchwork_15634 that come from known issues:

### IGT changes ###

#### Issues hit ####

* igt@i915_selftest@live_blt:
- fi-hsw-4770: [PASS][3] -> [DMESG-FAIL][4] ([i915#725])
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7503/fi-hsw-4770/igt@i915_selftest@live_blt.html
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15634/fi-hsw-4770/igt@i915_selftest@live_blt.html

* igt@i915_selftest@live_gem_contexts:
- fi-byt-n2820: [PASS][5] -> [INCOMPLETE][6] ([i915#45])
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7503/fi-byt-n2820/igt@i915_selftest@live_gem_contexts.html
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15634/fi-byt-n2820/igt@i915_selftest@live_gem_contexts.html

#### Possible fixes ####

* igt@gem_exec_gttfill@basic:
- {fi-tgl-u}: [INCOMPLETE][7] ([fdo#111593]) -> [PASS][8]
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7503/fi-tgl-u/igt@[email protected]
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15634/fi-tgl-u/igt@[email protected]

* igt@i915_selftest@live_gem_contexts:
- fi-hsw-peppy: [INCOMPLETE][9] ([i915#694]) -> [PASS][10]
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7503/fi-hsw-peppy/igt@i915_selftest@live_gem_contexts.html
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15634/fi-hsw-peppy/igt@i915_selftest@live_gem_contexts.html

#### Warnings ####

* igt@i915_selftest@live_gt_pm:
- fi-icl-guc: [INCOMPLETE][11] ([i915#140]) -> [DMESG-FAIL][12] ([i915#571])
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7503/fi-icl-guc/igt@i915_selftest@live_gt_pm.html
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15634/fi-icl-guc/igt@i915_selftest@live_gt_pm.html

{name}: This element is suppressed. This means it is ignored when computing
the status of the difference (SUCCESS, WARNING, or FAILURE).

[fdo#111593]: https://bugs.freedesktop.org/show_bug.cgi?id=111593
[i915#109]: https://gitlab.freedesktop.org/drm/intel/issues/109
[i915#140]: https://gitlab.freedesktop.org/drm/intel/issues/140
[i915#45]: https://gitlab.freedesktop.org/drm/intel/issues/45
[i915#571]: https://gitlab.freedesktop.org/drm/intel/issues/571
[i915#591]: https://gitlab.freedesktop.org/drm/intel/issues/591
[i915#694]: https://gitlab.freedesktop.org/drm/intel/issues/694
[i915#710]: https://gitlab.freedesktop.org/drm/intel/issues/710
[i915#725]: https://gitlab.freedesktop.org/drm/intel/issues/725
[i915#92]: https://gitlab.freedesktop.org/drm/intel/issues/92

Participating hosts (40 -> 32)
------------------------------

Additional (1): fi-apl-guc
Missing (9): fi-hsw-4770r fi-ilk-m540 fi-cml-s fi-hsw-4200u fi-byt-squawks fi-bsw-cyan fi-ctg-p8600 fi-byt-clapper fi-bdw-samus

Build changes
-------------

* CI: CI-20190529 -> None
* Linux: CI_DRM_7503 -> Patchwork_15634

CI-20190529: 20190529
CI_DRM_7503: f475d85ea67eb3fe205a836461096fc082db01bf @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_5335: 06aa2c377ed40df1e246fca009c441fa18e53825 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_15634: addcad6b8cf1e6ea2291fd254319f75e7412f27b @ git://anongit.freedesktop.org/gfx-ci/linux

== Linux commits ==

addcad6b8cf1 drm/i915/gt: Replace I915_WRITE with its uncore counterpart

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15634/index.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx