Commit 053ffdd1 authored by Ville Syrjälä's avatar Ville Syrjälä

drm/i915: Give g4x_{dp,hdmi}.c g4x_ namespace

s/intel_/g4x_/ for the externally visible g4x_{dp,hdmi}.c
functions.
Acked-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20210318161015.22070-8-ville.syrjala@linux.intel.com
parent 33e9e541
...@@ -66,8 +66,8 @@ const struct dpll *vlv_get_dpll(struct drm_i915_private *i915) ...@@ -66,8 +66,8 @@ const struct dpll *vlv_get_dpll(struct drm_i915_private *i915)
return IS_CHERRYVIEW(i915) ? &chv_dpll[0].dpll : &vlv_dpll[0].dpll; return IS_CHERRYVIEW(i915) ? &chv_dpll[0].dpll : &vlv_dpll[0].dpll;
} }
void intel_dp_set_clock(struct intel_encoder *encoder, void g4x_dp_set_clock(struct intel_encoder *encoder,
struct intel_crtc_state *pipe_config) struct intel_crtc_state *pipe_config)
{ {
struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
const struct dp_link_dpll *divisor = NULL; const struct dp_link_dpll *divisor = NULL;
...@@ -286,9 +286,9 @@ static bool cpt_dp_port_selected(struct drm_i915_private *dev_priv, ...@@ -286,9 +286,9 @@ static bool cpt_dp_port_selected(struct drm_i915_private *dev_priv,
return false; return false;
} }
bool intel_dp_port_enabled(struct drm_i915_private *dev_priv, bool g4x_dp_port_enabled(struct drm_i915_private *dev_priv,
i915_reg_t dp_reg, enum port port, i915_reg_t dp_reg, enum port port,
enum pipe *pipe) enum pipe *pipe)
{ {
bool ret; bool ret;
u32 val; u32 val;
...@@ -323,8 +323,8 @@ static bool intel_dp_get_hw_state(struct intel_encoder *encoder, ...@@ -323,8 +323,8 @@ static bool intel_dp_get_hw_state(struct intel_encoder *encoder,
if (!wakeref) if (!wakeref)
return false; return false;
ret = intel_dp_port_enabled(dev_priv, intel_dp->output_reg, ret = g4x_dp_port_enabled(dev_priv, intel_dp->output_reg,
encoder->port, pipe); encoder->port, pipe);
intel_display_power_put(dev_priv, encoder->power_domain, wakeref); intel_display_power_put(dev_priv, encoder->power_domain, wakeref);
...@@ -1270,8 +1270,8 @@ enum pipe vlv_active_pipe(struct intel_dp *intel_dp) ...@@ -1270,8 +1270,8 @@ enum pipe vlv_active_pipe(struct intel_dp *intel_dp)
struct intel_encoder *encoder = &dp_to_dig_port(intel_dp)->base; struct intel_encoder *encoder = &dp_to_dig_port(intel_dp)->base;
enum pipe pipe; enum pipe pipe;
if (intel_dp_port_enabled(dev_priv, intel_dp->output_reg, if (g4x_dp_port_enabled(dev_priv, intel_dp->output_reg,
encoder->port, &pipe)) encoder->port, &pipe))
return pipe; return pipe;
return INVALID_PIPE; return INVALID_PIPE;
...@@ -1301,9 +1301,8 @@ static const struct drm_encoder_funcs intel_dp_enc_funcs = { ...@@ -1301,9 +1301,8 @@ static const struct drm_encoder_funcs intel_dp_enc_funcs = {
.destroy = intel_dp_encoder_destroy, .destroy = intel_dp_encoder_destroy,
}; };
bool intel_dp_init(struct drm_i915_private *dev_priv, bool g4x_dp_init(struct drm_i915_private *dev_priv,
i915_reg_t output_reg, i915_reg_t output_reg, enum port port)
enum port port)
{ {
struct intel_digital_port *dig_port; struct intel_digital_port *dig_port;
struct intel_encoder *intel_encoder; struct intel_encoder *intel_encoder;
......
...@@ -19,13 +19,12 @@ struct intel_encoder; ...@@ -19,13 +19,12 @@ struct intel_encoder;
const struct dpll *vlv_get_dpll(struct drm_i915_private *i915); const struct dpll *vlv_get_dpll(struct drm_i915_private *i915);
enum pipe vlv_active_pipe(struct intel_dp *intel_dp); enum pipe vlv_active_pipe(struct intel_dp *intel_dp);
void intel_dp_set_clock(struct intel_encoder *encoder, void g4x_dp_set_clock(struct intel_encoder *encoder,
struct intel_crtc_state *pipe_config); struct intel_crtc_state *pipe_config);
bool intel_dp_port_enabled(struct drm_i915_private *dev_priv, bool g4x_dp_port_enabled(struct drm_i915_private *dev_priv,
i915_reg_t dp_reg, enum port port, i915_reg_t dp_reg, enum port port,
enum pipe *pipe); enum pipe *pipe);
bool intel_dp_init(struct drm_i915_private *dev_priv, bool g4x_dp_init(struct drm_i915_private *dev_priv,
i915_reg_t output_reg, i915_reg_t output_reg, enum port port);
enum port port);
#endif #endif
...@@ -528,8 +528,8 @@ intel_hdmi_hotplug(struct intel_encoder *encoder, ...@@ -528,8 +528,8 @@ intel_hdmi_hotplug(struct intel_encoder *encoder,
return state; return state;
} }
void intel_hdmi_init(struct drm_i915_private *dev_priv, void g4x_hdmi_init(struct drm_i915_private *dev_priv,
i915_reg_t hdmi_reg, enum port port) i915_reg_t hdmi_reg, enum port port)
{ {
struct intel_digital_port *dig_port; struct intel_digital_port *dig_port;
struct intel_encoder *intel_encoder; struct intel_encoder *intel_encoder;
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
enum port; enum port;
struct drm_i915_private; struct drm_i915_private;
void intel_hdmi_init(struct drm_i915_private *dev_priv, void g4x_hdmi_init(struct drm_i915_private *dev_priv,
i915_reg_t hdmi_reg, enum port port); i915_reg_t hdmi_reg, enum port port);
#endif #endif
...@@ -406,13 +406,13 @@ void assert_panel_unlocked(struct drm_i915_private *dev_priv, enum pipe pipe) ...@@ -406,13 +406,13 @@ void assert_panel_unlocked(struct drm_i915_private *dev_priv, enum pipe pipe)
intel_lvds_port_enabled(dev_priv, PCH_LVDS, &panel_pipe); intel_lvds_port_enabled(dev_priv, PCH_LVDS, &panel_pipe);
break; break;
case PANEL_PORT_SELECT_DPA: case PANEL_PORT_SELECT_DPA:
intel_dp_port_enabled(dev_priv, DP_A, PORT_A, &panel_pipe); g4x_dp_port_enabled(dev_priv, DP_A, PORT_A, &panel_pipe);
break; break;
case PANEL_PORT_SELECT_DPC: case PANEL_PORT_SELECT_DPC:
intel_dp_port_enabled(dev_priv, PCH_DP_C, PORT_C, &panel_pipe); g4x_dp_port_enabled(dev_priv, PCH_DP_C, PORT_C, &panel_pipe);
break; break;
case PANEL_PORT_SELECT_DPD: case PANEL_PORT_SELECT_DPD:
intel_dp_port_enabled(dev_priv, PCH_DP_D, PORT_D, &panel_pipe); g4x_dp_port_enabled(dev_priv, PCH_DP_D, PORT_D, &panel_pipe);
break; break;
default: default:
MISSING_CASE(port_sel); MISSING_CASE(port_sel);
...@@ -515,7 +515,7 @@ static void assert_pch_dp_disabled(struct drm_i915_private *dev_priv, ...@@ -515,7 +515,7 @@ static void assert_pch_dp_disabled(struct drm_i915_private *dev_priv,
enum pipe port_pipe; enum pipe port_pipe;
bool state; bool state;
state = intel_dp_port_enabled(dev_priv, dp_reg, port, &port_pipe); state = g4x_dp_port_enabled(dev_priv, dp_reg, port, &port_pipe);
I915_STATE_WARN(state && port_pipe == pipe, I915_STATE_WARN(state && port_pipe == pipe,
"PCH DP %c enabled on transcoder %c, should be disabled\n", "PCH DP %c enabled on transcoder %c, should be disabled\n",
...@@ -11755,28 +11755,28 @@ static void intel_setup_outputs(struct drm_i915_private *dev_priv) ...@@ -11755,28 +11755,28 @@ static void intel_setup_outputs(struct drm_i915_private *dev_priv)
dpd_is_edp = intel_dp_is_port_edp(dev_priv, PORT_D); dpd_is_edp = intel_dp_is_port_edp(dev_priv, PORT_D);
if (ilk_has_edp_a(dev_priv)) if (ilk_has_edp_a(dev_priv))
intel_dp_init(dev_priv, DP_A, PORT_A); g4x_dp_init(dev_priv, DP_A, PORT_A);
if (intel_de_read(dev_priv, PCH_HDMIB) & SDVO_DETECTED) { if (intel_de_read(dev_priv, PCH_HDMIB) & SDVO_DETECTED) {
/* PCH SDVOB multiplex with HDMIB */ /* PCH SDVOB multiplex with HDMIB */
found = intel_sdvo_init(dev_priv, PCH_SDVOB, PORT_B); found = intel_sdvo_init(dev_priv, PCH_SDVOB, PORT_B);
if (!found) if (!found)
intel_hdmi_init(dev_priv, PCH_HDMIB, PORT_B); g4x_hdmi_init(dev_priv, PCH_HDMIB, PORT_B);
if (!found && (intel_de_read(dev_priv, PCH_DP_B) & DP_DETECTED)) if (!found && (intel_de_read(dev_priv, PCH_DP_B) & DP_DETECTED))
intel_dp_init(dev_priv, PCH_DP_B, PORT_B); g4x_dp_init(dev_priv, PCH_DP_B, PORT_B);
} }
if (intel_de_read(dev_priv, PCH_HDMIC) & SDVO_DETECTED) if (intel_de_read(dev_priv, PCH_HDMIC) & SDVO_DETECTED)
intel_hdmi_init(dev_priv, PCH_HDMIC, PORT_C); g4x_hdmi_init(dev_priv, PCH_HDMIC, PORT_C);
if (!dpd_is_edp && intel_de_read(dev_priv, PCH_HDMID) & SDVO_DETECTED) if (!dpd_is_edp && intel_de_read(dev_priv, PCH_HDMID) & SDVO_DETECTED)
intel_hdmi_init(dev_priv, PCH_HDMID, PORT_D); g4x_hdmi_init(dev_priv, PCH_HDMID, PORT_D);
if (intel_de_read(dev_priv, PCH_DP_C) & DP_DETECTED) if (intel_de_read(dev_priv, PCH_DP_C) & DP_DETECTED)
intel_dp_init(dev_priv, PCH_DP_C, PORT_C); g4x_dp_init(dev_priv, PCH_DP_C, PORT_C);
if (intel_de_read(dev_priv, PCH_DP_D) & DP_DETECTED) if (intel_de_read(dev_priv, PCH_DP_D) & DP_DETECTED)
intel_dp_init(dev_priv, PCH_DP_D, PORT_D); g4x_dp_init(dev_priv, PCH_DP_D, PORT_D);
} else if (IS_VALLEYVIEW(dev_priv) || IS_CHERRYVIEW(dev_priv)) { } else if (IS_VALLEYVIEW(dev_priv) || IS_CHERRYVIEW(dev_priv)) {
bool has_edp, has_port; bool has_edp, has_port;
...@@ -11801,16 +11801,16 @@ static void intel_setup_outputs(struct drm_i915_private *dev_priv) ...@@ -11801,16 +11801,16 @@ static void intel_setup_outputs(struct drm_i915_private *dev_priv)
has_edp = intel_dp_is_port_edp(dev_priv, PORT_B); has_edp = intel_dp_is_port_edp(dev_priv, PORT_B);
has_port = intel_bios_is_port_present(dev_priv, PORT_B); has_port = intel_bios_is_port_present(dev_priv, PORT_B);
if (intel_de_read(dev_priv, VLV_DP_B) & DP_DETECTED || has_port) if (intel_de_read(dev_priv, VLV_DP_B) & DP_DETECTED || has_port)
has_edp &= intel_dp_init(dev_priv, VLV_DP_B, PORT_B); has_edp &= g4x_dp_init(dev_priv, VLV_DP_B, PORT_B);
if ((intel_de_read(dev_priv, VLV_HDMIB) & SDVO_DETECTED || has_port) && !has_edp) if ((intel_de_read(dev_priv, VLV_HDMIB) & SDVO_DETECTED || has_port) && !has_edp)
intel_hdmi_init(dev_priv, VLV_HDMIB, PORT_B); g4x_hdmi_init(dev_priv, VLV_HDMIB, PORT_B);
has_edp = intel_dp_is_port_edp(dev_priv, PORT_C); has_edp = intel_dp_is_port_edp(dev_priv, PORT_C);
has_port = intel_bios_is_port_present(dev_priv, PORT_C); has_port = intel_bios_is_port_present(dev_priv, PORT_C);
if (intel_de_read(dev_priv, VLV_DP_C) & DP_DETECTED || has_port) if (intel_de_read(dev_priv, VLV_DP_C) & DP_DETECTED || has_port)
has_edp &= intel_dp_init(dev_priv, VLV_DP_C, PORT_C); has_edp &= g4x_dp_init(dev_priv, VLV_DP_C, PORT_C);
if ((intel_de_read(dev_priv, VLV_HDMIC) & SDVO_DETECTED || has_port) && !has_edp) if ((intel_de_read(dev_priv, VLV_HDMIC) & SDVO_DETECTED || has_port) && !has_edp)
intel_hdmi_init(dev_priv, VLV_HDMIC, PORT_C); g4x_hdmi_init(dev_priv, VLV_HDMIC, PORT_C);
if (IS_CHERRYVIEW(dev_priv)) { if (IS_CHERRYVIEW(dev_priv)) {
/* /*
...@@ -11819,9 +11819,9 @@ static void intel_setup_outputs(struct drm_i915_private *dev_priv) ...@@ -11819,9 +11819,9 @@ static void intel_setup_outputs(struct drm_i915_private *dev_priv)
*/ */
has_port = intel_bios_is_port_present(dev_priv, PORT_D); has_port = intel_bios_is_port_present(dev_priv, PORT_D);
if (intel_de_read(dev_priv, CHV_DP_D) & DP_DETECTED || has_port) if (intel_de_read(dev_priv, CHV_DP_D) & DP_DETECTED || has_port)
intel_dp_init(dev_priv, CHV_DP_D, PORT_D); g4x_dp_init(dev_priv, CHV_DP_D, PORT_D);
if (intel_de_read(dev_priv, CHV_HDMID) & SDVO_DETECTED || has_port) if (intel_de_read(dev_priv, CHV_HDMID) & SDVO_DETECTED || has_port)
intel_hdmi_init(dev_priv, CHV_HDMID, PORT_D); g4x_hdmi_init(dev_priv, CHV_HDMID, PORT_D);
} }
vlv_dsi_init(dev_priv); vlv_dsi_init(dev_priv);
...@@ -11842,11 +11842,11 @@ static void intel_setup_outputs(struct drm_i915_private *dev_priv) ...@@ -11842,11 +11842,11 @@ static void intel_setup_outputs(struct drm_i915_private *dev_priv)
if (!found && IS_G4X(dev_priv)) { if (!found && IS_G4X(dev_priv)) {
drm_dbg_kms(&dev_priv->drm, drm_dbg_kms(&dev_priv->drm,
"probing HDMI on SDVOB\n"); "probing HDMI on SDVOB\n");
intel_hdmi_init(dev_priv, GEN4_HDMIB, PORT_B); g4x_hdmi_init(dev_priv, GEN4_HDMIB, PORT_B);
} }
if (!found && IS_G4X(dev_priv)) if (!found && IS_G4X(dev_priv))
intel_dp_init(dev_priv, DP_B, PORT_B); g4x_dp_init(dev_priv, DP_B, PORT_B);
} }
/* Before G4X SDVOC doesn't have its own detect register */ /* Before G4X SDVOC doesn't have its own detect register */
...@@ -11861,14 +11861,14 @@ static void intel_setup_outputs(struct drm_i915_private *dev_priv) ...@@ -11861,14 +11861,14 @@ static void intel_setup_outputs(struct drm_i915_private *dev_priv)
if (IS_G4X(dev_priv)) { if (IS_G4X(dev_priv)) {
drm_dbg_kms(&dev_priv->drm, drm_dbg_kms(&dev_priv->drm,
"probing HDMI on SDVOC\n"); "probing HDMI on SDVOC\n");
intel_hdmi_init(dev_priv, GEN4_HDMIC, PORT_C); g4x_hdmi_init(dev_priv, GEN4_HDMIC, PORT_C);
} }
if (IS_G4X(dev_priv)) if (IS_G4X(dev_priv))
intel_dp_init(dev_priv, DP_C, PORT_C); g4x_dp_init(dev_priv, DP_C, PORT_C);
} }
if (IS_G4X(dev_priv) && (intel_de_read(dev_priv, DP_D) & DP_DETECTED)) if (IS_G4X(dev_priv) && (intel_de_read(dev_priv, DP_D) & DP_DETECTED))
intel_dp_init(dev_priv, DP_D, PORT_D); g4x_dp_init(dev_priv, DP_D, PORT_D);
if (SUPPORTS_TV(dev_priv)) if (SUPPORTS_TV(dev_priv))
intel_tv_init(dev_priv); intel_tv_init(dev_priv);
......
...@@ -1780,7 +1780,7 @@ intel_dp_compute_config(struct intel_encoder *encoder, ...@@ -1780,7 +1780,7 @@ intel_dp_compute_config(struct intel_encoder *encoder,
pipe_config->dp_m_n.gmch_m *= pipe_config->splitter.link_count; pipe_config->dp_m_n.gmch_m *= pipe_config->splitter.link_count;
if (!HAS_DDI(dev_priv)) if (!HAS_DDI(dev_priv))
intel_dp_set_clock(encoder, pipe_config); g4x_dp_set_clock(encoder, pipe_config);
intel_vrr_compute_config(pipe_config, conn_state); intel_vrr_compute_config(pipe_config, conn_state);
intel_psr_compute_config(intel_dp, pipe_config); intel_psr_compute_config(intel_dp, pipe_config);
......
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