Rev 1129 | Rev 1221 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1129 | Rev 1179 | ||
---|---|---|---|
Line 26... | Line 26... | ||
26 | #include "drmP.h" |
26 | #include "drmP.h" |
27 | #include "drm_edid.h" |
27 | #include "drm_edid.h" |
28 | #include "drm_crtc_helper.h" |
28 | #include "drm_crtc_helper.h" |
29 | #include "radeon_drm.h" |
29 | #include "radeon_drm.h" |
30 | #include "radeon.h" |
30 | #include "radeon.h" |
- | 31 | #include "atom.h" |
|
Line 31... | Line 32... | ||
31 | 32 | ||
32 | extern void |
33 | extern void |
33 | radeon_combios_connected_scratch_regs(struct drm_connector *connector, |
34 | radeon_combios_connected_scratch_regs(struct drm_connector *connector, |
34 | struct drm_encoder *encoder, |
35 | struct drm_encoder *encoder, |
35 | bool connected); |
36 | bool connected); |
36 | extern void |
37 | extern void |
37 | radeon_atombios_connected_scratch_regs(struct drm_connector *connector, |
38 | radeon_atombios_connected_scratch_regs(struct drm_connector *connector, |
38 | struct drm_encoder *encoder, |
39 | struct drm_encoder *encoder, |
Line -... | Line 40... | ||
- | 40 | bool connected); |
|
- | 41 | ||
- | 42 | static void radeon_property_change_mode(struct drm_encoder *encoder) |
|
- | 43 | { |
|
- | 44 | struct drm_crtc *crtc = encoder->crtc; |
|
- | 45 | ||
- | 46 | if (crtc && crtc->enabled) { |
|
- | 47 | drm_crtc_helper_set_mode(crtc, &crtc->mode, |
|
- | 48 | crtc->x, crtc->y, crtc->fb); |
|
39 | bool connected); |
49 | } |
40 | 50 | } |
|
41 | static void |
51 | static void |
42 | radeon_connector_update_scratch_regs(struct drm_connector *connector, enum drm_connector_status status) |
52 | radeon_connector_update_scratch_regs(struct drm_connector *connector, enum drm_connector_status status) |
43 | { |
53 | { |
Line 75... | Line 85... | ||
75 | radeon_combios_connected_scratch_regs(connector, encoder, connected); |
85 | radeon_combios_connected_scratch_regs(connector, encoder, connected); |
Line 76... | Line 86... | ||
76 | 86 | ||
77 | } |
87 | } |
Line -... | Line 88... | ||
- | 88 | } |
|
- | 89 | ||
- | 90 | struct drm_encoder *radeon_find_encoder(struct drm_connector *connector, int encoder_type) |
|
- | 91 | { |
|
- | 92 | struct drm_mode_object *obj; |
|
- | 93 | struct drm_encoder *encoder; |
|
- | 94 | int i; |
|
- | 95 | ||
- | 96 | for (i = 0; i < DRM_CONNECTOR_MAX_ENCODER; i++) { |
|
- | 97 | if (connector->encoder_ids[i] == 0) |
|
- | 98 | break; |
|
- | 99 | ||
- | 100 | obj = drm_mode_object_find(connector->dev, connector->encoder_ids[i], DRM_MODE_OBJECT_ENCODER); |
|
- | 101 | if (!obj) |
|
- | 102 | continue; |
|
- | 103 | ||
- | 104 | encoder = obj_to_encoder(obj); |
|
- | 105 | if (encoder->encoder_type == encoder_type) |
|
- | 106 | return encoder; |
|
- | 107 | } |
|
- | 108 | return NULL; |
|
78 | } |
109 | } |
79 | 110 | ||
80 | struct drm_encoder *radeon_best_single_encoder(struct drm_connector *connector) |
111 | struct drm_encoder *radeon_best_single_encoder(struct drm_connector *connector) |
81 | { |
112 | { |
82 | int enc_id = connector->encoder_ids[0]; |
113 | int enc_id = connector->encoder_ids[0]; |
Line 83... | Line -... | ||
83 | struct drm_mode_object *obj; |
- | |
84 | struct drm_encoder *encoder; |
- | |
85 | 114 | struct drm_mode_object *obj; |
|
86 | ENTRY(); |
115 | struct drm_encoder *encoder; |
87 | 116 | ||
88 | /* pick the encoder ids */ |
117 | /* pick the encoder ids */ |
89 | if (enc_id) { |
118 | if (enc_id) { |
Line 94... | Line 123... | ||
94 | return encoder; |
123 | return encoder; |
95 | } |
124 | } |
96 | return NULL; |
125 | return NULL; |
97 | } |
126 | } |
Line -... | Line 127... | ||
- | 127 | ||
- | 128 | /* |
|
- | 129 | * radeon_connector_analog_encoder_conflict_solve |
|
- | 130 | * - search for other connectors sharing this encoder |
|
- | 131 | * if priority is true, then set them disconnected if this is connected |
|
- | 132 | * if priority is false, set us disconnected if they are connected |
|
- | 133 | */ |
|
- | 134 | static enum drm_connector_status |
|
- | 135 | radeon_connector_analog_encoder_conflict_solve(struct drm_connector *connector, |
|
- | 136 | struct drm_encoder *encoder, |
|
- | 137 | enum drm_connector_status current_status, |
|
- | 138 | bool priority) |
|
- | 139 | { |
|
- | 140 | struct drm_device *dev = connector->dev; |
|
- | 141 | struct drm_connector *conflict; |
|
- | 142 | int i; |
|
- | 143 | ||
- | 144 | list_for_each_entry(conflict, &dev->mode_config.connector_list, head) { |
|
- | 145 | if (conflict == connector) |
|
- | 146 | continue; |
|
- | 147 | ||
- | 148 | for (i = 0; i < DRM_CONNECTOR_MAX_ENCODER; i++) { |
|
- | 149 | if (conflict->encoder_ids[i] == 0) |
|
- | 150 | break; |
|
- | 151 | ||
- | 152 | /* if the IDs match */ |
|
- | 153 | if (conflict->encoder_ids[i] == encoder->base.id) { |
|
- | 154 | if (conflict->status != connector_status_connected) |
|
- | 155 | continue; |
|
- | 156 | ||
- | 157 | if (priority == true) { |
|
- | 158 | DRM_INFO("1: conflicting encoders switching off %s\n", drm_get_connector_name(conflict)); |
|
- | 159 | DRM_INFO("in favor of %s\n", drm_get_connector_name(connector)); |
|
- | 160 | conflict->status = connector_status_disconnected; |
|
- | 161 | radeon_connector_update_scratch_regs(conflict, connector_status_disconnected); |
|
- | 162 | } else { |
|
- | 163 | DRM_INFO("2: conflicting encoders switching off %s\n", drm_get_connector_name(connector)); |
|
- | 164 | DRM_INFO("in favor of %s\n", drm_get_connector_name(conflict)); |
|
- | 165 | current_status = connector_status_disconnected; |
|
- | 166 | } |
|
- | 167 | break; |
|
- | 168 | } |
|
- | 169 | } |
|
- | 170 | } |
|
- | 171 | return current_status; |
|
- | 172 | ||
- | 173 | } |
|
98 | 174 | ||
99 | static struct drm_display_mode *radeon_fp_native_mode(struct drm_encoder *encoder) |
175 | static struct drm_display_mode *radeon_fp_native_mode(struct drm_encoder *encoder) |
100 | { |
176 | { |
101 | struct drm_device *dev = encoder->dev; |
177 | struct drm_device *dev = encoder->dev; |
102 | struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder); |
178 | struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder); |
Line 126... | Line 202... | ||
126 | DRM_DEBUG("Adding native panel mode %s\n", mode->name); |
202 | DRM_DEBUG("Adding native panel mode %s\n", mode->name); |
127 | } |
203 | } |
128 | return mode; |
204 | return mode; |
129 | } |
205 | } |
Line -... | Line 206... | ||
- | 206 | ||
- | 207 | static void radeon_add_common_modes(struct drm_encoder *encoder, struct drm_connector *connector) |
|
- | 208 | { |
|
- | 209 | struct drm_device *dev = encoder->dev; |
|
- | 210 | struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder); |
|
- | 211 | struct drm_display_mode *mode = NULL; |
|
- | 212 | struct radeon_native_mode *native_mode = &radeon_encoder->native_mode; |
|
- | 213 | int i; |
|
- | 214 | struct mode_size { |
|
- | 215 | int w; |
|
- | 216 | int h; |
|
- | 217 | } common_modes[17] = { |
|
- | 218 | { 640, 480}, |
|
- | 219 | { 720, 480}, |
|
- | 220 | { 800, 600}, |
|
- | 221 | { 848, 480}, |
|
- | 222 | {1024, 768}, |
|
- | 223 | {1152, 768}, |
|
- | 224 | {1280, 720}, |
|
- | 225 | {1280, 800}, |
|
- | 226 | {1280, 854}, |
|
- | 227 | {1280, 960}, |
|
- | 228 | {1280, 1024}, |
|
- | 229 | {1440, 900}, |
|
- | 230 | {1400, 1050}, |
|
- | 231 | {1680, 1050}, |
|
- | 232 | {1600, 1200}, |
|
- | 233 | {1920, 1080}, |
|
- | 234 | {1920, 1200} |
|
- | 235 | }; |
|
- | 236 | ||
- | 237 | for (i = 0; i < 17; i++) { |
|
- | 238 | if (radeon_encoder->devices & (ATOM_DEVICE_LCD_SUPPORT)) { |
|
- | 239 | if (common_modes[i].w > native_mode->panel_xres || |
|
- | 240 | common_modes[i].h > native_mode->panel_yres || |
|
- | 241 | (common_modes[i].w == native_mode->panel_xres && |
|
- | 242 | common_modes[i].h == native_mode->panel_yres)) |
|
- | 243 | continue; |
|
- | 244 | } |
|
- | 245 | if (common_modes[i].w < 320 || common_modes[i].h < 200) |
|
- | 246 | continue; |
|
- | 247 | ||
- | 248 | mode = drm_cvt_mode(dev, common_modes[i].w, common_modes[i].h, 60, false, false); |
|
- | 249 | drm_mode_probed_add(connector, mode); |
|
- | 250 | } |
|
- | 251 | } |
|
130 | 252 | ||
131 | int radeon_connector_set_property(struct drm_connector *connector, struct drm_property *property, |
253 | int radeon_connector_set_property(struct drm_connector *connector, struct drm_property *property, |
132 | uint64_t val) |
254 | uint64_t val) |
- | 255 | { |
|
- | 256 | struct drm_device *dev = connector->dev; |
|
- | 257 | struct radeon_device *rdev = dev->dev_private; |
|
- | 258 | struct drm_encoder *encoder; |
|
- | 259 | struct radeon_encoder *radeon_encoder; |
|
- | 260 | ||
- | 261 | if (property == rdev->mode_info.coherent_mode_property) { |
|
- | 262 | struct radeon_encoder_atom_dig *dig; |
|
- | 263 | ||
- | 264 | /* need to find digital encoder on connector */ |
|
- | 265 | encoder = radeon_find_encoder(connector, DRM_MODE_ENCODER_TMDS); |
|
- | 266 | if (!encoder) |
|
- | 267 | return 0; |
|
- | 268 | ||
- | 269 | radeon_encoder = to_radeon_encoder(encoder); |
|
- | 270 | ||
- | 271 | if (!radeon_encoder->enc_priv) |
|
- | 272 | return 0; |
|
- | 273 | ||
- | 274 | dig = radeon_encoder->enc_priv; |
|
- | 275 | dig->coherent_mode = val ? true : false; |
|
- | 276 | radeon_property_change_mode(&radeon_encoder->base); |
|
- | 277 | } |
|
- | 278 | ||
- | 279 | if (property == rdev->mode_info.tv_std_property) { |
|
- | 280 | encoder = radeon_find_encoder(connector, DRM_MODE_ENCODER_TVDAC); |
|
- | 281 | if (!encoder) { |
|
- | 282 | encoder = radeon_find_encoder(connector, DRM_MODE_ENCODER_DAC); |
|
- | 283 | } |
|
- | 284 | ||
- | 285 | if (!encoder) |
|
- | 286 | return 0; |
|
- | 287 | ||
- | 288 | radeon_encoder = to_radeon_encoder(encoder); |
|
- | 289 | if (!radeon_encoder->enc_priv) |
|
- | 290 | return 0; |
|
- | 291 | if (rdev->is_atom_bios) { |
|
- | 292 | struct radeon_encoder_atom_dac *dac_int; |
|
- | 293 | dac_int = radeon_encoder->enc_priv; |
|
- | 294 | dac_int->tv_std = val; |
|
- | 295 | } else { |
|
- | 296 | struct radeon_encoder_tv_dac *dac_int; |
|
- | 297 | dac_int = radeon_encoder->enc_priv; |
|
- | 298 | dac_int->tv_std = val; |
|
- | 299 | } |
|
- | 300 | radeon_property_change_mode(&radeon_encoder->base); |
|
- | 301 | } |
|
- | 302 | ||
- | 303 | if (property == rdev->mode_info.load_detect_property) { |
|
- | 304 | struct radeon_connector *radeon_connector = |
|
- | 305 | to_radeon_connector(connector); |
|
- | 306 | ||
- | 307 | if (val == 0) |
|
- | 308 | radeon_connector->dac_load_detect = false; |
|
- | 309 | else |
|
- | 310 | radeon_connector->dac_load_detect = true; |
|
- | 311 | } |
|
- | 312 | ||
- | 313 | if (property == rdev->mode_info.tmds_pll_property) { |
|
- | 314 | struct radeon_encoder_int_tmds *tmds = NULL; |
|
- | 315 | bool ret = false; |
|
- | 316 | /* need to find digital encoder on connector */ |
|
- | 317 | encoder = radeon_find_encoder(connector, DRM_MODE_ENCODER_TMDS); |
|
- | 318 | if (!encoder) |
|
- | 319 | return 0; |
|
- | 320 | ||
- | 321 | radeon_encoder = to_radeon_encoder(encoder); |
|
- | 322 | ||
- | 323 | tmds = radeon_encoder->enc_priv; |
|
133 | { |
324 | if (!tmds) |
- | 325 | return 0; |
|
- | 326 | ||
- | 327 | if (val == 0) { |
|
- | 328 | if (rdev->is_atom_bios) |
|
- | 329 | ret = radeon_atombios_get_tmds_info(radeon_encoder, tmds); |
|
- | 330 | else |
|
- | 331 | ret = radeon_legacy_get_tmds_info_from_combios(radeon_encoder, tmds); |
|
- | 332 | } |
|
- | 333 | if (val == 1 || ret == false) { |
|
- | 334 | radeon_legacy_get_tmds_info_from_table(radeon_encoder, tmds); |
|
- | 335 | } |
|
134 | return 0; |
336 | radeon_property_change_mode(&radeon_encoder->base); |
Line -... | Line 337... | ||
- | 337 | } |
|
- | 338 | ||
- | 339 | return 0; |
|
- | 340 | } |
|
- | 341 | ||
- | 342 | static void radeon_fixup_lvds_native_mode(struct drm_encoder *encoder, |
|
- | 343 | struct drm_connector *connector) |
|
- | 344 | { |
|
- | 345 | struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder); |
|
- | 346 | struct radeon_native_mode *native_mode = &radeon_encoder->native_mode; |
|
- | 347 | ||
- | 348 | /* Try to get native mode details from EDID if necessary */ |
|
- | 349 | if (!native_mode->dotclock) { |
|
- | 350 | struct drm_display_mode *t, *mode; |
|
- | 351 | ||
- | 352 | list_for_each_entry_safe(mode, t, &connector->probed_modes, head) { |
|
- | 353 | if (mode->hdisplay == native_mode->panel_xres && |
|
- | 354 | mode->vdisplay == native_mode->panel_yres) { |
|
- | 355 | native_mode->hblank = mode->htotal - mode->hdisplay; |
|
- | 356 | native_mode->hoverplus = mode->hsync_start - mode->hdisplay; |
|
- | 357 | native_mode->hsync_width = mode->hsync_end - mode->hsync_start; |
|
- | 358 | native_mode->vblank = mode->vtotal - mode->vdisplay; |
|
- | 359 | native_mode->voverplus = mode->vsync_start - mode->vdisplay; |
|
- | 360 | native_mode->vsync_width = mode->vsync_end - mode->vsync_start; |
|
- | 361 | native_mode->dotclock = mode->clock; |
|
- | 362 | DRM_INFO("Determined LVDS native mode details from EDID\n"); |
|
- | 363 | break; |
|
- | 364 | } |
|
- | 365 | } |
|
- | 366 | } |
|
- | 367 | if (!native_mode->dotclock) { |
|
- | 368 | DRM_INFO("No LVDS native mode details, disabling RMX\n"); |
|
- | 369 | radeon_encoder->rmx_type = RMX_OFF; |
|
Line 135... | Line 370... | ||
135 | } |
370 | } |
136 | 371 | } |
|
137 | 372 | ||
138 | static int radeon_lvds_get_modes(struct drm_connector *connector) |
373 | static int radeon_lvds_get_modes(struct drm_connector *connector) |
Line 143... | Line 378... | ||
143 | struct drm_display_mode *mode; |
378 | struct drm_display_mode *mode; |
Line 144... | Line 379... | ||
144 | 379 | ||
145 | if (radeon_connector->ddc_bus) { |
380 | if (radeon_connector->ddc_bus) { |
146 | ret = radeon_ddc_get_modes(radeon_connector); |
381 | ret = radeon_ddc_get_modes(radeon_connector); |
- | 382 | if (ret > 0) { |
|
- | 383 | encoder = radeon_best_single_encoder(connector); |
|
- | 384 | if (encoder) { |
|
- | 385 | radeon_fixup_lvds_native_mode(encoder, connector); |
|
- | 386 | /* add scaled modes */ |
|
- | 387 | radeon_add_common_modes(encoder, connector); |
|
147 | if (ret > 0) { |
388 | } |
148 | return ret; |
389 | return ret; |
149 | } |
390 | } |
Line 150... | Line 391... | ||
150 | } |
391 | } |
Line 156... | Line 397... | ||
156 | /* we have no EDID modes */ |
397 | /* we have no EDID modes */ |
157 | mode = radeon_fp_native_mode(encoder); |
398 | mode = radeon_fp_native_mode(encoder); |
158 | if (mode) { |
399 | if (mode) { |
159 | ret = 1; |
400 | ret = 1; |
160 | drm_mode_probed_add(connector, mode); |
401 | drm_mode_probed_add(connector, mode); |
- | 402 | /* add scaled modes */ |
|
- | 403 | radeon_add_common_modes(encoder, connector); |
|
161 | } |
404 | } |
- | 405 | ||
162 | return ret; |
406 | return ret; |
163 | } |
407 | } |
Line 164... | Line 408... | ||
164 | 408 | ||
165 | static int radeon_lvds_mode_valid(struct drm_connector *connector, |
409 | static int radeon_lvds_mode_valid(struct drm_connector *connector, |
Line 186... | Line 430... | ||
186 | // drm_sysfs_connector_remove(connector); |
430 | // drm_sysfs_connector_remove(connector); |
187 | drm_connector_cleanup(connector); |
431 | drm_connector_cleanup(connector); |
188 | kfree(connector); |
432 | kfree(connector); |
189 | } |
433 | } |
Line -... | Line 434... | ||
- | 434 | ||
- | 435 | static int radeon_lvds_set_property(struct drm_connector *connector, |
|
- | 436 | struct drm_property *property, |
|
- | 437 | uint64_t value) |
|
- | 438 | { |
|
- | 439 | struct drm_device *dev = connector->dev; |
|
- | 440 | struct radeon_encoder *radeon_encoder; |
|
- | 441 | enum radeon_rmx_type rmx_type; |
|
- | 442 | ||
- | 443 | DRM_DEBUG("\n"); |
|
- | 444 | if (property != dev->mode_config.scaling_mode_property) |
|
- | 445 | return 0; |
|
- | 446 | ||
- | 447 | if (connector->encoder) |
|
- | 448 | radeon_encoder = to_radeon_encoder(connector->encoder); |
|
- | 449 | else { |
|
- | 450 | struct drm_connector_helper_funcs *connector_funcs = connector->helper_private; |
|
- | 451 | radeon_encoder = to_radeon_encoder(connector_funcs->best_encoder(connector)); |
|
- | 452 | } |
|
- | 453 | ||
- | 454 | switch (value) { |
|
- | 455 | case DRM_MODE_SCALE_NONE: rmx_type = RMX_OFF; break; |
|
- | 456 | case DRM_MODE_SCALE_CENTER: rmx_type = RMX_CENTER; break; |
|
- | 457 | case DRM_MODE_SCALE_ASPECT: rmx_type = RMX_ASPECT; break; |
|
- | 458 | default: |
|
- | 459 | case DRM_MODE_SCALE_FULLSCREEN: rmx_type = RMX_FULL; break; |
|
- | 460 | } |
|
- | 461 | if (radeon_encoder->rmx_type == rmx_type) |
|
- | 462 | return 0; |
|
- | 463 | ||
- | 464 | radeon_encoder->rmx_type = rmx_type; |
|
- | 465 | ||
- | 466 | radeon_property_change_mode(&radeon_encoder->base); |
|
- | 467 | return 0; |
|
- | 468 | } |
|
- | 469 | ||
190 | 470 | ||
191 | struct drm_connector_helper_funcs radeon_lvds_connector_helper_funcs = { |
471 | struct drm_connector_helper_funcs radeon_lvds_connector_helper_funcs = { |
192 | .get_modes = radeon_lvds_get_modes, |
472 | .get_modes = radeon_lvds_get_modes, |
193 | .mode_valid = radeon_lvds_mode_valid, |
473 | .mode_valid = radeon_lvds_mode_valid, |
194 | .best_encoder = radeon_best_single_encoder, |
474 | .best_encoder = radeon_best_single_encoder, |
Line 197... | Line 477... | ||
197 | struct drm_connector_funcs radeon_lvds_connector_funcs = { |
477 | struct drm_connector_funcs radeon_lvds_connector_funcs = { |
198 | .dpms = drm_helper_connector_dpms, |
478 | .dpms = drm_helper_connector_dpms, |
199 | .detect = radeon_lvds_detect, |
479 | .detect = radeon_lvds_detect, |
200 | .fill_modes = drm_helper_probe_single_connector_modes, |
480 | .fill_modes = drm_helper_probe_single_connector_modes, |
201 | .destroy = radeon_connector_destroy, |
481 | .destroy = radeon_connector_destroy, |
202 | .set_property = radeon_connector_set_property, |
482 | .set_property = radeon_lvds_set_property, |
203 | }; |
483 | }; |
Line 204... | Line 484... | ||
204 | 484 | ||
205 | static int radeon_vga_get_modes(struct drm_connector *connector) |
485 | static int radeon_vga_get_modes(struct drm_connector *connector) |
206 | { |
486 | { |
Line 213... | Line 493... | ||
213 | } |
493 | } |
Line 214... | Line 494... | ||
214 | 494 | ||
215 | static int radeon_vga_mode_valid(struct drm_connector *connector, |
495 | static int radeon_vga_mode_valid(struct drm_connector *connector, |
216 | struct drm_display_mode *mode) |
496 | struct drm_display_mode *mode) |
217 | { |
- | |
218 | 497 | { |
|
219 | return MODE_OK; |
498 | return MODE_OK; |
Line 220... | Line 499... | ||
220 | } |
499 | } |
221 | 500 | ||
Line 225... | Line 504... | ||
225 | struct drm_encoder *encoder; |
504 | struct drm_encoder *encoder; |
226 | struct drm_encoder_helper_funcs *encoder_funcs; |
505 | struct drm_encoder_helper_funcs *encoder_funcs; |
227 | bool dret; |
506 | bool dret; |
228 | enum drm_connector_status ret = connector_status_disconnected; |
507 | enum drm_connector_status ret = connector_status_disconnected; |
Line -... | Line 508... | ||
- | 508 | ||
- | 509 | encoder = radeon_best_single_encoder(connector); |
|
- | 510 | if (!encoder) |
|
- | 511 | ret = connector_status_disconnected; |
|
229 | 512 | ||
230 | radeon_i2c_do_lock(radeon_connector, 1); |
513 | radeon_i2c_do_lock(radeon_connector, 1); |
231 | dret = radeon_ddc_probe(radeon_connector); |
514 | dret = radeon_ddc_probe(radeon_connector); |
232 | radeon_i2c_do_lock(radeon_connector, 0); |
515 | radeon_i2c_do_lock(radeon_connector, 0); |
233 | if (dret) |
516 | if (dret) |
234 | ret = connector_status_connected; |
517 | ret = connector_status_connected; |
235 | else { |
518 | else { |
236 | /* if EDID fails to a load detect */ |
- | |
237 | encoder = radeon_best_single_encoder(connector); |
- | |
238 | if (!encoder) |
- | |
239 | ret = connector_status_disconnected; |
- | |
240 | else { |
519 | if (radeon_connector->dac_load_detect) { |
241 | encoder_funcs = encoder->helper_private; |
520 | encoder_funcs = encoder->helper_private; |
242 | ret = encoder_funcs->detect(encoder, connector); |
521 | ret = encoder_funcs->detect(encoder, connector); |
243 | } |
522 | } |
Line -... | Line 523... | ||
- | 523 | } |
|
- | 524 | ||
244 | } |
525 | if (ret == connector_status_connected) |
245 | 526 | ret = radeon_connector_analog_encoder_conflict_solve(connector, encoder, ret, true); |
|
246 | radeon_connector_update_scratch_regs(connector, ret); |
527 | radeon_connector_update_scratch_regs(connector, ret); |
Line 247... | Line 528... | ||
247 | return ret; |
528 | return ret; |
Line 259... | Line 540... | ||
259 | .fill_modes = drm_helper_probe_single_connector_modes, |
540 | .fill_modes = drm_helper_probe_single_connector_modes, |
260 | .destroy = radeon_connector_destroy, |
541 | .destroy = radeon_connector_destroy, |
261 | .set_property = radeon_connector_set_property, |
542 | .set_property = radeon_connector_set_property, |
262 | }; |
543 | }; |
Line -... | Line 544... | ||
- | 544 | ||
- | 545 | static int radeon_tv_get_modes(struct drm_connector *connector) |
|
- | 546 | { |
|
- | 547 | struct drm_device *dev = connector->dev; |
|
- | 548 | struct radeon_device *rdev = dev->dev_private; |
|
- | 549 | struct drm_display_mode *tv_mode; |
|
- | 550 | struct drm_encoder *encoder; |
|
- | 551 | ||
- | 552 | encoder = radeon_best_single_encoder(connector); |
|
- | 553 | if (!encoder) |
|
- | 554 | return 0; |
|
- | 555 | ||
- | 556 | /* avivo chips can scale any mode */ |
|
- | 557 | if (rdev->family >= CHIP_RS600) |
|
- | 558 | /* add scaled modes */ |
|
- | 559 | radeon_add_common_modes(encoder, connector); |
|
- | 560 | else { |
|
- | 561 | /* only 800x600 is supported right now on pre-avivo chips */ |
|
- | 562 | tv_mode = drm_cvt_mode(dev, 800, 600, 60, false, false); |
|
- | 563 | tv_mode->type = DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED; |
|
- | 564 | drm_mode_probed_add(connector, tv_mode); |
|
- | 565 | } |
|
- | 566 | return 1; |
|
- | 567 | } |
|
- | 568 | ||
- | 569 | static int radeon_tv_mode_valid(struct drm_connector *connector, |
|
- | 570 | struct drm_display_mode *mode) |
|
- | 571 | { |
|
- | 572 | return MODE_OK; |
|
- | 573 | } |
|
- | 574 | ||
- | 575 | static enum drm_connector_status radeon_tv_detect(struct drm_connector *connector) |
|
- | 576 | { |
|
- | 577 | struct drm_encoder *encoder; |
|
- | 578 | struct drm_encoder_helper_funcs *encoder_funcs; |
|
- | 579 | struct radeon_connector *radeon_connector = to_radeon_connector(connector); |
|
- | 580 | enum drm_connector_status ret = connector_status_disconnected; |
|
- | 581 | ||
- | 582 | if (!radeon_connector->dac_load_detect) |
|
- | 583 | return ret; |
|
- | 584 | ||
- | 585 | encoder = radeon_best_single_encoder(connector); |
|
- | 586 | if (!encoder) |
|
- | 587 | ret = connector_status_disconnected; |
|
- | 588 | else { |
|
- | 589 | encoder_funcs = encoder->helper_private; |
|
- | 590 | ret = encoder_funcs->detect(encoder, connector); |
|
- | 591 | } |
|
- | 592 | if (ret == connector_status_connected) |
|
- | 593 | ret = radeon_connector_analog_encoder_conflict_solve(connector, encoder, ret, false); |
|
- | 594 | radeon_connector_update_scratch_regs(connector, ret); |
|
- | 595 | return ret; |
|
- | 596 | } |
|
- | 597 | ||
- | 598 | struct drm_connector_helper_funcs radeon_tv_connector_helper_funcs = { |
|
- | 599 | .get_modes = radeon_tv_get_modes, |
|
- | 600 | .mode_valid = radeon_tv_mode_valid, |
|
- | 601 | .best_encoder = radeon_best_single_encoder, |
|
- | 602 | }; |
|
- | 603 | ||
- | 604 | struct drm_connector_funcs radeon_tv_connector_funcs = { |
|
- | 605 | .dpms = drm_helper_connector_dpms, |
|
- | 606 | .detect = radeon_tv_detect, |
|
- | 607 | .fill_modes = drm_helper_probe_single_connector_modes, |
|
- | 608 | .destroy = radeon_connector_destroy, |
|
- | 609 | .set_property = radeon_connector_set_property, |
|
- | 610 | }; |
|
263 | 611 | ||
264 | static int radeon_dvi_get_modes(struct drm_connector *connector) |
612 | static int radeon_dvi_get_modes(struct drm_connector *connector) |
265 | { |
613 | { |
266 | struct radeon_connector *radeon_connector = to_radeon_connector(connector); |
614 | struct radeon_connector *radeon_connector = to_radeon_connector(connector); |
Line 267... | Line 615... | ||
267 | int ret; |
615 | int ret; |
268 | - | ||
269 | ret = radeon_ddc_get_modes(radeon_connector); |
- | |
270 | /* reset scratch regs here since radeon_dvi_detect doesn't check digital bit */ |
616 | |
271 | radeon_connector_update_scratch_regs(connector, connector_status_connected); |
617 | ret = radeon_ddc_get_modes(radeon_connector); |
Line -... | Line 618... | ||
- | 618 | return ret; |
|
- | 619 | } |
|
- | 620 | ||
- | 621 | /* |
|
- | 622 | * DVI is complicated |
|
- | 623 | * Do a DDC probe, if DDC probe passes, get the full EDID so |
|
- | 624 | * we can do analog/digital monitor detection at this point. |
|
- | 625 | * If the monitor is an analog monitor or we got no DDC, |
|
- | 626 | * we need to find the DAC encoder object for this connector. |
|
- | 627 | * If we got no DDC, we do load detection on the DAC encoder object. |
|
- | 628 | * If we got analog DDC or load detection passes on the DAC encoder |
|
272 | return ret; |
629 | * we have to check if this analog encoder is shared with anyone else (TV) |
273 | } |
630 | * if its shared we have to set the other connector to disconnected. |
274 | 631 | */ |
|
275 | static enum drm_connector_status radeon_dvi_detect(struct drm_connector *connector) |
632 | static enum drm_connector_status radeon_dvi_detect(struct drm_connector *connector) |
276 | { |
633 | { |
277 | struct radeon_connector *radeon_connector = to_radeon_connector(connector); |
634 | struct radeon_connector *radeon_connector = to_radeon_connector(connector); |
278 | struct drm_encoder *encoder; |
635 | struct drm_encoder *encoder = NULL; |
279 | struct drm_encoder_helper_funcs *encoder_funcs; |
636 | struct drm_encoder_helper_funcs *encoder_funcs; |
280 | struct drm_mode_object *obj; |
637 | struct drm_mode_object *obj; |
Line 281... | Line 638... | ||
281 | int i; |
638 | int i; |
282 | enum drm_connector_status ret = connector_status_disconnected; |
639 | enum drm_connector_status ret = connector_status_disconnected; |
283 | bool dret; |
640 | bool dret; |
284 | 641 | ||
- | 642 | radeon_i2c_do_lock(radeon_connector, 1); |
|
- | 643 | dret = radeon_ddc_probe(radeon_connector); |
|
- | 644 | radeon_i2c_do_lock(radeon_connector, 0); |
|
- | 645 | if (dret) { |
|
- | 646 | radeon_i2c_do_lock(radeon_connector, 1); |
|
- | 647 | radeon_connector->edid = drm_get_edid(&radeon_connector->base, &radeon_connector->ddc_bus->adapter); |
|
- | 648 | radeon_i2c_do_lock(radeon_connector, 0); |
|
- | 649 | ||
- | 650 | if (!radeon_connector->edid) { |
|
- | 651 | DRM_ERROR("DDC responded but not EDID found for %s\n", |
|
- | 652 | drm_get_connector_name(connector)); |
|
- | 653 | } else { |
|
- | 654 | radeon_connector->use_digital = !!(radeon_connector->edid->input & DRM_EDID_INPUT_DIGITAL); |
|
285 | radeon_i2c_do_lock(radeon_connector, 1); |
655 | |
- | 656 | /* if this isn't a digital monitor |
|
- | 657 | then we need to make sure we don't have any |
|
- | 658 | TV conflicts */ |
|
- | 659 | ret = connector_status_connected; |
|
286 | dret = radeon_ddc_probe(radeon_connector); |
660 | } |
- | 661 | } |
|
- | 662 | ||
- | 663 | if ((ret == connector_status_connected) && (radeon_connector->use_digital == true)) |
|
287 | radeon_i2c_do_lock(radeon_connector, 0); |
664 | goto out; |
288 | if (dret) |
665 | |
289 | ret = connector_status_connected; |
666 | /* find analog encoder */ |
Line 290... | Line 667... | ||
290 | else { |
667 | if (radeon_connector->dac_load_detect) { |
Line 300... | Line 677... | ||
300 | 677 | ||
Line 301... | Line 678... | ||
301 | encoder = obj_to_encoder(obj); |
678 | encoder = obj_to_encoder(obj); |
302 | 679 | ||
- | 680 | encoder_funcs = encoder->helper_private; |
|
303 | encoder_funcs = encoder->helper_private; |
681 | if (encoder_funcs->detect) { |
304 | if (encoder_funcs->detect) { |
682 | if (ret != connector_status_connected) { |
305 | ret = encoder_funcs->detect(encoder, connector); |
683 | ret = encoder_funcs->detect(encoder, connector); |
- | 684 | if (ret == connector_status_connected) { |
|
- | 685 | radeon_connector->use_digital = false; |
|
306 | if (ret == connector_status_connected) { |
686 | } |
307 | radeon_connector->use_digital = 0; |
687 | } |
308 | break; |
688 | break; |
309 | } |
689 | } |
- | 690 | } |
|
- | 691 | } |
|
- | 692 | ||
- | 693 | if ((ret == connector_status_connected) && (radeon_connector->use_digital == false) && |
|
310 | } |
694 | encoder) { |
Line -... | Line 695... | ||
- | 695 | ret = radeon_connector_analog_encoder_conflict_solve(connector, encoder, ret, true); |
|
311 | } |
696 | } |
312 | } |
697 | |
313 | 698 | out: |
|
314 | /* updated in get modes as well since we need to know if it's analog or digital */ |
699 | /* updated in get modes as well since we need to know if it's analog or digital */ |
Line 322... | Line 707... | ||
322 | int enc_id = connector->encoder_ids[0]; |
707 | int enc_id = connector->encoder_ids[0]; |
323 | struct radeon_connector *radeon_connector = to_radeon_connector(connector); |
708 | struct radeon_connector *radeon_connector = to_radeon_connector(connector); |
324 | struct drm_mode_object *obj; |
709 | struct drm_mode_object *obj; |
325 | struct drm_encoder *encoder; |
710 | struct drm_encoder *encoder; |
326 | int i; |
711 | int i; |
327 | - | ||
328 | ENTRY(); |
- | |
329 | - | ||
330 | for (i = 0; i < DRM_CONNECTOR_MAX_ENCODER; i++) { |
712 | for (i = 0; i < DRM_CONNECTOR_MAX_ENCODER; i++) { |
331 | if (connector->encoder_ids[i] == 0) |
713 | if (connector->encoder_ids[i] == 0) |
332 | break; |
714 | break; |
Line 333... | Line 715... | ||
333 | 715 | ||
334 | obj = drm_mode_object_find(connector->dev, connector->encoder_ids[i], DRM_MODE_OBJECT_ENCODER); |
716 | obj = drm_mode_object_find(connector->dev, connector->encoder_ids[i], DRM_MODE_OBJECT_ENCODER); |
335 | if (!obj) |
717 | if (!obj) |
Line 336... | Line 718... | ||
336 | continue; |
718 | continue; |
Line 337... | Line 719... | ||
337 | 719 | ||
338 | encoder = obj_to_encoder(obj); |
720 | encoder = obj_to_encoder(obj); |
339 | 721 | ||
340 | if (radeon_connector->use_digital) { |
722 | if (radeon_connector->use_digital == true) { |
341 | if (encoder->encoder_type == DRM_MODE_ENCODER_TMDS) |
723 | if (encoder->encoder_type == DRM_MODE_ENCODER_TMDS) |
342 | return encoder; |
724 | return encoder; |
Line 382... | Line 764... | ||
382 | int connector_type, |
764 | int connector_type, |
383 | struct radeon_i2c_bus_rec *i2c_bus, |
765 | struct radeon_i2c_bus_rec *i2c_bus, |
384 | bool linkb, |
766 | bool linkb, |
385 | uint32_t igp_lane_info) |
767 | uint32_t igp_lane_info) |
386 | { |
768 | { |
- | 769 | struct radeon_device *rdev = dev->dev_private; |
|
387 | struct drm_connector *connector; |
770 | struct drm_connector *connector; |
388 | struct radeon_connector *radeon_connector; |
771 | struct radeon_connector *radeon_connector; |
389 | struct radeon_connector_atom_dig *radeon_dig_connector; |
772 | struct radeon_connector_atom_dig *radeon_dig_connector; |
390 | uint32_t subpixel_order = SubPixelNone; |
773 | uint32_t subpixel_order = SubPixelNone; |
Line 391... | Line 774... | ||
391 | 774 | ||
392 | /* fixme - tv/cv/din */ |
775 | /* fixme - tv/cv/din */ |
393 | if ((connector_type == DRM_MODE_CONNECTOR_Unknown) || |
- | |
394 | (connector_type == DRM_MODE_CONNECTOR_SVIDEO) || |
- | |
395 | (connector_type == DRM_MODE_CONNECTOR_Composite) || |
- | |
396 | (connector_type == DRM_MODE_CONNECTOR_9PinDIN)) |
776 | if (connector_type == DRM_MODE_CONNECTOR_Unknown) |
Line 397... | Line 777... | ||
397 | return; |
777 | return; |
398 | 778 | ||
399 | /* see if we already added it */ |
779 | /* see if we already added it */ |
Line 420... | Line 800... | ||
420 | if (i2c_bus->valid) { |
800 | if (i2c_bus->valid) { |
421 | radeon_connector->ddc_bus = radeon_i2c_create(dev, i2c_bus, "VGA"); |
801 | radeon_connector->ddc_bus = radeon_i2c_create(dev, i2c_bus, "VGA"); |
422 | if (!radeon_connector->ddc_bus) |
802 | if (!radeon_connector->ddc_bus) |
423 | goto failed; |
803 | goto failed; |
424 | } |
804 | } |
- | 805 | drm_connector_attach_property(&radeon_connector->base, |
|
- | 806 | rdev->mode_info.load_detect_property, |
|
- | 807 | 1); |
|
425 | break; |
808 | break; |
426 | case DRM_MODE_CONNECTOR_DVIA: |
809 | case DRM_MODE_CONNECTOR_DVIA: |
427 | drm_connector_init(dev, &radeon_connector->base, &radeon_vga_connector_funcs, connector_type); |
810 | drm_connector_init(dev, &radeon_connector->base, &radeon_vga_connector_funcs, connector_type); |
428 | drm_connector_helper_add(&radeon_connector->base, &radeon_vga_connector_helper_funcs); |
811 | drm_connector_helper_add(&radeon_connector->base, &radeon_vga_connector_helper_funcs); |
429 | if (i2c_bus->valid) { |
812 | if (i2c_bus->valid) { |
430 | radeon_connector->ddc_bus = radeon_i2c_create(dev, i2c_bus, "DVI"); |
813 | radeon_connector->ddc_bus = radeon_i2c_create(dev, i2c_bus, "DVI"); |
431 | if (!radeon_connector->ddc_bus) |
814 | if (!radeon_connector->ddc_bus) |
432 | goto failed; |
815 | goto failed; |
433 | } |
816 | } |
- | 817 | drm_connector_attach_property(&radeon_connector->base, |
|
- | 818 | rdev->mode_info.load_detect_property, |
|
- | 819 | 1); |
|
434 | break; |
820 | break; |
435 | case DRM_MODE_CONNECTOR_DVII: |
821 | case DRM_MODE_CONNECTOR_DVII: |
436 | case DRM_MODE_CONNECTOR_DVID: |
822 | case DRM_MODE_CONNECTOR_DVID: |
437 | radeon_dig_connector = kzalloc(sizeof(struct radeon_connector_atom_dig), GFP_KERNEL); |
823 | radeon_dig_connector = kzalloc(sizeof(struct radeon_connector_atom_dig), GFP_KERNEL); |
438 | if (!radeon_dig_connector) |
824 | if (!radeon_dig_connector) |
Line 446... | Line 832... | ||
446 | radeon_connector->ddc_bus = radeon_i2c_create(dev, i2c_bus, "DVI"); |
832 | radeon_connector->ddc_bus = radeon_i2c_create(dev, i2c_bus, "DVI"); |
447 | if (!radeon_connector->ddc_bus) |
833 | if (!radeon_connector->ddc_bus) |
448 | goto failed; |
834 | goto failed; |
449 | } |
835 | } |
450 | subpixel_order = SubPixelHorizontalRGB; |
836 | subpixel_order = SubPixelHorizontalRGB; |
- | 837 | drm_connector_attach_property(&radeon_connector->base, |
|
- | 838 | rdev->mode_info.coherent_mode_property, |
|
- | 839 | 1); |
|
- | 840 | drm_connector_attach_property(&radeon_connector->base, |
|
- | 841 | rdev->mode_info.load_detect_property, |
|
- | 842 | 1); |
|
451 | break; |
843 | break; |
452 | case DRM_MODE_CONNECTOR_HDMIA: |
844 | case DRM_MODE_CONNECTOR_HDMIA: |
453 | case DRM_MODE_CONNECTOR_HDMIB: |
845 | case DRM_MODE_CONNECTOR_HDMIB: |
454 | radeon_dig_connector = kzalloc(sizeof(struct radeon_connector_atom_dig), GFP_KERNEL); |
846 | radeon_dig_connector = kzalloc(sizeof(struct radeon_connector_atom_dig), GFP_KERNEL); |
455 | if (!radeon_dig_connector) |
847 | if (!radeon_dig_connector) |
Line 462... | Line 854... | ||
462 | if (i2c_bus->valid) { |
854 | if (i2c_bus->valid) { |
463 | radeon_connector->ddc_bus = radeon_i2c_create(dev, i2c_bus, "HDMI"); |
855 | radeon_connector->ddc_bus = radeon_i2c_create(dev, i2c_bus, "HDMI"); |
464 | if (!radeon_connector->ddc_bus) |
856 | if (!radeon_connector->ddc_bus) |
465 | goto failed; |
857 | goto failed; |
466 | } |
858 | } |
- | 859 | drm_connector_attach_property(&radeon_connector->base, |
|
- | 860 | rdev->mode_info.coherent_mode_property, |
|
- | 861 | 1); |
|
467 | subpixel_order = SubPixelHorizontalRGB; |
862 | subpixel_order = SubPixelHorizontalRGB; |
468 | break; |
863 | break; |
469 | case DRM_MODE_CONNECTOR_DisplayPort: |
864 | case DRM_MODE_CONNECTOR_DisplayPort: |
470 | radeon_dig_connector = kzalloc(sizeof(struct radeon_connector_atom_dig), GFP_KERNEL); |
865 | radeon_dig_connector = kzalloc(sizeof(struct radeon_connector_atom_dig), GFP_KERNEL); |
471 | if (!radeon_dig_connector) |
866 | if (!radeon_dig_connector) |
Line 483... | Line 878... | ||
483 | subpixel_order = SubPixelHorizontalRGB; |
878 | subpixel_order = SubPixelHorizontalRGB; |
484 | break; |
879 | break; |
485 | case DRM_MODE_CONNECTOR_SVIDEO: |
880 | case DRM_MODE_CONNECTOR_SVIDEO: |
486 | case DRM_MODE_CONNECTOR_Composite: |
881 | case DRM_MODE_CONNECTOR_Composite: |
487 | case DRM_MODE_CONNECTOR_9PinDIN: |
882 | case DRM_MODE_CONNECTOR_9PinDIN: |
- | 883 | if (radeon_tv == 1) { |
|
- | 884 | drm_connector_init(dev, &radeon_connector->base, &radeon_tv_connector_funcs, connector_type); |
|
- | 885 | drm_connector_helper_add(&radeon_connector->base, &radeon_tv_connector_helper_funcs); |
|
- | 886 | } |
|
- | 887 | drm_connector_attach_property(&radeon_connector->base, |
|
- | 888 | rdev->mode_info.load_detect_property, |
|
- | 889 | 1); |
|
488 | break; |
890 | break; |
489 | case DRM_MODE_CONNECTOR_LVDS: |
891 | case DRM_MODE_CONNECTOR_LVDS: |
490 | radeon_dig_connector = kzalloc(sizeof(struct radeon_connector_atom_dig), GFP_KERNEL); |
892 | radeon_dig_connector = kzalloc(sizeof(struct radeon_connector_atom_dig), GFP_KERNEL); |
491 | if (!radeon_dig_connector) |
893 | if (!radeon_dig_connector) |
492 | goto failed; |
894 | goto failed; |
Line 498... | Line 900... | ||
498 | if (i2c_bus->valid) { |
900 | if (i2c_bus->valid) { |
499 | radeon_connector->ddc_bus = radeon_i2c_create(dev, i2c_bus, "LVDS"); |
901 | radeon_connector->ddc_bus = radeon_i2c_create(dev, i2c_bus, "LVDS"); |
500 | if (!radeon_connector->ddc_bus) |
902 | if (!radeon_connector->ddc_bus) |
501 | goto failed; |
903 | goto failed; |
502 | } |
904 | } |
- | 905 | drm_mode_create_scaling_mode_property(dev); |
|
- | 906 | drm_connector_attach_property(&radeon_connector->base, |
|
- | 907 | dev->mode_config.scaling_mode_property, |
|
- | 908 | DRM_MODE_SCALE_FULLSCREEN); |
|
503 | subpixel_order = SubPixelHorizontalRGB; |
909 | subpixel_order = SubPixelHorizontalRGB; |
504 | break; |
910 | break; |
505 | } |
911 | } |
Line 506... | Line 912... | ||
506 | 912 | ||
Line 520... | Line 926... | ||
520 | uint32_t connector_id, |
926 | uint32_t connector_id, |
521 | uint32_t supported_device, |
927 | uint32_t supported_device, |
522 | int connector_type, |
928 | int connector_type, |
523 | struct radeon_i2c_bus_rec *i2c_bus) |
929 | struct radeon_i2c_bus_rec *i2c_bus) |
524 | { |
930 | { |
- | 931 | struct radeon_device *rdev = dev->dev_private; |
|
525 | struct drm_connector *connector; |
932 | struct drm_connector *connector; |
526 | struct radeon_connector *radeon_connector; |
933 | struct radeon_connector *radeon_connector; |
527 | uint32_t subpixel_order = SubPixelNone; |
934 | uint32_t subpixel_order = SubPixelNone; |
Line 528... | Line 935... | ||
528 | 935 | ||
529 | /* fixme - tv/cv/din */ |
936 | /* fixme - tv/cv/din */ |
530 | if ((connector_type == DRM_MODE_CONNECTOR_Unknown) || |
- | |
531 | (connector_type == DRM_MODE_CONNECTOR_SVIDEO) || |
- | |
532 | (connector_type == DRM_MODE_CONNECTOR_Composite) || |
- | |
533 | (connector_type == DRM_MODE_CONNECTOR_9PinDIN)) |
937 | if (connector_type == DRM_MODE_CONNECTOR_Unknown) |
Line 534... | Line 938... | ||
534 | return; |
938 | return; |
535 | 939 | ||
536 | /* see if we already added it */ |
940 | /* see if we already added it */ |
Line 557... | Line 961... | ||
557 | if (i2c_bus->valid) { |
961 | if (i2c_bus->valid) { |
558 | radeon_connector->ddc_bus = radeon_i2c_create(dev, i2c_bus, "VGA"); |
962 | radeon_connector->ddc_bus = radeon_i2c_create(dev, i2c_bus, "VGA"); |
559 | if (!radeon_connector->ddc_bus) |
963 | if (!radeon_connector->ddc_bus) |
560 | goto failed; |
964 | goto failed; |
561 | } |
965 | } |
- | 966 | drm_connector_attach_property(&radeon_connector->base, |
|
- | 967 | rdev->mode_info.load_detect_property, |
|
- | 968 | 1); |
|
562 | break; |
969 | break; |
563 | case DRM_MODE_CONNECTOR_DVIA: |
970 | case DRM_MODE_CONNECTOR_DVIA: |
564 | drm_connector_init(dev, &radeon_connector->base, &radeon_vga_connector_funcs, connector_type); |
971 | drm_connector_init(dev, &radeon_connector->base, &radeon_vga_connector_funcs, connector_type); |
565 | drm_connector_helper_add(&radeon_connector->base, &radeon_vga_connector_helper_funcs); |
972 | drm_connector_helper_add(&radeon_connector->base, &radeon_vga_connector_helper_funcs); |
566 | if (i2c_bus->valid) { |
973 | if (i2c_bus->valid) { |
567 | radeon_connector->ddc_bus = radeon_i2c_create(dev, i2c_bus, "DVI"); |
974 | radeon_connector->ddc_bus = radeon_i2c_create(dev, i2c_bus, "DVI"); |
568 | if (!radeon_connector->ddc_bus) |
975 | if (!radeon_connector->ddc_bus) |
569 | goto failed; |
976 | goto failed; |
570 | } |
977 | } |
- | 978 | drm_connector_attach_property(&radeon_connector->base, |
|
- | 979 | rdev->mode_info.load_detect_property, |
|
- | 980 | 1); |
|
571 | break; |
981 | break; |
572 | case DRM_MODE_CONNECTOR_DVII: |
982 | case DRM_MODE_CONNECTOR_DVII: |
573 | case DRM_MODE_CONNECTOR_DVID: |
983 | case DRM_MODE_CONNECTOR_DVID: |
574 | drm_connector_init(dev, &radeon_connector->base, &radeon_dvi_connector_funcs, connector_type); |
984 | drm_connector_init(dev, &radeon_connector->base, &radeon_dvi_connector_funcs, connector_type); |
575 | drm_connector_helper_add(&radeon_connector->base, &radeon_dvi_connector_helper_funcs); |
985 | drm_connector_helper_add(&radeon_connector->base, &radeon_dvi_connector_helper_funcs); |
576 | if (i2c_bus->valid) { |
986 | if (i2c_bus->valid) { |
577 | radeon_connector->ddc_bus = radeon_i2c_create(dev, i2c_bus, "DVI"); |
987 | radeon_connector->ddc_bus = radeon_i2c_create(dev, i2c_bus, "DVI"); |
578 | if (!radeon_connector->ddc_bus) |
988 | if (!radeon_connector->ddc_bus) |
579 | goto failed; |
989 | goto failed; |
- | 990 | drm_connector_attach_property(&radeon_connector->base, |
|
- | 991 | rdev->mode_info.load_detect_property, |
|
- | 992 | 1); |
|
580 | } |
993 | } |
581 | subpixel_order = SubPixelHorizontalRGB; |
994 | subpixel_order = SubPixelHorizontalRGB; |
582 | break; |
995 | break; |
583 | case DRM_MODE_CONNECTOR_SVIDEO: |
996 | case DRM_MODE_CONNECTOR_SVIDEO: |
584 | case DRM_MODE_CONNECTOR_Composite: |
997 | case DRM_MODE_CONNECTOR_Composite: |
585 | case DRM_MODE_CONNECTOR_9PinDIN: |
998 | case DRM_MODE_CONNECTOR_9PinDIN: |
- | 999 | if (radeon_tv == 1) { |
|
- | 1000 | drm_connector_init(dev, &radeon_connector->base, &radeon_tv_connector_funcs, connector_type); |
|
- | 1001 | drm_connector_helper_add(&radeon_connector->base, &radeon_tv_connector_helper_funcs); |
|
- | 1002 | drm_connector_attach_property(&radeon_connector->base, |
|
- | 1003 | rdev->mode_info.load_detect_property, |
|
- | 1004 | 1); |
|
- | 1005 | } |
|
586 | break; |
1006 | break; |
587 | case DRM_MODE_CONNECTOR_LVDS: |
1007 | case DRM_MODE_CONNECTOR_LVDS: |
588 | drm_connector_init(dev, &radeon_connector->base, &radeon_lvds_connector_funcs, connector_type); |
1008 | drm_connector_init(dev, &radeon_connector->base, &radeon_lvds_connector_funcs, connector_type); |
589 | drm_connector_helper_add(&radeon_connector->base, &radeon_lvds_connector_helper_funcs); |
1009 | drm_connector_helper_add(&radeon_connector->base, &radeon_lvds_connector_helper_funcs); |
590 | if (i2c_bus->valid) { |
1010 | if (i2c_bus->valid) { |
591 | radeon_connector->ddc_bus = radeon_i2c_create(dev, i2c_bus, "LVDS"); |
1011 | radeon_connector->ddc_bus = radeon_i2c_create(dev, i2c_bus, "LVDS"); |
592 | if (!radeon_connector->ddc_bus) |
1012 | if (!radeon_connector->ddc_bus) |
593 | goto failed; |
1013 | goto failed; |
594 | } |
1014 | } |
- | 1015 | drm_connector_attach_property(&radeon_connector->base, |
|
- | 1016 | dev->mode_config.scaling_mode_property, |
|
- | 1017 | DRM_MODE_SCALE_FULLSCREEN); |
|
595 | subpixel_order = SubPixelHorizontalRGB; |
1018 | subpixel_order = SubPixelHorizontalRGB; |
596 | break; |
1019 | break; |
597 | } |
1020 | } |
Line 598... | Line 1021... | ||
598 | 1021 |