2 * Copyright 2016 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.
26 #ifndef DC_BIOS_TYPES_H
27 #define DC_BIOS_TYPES_H
29 /******************************************************************************
30 * Interface file for VBIOS implementations.
32 * The default implementation is inside DC.
33 * Display Manager (which instantiates DC) has the option to supply it's own
34 * (external to DC) implementation of VBIOS, which will be called by DC, using
36 * (The intended use is Diagnostics, but other uses may appear.)
37 *****************************************************************************/
39 #include "include/bios_parser_types.h"
41 struct dc_vbios_funcs {
42 uint8_t (*get_connectors_number)(struct dc_bios *bios);
44 struct graphics_object_id (*get_encoder_id)(
47 struct graphics_object_id (*get_connector_id)(
49 uint8_t connector_index);
50 uint32_t (*get_dst_number)(
52 struct graphics_object_id id);
54 enum bp_result (*get_src_obj)(
56 struct graphics_object_id object_id, uint32_t index,
57 struct graphics_object_id *src_object_id);
58 enum bp_result (*get_dst_obj)(
60 struct graphics_object_id object_id, uint32_t index,
61 struct graphics_object_id *dest_object_id);
63 enum bp_result (*get_i2c_info)(
65 struct graphics_object_id id,
66 struct graphics_object_i2c_info *info);
68 enum bp_result (*get_voltage_ddc_info)(
71 struct graphics_object_i2c_info *info);
72 enum bp_result (*get_thermal_ddc_info)(
74 uint32_t i2c_channel_id,
75 struct graphics_object_i2c_info *info);
76 enum bp_result (*get_hpd_info)(
78 struct graphics_object_id id,
79 struct graphics_object_hpd_info *info);
80 enum bp_result (*get_device_tag)(
82 struct graphics_object_id connector_object_id,
83 uint32_t device_tag_index,
84 struct connector_device_tag_info *info);
85 enum bp_result (*get_firmware_info)(
87 struct dc_firmware_info *info);
88 enum bp_result (*get_spread_spectrum_info)(
90 enum as_signal_type signal,
92 struct spread_spectrum_info *ss_info);
93 uint32_t (*get_ss_entry_number)(
95 enum as_signal_type signal);
96 enum bp_result (*get_embedded_panel_info)(
98 struct embedded_panel_info *info);
99 enum bp_result (*get_gpio_pin_info)(
100 struct dc_bios *bios,
102 struct gpio_pin_info *info);
103 enum bp_result (*get_encoder_cap_info)(
104 struct dc_bios *bios,
105 struct graphics_object_id object_id,
106 struct bp_encoder_cap_info *info);
108 bool (*is_lid_status_changed)(
109 struct dc_bios *bios);
110 bool (*is_display_config_changed)(
111 struct dc_bios *bios);
112 bool (*is_accelerated_mode)(
113 struct dc_bios *bios);
114 void (*get_bios_event_info)(
115 struct dc_bios *bios,
116 struct bios_event_info *info);
117 void (*update_requested_backlight_level)(
118 struct dc_bios *bios,
119 uint32_t backlight_8bit);
120 uint32_t (*get_requested_backlight_level)(
121 struct dc_bios *bios);
122 void (*take_backlight_control)(
123 struct dc_bios *bios,
126 bool (*is_active_display)(
127 struct dc_bios *bios,
128 enum signal_type signal,
129 const struct connector_device_tag_info *device_tag);
130 enum controller_id (*get_embedded_display_controller_id)(
131 struct dc_bios *bios);
132 uint32_t (*get_embedded_display_refresh_rate)(
133 struct dc_bios *bios);
135 void (*set_scratch_critical_state)(
136 struct dc_bios *bios,
138 bool (*is_device_id_supported)(
139 struct dc_bios *bios,
140 struct device_id id);
144 enum bp_result (*encoder_control)(
145 struct dc_bios *bios,
146 struct bp_encoder_control *cntl);
147 enum bp_result (*transmitter_control)(
148 struct dc_bios *bios,
149 struct bp_transmitter_control *cntl);
150 enum bp_result (*crt_control)(
151 struct dc_bios *bios,
152 enum engine_id engine_id,
154 uint32_t pixel_clock);
155 enum bp_result (*enable_crtc)(
156 struct dc_bios *bios,
157 enum controller_id id,
159 enum bp_result (*adjust_pixel_clock)(
160 struct dc_bios *bios,
161 struct bp_adjust_pixel_clock_parameters *bp_params);
162 enum bp_result (*set_pixel_clock)(
163 struct dc_bios *bios,
164 struct bp_pixel_clock_parameters *bp_params);
165 enum bp_result (*set_dce_clock)(
166 struct dc_bios *bios,
167 struct bp_set_dce_clock_parameters *bp_params);
168 unsigned int (*get_smu_clock_info)(
169 struct dc_bios *bios);
170 enum bp_result (*enable_spread_spectrum_on_ppll)(
171 struct dc_bios *bios,
172 struct bp_spread_spectrum_parameters *bp_params,
174 enum bp_result (*program_crtc_timing)(
175 struct dc_bios *bios,
176 struct bp_hw_crtc_timing_parameters *bp_params);
178 enum bp_result (*crtc_source_select)(
179 struct dc_bios *bios,
180 struct bp_crtc_source_select *bp_params);
181 enum bp_result (*program_display_engine_pll)(
182 struct dc_bios *bios,
183 struct bp_pixel_clock_parameters *bp_params);
185 enum signal_type (*dac_load_detect)(
186 struct dc_bios *bios,
187 struct graphics_object_id encoder,
188 struct graphics_object_id connector,
189 enum signal_type display_signal);
191 enum bp_result (*enable_disp_power_gating)(
192 struct dc_bios *bios,
193 enum controller_id controller_id,
194 enum bp_pipe_control_action action);
196 void (*post_init)(struct dc_bios *bios);
198 void (*bios_parser_destroy)(struct dc_bios **dcb);
201 struct bios_registers {
202 uint32_t BIOS_SCRATCH_6;
206 const struct dc_vbios_funcs *funcs;
211 uint8_t *bios_local_image;
213 struct dc_context *ctx;
214 const struct bios_registers *regs;
215 struct integrated_info *integrated_info;
218 #endif /* DC_BIOS_TYPES_H */