Commit c84c6fe3 authored by Jani Nikula's avatar Jani Nikula

drm/i915: make encoder enable and disable hooks optional

Encoders are not alike, make enable and disable hooks optional like
other hooks. Utilize this in DSI code, and remove the silly nop hook.

v2: Add the check also to intel_sanitize_encoder() (Madhav)
Reviewed-by: default avatarMadhav Chauhan <madhav.chauhan@intel.com>
Acked-by: default avatarVille Syrjala <ville.syrjala@linux.intel.com>
Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20181016124134.10257-1-jani.nikula@intel.com
parent 27a981b6
...@@ -5481,7 +5481,8 @@ static void intel_encoders_enable(struct drm_crtc *crtc, ...@@ -5481,7 +5481,8 @@ static void intel_encoders_enable(struct drm_crtc *crtc,
if (conn_state->crtc != crtc) if (conn_state->crtc != crtc)
continue; continue;
encoder->enable(encoder, crtc_state, conn_state); if (encoder->enable)
encoder->enable(encoder, crtc_state, conn_state);
intel_opregion_notify_encoder(encoder, true); intel_opregion_notify_encoder(encoder, true);
} }
} }
...@@ -5502,7 +5503,8 @@ static void intel_encoders_disable(struct drm_crtc *crtc, ...@@ -5502,7 +5503,8 @@ static void intel_encoders_disable(struct drm_crtc *crtc,
continue; continue;
intel_opregion_notify_encoder(encoder, false); intel_opregion_notify_encoder(encoder, false);
encoder->disable(encoder, old_crtc_state, old_conn_state); if (encoder->disable)
encoder->disable(encoder, old_crtc_state, old_conn_state);
} }
} }
...@@ -15293,7 +15295,8 @@ static void intel_sanitize_encoder(struct intel_encoder *encoder) ...@@ -15293,7 +15295,8 @@ static void intel_sanitize_encoder(struct intel_encoder *encoder)
DRM_DEBUG_KMS("[ENCODER:%d:%s] manually disabled\n", DRM_DEBUG_KMS("[ENCODER:%d:%s] manually disabled\n",
encoder->base.base.id, encoder->base.base.id,
encoder->base.name); encoder->base.name);
encoder->disable(encoder, to_intel_crtc_state(crtc_state), connector->base.state); if (encoder->disable)
encoder->disable(encoder, to_intel_crtc_state(crtc_state), connector->base.state);
if (encoder->post_disable) if (encoder->post_disable)
encoder->post_disable(encoder, to_intel_crtc_state(crtc_state), connector->base.state); encoder->post_disable(encoder, to_intel_crtc_state(crtc_state), connector->base.state);
} }
......
...@@ -794,6 +794,10 @@ static void intel_dsi_msleep(struct intel_dsi *intel_dsi, int msec) ...@@ -794,6 +794,10 @@ static void intel_dsi_msleep(struct intel_dsi *intel_dsi, int msec)
* - wait t4 - wait t4 * - wait t4 - wait t4
*/ */
/*
* DSI port enable has to be done before pipe and plane enable, so we do it in
* the pre_enable hook instead of the enable hook.
*/
static void intel_dsi_pre_enable(struct intel_encoder *encoder, static void intel_dsi_pre_enable(struct intel_encoder *encoder,
const struct intel_crtc_state *pipe_config, const struct intel_crtc_state *pipe_config,
const struct drm_connector_state *conn_state) const struct drm_connector_state *conn_state)
...@@ -895,17 +899,6 @@ static void intel_dsi_pre_enable(struct intel_encoder *encoder, ...@@ -895,17 +899,6 @@ static void intel_dsi_pre_enable(struct intel_encoder *encoder,
intel_dsi_vbt_exec_sequence(intel_dsi, MIPI_SEQ_BACKLIGHT_ON); intel_dsi_vbt_exec_sequence(intel_dsi, MIPI_SEQ_BACKLIGHT_ON);
} }
/*
* DSI port enable has to be done before pipe and plane enable, so we do it in
* the pre_enable hook.
*/
static void intel_dsi_enable_nop(struct intel_encoder *encoder,
const struct intel_crtc_state *pipe_config,
const struct drm_connector_state *conn_state)
{
DRM_DEBUG_KMS("\n");
}
/* /*
* DSI port disable has to be done after pipe and plane disable, so we do it in * DSI port disable has to be done after pipe and plane disable, so we do it in
* the post_disable hook. * the post_disable hook.
...@@ -1764,7 +1757,6 @@ void vlv_dsi_init(struct drm_i915_private *dev_priv) ...@@ -1764,7 +1757,6 @@ void vlv_dsi_init(struct drm_i915_private *dev_priv)
intel_encoder->compute_config = intel_dsi_compute_config; intel_encoder->compute_config = intel_dsi_compute_config;
intel_encoder->pre_enable = intel_dsi_pre_enable; intel_encoder->pre_enable = intel_dsi_pre_enable;
intel_encoder->enable = intel_dsi_enable_nop;
intel_encoder->disable = intel_dsi_disable; intel_encoder->disable = intel_dsi_disable;
intel_encoder->post_disable = intel_dsi_post_disable; intel_encoder->post_disable = intel_dsi_post_disable;
intel_encoder->get_hw_state = intel_dsi_get_hw_state; intel_encoder->get_hw_state = intel_dsi_get_hw_state;
......
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