[RFC PATCH 13/20] drm/i915/display: Add more macros to remove all direct calls to uncore
Matthew Brost
matthew.brost at intel.com
Thu Dec 22 22:21:20 UTC 2022
From: Maarten Lankhorst <maarten.lankhorst at linux.intel.com>
Signed-off-by: Maarten Lankhorst <maarten.lankhorst at linux.intel.com>
---
drivers/gpu/drm/i915/display/intel_de.h | 38 +++++++++++++++++++++++++
1 file changed, 38 insertions(+)
diff --git a/drivers/gpu/drm/i915/display/intel_de.h b/drivers/gpu/drm/i915/display/intel_de.h
index 3dbd76fdabd6..3394044d281c 100644
--- a/drivers/gpu/drm/i915/display/intel_de.h
+++ b/drivers/gpu/drm/i915/display/intel_de.h
@@ -9,6 +9,7 @@
#include "i915_drv.h"
#include "i915_trace.h"
#include "intel_uncore.h"
+#include "intel_pcode.h"
static inline u32
intel_de_read(struct drm_i915_private *i915, i915_reg_t reg)
@@ -116,4 +117,41 @@ intel_de_write_notrace(struct drm_i915_private *i915, i915_reg_t reg, u32 val)
intel_uncore_write_notrace(&i915->uncore, reg, val);
}
+static inline void
+intel_de_write_samevalue(struct drm_i915_private *i915, i915_reg_t reg)
+{
+ spin_lock_irq(&i915->uncore.lock);
+ intel_de_write_fw(i915, reg, intel_de_read_fw(i915, reg));
+ spin_unlock_irq(&i915->uncore.lock);
+}
+
+static inline int
+intel_de_pcode_write_timeout(struct drm_i915_private *i915, u32 mbox, u32 val,
+ int fast_timeout_us, int slow_timeout_ms)
+{
+ return snb_pcode_write_timeout(&i915->uncore, mbox, val,
+ fast_timeout_us, slow_timeout_ms);
+}
+
+static inline int
+intel_de_pcode_write(struct drm_i915_private *i915, u32 mbox, u32 val)
+{
+
+ return snb_pcode_write(&i915->uncore, mbox, val);
+}
+
+static inline int
+intel_de_pcode_read(struct drm_i915_private *i915, u32 mbox, u32 *val, u32 *val1)
+{
+ return snb_pcode_read(&i915->uncore, mbox, val, val1);
+}
+
+static inline int intel_de_pcode_request(struct drm_i915_private *i915, u32 mbox,
+ u32 request, u32 reply_mask, u32 reply,
+ int timeout_base_ms)
+{
+ return skl_pcode_request(&i915->uncore, mbox, request, reply_mask, reply,
+ timeout_base_ms);
+}
+
#endif /* __INTEL_DE_H__ */
--
2.37.3
More information about the dri-devel
mailing list