1 /* SPDX-License-Identifier: MIT */
2 /*
3  * Copyright © 2019 Intel Corporation
4  */
5 
6 #ifndef __INTEL_DDI_H__
7 #define __INTEL_DDI_H__
8 
9 #include <drm/i915_drm.h>
10 
11 #include "intel_display.h"
12 
13 struct drm_connector_state;
14 struct drm_i915_private;
15 struct intel_connector;
16 struct intel_crtc;
17 struct intel_crtc_state;
18 struct intel_dp;
19 struct intel_dpll_hw_state;
20 struct intel_encoder;
21 
22 void intel_ddi_fdi_post_disable(struct intel_encoder *intel_encoder,
23 				const struct intel_crtc_state *old_crtc_state,
24 				const struct drm_connector_state *old_conn_state);
25 void hsw_fdi_link_train(struct intel_encoder *encoder,
26 			const struct intel_crtc_state *crtc_state);
27 void intel_ddi_init(struct drm_i915_private *dev_priv, enum port port);
28 bool intel_ddi_get_hw_state(struct intel_encoder *encoder, enum pipe *pipe);
29 void intel_ddi_enable_transcoder_func(const struct intel_crtc_state *crtc_state);
30 void intel_ddi_disable_transcoder_func(const struct intel_crtc_state *crtc_state);
31 void intel_ddi_enable_pipe_clock(const struct intel_crtc_state *crtc_state);
32 void intel_ddi_disable_pipe_clock(const  struct intel_crtc_state *crtc_state);
33 void intel_ddi_set_dp_msa(const struct intel_crtc_state *crtc_state,
34 			  const struct drm_connector_state *conn_state);
35 bool intel_ddi_connector_get_hw_state(struct intel_connector *intel_connector);
36 void intel_ddi_get_config(struct intel_encoder *encoder,
37 			  struct intel_crtc_state *pipe_config);
38 void intel_ddi_set_vc_payload_alloc(const struct intel_crtc_state *crtc_state,
39 				    bool state);
40 void intel_ddi_compute_min_voltage_level(struct drm_i915_private *dev_priv,
41 					 struct intel_crtc_state *crtc_state);
42 u32 bxt_signal_levels(struct intel_dp *intel_dp);
43 u32 ddi_signal_levels(struct intel_dp *intel_dp);
44 u8 intel_ddi_dp_voltage_max(struct intel_encoder *encoder);
45 u8 intel_ddi_dp_pre_emphasis_max(struct intel_encoder *encoder,
46 				 u8 voltage_swing);
47 int intel_ddi_toggle_hdcp_signalling(struct intel_encoder *intel_encoder,
48 				     bool enable);
49 void icl_sanitize_encoder_pll_mapping(struct intel_encoder *encoder);
50 int cnl_calc_wrpll_link(struct drm_i915_private *dev_priv,
51 			struct intel_dpll_hw_state *state);
52 
53 #endif /* __INTEL_DDI_H__ */
54