Commit 7d085bb1 authored by Jani Nikula's avatar Jani Nikula

drm/i915/hti: convert to struct intel_display

Going forward, struct intel_display shall replace struct
drm_i915_private as the main display device data pointer type. Convert
intel_hti.[ch] to struct intel_display.
Reviewed-by: default avatarRodrigo Vivi <rodrigo.vivi@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240813164123.2674462-7-jani.nikula@intel.comSigned-off-by: default avatarJani Nikula <jani.nikula@intel.com>
parent 6276706f
...@@ -4900,7 +4900,7 @@ void intel_ddi_init(struct intel_display *display, ...@@ -4900,7 +4900,7 @@ void intel_ddi_init(struct intel_display *display,
* driver. In that case we should skip initializing the corresponding * driver. In that case we should skip initializing the corresponding
* outputs. * outputs.
*/ */
if (intel_hti_uses_phy(dev_priv, phy)) { if (intel_hti_uses_phy(display, phy)) {
drm_dbg_kms(&dev_priv->drm, "PORT %c / PHY %c reserved by HTI\n", drm_dbg_kms(&dev_priv->drm, "PORT %c / PHY %c reserved by HTI\n",
port_name(port), phy_name(phy)); port_name(port), phy_name(phy));
return; return;
......
...@@ -453,7 +453,7 @@ int intel_display_driver_probe_nogem(struct drm_i915_private *i915) ...@@ -453,7 +453,7 @@ int intel_display_driver_probe_nogem(struct drm_i915_private *i915)
if (i915->display.cdclk.max_cdclk_freq == 0) if (i915->display.cdclk.max_cdclk_freq == 0)
intel_update_max_cdclk(i915); intel_update_max_cdclk(i915);
intel_hti_init(i915); intel_hti_init(display);
/* Just disable it once at startup */ /* Just disable it once at startup */
intel_vga_disable(i915); intel_vga_disable(i915);
......
...@@ -3339,6 +3339,7 @@ static int icl_get_combo_phy_dpll(struct intel_atomic_state *state, ...@@ -3339,6 +3339,7 @@ static int icl_get_combo_phy_dpll(struct intel_atomic_state *state,
struct intel_crtc *crtc, struct intel_crtc *crtc,
struct intel_encoder *encoder) struct intel_encoder *encoder)
{ {
struct intel_display *display = to_intel_display(crtc);
struct drm_i915_private *i915 = to_i915(crtc->base.dev); struct drm_i915_private *i915 = to_i915(crtc->base.dev);
struct intel_crtc_state *crtc_state = struct intel_crtc_state *crtc_state =
intel_atomic_get_new_crtc_state(state, crtc); intel_atomic_get_new_crtc_state(state, crtc);
...@@ -3379,7 +3380,7 @@ static int icl_get_combo_phy_dpll(struct intel_atomic_state *state, ...@@ -3379,7 +3380,7 @@ static int icl_get_combo_phy_dpll(struct intel_atomic_state *state,
} }
/* Eliminate DPLLs from consideration if reserved by HTI */ /* Eliminate DPLLs from consideration if reserved by HTI */
dpll_mask &= ~intel_hti_dpll_mask(i915); dpll_mask &= ~intel_hti_dpll_mask(display);
port_dpll->pll = intel_find_shared_dpll(state, crtc, port_dpll->pll = intel_find_shared_dpll(state, crtc,
&port_dpll->hw_state, &port_dpll->hw_state,
......
...@@ -9,33 +9,33 @@ ...@@ -9,33 +9,33 @@
#include "intel_hti.h" #include "intel_hti.h"
#include "intel_hti_regs.h" #include "intel_hti_regs.h"
void intel_hti_init(struct drm_i915_private *i915) void intel_hti_init(struct intel_display *display)
{ {
/* /*
* If the platform has HTI, we need to find out whether it has reserved * If the platform has HTI, we need to find out whether it has reserved
* any display resources before we create our display outputs. * any display resources before we create our display outputs.
*/ */
if (DISPLAY_INFO(i915)->has_hti) if (DISPLAY_INFO(display)->has_hti)
i915->display.hti.state = intel_de_read(i915, HDPORT_STATE); display->hti.state = intel_de_read(display, HDPORT_STATE);
} }
bool intel_hti_uses_phy(struct drm_i915_private *i915, enum phy phy) bool intel_hti_uses_phy(struct intel_display *display, enum phy phy)
{ {
if (drm_WARN_ON(&i915->drm, phy == PHY_NONE)) if (drm_WARN_ON(display->drm, phy == PHY_NONE))
return false; return false;
return i915->display.hti.state & HDPORT_ENABLED && return display->hti.state & HDPORT_ENABLED &&
i915->display.hti.state & HDPORT_DDI_USED(phy); display->hti.state & HDPORT_DDI_USED(phy);
} }
u32 intel_hti_dpll_mask(struct drm_i915_private *i915) u32 intel_hti_dpll_mask(struct intel_display *display)
{ {
if (!(i915->display.hti.state & HDPORT_ENABLED)) if (!(display->hti.state & HDPORT_ENABLED))
return 0; return 0;
/* /*
* Note: This is subtle. The values must coincide with what's defined * Note: This is subtle. The values must coincide with what's defined
* for the platform. * for the platform.
*/ */
return REG_FIELD_GET(HDPORT_DPLL_USED_MASK, i915->display.hti.state); return REG_FIELD_GET(HDPORT_DPLL_USED_MASK, display->hti.state);
} }
...@@ -8,11 +8,11 @@ ...@@ -8,11 +8,11 @@
#include <linux/types.h> #include <linux/types.h>
struct drm_i915_private; struct intel_display;
enum phy; enum phy;
void intel_hti_init(struct drm_i915_private *i915); void intel_hti_init(struct intel_display *display);
bool intel_hti_uses_phy(struct drm_i915_private *i915, enum phy phy); bool intel_hti_uses_phy(struct intel_display *display, enum phy phy);
u32 intel_hti_dpll_mask(struct drm_i915_private *i915); u32 intel_hti_dpll_mask(struct intel_display *display);
#endif /* __INTEL_HTI_H__ */ #endif /* __INTEL_HTI_H__ */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment