diff options
Diffstat (limited to 'drivers/gpu/drm/radeon/radeon_mode.h')
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_mode.h | 55 |
1 files changed, 35 insertions, 20 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_mode.h b/drivers/gpu/drm/radeon/radeon_mode.h index e81b2aeb6a8f..1702b820aa4d 100644 --- a/drivers/gpu/drm/radeon/radeon_mode.h +++ b/drivers/gpu/drm/radeon/radeon_mode.h | |||
@@ -83,6 +83,8 @@ struct radeon_i2c_bus_rec { | |||
83 | bool valid; | 83 | bool valid; |
84 | /* id used by atom */ | 84 | /* id used by atom */ |
85 | uint8_t i2c_id; | 85 | uint8_t i2c_id; |
86 | /* id used by atom */ | ||
87 | uint8_t hpd_id; | ||
86 | /* can be used with hw i2c engine */ | 88 | /* can be used with hw i2c engine */ |
87 | bool hw_capable; | 89 | bool hw_capable; |
88 | /* uses multi-media i2c engine */ | 90 | /* uses multi-media i2c engine */ |
@@ -113,6 +115,7 @@ struct radeon_tmds_pll { | |||
113 | 115 | ||
114 | #define RADEON_MAX_BIOS_CONNECTOR 16 | 116 | #define RADEON_MAX_BIOS_CONNECTOR 16 |
115 | 117 | ||
118 | /* pll flags */ | ||
116 | #define RADEON_PLL_USE_BIOS_DIVS (1 << 0) | 119 | #define RADEON_PLL_USE_BIOS_DIVS (1 << 0) |
117 | #define RADEON_PLL_NO_ODD_POST_DIV (1 << 1) | 120 | #define RADEON_PLL_NO_ODD_POST_DIV (1 << 1) |
118 | #define RADEON_PLL_USE_REF_DIV (1 << 2) | 121 | #define RADEON_PLL_USE_REF_DIV (1 << 2) |
@@ -127,6 +130,12 @@ struct radeon_tmds_pll { | |||
127 | #define RADEON_PLL_PREFER_CLOSEST_LOWER (1 << 11) | 130 | #define RADEON_PLL_PREFER_CLOSEST_LOWER (1 << 11) |
128 | #define RADEON_PLL_USE_POST_DIV (1 << 12) | 131 | #define RADEON_PLL_USE_POST_DIV (1 << 12) |
129 | 132 | ||
133 | /* pll algo */ | ||
134 | enum radeon_pll_algo { | ||
135 | PLL_ALGO_LEGACY, | ||
136 | PLL_ALGO_NEW | ||
137 | }; | ||
138 | |||
130 | struct radeon_pll { | 139 | struct radeon_pll { |
131 | /* reference frequency */ | 140 | /* reference frequency */ |
132 | uint32_t reference_freq; | 141 | uint32_t reference_freq; |
@@ -157,6 +166,13 @@ struct radeon_pll { | |||
157 | 166 | ||
158 | /* pll id */ | 167 | /* pll id */ |
159 | uint32_t id; | 168 | uint32_t id; |
169 | /* pll algo */ | ||
170 | enum radeon_pll_algo algo; | ||
171 | }; | ||
172 | |||
173 | struct i2c_algo_radeon_data { | ||
174 | struct i2c_adapter bit_adapter; | ||
175 | struct i2c_algo_bit_data bit_data; | ||
160 | }; | 176 | }; |
161 | 177 | ||
162 | struct radeon_i2c_chan { | 178 | struct radeon_i2c_chan { |
@@ -164,7 +180,7 @@ struct radeon_i2c_chan { | |||
164 | struct drm_device *dev; | 180 | struct drm_device *dev; |
165 | union { | 181 | union { |
166 | struct i2c_algo_dp_aux_data dp; | 182 | struct i2c_algo_dp_aux_data dp; |
167 | struct i2c_algo_bit_data bit; | 183 | struct i2c_algo_radeon_data radeon; |
168 | } algo; | 184 | } algo; |
169 | struct radeon_i2c_bus_rec rec; | 185 | struct radeon_i2c_bus_rec rec; |
170 | }; | 186 | }; |
@@ -193,7 +209,7 @@ struct radeon_mode_info { | |||
193 | struct card_info *atom_card_info; | 209 | struct card_info *atom_card_info; |
194 | enum radeon_connector_table connector_table; | 210 | enum radeon_connector_table connector_table; |
195 | bool mode_config_initialized; | 211 | bool mode_config_initialized; |
196 | struct radeon_crtc *crtcs[2]; | 212 | struct radeon_crtc *crtcs[6]; |
197 | /* DVI-I properties */ | 213 | /* DVI-I properties */ |
198 | struct drm_property *coherent_mode_property; | 214 | struct drm_property *coherent_mode_property; |
199 | /* DAC enable load detect */ | 215 | /* DAC enable load detect */ |
@@ -202,7 +218,8 @@ struct radeon_mode_info { | |||
202 | struct drm_property *tv_std_property; | 218 | struct drm_property *tv_std_property; |
203 | /* legacy TMDS PLL detect */ | 219 | /* legacy TMDS PLL detect */ |
204 | struct drm_property *tmds_pll_property; | 220 | struct drm_property *tmds_pll_property; |
205 | 221 | /* hardcoded DFP edid from BIOS */ | |
222 | struct edid *bios_hardcoded_edid; | ||
206 | }; | 223 | }; |
207 | 224 | ||
208 | #define MAX_H_CODE_TIMING_LEN 32 | 225 | #define MAX_H_CODE_TIMING_LEN 32 |
@@ -237,6 +254,7 @@ struct radeon_crtc { | |||
237 | fixed20_12 vsc; | 254 | fixed20_12 vsc; |
238 | fixed20_12 hsc; | 255 | fixed20_12 hsc; |
239 | struct drm_display_mode native_mode; | 256 | struct drm_display_mode native_mode; |
257 | int pll_id; | ||
240 | }; | 258 | }; |
241 | 259 | ||
242 | struct radeon_encoder_primary_dac { | 260 | struct radeon_encoder_primary_dac { |
@@ -303,6 +321,7 @@ struct radeon_encoder_atom_dig { | |||
303 | /* atom lvds */ | 321 | /* atom lvds */ |
304 | uint32_t lvds_misc; | 322 | uint32_t lvds_misc; |
305 | uint16_t panel_pwr_delay; | 323 | uint16_t panel_pwr_delay; |
324 | enum radeon_pll_algo pll_algo; | ||
306 | struct radeon_atom_ss *ss; | 325 | struct radeon_atom_ss *ss; |
307 | /* panel mode */ | 326 | /* panel mode */ |
308 | struct drm_display_mode native_mode; | 327 | struct drm_display_mode native_mode; |
@@ -398,6 +417,7 @@ extern void dp_link_train(struct drm_encoder *encoder, | |||
398 | struct drm_connector *connector); | 417 | struct drm_connector *connector); |
399 | extern u8 radeon_dp_getsinktype(struct radeon_connector *radeon_connector); | 418 | extern u8 radeon_dp_getsinktype(struct radeon_connector *radeon_connector); |
400 | extern bool radeon_dp_getdpcd(struct radeon_connector *radeon_connector); | 419 | extern bool radeon_dp_getdpcd(struct radeon_connector *radeon_connector); |
420 | extern void atombios_dig_encoder_setup(struct drm_encoder *encoder, int action); | ||
401 | extern void atombios_dig_transmitter_setup(struct drm_encoder *encoder, | 421 | extern void atombios_dig_transmitter_setup(struct drm_encoder *encoder, |
402 | int action, uint8_t lane_num, | 422 | int action, uint8_t lane_num, |
403 | uint8_t lane_set); | 423 | uint8_t lane_set); |
@@ -411,14 +431,15 @@ extern struct radeon_i2c_chan *radeon_i2c_create(struct drm_device *dev, | |||
411 | struct radeon_i2c_bus_rec *rec, | 431 | struct radeon_i2c_bus_rec *rec, |
412 | const char *name); | 432 | const char *name); |
413 | extern void radeon_i2c_destroy(struct radeon_i2c_chan *i2c); | 433 | extern void radeon_i2c_destroy(struct radeon_i2c_chan *i2c); |
414 | extern void radeon_i2c_sw_get_byte(struct radeon_i2c_chan *i2c_bus, | 434 | extern void radeon_i2c_destroy_dp(struct radeon_i2c_chan *i2c); |
415 | u8 slave_addr, | 435 | extern void radeon_i2c_get_byte(struct radeon_i2c_chan *i2c_bus, |
416 | u8 addr, | 436 | u8 slave_addr, |
417 | u8 *val); | 437 | u8 addr, |
418 | extern void radeon_i2c_sw_put_byte(struct radeon_i2c_chan *i2c, | 438 | u8 *val); |
419 | u8 slave_addr, | 439 | extern void radeon_i2c_put_byte(struct radeon_i2c_chan *i2c, |
420 | u8 addr, | 440 | u8 slave_addr, |
421 | u8 val); | 441 | u8 addr, |
442 | u8 val); | ||
422 | extern bool radeon_ddc_probe(struct radeon_connector *radeon_connector); | 443 | extern bool radeon_ddc_probe(struct radeon_connector *radeon_connector); |
423 | extern int radeon_ddc_get_modes(struct radeon_connector *radeon_connector); | 444 | extern int radeon_ddc_get_modes(struct radeon_connector *radeon_connector); |
424 | 445 | ||
@@ -432,14 +453,6 @@ extern void radeon_compute_pll(struct radeon_pll *pll, | |||
432 | uint32_t *ref_div_p, | 453 | uint32_t *ref_div_p, |
433 | uint32_t *post_div_p); | 454 | uint32_t *post_div_p); |
434 | 455 | ||
435 | extern void radeon_compute_pll_avivo(struct radeon_pll *pll, | ||
436 | uint64_t freq, | ||
437 | uint32_t *dot_clock_p, | ||
438 | uint32_t *fb_div_p, | ||
439 | uint32_t *frac_fb_div_p, | ||
440 | uint32_t *ref_div_p, | ||
441 | uint32_t *post_div_p); | ||
442 | |||
443 | extern void radeon_setup_encoder_clones(struct drm_device *dev); | 456 | extern void radeon_setup_encoder_clones(struct drm_device *dev); |
444 | 457 | ||
445 | struct drm_encoder *radeon_encoder_legacy_lvds_add(struct drm_device *dev, int bios_index); | 458 | struct drm_encoder *radeon_encoder_legacy_lvds_add(struct drm_device *dev, int bios_index); |
@@ -473,6 +486,9 @@ extern int radeon_crtc_cursor_set(struct drm_crtc *crtc, | |||
473 | extern int radeon_crtc_cursor_move(struct drm_crtc *crtc, | 486 | extern int radeon_crtc_cursor_move(struct drm_crtc *crtc, |
474 | int x, int y); | 487 | int x, int y); |
475 | 488 | ||
489 | extern bool radeon_combios_check_hardcoded_edid(struct radeon_device *rdev); | ||
490 | extern struct edid * | ||
491 | radeon_combios_get_hardcoded_edid(struct radeon_device *rdev); | ||
476 | extern bool radeon_atom_get_clock_info(struct drm_device *dev); | 492 | extern bool radeon_atom_get_clock_info(struct drm_device *dev); |
477 | extern bool radeon_combios_get_clock_info(struct drm_device *dev); | 493 | extern bool radeon_combios_get_clock_info(struct drm_device *dev); |
478 | extern struct radeon_encoder_atom_dig * | 494 | extern struct radeon_encoder_atom_dig * |
@@ -531,7 +547,6 @@ void radeon_atombios_init_crtc(struct drm_device *dev, | |||
531 | struct radeon_crtc *radeon_crtc); | 547 | struct radeon_crtc *radeon_crtc); |
532 | void radeon_legacy_init_crtc(struct drm_device *dev, | 548 | void radeon_legacy_init_crtc(struct drm_device *dev, |
533 | struct radeon_crtc *radeon_crtc); | 549 | struct radeon_crtc *radeon_crtc); |
534 | extern void radeon_i2c_do_lock(struct radeon_i2c_chan *i2c, int lock_state); | ||
535 | 550 | ||
536 | void radeon_get_clock_info(struct drm_device *dev); | 551 | void radeon_get_clock_info(struct drm_device *dev); |
537 | 552 | ||