Commit | Line | Data |
---|---|---|
4562236b HW |
1 | /* |
2 | * Copyright 2012-15 Advanced Micro Devices, Inc. | |
3 | * | |
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: | |
10 | * | |
11 | * The above copyright notice and this permission notice shall be included in | |
12 | * all copies or substantial portions of the Software. | |
13 | * | |
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. | |
21 | * | |
22 | * Authors: AMD | |
23 | * | |
24 | */ | |
25 | ||
26 | #include "dm_services.h" | |
27 | #include "dm_services_types.h" | |
28 | ||
29 | #include "virtual_link_encoder.h" | |
30 | ||
4562236b HW |
31 | static bool virtual_link_encoder_validate_output_with_stream( |
32 | struct link_encoder *enc, | |
0971c40e | 33 | const struct dc_stream_state *stream) { return true; } |
4562236b HW |
34 | |
35 | static void virtual_link_encoder_hw_init(struct link_encoder *enc) {} | |
36 | ||
37 | static void virtual_link_encoder_setup( | |
38 | struct link_encoder *enc, | |
39 | enum signal_type signal) {} | |
40 | ||
41 | static void virtual_link_encoder_enable_tmds_output( | |
42 | struct link_encoder *enc, | |
43 | enum clock_source_id clock_source, | |
44 | enum dc_color_depth color_depth, | |
45 | bool hdmi, | |
46 | bool dual_link, | |
47 | uint32_t pixel_clock) {} | |
48 | ||
49 | static void virtual_link_encoder_enable_dp_output( | |
50 | struct link_encoder *enc, | |
51 | const struct dc_link_settings *link_settings, | |
52 | enum clock_source_id clock_source) {} | |
53 | ||
54 | static void virtual_link_encoder_enable_dp_mst_output( | |
55 | struct link_encoder *enc, | |
56 | const struct dc_link_settings *link_settings, | |
57 | enum clock_source_id clock_source) {} | |
58 | ||
59 | static void virtual_link_encoder_disable_output( | |
60 | struct link_encoder *link_enc, | |
61 | enum signal_type signal) {} | |
62 | ||
63 | static void virtual_link_encoder_dp_set_lane_settings( | |
64 | struct link_encoder *enc, | |
65 | const struct link_training_settings *link_settings) {} | |
66 | ||
67 | static void virtual_link_encoder_dp_set_phy_pattern( | |
68 | struct link_encoder *enc, | |
69 | const struct encoder_set_dp_phy_pattern_param *param) {} | |
70 | ||
71 | static void virtual_link_encoder_update_mst_stream_allocation_table( | |
72 | struct link_encoder *enc, | |
73 | const struct link_mst_stream_allocation_table *table) {} | |
74 | ||
4562236b HW |
75 | static void virtual_link_encoder_edp_backlight_control( |
76 | struct link_encoder *enc, | |
77 | bool enable) {} | |
78 | ||
79 | static void virtual_link_encoder_edp_power_control( | |
80 | struct link_encoder *enc, | |
81 | bool power_up) {} | |
82 | ||
83 | static void virtual_link_encoder_connect_dig_be_to_fe( | |
84 | struct link_encoder *enc, | |
85 | enum engine_id engine, | |
86 | bool connect) {} | |
87 | ||
88 | static void virtual_link_encoder_destroy(struct link_encoder **enc) | |
89 | { | |
90 | dm_free(*enc); | |
91 | *enc = NULL; | |
92 | } | |
93 | ||
94 | ||
95 | static const struct link_encoder_funcs virtual_lnk_enc_funcs = { | |
96 | .validate_output_with_stream = | |
97 | virtual_link_encoder_validate_output_with_stream, | |
98 | .hw_init = virtual_link_encoder_hw_init, | |
99 | .setup = virtual_link_encoder_setup, | |
100 | .enable_tmds_output = virtual_link_encoder_enable_tmds_output, | |
101 | .enable_dp_output = virtual_link_encoder_enable_dp_output, | |
102 | .enable_dp_mst_output = virtual_link_encoder_enable_dp_mst_output, | |
103 | .disable_output = virtual_link_encoder_disable_output, | |
104 | .dp_set_lane_settings = virtual_link_encoder_dp_set_lane_settings, | |
105 | .dp_set_phy_pattern = virtual_link_encoder_dp_set_phy_pattern, | |
106 | .update_mst_stream_allocation_table = | |
107 | virtual_link_encoder_update_mst_stream_allocation_table, | |
4562236b HW |
108 | .backlight_control = virtual_link_encoder_edp_backlight_control, |
109 | .power_control = virtual_link_encoder_edp_power_control, | |
110 | .connect_dig_be_to_fe = virtual_link_encoder_connect_dig_be_to_fe, | |
111 | .destroy = virtual_link_encoder_destroy | |
112 | }; | |
113 | ||
114 | bool virtual_link_encoder_construct( | |
115 | struct link_encoder *enc, const struct encoder_init_data *init_data) | |
116 | { | |
117 | enc->funcs = &virtual_lnk_enc_funcs; | |
118 | enc->ctx = init_data->ctx; | |
119 | enc->id = init_data->encoder; | |
120 | ||
121 | enc->hpd_source = init_data->hpd_source; | |
122 | enc->connector = init_data->connector; | |
123 | ||
124 | enc->transmitter = init_data->transmitter; | |
125 | ||
4562236b HW |
126 | enc->output_signals = SIGNAL_TYPE_VIRTUAL; |
127 | ||
128 | enc->preferred_engine = ENGINE_ID_VIRTUAL; | |
129 | ||
130 | return true; | |
131 | } | |
132 | ||
133 |