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 "intel_display.h"
10 #include "i915_reg.h"
11 
12 struct drm_connector_state;
13 struct drm_i915_private;
14 struct intel_connector;
15 struct intel_crtc;
16 struct intel_crtc_state;
17 struct intel_dp;
18 struct intel_dpll_hw_state;
19 struct intel_encoder;
20 enum transcoder;
21 
22 i915_reg_t dp_tp_ctl_reg(struct intel_encoder *encoder,
23 			 const struct intel_crtc_state *crtc_state);
24 i915_reg_t dp_tp_status_reg(struct intel_encoder *encoder,
25 			    const struct intel_crtc_state *crtc_state);
26 void intel_ddi_fdi_post_disable(struct intel_atomic_state *state,
27 				struct intel_encoder *intel_encoder,
28 				const struct intel_crtc_state *old_crtc_state,
29 				const struct drm_connector_state *old_conn_state);
30 void hsw_fdi_link_train(struct intel_encoder *encoder,
31 			const struct intel_crtc_state *crtc_state);
32 void intel_ddi_init(struct drm_i915_private *dev_priv, enum port port);
33 bool intel_ddi_get_hw_state(struct intel_encoder *encoder, enum pipe *pipe);
34 void intel_ddi_enable_transcoder_func(struct intel_encoder *encoder,
35 				      const struct intel_crtc_state *crtc_state);
36 void intel_ddi_disable_transcoder_func(const struct intel_crtc_state *crtc_state);
37 void intel_ddi_enable_pipe_clock(struct intel_encoder *encoder,
38 				 const struct intel_crtc_state *crtc_state);
39 void intel_ddi_disable_pipe_clock(const  struct intel_crtc_state *crtc_state);
40 void intel_ddi_set_dp_msa(const struct intel_crtc_state *crtc_state,
41 			  const struct drm_connector_state *conn_state);
42 bool intel_ddi_connector_get_hw_state(struct intel_connector *intel_connector);
43 void intel_ddi_get_config(struct intel_encoder *encoder,
44 			  struct intel_crtc_state *pipe_config);
45 void intel_ddi_set_vc_payload_alloc(const struct intel_crtc_state *crtc_state,
46 				    bool state);
47 void intel_ddi_compute_min_voltage_level(struct drm_i915_private *dev_priv,
48 					 struct intel_crtc_state *crtc_state);
49 u32 bxt_signal_levels(struct intel_dp *intel_dp,
50 		      const struct intel_crtc_state *crtc_state);
51 u32 ddi_signal_levels(struct intel_dp *intel_dp,
52 		      const struct intel_crtc_state *crtc_state);
53 int intel_ddi_toggle_hdcp_bits(struct intel_encoder *intel_encoder,
54 			       enum transcoder cpu_transcoder,
55 			       bool enable, u32 hdcp_mask);
56 void icl_sanitize_encoder_pll_mapping(struct intel_encoder *encoder);
57 
58 #endif /* __INTEL_DDI_H__ */
59