Skip to contentSkip to conversation

drm/i915: use intel_uncore_rmw when appropriate

PATCH Superseded Andrzej Hajda 3 participants 4 messages Oct 17, 2022 – Oct 18, 2022

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/i915: use intel_uncore_rmw when appropriate

This patch replaces all occurences of the form intel_uncore_write(reg, intel_uncore_read(reg) OP val) with intel_uncore_rmw.

---
Apparently I have missed this pattern during refactoring.

Regards
Andrzej

---
 drivers/gpu/drm/i915/gt/intel_rps.c |   4 +-
 drivers/gpu/drm/i915/intel_pm.c     | 190 ++++++++++------------------
 2 files changed, 68 insertions(+), 126 deletions(-)
drivers/gpu/drm/i915/gt/intel_rps.c +1 -3
index fc23c562d9b2a7..070005dd0da476 100644
@@ -625,9 +625,7 @@ static void gen5_rps_disable(struct intel_rps *rps)
 	rgvswctl = intel_uncore_read16(uncore, MEMSWCTL);
 
 	/* Ack interrupts, disable EFC interrupt */
-	intel_uncore_write(uncore, MEMINTREN,
-			   intel_uncore_read(uncore, MEMINTREN) &
-			   ~MEMINT_EVAL_CHG_EN);
+	intel_uncore_rmw(uncore, MEMINTREN, MEMINT_EVAL_CHG_EN, 0);
 	intel_uncore_write(uncore, MEMINTRSTS, MEMINT_EVAL_CHG);
 
 	/* Go back to the starting frequency */
drivers/gpu/drm/i915/intel_pm.c +67 -123

429 lines not on this page · raw message

Signature · 1 line
2.34.1
#1 lore raw

[Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/i915: use intel_uncore_rmw when appropriate

== Series Details ==

== Series Details ==

Series: drm/i915: use intel_uncore_rmw when appropriate
URL : https://patchwork.freedesktop.org/series/109765/
State : warning

== Summary ==

Error: dim checkpatch failed
a20d0ab10cf0 drm/i915: use intel_uncore_rmw when appropriate -:75: WARNING:LONG_LINE: line length of 101 exceeds 100 columns #75: FILE: drivers/gpu/drm/i915/intel_pm.c:88:
+ intel_uncore_rmw(&dev_priv->uncore, GEN8_UCGCTL6, 0, GEN8_HDCUNIT_CLOCK_GATE_DISABLE_HDCREQ);

total: 0 errors, 1 warnings, 0 checks, 439 lines checked

#2 lore raw

[Intel-gfx] ✗ Fi.CI.BAT: failure for drm/i915: use intel_uncore_rmw when appropriate

In reply to Andrzej Hajda
== Series Details ==

== Series Details ==

Series: drm/i915: use intel_uncore_rmw when appropriate
URL : https://patchwork.freedesktop.org/series/109765/
State : failure

== Summary ==

CI Bug Log - changes from CI_DRM_12251 -> Patchwork_109765v1
====================================================

Summary
-------

**FAILURE**

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

If you think the reported changes have nothing to do with the changes introduced in Patchwork_109765v1, 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_109765v1/index.html

Participating hosts (44 -> 44)
------------------------------

Additional (3): fi-hsw-4770 fi-rkl-11600 bat-dg1-5
Missing (3): bat-dg2-11 fi-icl-u2 fi-bdw-samus

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

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

### IGT changes ###

#### Possible regressions ####

* igt@runner@aborted:
- bat-dg1-5: NOTRUN -> [FAIL][1]
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109765v1/bat-dg1-5/igt@[email protected]

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

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

### IGT changes ###

#### Issues hit ####

* igt@i915_pm_backlight@basic-brightness:
- fi-hsw-4770: NOTRUN -> [SKIP][2] ([fdo#109271] / [i915#3012])
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109765v1/fi-hsw-4770/igt@[email protected]

* igt@i915_pm_rpm@module-reload:
- fi-hsw-4770: NOTRUN -> [INCOMPLETE][3] ([i915#7221])
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109765v1/fi-hsw-4770/igt@[email protected]

* igt@kms_addfb_basic@addfb25-y-tiled-small-legacy:
- fi-hsw-4770: NOTRUN -> [SKIP][4] ([fdo#109271]) +9 similar issues
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109765v1/fi-hsw-4770/igt@[email protected]

* igt@kms_chamelium@dp-crc-fast:
- fi-hsw-4770: NOTRUN -> [SKIP][5] ([fdo#109271] / [fdo#111827]) +7 similar issues
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109765v1/fi-hsw-4770/igt@[email protected]

* igt@kms_psr@sprite_plane_onoff:
- fi-hsw-4770: NOTRUN -> [SKIP][6] ([fdo#109271] / [i915#1072]) +3 similar issues
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109765v1/fi-hsw-4770/igt@kms_psr@sprite_plane_onoff.html

* igt@runner@aborted:
- fi-hsw-4770: NOTRUN -> [FAIL][7] ([fdo#109271] / [i915#4312] / [i915#5594])
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109765v1/fi-hsw-4770/igt@[email protected]
- fi-rkl-11600: NOTRUN -> [FAIL][8] ([i915#7220])
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109765v1/fi-rkl-11600/igt@[email protected]

#### Possible fixes ####

* igt@kms_cursor_legacy@basic-busy-flip-before-cursor@atomic-transitions-varying-size:
- fi-bsw-kefka: [FAIL][9] ([i915#6298]) -> [PASS][10]
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12251/fi-bsw-kefka/igt@kms_cursor_legacy@basic-busy-flip-before-cursor@atomic-transitions-varying-size.html
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109765v1/fi-bsw-kefka/igt@kms_cursor_legacy@basic-busy-flip-before-cursor@atomic-transitions-varying-size.html

[fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
[fdo#111827]: https://bugs.freedesktop.org/show_bug.cgi?id=111827
[i915#1072]: https://gitlab.freedesktop.org/drm/intel/issues/1072
[i915#3012]: https://gitlab.freedesktop.org/drm/intel/issues/3012
[i915#4312]: https://gitlab.freedesktop.org/drm/intel/issues/4312
[i915#5594]: https://gitlab.freedesktop.org/drm/intel/issues/5594
[i915#6298]: https://gitlab.freedesktop.org/drm/intel/issues/6298
[i915#7220]: https://gitlab.freedesktop.org/drm/intel/issues/7220
[i915#7221]: https://gitlab.freedesktop.org/drm/intel/issues/7221

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

* Linux: CI_DRM_12251 -> Patchwork_109765v1

CI-20190529: 20190529
CI_DRM_12251: ff61e79b01712f5d31a4c4f23c6971bbaa71cecb @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_7016: 642f4bf44e2b42791b4d1684936a1bfbe2d099ee @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git
Patchwork_109765v1: ff61e79b01712f5d31a4c4f23c6971bbaa71cecb @ git://anongit.freedesktop.org/gfx-ci/linux

### Linux commits

2103e1591e98 drm/i915: use intel_uncore_rmw when appropriate

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109765v1/index.html

#3 lore raw
In reply to Andrzej Hajda
Quoted 20 lines · Andrzej Hajda

This patch replaces all occurences of the form intel_uncore_write(reg, intel_uncore_read(reg) OP val) with intel_uncore_rmw.

---
Apparently I have missed this pattern during refactoring.

Regards
Andrzej

---
 drivers/gpu/drm/i915/gt/intel_rps.c |   4 +-
 drivers/gpu/drm/i915/intel_pm.c     | 190 ++++++++++------------------
 2 files changed, 68 insertions(+), 126 deletions(-)
drivers/gpu/drm/i915/gt/intel_rps.c +0 -0
index fc23c562d9b2a7..070005dd0da476 100644

drivers/gpu/drm/i915/gt/intel_rps.c static void gen5_rps_disable(struct intel_rps *rps) · line 631

Quoted 10 lines
drivers/gpu/drm/i915/gt/intel_rps.c +1 -3
@@ -625,9 +625,7 @@ static void gen5_rps_disable(struct intel_rps *rps)
 	rgvswctl = intel_uncore_read16(uncore, MEMSWCTL);
 
 	/* Ack interrupts, disable EFC interrupt */
-	intel_uncore_write(uncore, MEMINTREN,
-			   intel_uncore_read(uncore, MEMINTREN) &
-			   ~MEMINT_EVAL_CHG_EN);
+	intel_uncore_rmw(uncore, MEMINTREN, MEMINT_EVAL_CHG_EN, 0);
 	intel_uncore_write(uncore, MEMINTRSTS, MEMINT_EVAL_CHG);
 
 	/* Go back to the starting frequency */

Maybe split the gt stuff to a separate patch?

Quoted 4 lines
drivers/gpu/drm/i915/intel_pm.c +0 -0
index 19d4a88184d7a1..4d264147ada94b 100644

<snip>

drivers/gpu/drm/i915/intel_pm.c static void lpt_init_clock_gating(struct drm_i915_private *dev_priv) · line 4275

Quoted 8 lines
drivers/gpu/drm/i915/intel_pm.c +1 -3
@@ -4293,14 +4272,12 @@ static void lpt_init_clock_gating(struct drm_i915_private *dev_priv)
 	 * disabled when not needed anymore in order to save power.
 	 */
 	if (HAS_PCH_LPT_LP(dev_priv))
-		intel_uncore_write(&dev_priv->uncore, SOUTH_DSPCLK_GATE_D,
-			   intel_uncore_read(&dev_priv->uncore, SOUTH_DSPCLK_GATE_D) |
-			   PCH_LP_PARTITION_LEVEL_DISABLE);
+		intel_uncore_rmw(&dev_priv->uncore, SOUTH_DSPCLK_GATE_D, 0,
                                                                        ^

I'd put the newline there in these cases. That way everything we're doing to the register value would be neatly on the same line instead of spread around like this.

Quoted 11 lines
drivers/gpu/drm/i915/intel_pm.c +3 -3
+				 PCH_LP_PARTITION_LEVEL_DISABLE);
 
 	/* WADPOClockGatingDisable:hsw */
-	intel_uncore_write(&dev_priv->uncore, TRANS_CHICKEN1(PIPE_A),
-		   intel_uncore_read(&dev_priv->uncore, TRANS_CHICKEN1(PIPE_A)) |
-		   TRANS_CHICKEN1_DP0UNIT_GC_DISABLE);
+	intel_uncore_rmw(&dev_priv->uncore, TRANS_CHICKEN1(PIPE_A), 0,
+			 TRANS_CHICKEN1_DP0UNIT_GC_DISABLE);
 }
 
 static void lpt_suspend_hw(struct drm_i915_private *dev_priv)

<snip>

Quoted 24 lines
drivers/gpu/drm/i915/intel_pm.c +4 -9
@@ -4532,43 +4494,37 @@ static void bdw_init_clock_gating(struct drm_i915_private *dev_priv)
 	enum pipe pipe;
 
 	/* WaFbcAsynchFlipDisableFbcQueue:hsw,bdw */
-	intel_uncore_write(&dev_priv->uncore, CHICKEN_PIPESL_1(PIPE_A),
-		   intel_uncore_read(&dev_priv->uncore, CHICKEN_PIPESL_1(PIPE_A)) |
-		   HSW_FBCQ_DIS);
+	intel_uncore_rmw(&dev_priv->uncore, CHICKEN_PIPESL_1(PIPE_A), 0, HSW_FBCQ_DIS);
 
 	/* WaSwitchSolVfFArbitrationPriority:bdw */
-	intel_uncore_write(&dev_priv->uncore, GAM_ECOCHK, intel_uncore_read(&dev_priv->uncore, GAM_ECOCHK) | HSW_ECOCHK_ARB_PRIO_SOL);
+	intel_uncore_rmw(&dev_priv->uncore, GAM_ECOCHK, 0, HSW_ECOCHK_ARB_PRIO_SOL);
 
 	/* WaPsrDPAMaskVBlankInSRD:bdw */
-	intel_uncore_write(&dev_priv->uncore, CHICKEN_PAR1_1,
-		   intel_uncore_read(&dev_priv->uncore, CHICKEN_PAR1_1) | DPA_MASK_VBLANK_SRD);
+	intel_uncore_rmw(&dev_priv->uncore, CHICKEN_PAR1_1, 0, DPA_MASK_VBLANK_SRD);
 
 	for_each_pipe(dev_priv, pipe) {
 		/* WaPsrDPRSUnmaskVBlankInSRD:bdw */
-		intel_uncore_write(&dev_priv->uncore, CHICKEN_PIPESL_1(pipe),
-			   intel_uncore_read(&dev_priv->uncore, CHICKEN_PIPESL_1(pipe)) |
-			   BDW_DPRS_MASK_VBLANK_SRD);
+		intel_uncore_rmw(&dev_priv->uncore, CHICKEN_PIPESL_1(pipe), 0,

drivers/gpu/drm/i915/intel_pm.c static void bdw_init_clock_gating(struct drm_i915_private *dev_priv) · line 4514

Quoted 10 lines
drivers/gpu/drm/i915/intel_pm.c +3 -3
+				 BDW_DPRS_MASK_VBLANK_SRD);
 	}
 
 	/* WaVSRefCountFullforceMissDisable:bdw */
 	/* WaDSRefCountFullforceMissDisable:bdw */
-	intel_uncore_write(&dev_priv->uncore, GEN7_FF_THREAD_MODE,
-		   intel_uncore_read(&dev_priv->uncore, GEN7_FF_THREAD_MODE) &
-		   ~(GEN8_FF_DS_REF_CNT_FFME | GEN7_FF_VS_REF_CNT_FFME));
+	intel_uncore_rmw(&dev_priv->uncore, GEN7_FF_THREAD_MODE,
+			 (GEN8_FF_DS_REF_CNT_FFME | GEN7_FF_VS_REF_CNT_FFME), 0);

Useless parens there. Ditto in the other copy.

This stuff really doesn't belong here anyway. I thought someone would have hoisted all the gt stuff into a more appropriate place by now. But I guess not.

Rest of the patch looked ok to me.

Signature · 2 lines
Ville Syrjälä
Intel