Commit f99be1b3 authored by Ville Syrjälä's avatar Ville Syrjälä

drm/i915: Move infoframe vfuncs into intel_digital_port

DP ports will also want to utilize the video DIP for SDP transmission.
So let's move the vfuncs into the dig_port.

v2: Rebase due to DDI changes
Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: default avatarShashank Sharma <shashank.sharma@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20170818134958.15502-5-ville.syrjala@linux.intel.com
parent c5f93fcf
...@@ -2155,9 +2155,9 @@ static void intel_ddi_pre_enable_hdmi(struct intel_encoder *encoder, ...@@ -2155,9 +2155,9 @@ static void intel_ddi_pre_enable_hdmi(struct intel_encoder *encoder,
const struct drm_connector_state *conn_state, const struct drm_connector_state *conn_state,
struct intel_shared_dpll *pll) struct intel_shared_dpll *pll)
{ {
struct intel_hdmi *intel_hdmi = enc_to_intel_hdmi(&encoder->base); struct intel_digital_port *intel_dig_port = enc_to_dig_port(&encoder->base);
struct intel_hdmi *intel_hdmi = &intel_dig_port->hdmi;
struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
struct drm_encoder *drm_encoder = &encoder->base;
enum port port = intel_ddi_get_encoder_port(encoder); enum port port = intel_ddi_get_encoder_port(encoder);
int level = intel_ddi_hdmi_level(dev_priv, port); int level = intel_ddi_hdmi_level(dev_priv, port);
struct intel_digital_port *dig_port = enc_to_dig_port(&encoder->base); struct intel_digital_port *dig_port = enc_to_dig_port(&encoder->base);
...@@ -2176,7 +2176,7 @@ static void intel_ddi_pre_enable_hdmi(struct intel_encoder *encoder, ...@@ -2176,7 +2176,7 @@ static void intel_ddi_pre_enable_hdmi(struct intel_encoder *encoder,
else if (IS_CANNONLAKE(dev_priv)) else if (IS_CANNONLAKE(dev_priv))
cnl_ddi_vswing_sequence(encoder, level); cnl_ddi_vswing_sequence(encoder, level);
intel_hdmi->set_infoframes(drm_encoder, intel_dig_port->set_infoframes(&encoder->base,
has_infoframe, has_infoframe,
crtc_state, conn_state); crtc_state, conn_state);
} }
...@@ -2239,9 +2239,7 @@ static void intel_ddi_post_disable(struct intel_encoder *intel_encoder, ...@@ -2239,9 +2239,7 @@ static void intel_ddi_post_disable(struct intel_encoder *intel_encoder,
intel_wait_ddi_buf_idle(dev_priv, port); intel_wait_ddi_buf_idle(dev_priv, port);
if (type == INTEL_OUTPUT_HDMI) { if (type == INTEL_OUTPUT_HDMI) {
struct intel_hdmi *intel_hdmi = enc_to_intel_hdmi(encoder); dig_port->set_infoframes(encoder, false,
intel_hdmi->set_infoframes(encoder, false,
old_crtc_state, old_conn_state); old_crtc_state, old_conn_state);
} }
...@@ -2444,7 +2442,7 @@ void intel_ddi_get_config(struct intel_encoder *encoder, ...@@ -2444,7 +2442,7 @@ void intel_ddi_get_config(struct intel_encoder *encoder,
struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
struct intel_crtc *intel_crtc = to_intel_crtc(encoder->base.crtc); struct intel_crtc *intel_crtc = to_intel_crtc(encoder->base.crtc);
enum transcoder cpu_transcoder = pipe_config->cpu_transcoder; enum transcoder cpu_transcoder = pipe_config->cpu_transcoder;
struct intel_hdmi *intel_hdmi; struct intel_digital_port *intel_dig_port;
u32 temp, flags = 0; u32 temp, flags = 0;
/* XXX: DSI transcoder paranoia */ /* XXX: DSI transcoder paranoia */
...@@ -2483,9 +2481,9 @@ void intel_ddi_get_config(struct intel_encoder *encoder, ...@@ -2483,9 +2481,9 @@ void intel_ddi_get_config(struct intel_encoder *encoder,
switch (temp & TRANS_DDI_MODE_SELECT_MASK) { switch (temp & TRANS_DDI_MODE_SELECT_MASK) {
case TRANS_DDI_MODE_SELECT_HDMI: case TRANS_DDI_MODE_SELECT_HDMI:
pipe_config->has_hdmi_sink = true; pipe_config->has_hdmi_sink = true;
intel_hdmi = enc_to_intel_hdmi(&encoder->base); intel_dig_port = enc_to_dig_port(&encoder->base);
if (intel_hdmi->infoframe_enabled(&encoder->base, pipe_config)) if (intel_dig_port->infoframe_enabled(&encoder->base, pipe_config))
pipe_config->has_infoframe = true; pipe_config->has_infoframe = true;
if ((temp & TRANS_DDI_HDMI_SCRAMBLING_MASK) == if ((temp & TRANS_DDI_HDMI_SCRAMBLING_MASK) ==
......
...@@ -909,16 +909,6 @@ struct intel_hdmi { ...@@ -909,16 +909,6 @@ struct intel_hdmi {
bool has_audio; bool has_audio;
bool rgb_quant_range_selectable; bool rgb_quant_range_selectable;
struct intel_connector *attached_connector; struct intel_connector *attached_connector;
void (*write_infoframe)(struct drm_encoder *encoder,
const struct intel_crtc_state *crtc_state,
enum hdmi_infoframe_type type,
const void *frame, ssize_t len);
void (*set_infoframes)(struct drm_encoder *encoder,
bool enable,
const struct intel_crtc_state *crtc_state,
const struct drm_connector_state *conn_state);
bool (*infoframe_enabled)(struct drm_encoder *encoder,
const struct intel_crtc_state *pipe_config);
}; };
struct intel_dp_mst_encoder; struct intel_dp_mst_encoder;
...@@ -1069,6 +1059,17 @@ struct intel_digital_port { ...@@ -1069,6 +1059,17 @@ struct intel_digital_port {
bool release_cl2_override; bool release_cl2_override;
uint8_t max_lanes; uint8_t max_lanes;
enum intel_display_power_domain ddi_io_power_domain; enum intel_display_power_domain ddi_io_power_domain;
void (*write_infoframe)(struct drm_encoder *encoder,
const struct intel_crtc_state *crtc_state,
enum hdmi_infoframe_type type,
const void *frame, ssize_t len);
void (*set_infoframes)(struct drm_encoder *encoder,
bool enable,
const struct intel_crtc_state *crtc_state,
const struct drm_connector_state *conn_state);
bool (*infoframe_enabled)(struct drm_encoder *encoder,
const struct intel_crtc_state *pipe_config);
}; };
struct intel_dp_mst_encoder { struct intel_dp_mst_encoder {
......
...@@ -434,7 +434,7 @@ static void intel_write_infoframe(struct drm_encoder *encoder, ...@@ -434,7 +434,7 @@ static void intel_write_infoframe(struct drm_encoder *encoder,
const struct intel_crtc_state *crtc_state, const struct intel_crtc_state *crtc_state,
union hdmi_infoframe *frame) union hdmi_infoframe *frame)
{ {
struct intel_hdmi *intel_hdmi = enc_to_intel_hdmi(encoder); struct intel_digital_port *intel_dig_port = enc_to_dig_port(encoder);
uint8_t buffer[VIDEO_DIP_DATA_SIZE]; uint8_t buffer[VIDEO_DIP_DATA_SIZE];
ssize_t len; ssize_t len;
...@@ -450,7 +450,7 @@ static void intel_write_infoframe(struct drm_encoder *encoder, ...@@ -450,7 +450,7 @@ static void intel_write_infoframe(struct drm_encoder *encoder,
buffer[3] = 0; buffer[3] = 0;
len++; len++;
intel_hdmi->write_infoframe(encoder, crtc_state, frame->any.type, buffer, len); intel_dig_port->write_infoframe(encoder, crtc_state, frame->any.type, buffer, len);
} }
static void intel_hdmi_set_avi_infoframe(struct drm_encoder *encoder, static void intel_hdmi_set_avi_infoframe(struct drm_encoder *encoder,
...@@ -945,6 +945,7 @@ static void intel_hdmi_get_config(struct intel_encoder *encoder, ...@@ -945,6 +945,7 @@ static void intel_hdmi_get_config(struct intel_encoder *encoder,
struct intel_crtc_state *pipe_config) struct intel_crtc_state *pipe_config)
{ {
struct intel_hdmi *intel_hdmi = enc_to_intel_hdmi(&encoder->base); struct intel_hdmi *intel_hdmi = enc_to_intel_hdmi(&encoder->base);
struct intel_digital_port *intel_dig_port = hdmi_to_dig_port(intel_hdmi);
struct drm_device *dev = encoder->base.dev; struct drm_device *dev = encoder->base.dev;
struct drm_i915_private *dev_priv = to_i915(dev); struct drm_i915_private *dev_priv = to_i915(dev);
u32 tmp, flags = 0; u32 tmp, flags = 0;
...@@ -965,7 +966,7 @@ static void intel_hdmi_get_config(struct intel_encoder *encoder, ...@@ -965,7 +966,7 @@ static void intel_hdmi_get_config(struct intel_encoder *encoder,
if (tmp & HDMI_MODE_SELECT_HDMI) if (tmp & HDMI_MODE_SELECT_HDMI)
pipe_config->has_hdmi_sink = true; pipe_config->has_hdmi_sink = true;
if (intel_hdmi->infoframe_enabled(&encoder->base, pipe_config)) if (intel_dig_port->infoframe_enabled(&encoder->base, pipe_config))
pipe_config->has_infoframe = true; pipe_config->has_infoframe = true;
if (tmp & SDVO_AUDIO_ENABLE) if (tmp & SDVO_AUDIO_ENABLE)
...@@ -1142,6 +1143,8 @@ static void intel_disable_hdmi(struct intel_encoder *encoder, ...@@ -1142,6 +1143,8 @@ static void intel_disable_hdmi(struct intel_encoder *encoder,
struct drm_device *dev = encoder->base.dev; struct drm_device *dev = encoder->base.dev;
struct drm_i915_private *dev_priv = to_i915(dev); struct drm_i915_private *dev_priv = to_i915(dev);
struct intel_hdmi *intel_hdmi = enc_to_intel_hdmi(&encoder->base); struct intel_hdmi *intel_hdmi = enc_to_intel_hdmi(&encoder->base);
struct intel_digital_port *intel_dig_port =
hdmi_to_dig_port(intel_hdmi);
struct intel_crtc *crtc = to_intel_crtc(old_crtc_state->base.crtc); struct intel_crtc *crtc = to_intel_crtc(old_crtc_state->base.crtc);
u32 temp; u32 temp;
...@@ -1184,7 +1187,8 @@ static void intel_disable_hdmi(struct intel_encoder *encoder, ...@@ -1184,7 +1187,8 @@ static void intel_disable_hdmi(struct intel_encoder *encoder,
intel_set_pch_fifo_underrun_reporting(dev_priv, PIPE_A, true); intel_set_pch_fifo_underrun_reporting(dev_priv, PIPE_A, true);
} }
intel_hdmi->set_infoframes(&encoder->base, false, old_crtc_state, old_conn_state); intel_dig_port->set_infoframes(&encoder->base, false,
old_crtc_state, old_conn_state);
intel_dp_dual_mode_set_tmds_output(intel_hdmi, false); intel_dp_dual_mode_set_tmds_output(intel_hdmi, false);
} }
...@@ -1645,11 +1649,12 @@ static void intel_hdmi_pre_enable(struct intel_encoder *encoder, ...@@ -1645,11 +1649,12 @@ static void intel_hdmi_pre_enable(struct intel_encoder *encoder,
struct intel_crtc_state *pipe_config, struct intel_crtc_state *pipe_config,
struct drm_connector_state *conn_state) struct drm_connector_state *conn_state)
{ {
struct intel_hdmi *intel_hdmi = enc_to_intel_hdmi(&encoder->base); struct intel_digital_port *intel_dig_port =
enc_to_dig_port(&encoder->base);
intel_hdmi_prepare(encoder, pipe_config); intel_hdmi_prepare(encoder, pipe_config);
intel_hdmi->set_infoframes(&encoder->base, intel_dig_port->set_infoframes(&encoder->base,
pipe_config->has_infoframe, pipe_config->has_infoframe,
pipe_config, conn_state); pipe_config, conn_state);
} }
...@@ -1659,7 +1664,6 @@ static void vlv_hdmi_pre_enable(struct intel_encoder *encoder, ...@@ -1659,7 +1664,6 @@ static void vlv_hdmi_pre_enable(struct intel_encoder *encoder,
struct drm_connector_state *conn_state) struct drm_connector_state *conn_state)
{ {
struct intel_digital_port *dport = enc_to_dig_port(&encoder->base); struct intel_digital_port *dport = enc_to_dig_port(&encoder->base);
struct intel_hdmi *intel_hdmi = &dport->hdmi;
struct drm_device *dev = encoder->base.dev; struct drm_device *dev = encoder->base.dev;
struct drm_i915_private *dev_priv = to_i915(dev); struct drm_i915_private *dev_priv = to_i915(dev);
...@@ -1669,7 +1673,7 @@ static void vlv_hdmi_pre_enable(struct intel_encoder *encoder, ...@@ -1669,7 +1673,7 @@ static void vlv_hdmi_pre_enable(struct intel_encoder *encoder,
vlv_set_phy_signal_level(encoder, 0x2b245f5f, 0x00002000, 0x5578b83a, vlv_set_phy_signal_level(encoder, 0x2b245f5f, 0x00002000, 0x5578b83a,
0x2b247878); 0x2b247878);
intel_hdmi->set_infoframes(&encoder->base, dport->set_infoframes(&encoder->base,
pipe_config->has_infoframe, pipe_config->has_infoframe,
pipe_config, conn_state); pipe_config, conn_state);
...@@ -1731,7 +1735,6 @@ static void chv_hdmi_pre_enable(struct intel_encoder *encoder, ...@@ -1731,7 +1735,6 @@ static void chv_hdmi_pre_enable(struct intel_encoder *encoder,
struct drm_connector_state *conn_state) struct drm_connector_state *conn_state)
{ {
struct intel_digital_port *dport = enc_to_dig_port(&encoder->base); struct intel_digital_port *dport = enc_to_dig_port(&encoder->base);
struct intel_hdmi *intel_hdmi = &dport->hdmi;
struct drm_device *dev = encoder->base.dev; struct drm_device *dev = encoder->base.dev;
struct drm_i915_private *dev_priv = to_i915(dev); struct drm_i915_private *dev_priv = to_i915(dev);
...@@ -1741,7 +1744,7 @@ static void chv_hdmi_pre_enable(struct intel_encoder *encoder, ...@@ -1741,7 +1744,7 @@ static void chv_hdmi_pre_enable(struct intel_encoder *encoder,
/* Use 800mV-0dB */ /* Use 800mV-0dB */
chv_set_phy_signal_level(encoder, 128, 102, false); chv_set_phy_signal_level(encoder, 128, 102, false);
intel_hdmi->set_infoframes(&encoder->base, dport->set_infoframes(&encoder->base,
pipe_config->has_infoframe, pipe_config->has_infoframe,
pipe_config, conn_state); pipe_config, conn_state);
...@@ -1994,25 +1997,25 @@ void intel_hdmi_init_connector(struct intel_digital_port *intel_dig_port, ...@@ -1994,25 +1997,25 @@ void intel_hdmi_init_connector(struct intel_digital_port *intel_dig_port,
intel_encoder->hpd_pin = intel_hpd_pin(port); intel_encoder->hpd_pin = intel_hpd_pin(port);
if (IS_VALLEYVIEW(dev_priv) || IS_CHERRYVIEW(dev_priv)) { if (IS_VALLEYVIEW(dev_priv) || IS_CHERRYVIEW(dev_priv)) {
intel_hdmi->write_infoframe = vlv_write_infoframe; intel_dig_port->write_infoframe = vlv_write_infoframe;
intel_hdmi->set_infoframes = vlv_set_infoframes; intel_dig_port->set_infoframes = vlv_set_infoframes;
intel_hdmi->infoframe_enabled = vlv_infoframe_enabled; intel_dig_port->infoframe_enabled = vlv_infoframe_enabled;
} else if (IS_G4X(dev_priv)) { } else if (IS_G4X(dev_priv)) {
intel_hdmi->write_infoframe = g4x_write_infoframe; intel_dig_port->write_infoframe = g4x_write_infoframe;
intel_hdmi->set_infoframes = g4x_set_infoframes; intel_dig_port->set_infoframes = g4x_set_infoframes;
intel_hdmi->infoframe_enabled = g4x_infoframe_enabled; intel_dig_port->infoframe_enabled = g4x_infoframe_enabled;
} else if (HAS_DDI(dev_priv)) { } else if (HAS_DDI(dev_priv)) {
intel_hdmi->write_infoframe = hsw_write_infoframe; intel_dig_port->write_infoframe = hsw_write_infoframe;
intel_hdmi->set_infoframes = hsw_set_infoframes; intel_dig_port->set_infoframes = hsw_set_infoframes;
intel_hdmi->infoframe_enabled = hsw_infoframe_enabled; intel_dig_port->infoframe_enabled = hsw_infoframe_enabled;
} else if (HAS_PCH_IBX(dev_priv)) { } else if (HAS_PCH_IBX(dev_priv)) {
intel_hdmi->write_infoframe = ibx_write_infoframe; intel_dig_port->write_infoframe = ibx_write_infoframe;
intel_hdmi->set_infoframes = ibx_set_infoframes; intel_dig_port->set_infoframes = ibx_set_infoframes;
intel_hdmi->infoframe_enabled = ibx_infoframe_enabled; intel_dig_port->infoframe_enabled = ibx_infoframe_enabled;
} else { } else {
intel_hdmi->write_infoframe = cpt_write_infoframe; intel_dig_port->write_infoframe = cpt_write_infoframe;
intel_hdmi->set_infoframes = cpt_set_infoframes; intel_dig_port->set_infoframes = cpt_set_infoframes;
intel_hdmi->infoframe_enabled = cpt_infoframe_enabled; intel_dig_port->infoframe_enabled = cpt_infoframe_enabled;
} }
if (HAS_DDI(dev_priv)) if (HAS_DDI(dev_priv))
......
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