Commit d04afb15 authored by Madhav Chauhan's avatar Madhav Chauhan Committed by Jani Nikula

drm/i915/icl: Add DSI encoder compute config hook

This patch implements compute config for Gen11 DSI encoder which is
required at the time of modeset.

For DSI 8X clock is AFE clock which is 5 times port clock.

v2 by Jani:
 - drop the enable nop hook
 - fixed_mode is always true
 - HAS_GMCH_DISPLAY() is always false

v3 by Jani:
 - set encoder->compute_config dropped during rebase

v4 by Jani:
 - squash Vandita's port clock patch
 - remove todo comment
Co-developed-by: default avatarVandita Kulkarni <vandita.kulkarni@intel.com>
Signed-off-by: default avatarMadhav Chauhan <madhav.chauhan@intel.com>
Signed-off-by: default avatarVandita Kulkarni <vandita.kulkarni@intel.com>
Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/a21574173caa5e2932d9e3c537b0931097ab5ac2.1543500286.git.jani.nikula@intel.com
parent ab841148
...@@ -1074,6 +1074,36 @@ static void gen11_dsi_get_config(struct intel_encoder *encoder, ...@@ -1074,6 +1074,36 @@ static void gen11_dsi_get_config(struct intel_encoder *encoder,
pipe_config->output_types |= BIT(INTEL_OUTPUT_DSI); pipe_config->output_types |= BIT(INTEL_OUTPUT_DSI);
} }
static bool gen11_dsi_compute_config(struct intel_encoder *encoder,
struct intel_crtc_state *pipe_config,
struct drm_connector_state *conn_state)
{
struct intel_dsi *intel_dsi = container_of(encoder, struct intel_dsi,
base);
struct intel_connector *intel_connector = intel_dsi->attached_connector;
struct intel_crtc *crtc = to_intel_crtc(pipe_config->base.crtc);
const struct drm_display_mode *fixed_mode =
intel_connector->panel.fixed_mode;
struct drm_display_mode *adjusted_mode =
&pipe_config->base.adjusted_mode;
intel_fixed_panel_mode(fixed_mode, adjusted_mode);
intel_pch_panel_fitting(crtc, pipe_config, conn_state->scaling_mode);
adjusted_mode->flags = 0;
/* Dual link goes to trancoder DSI'0' */
if (intel_dsi->ports == BIT(PORT_B))
pipe_config->cpu_transcoder = TRANSCODER_DSI_1;
else
pipe_config->cpu_transcoder = TRANSCODER_DSI_0;
pipe_config->clock_set = true;
pipe_config->port_clock = intel_dsi_bitrate(intel_dsi) / 5;
return true;
}
static u64 gen11_dsi_get_power_domains(struct intel_encoder *encoder, static u64 gen11_dsi_get_power_domains(struct intel_encoder *encoder,
struct intel_crtc_state *crtc_state) struct intel_crtc_state *crtc_state)
{ {
...@@ -1244,6 +1274,7 @@ void icl_dsi_init(struct drm_i915_private *dev_priv) ...@@ -1244,6 +1274,7 @@ void icl_dsi_init(struct drm_i915_private *dev_priv)
encoder->disable = gen11_dsi_disable; encoder->disable = gen11_dsi_disable;
encoder->port = port; encoder->port = port;
encoder->get_config = gen11_dsi_get_config; encoder->get_config = gen11_dsi_get_config;
encoder->compute_config = gen11_dsi_compute_config;
encoder->get_hw_state = gen11_dsi_get_hw_state; encoder->get_hw_state = gen11_dsi_get_hw_state;
encoder->type = INTEL_OUTPUT_DSI; encoder->type = INTEL_OUTPUT_DSI;
encoder->cloneable = 0; encoder->cloneable = 0;
......
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