From: Jani Nikula Date: Tue, 27 May 2025 10:59:12 +0000 (+0300) Subject: drm/i915/sbi: convert to intel_de_*() X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ad3cfb65aceb2732ca4f87e410fa59957f6c1adf;p=thirdparty%2Flinux.git 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 Link: https://lore.kernel.org/r/146f9027f565feb827861f06c1ae218b378edd95.1748343520.git.jani.nikula@intel.com Signed-off-by: Jani Nikula --- diff --git a/drivers/gpu/drm/i915/display/intel_sbi.c b/drivers/gpu/drm/i915/display/intel_sbi.c index 135f190cf653d..78fd8bd9804dd 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 + #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; }