1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26 #ifndef DC_BIOS_TYPES_H
27 #define DC_BIOS_TYPES_H
28
29
30
31
32
33
34
35
36
37
38
39 #include "include/bios_parser_types.h"
40
41 struct dc_vbios_funcs {
42 uint8_t (*get_connectors_number)(struct dc_bios *bios);
43
44 struct graphics_object_id (*get_connector_id)(
45 struct dc_bios *bios,
46 uint8_t connector_index);
47 enum bp_result (*get_src_obj)(
48 struct dc_bios *bios,
49 struct graphics_object_id object_id, uint32_t index,
50 struct graphics_object_id *src_object_id);
51 enum bp_result (*get_i2c_info)(
52 struct dc_bios *dcb,
53 struct graphics_object_id id,
54 struct graphics_object_i2c_info *info);
55 enum bp_result (*get_hpd_info)(
56 struct dc_bios *bios,
57 struct graphics_object_id id,
58 struct graphics_object_hpd_info *info);
59 enum bp_result (*get_device_tag)(
60 struct dc_bios *bios,
61 struct graphics_object_id connector_object_id,
62 uint32_t device_tag_index,
63 struct connector_device_tag_info *info);
64 enum bp_result (*get_spread_spectrum_info)(
65 struct dc_bios *bios,
66 enum as_signal_type signal,
67 uint32_t index,
68 struct spread_spectrum_info *ss_info);
69 uint32_t (*get_ss_entry_number)(
70 struct dc_bios *bios,
71 enum as_signal_type signal);
72 enum bp_result (*get_embedded_panel_info)(
73 struct dc_bios *bios,
74 struct embedded_panel_info *info);
75 enum bp_result (*get_gpio_pin_info)(
76 struct dc_bios *bios,
77 uint32_t gpio_id,
78 struct gpio_pin_info *info);
79 enum bp_result (*get_encoder_cap_info)(
80 struct dc_bios *bios,
81 struct graphics_object_id object_id,
82 struct bp_encoder_cap_info *info);
83
84 bool (*is_accelerated_mode)(
85 struct dc_bios *bios);
86 void (*set_scratch_critical_state)(
87 struct dc_bios *bios,
88 bool state);
89 bool (*is_device_id_supported)(
90 struct dc_bios *bios,
91 struct device_id id);
92
93
94
95 enum bp_result (*encoder_control)(
96 struct dc_bios *bios,
97 struct bp_encoder_control *cntl);
98 enum bp_result (*transmitter_control)(
99 struct dc_bios *bios,
100 struct bp_transmitter_control *cntl);
101 enum bp_result (*enable_crtc)(
102 struct dc_bios *bios,
103 enum controller_id id,
104 bool enable);
105 enum bp_result (*adjust_pixel_clock)(
106 struct dc_bios *bios,
107 struct bp_adjust_pixel_clock_parameters *bp_params);
108 enum bp_result (*set_pixel_clock)(
109 struct dc_bios *bios,
110 struct bp_pixel_clock_parameters *bp_params);
111 enum bp_result (*set_dce_clock)(
112 struct dc_bios *bios,
113 struct bp_set_dce_clock_parameters *bp_params);
114 enum bp_result (*enable_spread_spectrum_on_ppll)(
115 struct dc_bios *bios,
116 struct bp_spread_spectrum_parameters *bp_params,
117 bool enable);
118 enum bp_result (*program_crtc_timing)(
119 struct dc_bios *bios,
120 struct bp_hw_crtc_timing_parameters *bp_params);
121 enum bp_result (*program_display_engine_pll)(
122 struct dc_bios *bios,
123 struct bp_pixel_clock_parameters *bp_params);
124 enum bp_result (*enable_disp_power_gating)(
125 struct dc_bios *bios,
126 enum controller_id controller_id,
127 enum bp_pipe_control_action action);
128
129 void (*bios_parser_destroy)(struct dc_bios **dcb);
130
131 enum bp_result (*get_board_layout_info)(
132 struct dc_bios *dcb,
133 struct board_layout_info *board_layout_info);
134 };
135
136 struct bios_registers {
137 uint32_t BIOS_SCRATCH_3;
138 uint32_t BIOS_SCRATCH_6;
139 };
140
141 struct dc_bios {
142 const struct dc_vbios_funcs *funcs;
143
144 uint8_t *bios;
145 uint32_t bios_size;
146
147 uint8_t *bios_local_image;
148
149 struct dc_context *ctx;
150 const struct bios_registers *regs;
151 struct integrated_info *integrated_info;
152 struct dc_firmware_info fw_info;
153 bool fw_info_valid;
154 };
155
156 #endif