2 * Copyright 2017 Advanced Micro Devices, Inc.
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
11 * The above copyright notice and this permission notice shall be included in
12 * all copies or substantial portions of the Software.
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17 * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
18 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
19 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20 * OTHER DEALINGS IN THE SOFTWARE.
28 #ifndef STREAM_ENCODER_H_
29 #define STREAM_ENCODER_H_
31 #include "audio_types.h"
35 struct dc_crtc_timing
;
37 struct encoder_info_packet
{
46 struct encoder_info_frame
{
47 /* auxiliary video information */
48 struct encoder_info_packet avi
;
49 struct encoder_info_packet gamut
;
50 struct encoder_info_packet vendor
;
51 /* source product description */
52 struct encoder_info_packet spd
;
53 /* video stream configuration */
54 struct encoder_info_packet vsc
;
55 /* HDR Static MetaData */
56 struct encoder_info_packet hdrsmd
;
59 struct encoder_unblank_param
{
60 struct dc_link_settings link_settings
;
61 unsigned int pixel_clk_khz
;
64 struct encoder_set_dp_phy_pattern_param
{
65 enum dp_test_pattern dp_phy_pattern
;
66 const uint8_t *custom_pattern
;
67 uint32_t custom_pattern_size
;
68 enum dp_panel_mode dp_panel_mode
;
71 struct stream_encoder
{
72 const struct stream_encoder_funcs
*funcs
;
73 struct dc_context
*ctx
;
78 struct stream_encoder_funcs
{
79 void (*dp_set_stream_attribute
)(
80 struct stream_encoder
*enc
,
81 struct dc_crtc_timing
*crtc_timing
,
82 enum dc_color_space output_color_space
);
84 void (*hdmi_set_stream_attribute
)(
85 struct stream_encoder
*enc
,
86 struct dc_crtc_timing
*crtc_timing
,
87 int actual_pix_clk_khz
,
90 void (*dvi_set_stream_attribute
)(
91 struct stream_encoder
*enc
,
92 struct dc_crtc_timing
*crtc_timing
,
95 void (*set_mst_bandwidth
)(
96 struct stream_encoder
*enc
,
97 struct fixed31_32 avg_time_slots_per_mtp
);
99 void (*update_hdmi_info_packets
)(
100 struct stream_encoder
*enc
,
101 const struct encoder_info_frame
*info_frame
);
103 void (*stop_hdmi_info_packets
)(
104 struct stream_encoder
*enc
);
106 void (*update_dp_info_packets
)(
107 struct stream_encoder
*enc
,
108 const struct encoder_info_frame
*info_frame
);
110 void (*stop_dp_info_packets
)(
111 struct stream_encoder
*enc
);
114 struct stream_encoder
*enc
);
117 struct stream_encoder
*enc
,
118 const struct encoder_unblank_param
*param
);
120 void (*audio_mute_control
)(
121 struct stream_encoder
*enc
, bool mute
);
123 void (*dp_audio_setup
)(
124 struct stream_encoder
*enc
,
125 unsigned int az_inst
,
126 struct audio_info
*info
);
128 void (*dp_audio_enable
) (
129 struct stream_encoder
*enc
);
131 void (*dp_audio_disable
) (
132 struct stream_encoder
*enc
);
134 void (*hdmi_audio_setup
)(
135 struct stream_encoder
*enc
,
136 unsigned int az_inst
,
137 struct audio_info
*info
,
138 struct audio_crtc_info
*audio_crtc_info
);
140 void (*hdmi_audio_disable
) (
141 struct stream_encoder
*enc
);
143 void (*setup_stereo_sync
) (
144 struct stream_encoder
*enc
,
149 struct stream_encoder
*enc
, bool enable
);
152 #endif /* STREAM_ENCODER_H_ */