summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJani Nikula <jani.nikula@intel.com>2025-05-27 13:59:12 +0300
committerJani Nikula <jani.nikula@intel.com>2025-06-04 16:28:36 +0300
commitad3cfb65aceb2732ca4f87e410fa59957f6c1adf (patch)
treed7ac2b45ea8beb74536acb2f318e615ad6285e1e
parentac3bff5d63a502380370cd894d837187b1c120a0 (diff)
downloadlinux-ad3cfb65aceb2732ca4f87e410fa59957f6c1adf.tar.gz
linux-ad3cfb65aceb2732ca4f87e410fa59957f6c1adf.zip
drm/i915/sbi: convert to intel_de_*()
Convert SBI to use the intel_de_*() interface. This allows us to drop the dependency in i915_drv.h while at it. The fast timeout for the status wait drops from 100 us to 2 us on i915, but that should be of no consequence. The slow timeout remains the same. Reviewed-by: Luca Coelho <luciano.coelho@intel.com> Link: https://lore.kernel.org/r/146f9027f565feb827861f06c1ae218b378edd95.1748343520.git.jani.nikula@intel.com Signed-off-by: Jani Nikula <jani.nikula@intel.com>
-rw-r--r--drivers/gpu/drm/i915/display/intel_sbi.c22
1 files changed, 9 insertions, 13 deletions
diff --git a/drivers/gpu/drm/i915/display/intel_sbi.c b/drivers/gpu/drm/i915/display/intel_sbi.c
index 135f190cf653..78fd8bd9804d 100644
--- a/drivers/gpu/drm/i915/display/intel_sbi.c
+++ b/drivers/gpu/drm/i915/display/intel_sbi.c
@@ -5,8 +5,10 @@
* LPT/WPT IOSF sideband.
*/
-#include "i915_drv.h"
+#include <drm/drm_print.h>
+
#include "i915_reg.h"
+#include "intel_de.h"
#include "intel_display_core.h"
#include "intel_sbi.h"
@@ -15,21 +17,17 @@ static int intel_sbi_rw(struct intel_display *display, u16 reg,
enum intel_sbi_destination destination,
u32 *val, bool is_read)
{
- struct drm_i915_private *i915 = to_i915(display->drm);
- struct intel_uncore *uncore = &i915->uncore;
u32 cmd;
lockdep_assert_held(&display->sbi.lock);
- if (intel_wait_for_register_fw(uncore,
- SBI_CTL_STAT, SBI_BUSY, 0,
- 100, NULL)) {
+ if (intel_de_wait_fw(display, SBI_CTL_STAT, SBI_BUSY, 0, 100, NULL)) {
drm_err(display->drm, "timeout waiting for SBI to become ready\n");
return -EBUSY;
}
- intel_uncore_write_fw(uncore, SBI_ADDR, (u32)reg << 16);
- intel_uncore_write_fw(uncore, SBI_DATA, is_read ? 0 : *val);
+ intel_de_write_fw(display, SBI_ADDR, (u32)reg << 16);
+ intel_de_write_fw(display, SBI_DATA, is_read ? 0 : *val);
if (destination == SBI_ICLK)
cmd = SBI_CTL_DEST_ICLK | SBI_CTL_OP_CRRD;
@@ -37,11 +35,9 @@ static int intel_sbi_rw(struct intel_display *display, u16 reg,
cmd = SBI_CTL_DEST_MPHY | SBI_CTL_OP_IORD;
if (!is_read)
cmd |= BIT(8);
- intel_uncore_write_fw(uncore, SBI_CTL_STAT, cmd | SBI_BUSY);
+ intel_de_write_fw(display, SBI_CTL_STAT, cmd | SBI_BUSY);
- if (__intel_wait_for_register_fw(uncore,
- SBI_CTL_STAT, SBI_BUSY, 0,
- 100, 100, &cmd)) {
+ if (intel_de_wait_fw(display, SBI_CTL_STAT, SBI_BUSY, 0, 100, &cmd)) {
drm_err(display->drm, "timeout waiting for SBI to complete read\n");
return -ETIMEDOUT;
}
@@ -52,7 +48,7 @@ static int intel_sbi_rw(struct intel_display *display, u16 reg,
}
if (is_read)
- *val = intel_uncore_read_fw(uncore, SBI_DATA);
+ *val = intel_de_read_fw(display, SBI_DATA);
return 0;
}