[Intel-gfx] [PATCH 5/5] drm/i915/ipc: use intel_uncore_rmw() to enable/disable

Jani Nikula jani.nikula at intel.com
Mon Sep 12 11:45:16 UTC 2022


Don't duplicate the rmw function.

Signed-off-by: Jani Nikula <jani.nikula at intel.com>
---
 drivers/gpu/drm/i915/display/skl_watermark.c | 12 ++----------
 1 file changed, 2 insertions(+), 10 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/skl_watermark.c b/drivers/gpu/drm/i915/display/skl_watermark.c
index ab7fc41d325a..c70d811163f6 100644
--- a/drivers/gpu/drm/i915/display/skl_watermark.c
+++ b/drivers/gpu/drm/i915/display/skl_watermark.c
@@ -3121,19 +3121,11 @@ bool skl_watermark_ipc_enabled(struct drm_i915_private *i915)
 
 void skl_watermark_ipc_update(struct drm_i915_private *i915)
 {
-	u32 val;
-
 	if (!HAS_IPC(i915))
 		return;
 
-	val = intel_uncore_read(&i915->uncore, DISP_ARB_CTL2);
-
-	if (skl_watermark_ipc_enabled(i915))
-		val |= DISP_IPC_ENABLE;
-	else
-		val &= ~DISP_IPC_ENABLE;
-
-	intel_uncore_write(&i915->uncore, DISP_ARB_CTL2, val);
+	intel_uncore_rmw(&i915->uncore, DISP_ARB_CTL2, DISP_IPC_ENABLE,
+			 skl_watermark_ipc_enabled(i915) ? DISP_IPC_ENABLE : 0);
 }
 
 static bool skl_watermark_ipc_can_enable(struct drm_i915_private *i915)
-- 
2.34.1



More information about the Intel-gfx mailing list