1 /* SPDX-License-Identifier: MIT */
2 /*
3  * Copyright © 2019 Intel Corporation
4  */
5 
6 #ifndef __INTEL_HDMI_H__
7 #define __INTEL_HDMI_H__
8 
9 #include <linux/hdmi.h>
10 #include <linux/types.h>
11 
12 #include "i915_reg.h"
13 
14 struct drm_connector;
15 struct drm_encoder;
16 struct drm_i915_private;
17 struct intel_connector;
18 struct intel_digital_port;
19 struct intel_encoder;
20 struct intel_crtc_state;
21 struct intel_hdmi;
22 struct drm_connector_state;
23 union hdmi_infoframe;
24 enum port;
25 
26 void intel_hdmi_init_connector(struct intel_digital_port *dig_port,
27 			       struct intel_connector *intel_connector);
28 int intel_hdmi_compute_config(struct intel_encoder *encoder,
29 			      struct intel_crtc_state *pipe_config,
30 			      struct drm_connector_state *conn_state);
31 void intel_hdmi_encoder_shutdown(struct intel_encoder *encoder);
32 bool intel_hdmi_handle_sink_scrambling(struct intel_encoder *encoder,
33 				       struct drm_connector *connector,
34 				       bool high_tmds_clock_ratio,
35 				       bool scrambling);
36 void intel_dp_dual_mode_set_tmds_output(struct intel_hdmi *hdmi, bool enable);
37 void intel_infoframe_init(struct intel_digital_port *dig_port);
38 u32 intel_hdmi_infoframes_enabled(struct intel_encoder *encoder,
39 				  const struct intel_crtc_state *crtc_state);
40 u32 intel_hdmi_infoframe_enable(unsigned int type);
41 void intel_hdmi_read_gcp_infoframe(struct intel_encoder *encoder,
42 				   struct intel_crtc_state *crtc_state);
43 void intel_read_infoframe(struct intel_encoder *encoder,
44 			  const struct intel_crtc_state *crtc_state,
45 			  enum hdmi_infoframe_type type,
46 			  union hdmi_infoframe *frame);
47 bool intel_hdmi_limited_color_range(const struct intel_crtc_state *crtc_state,
48 				    const struct drm_connector_state *conn_state);
49 bool intel_hdmi_deep_color_possible(const struct intel_crtc_state *crtc_state, int bpc,
50 				    bool has_hdmi_sink, bool ycbcr420_output);
51 int intel_hdmi_dsc_get_bpp(int src_fractional_bpp, int slice_width,
52 			   int num_slices, int output_format, bool hdmi_all_bpp,
53 			   int hdmi_max_chunk_bytes);
54 int intel_hdmi_dsc_get_num_slices(const struct intel_crtc_state *crtc_state,
55 				  int src_max_slices, int src_max_slice_width,
56 				  int hdmi_max_slices, int hdmi_throughput);
57 int intel_hdmi_dsc_get_slice_height(int vactive);
58 
59 #endif /* __INTEL_HDMI_H__ */
60