Linux-libre 5.4-rc7-gnu
[librecmc/linux-libre.git] / drivers / gpu / drm / i915 / display / intel_hdmi.h
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 <drm/i915_drm.h>
13
14 #include "i915_reg.h"
15
16 struct drm_connector;
17 struct drm_encoder;
18 struct drm_i915_private;
19 struct intel_connector;
20 struct intel_digital_port;
21 struct intel_encoder;
22 struct intel_crtc_state;
23 struct intel_hdmi;
24 struct drm_connector_state;
25 union hdmi_infoframe;
26
27 void intel_hdmi_init(struct drm_i915_private *dev_priv, i915_reg_t hdmi_reg,
28                      enum port port);
29 void intel_hdmi_init_connector(struct intel_digital_port *intel_dig_port,
30                                struct intel_connector *intel_connector);
31 struct intel_hdmi *enc_to_intel_hdmi(struct drm_encoder *encoder);
32 int intel_hdmi_compute_config(struct intel_encoder *encoder,
33                               struct intel_crtc_state *pipe_config,
34                               struct drm_connector_state *conn_state);
35 bool intel_hdmi_handle_sink_scrambling(struct intel_encoder *encoder,
36                                        struct drm_connector *connector,
37                                        bool high_tmds_clock_ratio,
38                                        bool scrambling);
39 void intel_dp_dual_mode_set_tmds_output(struct intel_hdmi *hdmi, bool enable);
40 void intel_infoframe_init(struct intel_digital_port *intel_dig_port);
41 u32 intel_hdmi_infoframes_enabled(struct intel_encoder *encoder,
42                                   const struct intel_crtc_state *crtc_state);
43 u32 intel_hdmi_infoframe_enable(unsigned int type);
44 void intel_hdmi_read_gcp_infoframe(struct intel_encoder *encoder,
45                                    struct intel_crtc_state *crtc_state);
46 void intel_read_infoframe(struct intel_encoder *encoder,
47                           const struct intel_crtc_state *crtc_state,
48                           enum hdmi_infoframe_type type,
49                           union hdmi_infoframe *frame);
50
51 #endif /* __INTEL_HDMI_H__ */