Lines Matching +full:ddc +full:- +full:i2c +full:- +full:bus

2  * Copyright 2007-8 Advanced Micro Devices, Inc.
42 struct drm_device *dev = connector->dev; in radeon_connector_hotplug()
43 struct radeon_device *rdev = dev->dev_private; in radeon_connector_hotplug()
49 if (radeon_connector->hpd.hpd == RADEON_HPD_NONE) in radeon_connector_hotplug()
52 radeon_hpd_set_polarity(rdev, radeon_connector->hpd.hpd); in radeon_connector_hotplug()
56 if (connector->dpms != DRM_MODE_DPMS_ON) in radeon_connector_hotplug()
60 if (connector->connector_type == DRM_MODE_CONNECTOR_DisplayPort) { in radeon_connector_hotplug()
62 radeon_connector->con_priv; in radeon_connector_hotplug()
65 if (dig_connector->dp_sink_type != CONNECTOR_OBJECT_ID_DISPLAYPORT) in radeon_connector_hotplug()
69 dig_connector->dp_sink_type = radeon_dp_getsinktype(radeon_connector); in radeon_connector_hotplug()
71 * passive dp->(dvi|hdmi) adaptor in radeon_connector_hotplug()
73 if (dig_connector->dp_sink_type == CONNECTOR_OBJECT_ID_DISPLAYPORT && in radeon_connector_hotplug()
74 radeon_hpd_sense(rdev, radeon_connector->hpd.hpd) && in radeon_connector_hotplug()
91 struct drm_crtc *crtc = encoder->crtc; in radeon_property_change_mode()
93 if (crtc && crtc->enabled) { in radeon_property_change_mode()
94 drm_crtc_helper_set_mode(crtc, &crtc->mode, in radeon_property_change_mode()
95 crtc->x, crtc->y, crtc->primary->fb); in radeon_property_change_mode()
101 struct drm_device *dev = connector->dev; in radeon_get_monitor_bpc()
102 struct radeon_device *rdev = dev->dev_private; in radeon_get_monitor_bpc()
108 switch (connector->connector_type) { in radeon_get_monitor_bpc()
111 if (radeon_connector->use_digital) { in radeon_get_monitor_bpc()
112 if (connector->display_info.is_hdmi) { in radeon_get_monitor_bpc()
113 if (connector->display_info.bpc) in radeon_get_monitor_bpc()
114 bpc = connector->display_info.bpc; in radeon_get_monitor_bpc()
120 if (connector->display_info.is_hdmi) { in radeon_get_monitor_bpc()
121 if (connector->display_info.bpc) in radeon_get_monitor_bpc()
122 bpc = connector->display_info.bpc; in radeon_get_monitor_bpc()
126 dig_connector = radeon_connector->con_priv; in radeon_get_monitor_bpc()
127 if ((dig_connector->dp_sink_type == CONNECTOR_OBJECT_ID_DISPLAYPORT) || in radeon_get_monitor_bpc()
128 (dig_connector->dp_sink_type == CONNECTOR_OBJECT_ID_eDP) || in radeon_get_monitor_bpc()
129 connector->display_info.is_hdmi) { in radeon_get_monitor_bpc()
130 if (connector->display_info.bpc) in radeon_get_monitor_bpc()
131 bpc = connector->display_info.bpc; in radeon_get_monitor_bpc()
136 if (connector->display_info.bpc) in radeon_get_monitor_bpc()
137 bpc = connector->display_info.bpc; in radeon_get_monitor_bpc()
140 connector->helper_private; in radeon_get_monitor_bpc()
141 struct drm_encoder *encoder = connector_funcs->best_encoder(connector); in radeon_get_monitor_bpc()
143 struct radeon_encoder_atom_dig *dig = radeon_encoder->enc_priv; in radeon_get_monitor_bpc()
145 if (dig->lcd_misc & ATOM_PANEL_MISC_V13_6BIT_PER_COLOR) in radeon_get_monitor_bpc()
147 else if (dig->lcd_misc & ATOM_PANEL_MISC_V13_8BIT_PER_COLOR) in radeon_get_monitor_bpc()
153 if (connector->display_info.is_hdmi) { in radeon_get_monitor_bpc()
157 connector->name, bpc); in radeon_get_monitor_bpc()
162 * Pre DCE-8 hw can't handle > 12 bpc, and more than 12 bpc doesn't make in radeon_get_monitor_bpc()
165 * required by the HDMI-1.3 spec. Clamp to a safe 12 bpc maximum. in radeon_get_monitor_bpc()
169 connector->name, bpc); in radeon_get_monitor_bpc()
174 if (connector->display_info.max_tmds_clock > 0) { in radeon_get_monitor_bpc()
176 mode_clock = radeon_connector->pixelclock_for_modeset; in radeon_get_monitor_bpc()
179 max_tmds_clock = connector->display_info.max_tmds_clock; in radeon_get_monitor_bpc()
182 connector->name, mode_clock, max_tmds_clock); in radeon_get_monitor_bpc()
186 if ((connector->display_info.edid_hdmi_rgb444_dc_modes & DRM_EDID_HDMI_DC_30) && in radeon_get_monitor_bpc()
193 connector->name, bpc); in radeon_get_monitor_bpc()
199 connector->name, bpc); in radeon_get_monitor_bpc()
204 connector->name); in radeon_get_monitor_bpc()
211 connector->name); in radeon_get_monitor_bpc()
216 connector->name, connector->display_info.bpc, bpc); in radeon_get_monitor_bpc()
224 struct drm_device *dev = connector->dev; in radeon_connector_update_scratch_regs()
225 struct radeon_device *rdev = dev->dev_private; in radeon_connector_update_scratch_regs()
228 const struct drm_connector_helper_funcs *connector_funcs = connector->helper_private; in radeon_connector_update_scratch_regs()
231 best_encoder = connector_funcs->best_encoder(connector); in radeon_connector_update_scratch_regs()
239 if (rdev->is_atom_bios) in radeon_connector_update_scratch_regs()
251 if (encoder->encoder_type == encoder_type) in radeon_find_encoder()
260 struct drm_device *dev = connector->dev; in radeon_connector_get_edid()
261 struct radeon_device *rdev = dev->dev_private; in radeon_connector_get_edid()
264 if (radeon_connector->edid) in radeon_connector_get_edid()
268 if (radeon_connector->router.ddc_valid) in radeon_connector_get_edid()
273 radeon_connector->ddc_bus->has_aux) { in radeon_connector_get_edid()
274 radeon_connector->edid = drm_get_edid(connector, in radeon_connector_get_edid()
275 &radeon_connector->ddc_bus->aux.ddc); in radeon_connector_get_edid()
276 } else if ((connector->connector_type == DRM_MODE_CONNECTOR_DisplayPort) || in radeon_connector_get_edid()
277 (connector->connector_type == DRM_MODE_CONNECTOR_eDP)) { in radeon_connector_get_edid()
278 struct radeon_connector_atom_dig *dig = radeon_connector->con_priv; in radeon_connector_get_edid()
280 if ((dig->dp_sink_type == CONNECTOR_OBJECT_ID_DISPLAYPORT || in radeon_connector_get_edid()
281 dig->dp_sink_type == CONNECTOR_OBJECT_ID_eDP) && in radeon_connector_get_edid()
282 radeon_connector->ddc_bus->has_aux) in radeon_connector_get_edid()
283 radeon_connector->edid = drm_get_edid(&radeon_connector->base, in radeon_connector_get_edid()
284 &radeon_connector->ddc_bus->aux.ddc); in radeon_connector_get_edid()
285 else if (radeon_connector->ddc_bus) in radeon_connector_get_edid()
286 radeon_connector->edid = drm_get_edid(&radeon_connector->base, in radeon_connector_get_edid()
287 &radeon_connector->ddc_bus->adapter); in radeon_connector_get_edid()
289 connector->connector_type == DRM_MODE_CONNECTOR_LVDS && in radeon_connector_get_edid()
290 radeon_connector->ddc_bus) { in radeon_connector_get_edid()
291 radeon_connector->edid = drm_get_edid_switcheroo(&radeon_connector->base, in radeon_connector_get_edid()
292 &radeon_connector->ddc_bus->adapter); in radeon_connector_get_edid()
293 } else if (radeon_connector->ddc_bus) { in radeon_connector_get_edid()
294 radeon_connector->edid = drm_get_edid(&radeon_connector->base, in radeon_connector_get_edid()
295 &radeon_connector->ddc_bus->adapter); in radeon_connector_get_edid()
298 if (!radeon_connector->edid) { in radeon_connector_get_edid()
299 /* don't fetch the edid from the vbios if ddc fails and runpm is in radeon_connector_get_edid()
302 if ((rdev->flags & RADEON_IS_PX) && (radeon_runtime_pm != 0)) in radeon_connector_get_edid()
305 if (rdev->is_atom_bios) { in radeon_connector_get_edid()
307 if (((connector->connector_type == DRM_MODE_CONNECTOR_LVDS) || in radeon_connector_get_edid()
308 (connector->connector_type == DRM_MODE_CONNECTOR_eDP))) in radeon_connector_get_edid()
309 radeon_connector->edid = radeon_bios_get_hardcoded_edid(rdev); in radeon_connector_get_edid()
312 radeon_connector->edid = radeon_bios_get_hardcoded_edid(rdev); in radeon_connector_get_edid()
321 kfree(radeon_connector->edid); in radeon_connector_free_edid()
322 radeon_connector->edid = NULL; in radeon_connector_free_edid()
330 if (radeon_connector->edid) { in radeon_ddc_get_modes()
331 drm_connector_update_edid_property(connector, radeon_connector->edid); in radeon_ddc_get_modes()
332 ret = drm_add_edid_modes(connector, radeon_connector->edid); in radeon_ddc_get_modes()
360 if (!list_empty(&connector->probed_modes)) { in radeon_get_native_mode()
362 list_first_entry(&connector->probed_modes, in radeon_get_native_mode()
365 radeon_encoder->native_mode = *preferred_mode; in radeon_get_native_mode()
367 radeon_encoder->native_mode.clock = 0; in radeon_get_native_mode()
373 * - search for other connectors sharing this encoder
383 struct drm_device *dev = connector->dev; in radeon_connector_analog_encoder_conflict_solve()
387 list_for_each_entry(conflict, &dev->mode_config.connector_list, head) { in radeon_connector_analog_encoder_conflict_solve()
398 if (conflict->status != connector_status_connected) in radeon_connector_analog_encoder_conflict_solve()
401 if (radeon_conflict->use_digital) in radeon_connector_analog_encoder_conflict_solve()
406 conflict->name); in radeon_connector_analog_encoder_conflict_solve()
408 connector->name); in radeon_connector_analog_encoder_conflict_solve()
409 conflict->status = connector_status_disconnected; in radeon_connector_analog_encoder_conflict_solve()
413 connector->name); in radeon_connector_analog_encoder_conflict_solve()
415 conflict->name); in radeon_connector_analog_encoder_conflict_solve()
428 struct drm_device *dev = encoder->dev; in radeon_fp_native_mode()
431 struct drm_display_mode *native_mode = &radeon_encoder->native_mode; in radeon_fp_native_mode()
433 if (native_mode->hdisplay != 0 && in radeon_fp_native_mode()
434 native_mode->vdisplay != 0 && in radeon_fp_native_mode()
435 native_mode->clock != 0) { in radeon_fp_native_mode()
439 mode->type = DRM_MODE_TYPE_PREFERRED | DRM_MODE_TYPE_DRIVER; in radeon_fp_native_mode()
442 DRM_DEBUG_KMS("Adding native panel mode %s\n", mode->name); in radeon_fp_native_mode()
443 } else if (native_mode->hdisplay != 0 && in radeon_fp_native_mode()
444 native_mode->vdisplay != 0) { in radeon_fp_native_mode()
452 mode = drm_cvt_mode(dev, native_mode->hdisplay, native_mode->vdisplay, 60, true, false, false); in radeon_fp_native_mode()
455 mode->type = DRM_MODE_TYPE_PREFERRED | DRM_MODE_TYPE_DRIVER; in radeon_fp_native_mode()
456 DRM_DEBUG_KMS("Adding cvt approximation of native panel mode %s\n", mode->name); in radeon_fp_native_mode()
463 struct drm_device *dev = encoder->dev; in radeon_add_common_modes()
466 struct drm_display_mode *native_mode = &radeon_encoder->native_mode; in radeon_add_common_modes()
492 if (radeon_encoder->devices & (ATOM_DEVICE_TV_SUPPORT)) { in radeon_add_common_modes()
497 if (radeon_encoder->devices & (ATOM_DEVICE_LCD_SUPPORT)) { in radeon_add_common_modes()
498 if (common_modes[i].w > native_mode->hdisplay || in radeon_add_common_modes()
499 common_modes[i].h > native_mode->vdisplay || in radeon_add_common_modes()
500 (common_modes[i].w == native_mode->hdisplay && in radeon_add_common_modes()
501 common_modes[i].h == native_mode->vdisplay)) in radeon_add_common_modes()
518 struct drm_device *dev = connector->dev; in radeon_connector_set_property()
519 struct radeon_device *rdev = dev->dev_private; in radeon_connector_set_property()
523 if (property == rdev->mode_info.coherent_mode_property) { in radeon_connector_set_property()
534 if (!radeon_encoder->enc_priv) in radeon_connector_set_property()
537 dig = radeon_encoder->enc_priv; in radeon_connector_set_property()
539 if (dig->coherent_mode != new_coherent_mode) { in radeon_connector_set_property()
540 dig->coherent_mode = new_coherent_mode; in radeon_connector_set_property()
541 radeon_property_change_mode(&radeon_encoder->base); in radeon_connector_set_property()
545 if (property == rdev->mode_info.audio_property) { in radeon_connector_set_property()
554 if (radeon_connector->audio != val) { in radeon_connector_set_property()
555 radeon_connector->audio = val; in radeon_connector_set_property()
556 radeon_property_change_mode(&radeon_encoder->base); in radeon_connector_set_property()
560 if (property == rdev->mode_info.dither_property) { in radeon_connector_set_property()
569 if (radeon_connector->dither != val) { in radeon_connector_set_property()
570 radeon_connector->dither = val; in radeon_connector_set_property()
571 radeon_property_change_mode(&radeon_encoder->base); in radeon_connector_set_property()
575 if (property == rdev->mode_info.underscan_property) { in radeon_connector_set_property()
583 if (radeon_encoder->underscan_type != val) { in radeon_connector_set_property()
584 radeon_encoder->underscan_type = val; in radeon_connector_set_property()
585 radeon_property_change_mode(&radeon_encoder->base); in radeon_connector_set_property()
589 if (property == rdev->mode_info.underscan_hborder_property) { in radeon_connector_set_property()
597 if (radeon_encoder->underscan_hborder != val) { in radeon_connector_set_property()
598 radeon_encoder->underscan_hborder = val; in radeon_connector_set_property()
599 radeon_property_change_mode(&radeon_encoder->base); in radeon_connector_set_property()
603 if (property == rdev->mode_info.underscan_vborder_property) { in radeon_connector_set_property()
611 if (radeon_encoder->underscan_vborder != val) { in radeon_connector_set_property()
612 radeon_encoder->underscan_vborder = val; in radeon_connector_set_property()
613 radeon_property_change_mode(&radeon_encoder->base); in radeon_connector_set_property()
617 if (property == rdev->mode_info.tv_std_property) { in radeon_connector_set_property()
627 if (!radeon_encoder->enc_priv) in radeon_connector_set_property()
631 dac_int = radeon_encoder->enc_priv; in radeon_connector_set_property()
632 dac_int->tv_std = val; in radeon_connector_set_property()
635 dac_int = radeon_encoder->enc_priv; in radeon_connector_set_property()
636 dac_int->tv_std = val; in radeon_connector_set_property()
638 radeon_property_change_mode(&radeon_encoder->base); in radeon_connector_set_property()
641 if (property == rdev->mode_info.load_detect_property) { in radeon_connector_set_property()
646 radeon_connector->dac_load_detect = false; in radeon_connector_set_property()
648 radeon_connector->dac_load_detect = true; in radeon_connector_set_property()
651 if (property == rdev->mode_info.tmds_pll_property) { in radeon_connector_set_property()
661 tmds = radeon_encoder->enc_priv; in radeon_connector_set_property()
666 if (rdev->is_atom_bios) in radeon_connector_set_property()
674 radeon_property_change_mode(&radeon_encoder->base); in radeon_connector_set_property()
677 if (property == dev->mode_config.scaling_mode_property) { in radeon_connector_set_property()
680 if (connector->encoder) in radeon_connector_set_property()
681 radeon_encoder = to_radeon_encoder(connector->encoder); in radeon_connector_set_property()
683 const struct drm_connector_helper_funcs *connector_funcs = connector->helper_private; in radeon_connector_set_property()
684 radeon_encoder = to_radeon_encoder(connector_funcs->best_encoder(connector)); in radeon_connector_set_property()
694 if (radeon_encoder->rmx_type == rmx_type) in radeon_connector_set_property()
698 (radeon_encoder->native_mode.clock == 0)) in radeon_connector_set_property()
701 radeon_encoder->rmx_type = rmx_type; in radeon_connector_set_property()
703 radeon_property_change_mode(&radeon_encoder->base); in radeon_connector_set_property()
706 if (property == rdev->mode_info.output_csc_property) { in radeon_connector_set_property()
707 if (connector->encoder) in radeon_connector_set_property()
708 radeon_encoder = to_radeon_encoder(connector->encoder); in radeon_connector_set_property()
710 const struct drm_connector_helper_funcs *connector_funcs = connector->helper_private; in radeon_connector_set_property()
711 radeon_encoder = to_radeon_encoder(connector_funcs->best_encoder(connector)); in radeon_connector_set_property()
714 if (radeon_encoder->output_csc == val) in radeon_connector_set_property()
717 radeon_encoder->output_csc = val; in radeon_connector_set_property()
719 if (connector->encoder && connector->encoder->crtc) { in radeon_connector_set_property()
720 struct drm_crtc *crtc = connector->encoder->crtc; in radeon_connector_set_property()
723 radeon_crtc->output_csc = radeon_encoder->output_csc; in radeon_connector_set_property()
729 crtc->funcs->gamma_set(crtc, NULL, NULL, NULL, 0, NULL); in radeon_connector_set_property()
740 struct drm_display_mode *native_mode = &radeon_encoder->native_mode; in radeon_fixup_lvds_native_mode()
744 list_for_each_entry_safe(mode, t, &connector->probed_modes, head) { in radeon_fixup_lvds_native_mode()
745 if (mode->type & DRM_MODE_TYPE_PREFERRED) { in radeon_fixup_lvds_native_mode()
746 if (mode->hdisplay != native_mode->hdisplay || in radeon_fixup_lvds_native_mode()
747 mode->vdisplay != native_mode->vdisplay) in radeon_fixup_lvds_native_mode()
753 if (!native_mode->clock) { in radeon_fixup_lvds_native_mode()
754 list_for_each_entry_safe(mode, t, &connector->probed_modes, head) { in radeon_fixup_lvds_native_mode()
755 if (mode->hdisplay == native_mode->hdisplay && in radeon_fixup_lvds_native_mode()
756 mode->vdisplay == native_mode->vdisplay) { in radeon_fixup_lvds_native_mode()
765 if (!native_mode->clock) { in radeon_fixup_lvds_native_mode()
767 radeon_encoder->rmx_type = RMX_OFF; in radeon_fixup_lvds_native_mode()
799 connector->display_info.width_mm = mode->width_mm; in radeon_lvds_get_modes()
800 connector->display_info.height_mm = mode->height_mm; in radeon_lvds_get_modes()
813 if ((mode->hdisplay < 320) || (mode->vdisplay < 240)) in radeon_lvds_mode_valid()
818 struct drm_display_mode *native_mode = &radeon_encoder->native_mode; in radeon_lvds_mode_valid()
823 if ((mode->hdisplay > native_mode->hdisplay) || in radeon_lvds_mode_valid()
824 (mode->vdisplay > native_mode->vdisplay)) in radeon_lvds_mode_valid()
827 /* if scaling is disabled, block non-native modes */ in radeon_lvds_mode_valid()
828 if (radeon_encoder->rmx_type == RMX_OFF) { in radeon_lvds_mode_valid()
829 if ((mode->hdisplay != native_mode->hdisplay) || in radeon_lvds_mode_valid()
830 (mode->vdisplay != native_mode->vdisplay)) in radeon_lvds_mode_valid()
841 struct drm_device *dev = connector->dev; in radeon_lvds_detect()
842 struct radeon_device *rdev = dev->dev_private; in radeon_lvds_detect()
849 r = pm_runtime_get_sync(connector->dev->dev); in radeon_lvds_detect()
851 pm_runtime_put_autosuspend(connector->dev->dev); in radeon_lvds_detect()
858 struct drm_display_mode *native_mode = &radeon_encoder->native_mode; in radeon_lvds_detect()
861 if (native_mode->hdisplay >= 320 && native_mode->vdisplay >= 240) in radeon_lvds_detect()
863 /* don't fetch the edid from the vbios if ddc fails and runpm is in radeon_lvds_detect()
866 if ((rdev->flags & RADEON_IS_PX) && (radeon_runtime_pm != 0)) in radeon_lvds_detect()
872 if (radeon_connector->edid) in radeon_lvds_detect()
879 pm_runtime_mark_last_busy(connector->dev->dev); in radeon_lvds_detect()
880 pm_runtime_put_autosuspend(connector->dev->dev); in radeon_lvds_detect()
890 if (radeon_connector->ddc_bus && radeon_connector->ddc_bus->has_aux) { in radeon_connector_unregister()
891 drm_dp_aux_unregister(&radeon_connector->ddc_bus->aux); in radeon_connector_unregister()
892 radeon_connector->ddc_bus->has_aux = false; in radeon_connector_unregister()
901 kfree(radeon_connector->con_priv); in radeon_connector_destroy()
911 struct drm_device *dev = connector->dev; in radeon_lvds_set_property()
916 if (property != dev->mode_config.scaling_mode_property) in radeon_lvds_set_property()
919 if (connector->encoder) in radeon_lvds_set_property()
920 radeon_encoder = to_radeon_encoder(connector->encoder); in radeon_lvds_set_property()
922 const struct drm_connector_helper_funcs *connector_funcs = connector->helper_private; in radeon_lvds_set_property()
923 radeon_encoder = to_radeon_encoder(connector_funcs->best_encoder(connector)); in radeon_lvds_set_property()
933 if (radeon_encoder->rmx_type == rmx_type) in radeon_lvds_set_property()
936 radeon_encoder->rmx_type = rmx_type; in radeon_lvds_set_property()
938 radeon_property_change_mode(&radeon_encoder->base); in radeon_lvds_set_property()
973 struct drm_device *dev = connector->dev; in radeon_vga_mode_valid()
974 struct radeon_device *rdev = dev->dev_private; in radeon_vga_mode_valid()
978 if ((mode->clock / 10) > rdev->clock.max_pixel_clock) in radeon_vga_mode_valid()
987 struct drm_device *dev = connector->dev; in radeon_vga_detect()
988 struct radeon_device *rdev = dev->dev_private; in radeon_vga_detect()
997 r = pm_runtime_get_sync(connector->dev->dev); in radeon_vga_detect()
999 pm_runtime_put_autosuspend(connector->dev->dev); in radeon_vga_detect()
1008 if (radeon_connector->ddc_bus) in radeon_vga_detect()
1011 radeon_connector->detected_by_load = false; in radeon_vga_detect()
1015 if (!radeon_connector->edid) { in radeon_vga_detect()
1017 connector->name); in radeon_vga_detect()
1020 radeon_connector->use_digital = in radeon_vga_detect()
1021 !!(radeon_connector->edid->input & DRM_EDID_INPUT_DIGITAL); in radeon_vga_detect()
1024 * with a shared ddc line (often vga + hdmi) in radeon_vga_detect()
1026 if (radeon_connector->use_digital && radeon_connector->shared_ddc) { in radeon_vga_detect()
1040 if (radeon_connector->detected_by_load) in radeon_vga_detect()
1041 ret = connector->status; in radeon_vga_detect()
1045 if (radeon_connector->dac_load_detect && encoder) { in radeon_vga_detect()
1046 encoder_funcs = encoder->helper_private; in radeon_vga_detect()
1047 ret = encoder_funcs->detect(encoder, connector); in radeon_vga_detect()
1049 radeon_connector->detected_by_load = true; in radeon_vga_detect()
1060 if ((!rdev->is_atom_bios) && in radeon_vga_detect()
1062 rdev->mode_info.bios_hardcoded_edid) { in radeon_vga_detect()
1070 pm_runtime_mark_last_busy(connector->dev->dev); in radeon_vga_detect()
1071 pm_runtime_put_autosuspend(connector->dev->dev); in radeon_vga_detect()
1094 struct drm_device *dev = connector->dev; in radeon_tv_get_modes()
1095 struct radeon_device *rdev = dev->dev_private; in radeon_tv_get_modes()
1104 if (rdev->family >= CHIP_RS600) in radeon_tv_get_modes()
1108 /* only 800x600 is supported right now on pre-avivo chips */ in radeon_tv_get_modes()
1112 tv_mode->type = DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED; in radeon_tv_get_modes()
1121 if ((mode->hdisplay > 1024) || (mode->vdisplay > 768)) in radeon_tv_mode_valid()
1135 if (!radeon_connector->dac_load_detect) in radeon_tv_detect()
1139 r = pm_runtime_get_sync(connector->dev->dev); in radeon_tv_detect()
1141 pm_runtime_put_autosuspend(connector->dev->dev); in radeon_tv_detect()
1150 encoder_funcs = encoder->helper_private; in radeon_tv_detect()
1151 ret = encoder_funcs->detect(encoder, connector); in radeon_tv_detect()
1158 pm_runtime_mark_last_busy(connector->dev->dev); in radeon_tv_detect()
1159 pm_runtime_put_autosuspend(connector->dev->dev); in radeon_tv_detect()
1182 struct drm_device *dev = connector->dev; in radeon_check_hpd_status_unchanged()
1183 struct radeon_device *rdev = dev->dev_private; in radeon_check_hpd_status_unchanged()
1188 if (rdev->family >= CHIP_R600 in radeon_check_hpd_status_unchanged()
1189 && radeon_connector->hpd.hpd != RADEON_HPD_NONE) { in radeon_check_hpd_status_unchanged()
1190 if (radeon_hpd_sense(rdev, radeon_connector->hpd.hpd)) in radeon_check_hpd_status_unchanged()
1194 if (connector->status == status) in radeon_check_hpd_status_unchanged()
1203 * Do a DDC probe, if DDC probe passes, get the full EDID so
1205 * If the monitor is an analog monitor or we got no DDC,
1207 * If we got no DDC, we do load detection on the DAC encoder object.
1208 * If we got analog DDC or load detection passes on the DAC encoder
1215 struct drm_device *dev = connector->dev; in radeon_dvi_detect()
1216 struct radeon_device *rdev = dev->dev_private; in radeon_dvi_detect()
1225 r = pm_runtime_get_sync(connector->dev->dev); in radeon_dvi_detect()
1227 pm_runtime_put_autosuspend(connector->dev->dev); in radeon_dvi_detect()
1232 if (radeon_connector->detected_hpd_without_ddc) { in radeon_dvi_detect()
1234 radeon_connector->detected_hpd_without_ddc = false; in radeon_dvi_detect()
1238 ret = connector->status; in radeon_dvi_detect()
1242 if (radeon_connector->ddc_bus) { in radeon_dvi_detect()
1245 /* Sometimes the pins required for the DDC probe on DVI in radeon_dvi_detect()
1247 * for HPD do. If the DDC probe fails even though we had an HPD in radeon_dvi_detect()
1250 connector->status != connector_status_connected) { in radeon_dvi_detect()
1251 DRM_DEBUG_KMS("hpd detected without ddc, retrying in 1 second\n"); in radeon_dvi_detect()
1252 radeon_connector->detected_hpd_without_ddc = true; in radeon_dvi_detect()
1253 schedule_delayed_work(&rdev->hotplug_work, in radeon_dvi_detect()
1259 if (dret && radeon_connector->hpd.hpd != RADEON_HPD_NONE && in radeon_dvi_detect()
1260 !radeon_hpd_sense(rdev, radeon_connector->hpd.hpd) && in radeon_dvi_detect()
1261 connector->connector_type == DRM_MODE_CONNECTOR_HDMIA) { in radeon_dvi_detect()
1263 schedule_delayed_work(&rdev->hotplug_work, msecs_to_jiffies(1000)); in radeon_dvi_detect()
1269 radeon_connector->detected_by_load = false; in radeon_dvi_detect()
1273 if (!radeon_connector->edid) { in radeon_dvi_detect()
1275 connector->name); in radeon_dvi_detect()
1278 if ((rdev->family == CHIP_RS690 || rdev->family == CHIP_RS740) && in radeon_dvi_detect()
1279 radeon_connector->base.null_edid_counter) { in radeon_dvi_detect()
1281 DRM_ERROR("%s: detected RS690 floating bus bug, stopping ddc detect\n", in radeon_dvi_detect()
1282 connector->name); in radeon_dvi_detect()
1283 radeon_connector->ddc_bus = NULL; in radeon_dvi_detect()
1289 radeon_connector->use_digital = in radeon_dvi_detect()
1290 !!(radeon_connector->edid->input & DRM_EDID_INPUT_DIGITAL); in radeon_dvi_detect()
1293 * with a shared ddc line (often vga + hdmi) in radeon_dvi_detect()
1295 if ((!radeon_connector->use_digital) && radeon_connector->shared_ddc) { in radeon_dvi_detect()
1302 * shared DDC line and we have boards with DVI-D + HDMI with a shared in radeon_dvi_detect()
1303 * DDC line. The latter is more complex because with DVI<->HDMI adapters in radeon_dvi_detect()
1306 if (radeon_connector->shared_ddc && (ret == connector_status_connected)) { in radeon_dvi_detect()
1309 list_for_each_entry(list_connector, &dev->mode_config.connector_list, head) { in radeon_dvi_detect()
1313 if (list_radeon_connector->shared_ddc && in radeon_dvi_detect()
1314 (list_radeon_connector->ddc_bus->rec.i2c_id == in radeon_dvi_detect()
1315 radeon_connector->ddc_bus->rec.i2c_id)) { in radeon_dvi_detect()
1317 if (list_connector->connector_type != DRM_MODE_CONNECTOR_VGA) { in radeon_dvi_detect()
1319 if (!radeon_hpd_sense(rdev, radeon_connector->hpd.hpd)) { in radeon_dvi_detect()
1330 if ((ret == connector_status_connected) && (radeon_connector->use_digital == true)) in radeon_dvi_detect()
1333 /* DVI-D and HDMI-A are digital only */ in radeon_dvi_detect()
1334 if ((connector->connector_type == DRM_MODE_CONNECTOR_DVID) || in radeon_dvi_detect()
1335 (connector->connector_type == DRM_MODE_CONNECTOR_HDMIA)) in radeon_dvi_detect()
1343 if (radeon_connector->detected_by_load) in radeon_dvi_detect()
1344 ret = connector->status; in radeon_dvi_detect()
1349 if (radeon_connector->dac_load_detect) { in radeon_dvi_detect()
1351 if (encoder->encoder_type != DRM_MODE_ENCODER_DAC && in radeon_dvi_detect()
1352 encoder->encoder_type != DRM_MODE_ENCODER_TVDAC) in radeon_dvi_detect()
1355 encoder_funcs = encoder->helper_private; in radeon_dvi_detect()
1356 if (encoder_funcs->detect) { in radeon_dvi_detect()
1359 /* deal with analog monitors without DDC */ in radeon_dvi_detect()
1360 ret = encoder_funcs->detect(encoder, connector); in radeon_dvi_detect()
1362 radeon_connector->use_digital = false; in radeon_dvi_detect()
1365 radeon_connector->detected_by_load = true; in radeon_dvi_detect()
1370 radeon_connector->use_digital = true; in radeon_dvi_detect()
1371 lret = encoder_funcs->detect(encoder, connector); in radeon_dvi_detect()
1372 DRM_DEBUG_KMS("load_detect %x returned: %x\n", encoder->encoder_type, lret); in radeon_dvi_detect()
1374 radeon_connector->use_digital = false; in radeon_dvi_detect()
1381 if ((ret == connector_status_connected) && (radeon_connector->use_digital == false) && in radeon_dvi_detect()
1393 if ((!rdev->is_atom_bios) && in radeon_dvi_detect()
1395 rdev->mode_info.bios_hardcoded_edid) { in radeon_dvi_detect()
1396 radeon_connector->use_digital = true; in radeon_dvi_detect()
1403 if ((radeon_audio != 0) && radeon_connector->use_digital) { in radeon_dvi_detect()
1405 connector->helper_private; in radeon_dvi_detect()
1407 encoder = connector_funcs->best_encoder(connector); in radeon_dvi_detect()
1408 if (encoder && (encoder->encoder_type == DRM_MODE_ENCODER_TMDS)) { in radeon_dvi_detect()
1416 pm_runtime_mark_last_busy(connector->dev->dev); in radeon_dvi_detect()
1417 pm_runtime_put_autosuspend(connector->dev->dev); in radeon_dvi_detect()
1430 if (radeon_connector->use_digital == true) { in radeon_dvi_encoder()
1431 if (encoder->encoder_type == DRM_MODE_ENCODER_TMDS) in radeon_dvi_encoder()
1434 if (encoder->encoder_type == DRM_MODE_ENCODER_DAC || in radeon_dvi_encoder()
1435 encoder->encoder_type == DRM_MODE_ENCODER_TVDAC) in radeon_dvi_encoder()
1453 if (connector->force == DRM_FORCE_ON) in radeon_dvi_force()
1454 radeon_connector->use_digital = false; in radeon_dvi_force()
1455 if (connector->force == DRM_FORCE_ON_DIGITAL) in radeon_dvi_force()
1456 radeon_connector->use_digital = true; in radeon_dvi_force()
1462 struct drm_device *dev = connector->dev; in radeon_dvi_mode_valid()
1463 struct radeon_device *rdev = dev->dev_private; in radeon_dvi_mode_valid()
1469 if (radeon_connector->use_digital && in radeon_dvi_mode_valid()
1470 (rdev->family == CHIP_RV100) && in radeon_dvi_mode_valid()
1471 (mode->clock > 135000)) in radeon_dvi_mode_valid()
1474 if (radeon_connector->use_digital && (mode->clock > 165000)) { in radeon_dvi_mode_valid()
1475 if ((radeon_connector->connector_object_id == CONNECTOR_OBJECT_ID_DUAL_LINK_DVI_I) || in radeon_dvi_mode_valid()
1476 (radeon_connector->connector_object_id == CONNECTOR_OBJECT_ID_DUAL_LINK_DVI_D) || in radeon_dvi_mode_valid()
1477 (radeon_connector->connector_object_id == CONNECTOR_OBJECT_ID_HDMI_TYPE_B)) in radeon_dvi_mode_valid()
1479 else if (ASIC_IS_DCE6(rdev) && connector->display_info.is_hdmi) { in radeon_dvi_mode_valid()
1481 if (mode->clock > 340000) in radeon_dvi_mode_valid()
1491 if ((mode->clock / 10) > rdev->clock.max_pixel_clock) in radeon_dvi_mode_valid()
1516 struct radeon_connector_atom_dig *radeon_dig_connector = radeon_connector->con_priv; in radeon_dp_get_modes()
1520 if ((connector->connector_type == DRM_MODE_CONNECTOR_eDP) || in radeon_dp_get_modes()
1521 (connector->connector_type == DRM_MODE_CONNECTOR_LVDS)) { in radeon_dp_get_modes()
1524 if (connector->connector_type == DRM_MODE_CONNECTOR_eDP) { in radeon_dp_get_modes()
1525 if (!radeon_dig_connector->edp_on) in radeon_dp_get_modes()
1530 if (!radeon_dig_connector->edp_on) in radeon_dp_get_modes()
1534 /* need to setup ddc on the bridge */ in radeon_dp_get_modes()
1562 connector->display_info.width_mm = mode->width_mm; in radeon_dp_get_modes()
1563 connector->display_info.height_mm = mode->height_mm; in radeon_dp_get_modes()
1568 /* need to setup ddc on the bridge */ in radeon_dp_get_modes()
1591 switch (radeon_encoder->encoder_id) { in radeon_connector_encoder_get_dp_bridge_encoder_id()
1594 return radeon_encoder->encoder_id; in radeon_connector_encoder_get_dp_bridge_encoder_id()
1611 if (radeon_encoder->caps & ATOM_ENCODER_CAP_RECORD_HBR2) in radeon_connector_encoder_is_hbr2()
1620 struct drm_device *dev = connector->dev; in radeon_connector_is_dp12_capable()
1621 struct radeon_device *rdev = dev->dev_private; in radeon_connector_is_dp12_capable()
1624 (rdev->clock.default_dispclk >= 53900) && in radeon_connector_is_dp12_capable()
1635 struct drm_device *dev = connector->dev; in radeon_dp_detect()
1636 struct radeon_device *rdev = dev->dev_private; in radeon_dp_detect()
1639 struct radeon_connector_atom_dig *radeon_dig_connector = radeon_connector->con_priv; in radeon_dp_detect()
1644 r = pm_runtime_get_sync(connector->dev->dev); in radeon_dp_detect()
1646 pm_runtime_put_autosuspend(connector->dev->dev); in radeon_dp_detect()
1652 ret = connector->status; in radeon_dp_detect()
1658 if ((connector->connector_type == DRM_MODE_CONNECTOR_eDP) || in radeon_dp_detect()
1659 (connector->connector_type == DRM_MODE_CONNECTOR_LVDS)) { in radeon_dp_detect()
1662 struct drm_display_mode *native_mode = &radeon_encoder->native_mode; in radeon_dp_detect()
1665 if (native_mode->hdisplay >= 320 && native_mode->vdisplay >= 240) in radeon_dp_detect()
1667 /* don't fetch the edid from the vbios if ddc fails and runpm is in radeon_dp_detect()
1670 if ((rdev->flags & RADEON_IS_PX) && (radeon_runtime_pm != 0)) in radeon_dp_detect()
1674 radeon_dig_connector->dp_sink_type = CONNECTOR_OBJECT_ID_DISPLAYPORT; in radeon_dp_detect()
1675 if (!radeon_dig_connector->edp_on) in radeon_dp_detect()
1680 if (!radeon_dig_connector->edp_on) in radeon_dp_detect()
1686 radeon_dig_connector->dp_sink_type = CONNECTOR_OBJECT_ID_DISPLAYPORT; in radeon_dp_detect()
1691 /* setup ddc on the bridge */ in radeon_dp_detect()
1694 if (radeon_ddc_probe(radeon_connector, true)) /* try DDC */ in radeon_dp_detect()
1696 else if (radeon_connector->dac_load_detect) { /* try load detection */ in radeon_dp_detect()
1697 const struct drm_encoder_helper_funcs *encoder_funcs = encoder->helper_private; in radeon_dp_detect()
1698 ret = encoder_funcs->detect(encoder, connector); in radeon_dp_detect()
1702 radeon_dig_connector->dp_sink_type = radeon_dp_getsinktype(radeon_connector); in radeon_dp_detect()
1703 if (radeon_hpd_sense(rdev, radeon_connector->hpd.hpd)) { in radeon_dp_detect()
1705 if (radeon_dig_connector->dp_sink_type == CONNECTOR_OBJECT_ID_DISPLAYPORT) in radeon_dp_detect()
1708 if (radeon_dig_connector->dp_sink_type == CONNECTOR_OBJECT_ID_DISPLAYPORT) { in radeon_dp_detect()
1712 /* try non-aux ddc (DP to DVI/HDMI/etc. adapter) */ in radeon_dp_detect()
1728 pm_runtime_mark_last_busy(connector->dev->dev); in radeon_dp_detect()
1729 pm_runtime_put_autosuspend(connector->dev->dev); in radeon_dp_detect()
1738 struct drm_device *dev = connector->dev; in radeon_dp_mode_valid()
1739 struct radeon_device *rdev = dev->dev_private; in radeon_dp_mode_valid()
1741 struct radeon_connector_atom_dig *radeon_dig_connector = radeon_connector->con_priv; in radeon_dp_mode_valid()
1745 if ((connector->connector_type == DRM_MODE_CONNECTOR_eDP) || in radeon_dp_mode_valid()
1746 (connector->connector_type == DRM_MODE_CONNECTOR_LVDS)) { in radeon_dp_mode_valid()
1749 if ((mode->hdisplay < 320) || (mode->vdisplay < 240)) in radeon_dp_mode_valid()
1754 struct drm_display_mode *native_mode = &radeon_encoder->native_mode; in radeon_dp_mode_valid()
1759 if ((mode->hdisplay > native_mode->hdisplay) || in radeon_dp_mode_valid()
1760 (mode->vdisplay > native_mode->vdisplay)) in radeon_dp_mode_valid()
1763 /* if scaling is disabled, block non-native modes */ in radeon_dp_mode_valid()
1764 if (radeon_encoder->rmx_type == RMX_OFF) { in radeon_dp_mode_valid()
1765 if ((mode->hdisplay != native_mode->hdisplay) || in radeon_dp_mode_valid()
1766 (mode->vdisplay != native_mode->vdisplay)) in radeon_dp_mode_valid()
1771 if ((radeon_dig_connector->dp_sink_type == CONNECTOR_OBJECT_ID_DISPLAYPORT) || in radeon_dp_mode_valid()
1772 (radeon_dig_connector->dp_sink_type == CONNECTOR_OBJECT_ID_eDP)) { in radeon_dp_mode_valid()
1775 if (ASIC_IS_DCE6(rdev) && connector->display_info.is_hdmi) { in radeon_dp_mode_valid()
1777 if (mode->clock > 340000) in radeon_dp_mode_valid()
1780 if (mode->clock > 165000) in radeon_dp_mode_valid()
1795 if (radeon_connector->ddc_bus->has_aux) { in radeon_connector_late_register()
1796 radeon_connector->ddc_bus->aux.dev = radeon_connector->base.kdev; in radeon_connector_late_register()
1797 r = drm_dp_aux_register(&radeon_connector->ddc_bus->aux); in radeon_connector_late_register()
1853 struct radeon_device *rdev = dev->dev_private; in radeon_add_atom_connector()
1859 struct i2c_adapter *ddc = NULL; in radeon_add_atom_connector() local
1876 list_for_each_entry(connector, &dev->mode_config.connector_list, head) { in radeon_add_atom_connector()
1878 if (radeon_connector->connector_id == connector_id) { in radeon_add_atom_connector()
1879 radeon_connector->devices |= supported_device; in radeon_add_atom_connector()
1882 if (radeon_connector->ddc_bus && i2c_bus->valid) { in radeon_add_atom_connector()
1883 if (radeon_connector->ddc_bus->rec.i2c_id == i2c_bus->i2c_id) { in radeon_add_atom_connector()
1884 radeon_connector->shared_ddc = true; in radeon_add_atom_connector()
1887 if (radeon_connector->router_bus && router->ddc_valid && in radeon_add_atom_connector()
1888 (radeon_connector->router.router_id == router->router_id)) { in radeon_add_atom_connector()
1889 radeon_connector->shared_ddc = false; in radeon_add_atom_connector()
1896 list_for_each_entry(encoder, &dev->mode_config.encoder_list, head) { in radeon_add_atom_connector()
1898 if (radeon_encoder->devices & supported_device) { in radeon_add_atom_connector()
1899 switch (radeon_encoder->encoder_id) { in radeon_add_atom_connector()
1914 connector = &radeon_connector->base; in radeon_add_atom_connector()
1916 radeon_connector->connector_id = connector_id; in radeon_add_atom_connector()
1917 radeon_connector->devices = supported_device; in radeon_add_atom_connector()
1918 radeon_connector->shared_ddc = shared_ddc; in radeon_add_atom_connector()
1919 radeon_connector->connector_object_id = connector_object_id; in radeon_add_atom_connector()
1920 radeon_connector->hpd = *hpd; in radeon_add_atom_connector()
1922 radeon_connector->router = *router; in radeon_add_atom_connector()
1923 if (router->ddc_valid || router->cd_valid) { in radeon_add_atom_connector()
1924 radeon_connector->router_bus = radeon_i2c_lookup(rdev, &router->i2c_info); in radeon_add_atom_connector()
1925 if (!radeon_connector->router_bus) in radeon_add_atom_connector()
1926 DRM_ERROR("Failed to assign router i2c bus! Check dmesg for i2c errors.\n"); in radeon_add_atom_connector()
1933 radeon_dig_connector->igp_lane_info = igp_lane_info; in radeon_add_atom_connector()
1934 radeon_connector->con_priv = radeon_dig_connector; in radeon_add_atom_connector()
1935 if (i2c_bus->valid) { in radeon_add_atom_connector()
1936 radeon_connector->ddc_bus = radeon_i2c_lookup(rdev, i2c_bus); in radeon_add_atom_connector()
1937 if (radeon_connector->ddc_bus) { in radeon_add_atom_connector()
1939 ddc = &radeon_connector->ddc_bus->adapter; in radeon_add_atom_connector()
1941 DRM_ERROR("DP: Failed to assign ddc bus! Check dmesg for i2c errors.\n"); in radeon_add_atom_connector()
1948 drm_connector_init_with_ddc(dev, &radeon_connector->base, in radeon_add_atom_connector()
1951 ddc); in radeon_add_atom_connector()
1952 drm_connector_helper_add(&radeon_connector->base, in radeon_add_atom_connector()
1954 connector->interlace_allowed = true; in radeon_add_atom_connector()
1955 connector->doublescan_allowed = true; in radeon_add_atom_connector()
1956 radeon_connector->dac_load_detect = true; in radeon_add_atom_connector()
1957 drm_object_attach_property(&radeon_connector->base.base, in radeon_add_atom_connector()
1958 rdev->mode_info.load_detect_property, in radeon_add_atom_connector()
1960 drm_object_attach_property(&radeon_connector->base.base, in radeon_add_atom_connector()
1961 dev->mode_config.scaling_mode_property, in radeon_add_atom_connector()
1964 drm_object_attach_property(&radeon_connector->base.base, in radeon_add_atom_connector()
1965 rdev->mode_info.output_csc_property, in radeon_add_atom_connector()
1973 drm_connector_init_with_ddc(dev, &radeon_connector->base, in radeon_add_atom_connector()
1976 ddc); in radeon_add_atom_connector()
1977 drm_connector_helper_add(&radeon_connector->base, in radeon_add_atom_connector()
1979 drm_object_attach_property(&radeon_connector->base.base, in radeon_add_atom_connector()
1980 rdev->mode_info.underscan_property, in radeon_add_atom_connector()
1982 drm_object_attach_property(&radeon_connector->base.base, in radeon_add_atom_connector()
1983 rdev->mode_info.underscan_hborder_property, in radeon_add_atom_connector()
1985 drm_object_attach_property(&radeon_connector->base.base, in radeon_add_atom_connector()
1986 rdev->mode_info.underscan_vborder_property, in radeon_add_atom_connector()
1989 drm_object_attach_property(&radeon_connector->base.base, in radeon_add_atom_connector()
1990 dev->mode_config.scaling_mode_property, in radeon_add_atom_connector()
1993 drm_object_attach_property(&radeon_connector->base.base, in radeon_add_atom_connector()
1994 rdev->mode_info.dither_property, in radeon_add_atom_connector()
1998 drm_object_attach_property(&radeon_connector->base.base, in radeon_add_atom_connector()
1999 rdev->mode_info.audio_property, in radeon_add_atom_connector()
2001 radeon_connector->audio = RADEON_AUDIO_AUTO; in radeon_add_atom_connector()
2004 drm_object_attach_property(&radeon_connector->base.base, in radeon_add_atom_connector()
2005 rdev->mode_info.output_csc_property, in radeon_add_atom_connector()
2009 connector->interlace_allowed = true; in radeon_add_atom_connector()
2011 connector->doublescan_allowed = true; in radeon_add_atom_connector()
2013 connector->doublescan_allowed = false; in radeon_add_atom_connector()
2015 radeon_connector->dac_load_detect = true; in radeon_add_atom_connector()
2016 drm_object_attach_property(&radeon_connector->base.base, in radeon_add_atom_connector()
2017 rdev->mode_info.load_detect_property, in radeon_add_atom_connector()
2023 drm_connector_init_with_ddc(dev, &radeon_connector->base, in radeon_add_atom_connector()
2026 ddc); in radeon_add_atom_connector()
2027 drm_connector_helper_add(&radeon_connector->base, in radeon_add_atom_connector()
2029 drm_object_attach_property(&radeon_connector->base.base, in radeon_add_atom_connector()
2030 dev->mode_config.scaling_mode_property, in radeon_add_atom_connector()
2033 connector->interlace_allowed = false; in radeon_add_atom_connector()
2034 connector->doublescan_allowed = false; in radeon_add_atom_connector()
2040 if (i2c_bus->valid) { in radeon_add_atom_connector()
2041 radeon_connector->ddc_bus = radeon_i2c_lookup(rdev, i2c_bus); in radeon_add_atom_connector()
2042 if (!radeon_connector->ddc_bus) in radeon_add_atom_connector()
2043 DRM_ERROR("VGA: Failed to assign ddc bus! Check dmesg for i2c errors.\n"); in radeon_add_atom_connector()
2045 ddc = &radeon_connector->ddc_bus->adapter; in radeon_add_atom_connector()
2047 drm_connector_init_with_ddc(dev, &radeon_connector->base, in radeon_add_atom_connector()
2050 ddc); in radeon_add_atom_connector()
2051 drm_connector_helper_add(&radeon_connector->base, &radeon_vga_connector_helper_funcs); in radeon_add_atom_connector()
2052 radeon_connector->dac_load_detect = true; in radeon_add_atom_connector()
2053 drm_object_attach_property(&radeon_connector->base.base, in radeon_add_atom_connector()
2054 rdev->mode_info.load_detect_property, in radeon_add_atom_connector()
2057 drm_object_attach_property(&radeon_connector->base.base, in radeon_add_atom_connector()
2058 dev->mode_config.scaling_mode_property, in radeon_add_atom_connector()
2061 drm_object_attach_property(&radeon_connector->base.base, in radeon_add_atom_connector()
2062 rdev->mode_info.output_csc_property, in radeon_add_atom_connector()
2065 radeon_connector->hpd.hpd = RADEON_HPD_NONE; in radeon_add_atom_connector()
2066 connector->interlace_allowed = true; in radeon_add_atom_connector()
2067 connector->doublescan_allowed = true; in radeon_add_atom_connector()
2070 if (i2c_bus->valid) { in radeon_add_atom_connector()
2071 radeon_connector->ddc_bus = radeon_i2c_lookup(rdev, i2c_bus); in radeon_add_atom_connector()
2072 if (!radeon_connector->ddc_bus) in radeon_add_atom_connector()
2073 DRM_ERROR("DVIA: Failed to assign ddc bus! Check dmesg for i2c errors.\n"); in radeon_add_atom_connector()
2075 ddc = &radeon_connector->ddc_bus->adapter; in radeon_add_atom_connector()
2077 drm_connector_init_with_ddc(dev, &radeon_connector->base, in radeon_add_atom_connector()
2080 ddc); in radeon_add_atom_connector()
2081 drm_connector_helper_add(&radeon_connector->base, &radeon_vga_connector_helper_funcs); in radeon_add_atom_connector()
2082 radeon_connector->dac_load_detect = true; in radeon_add_atom_connector()
2083 drm_object_attach_property(&radeon_connector->base.base, in radeon_add_atom_connector()
2084 rdev->mode_info.load_detect_property, in radeon_add_atom_connector()
2087 drm_object_attach_property(&radeon_connector->base.base, in radeon_add_atom_connector()
2088 dev->mode_config.scaling_mode_property, in radeon_add_atom_connector()
2091 drm_object_attach_property(&radeon_connector->base.base, in radeon_add_atom_connector()
2092 rdev->mode_info.output_csc_property, in radeon_add_atom_connector()
2095 radeon_connector->hpd.hpd = RADEON_HPD_NONE; in radeon_add_atom_connector()
2096 connector->interlace_allowed = true; in radeon_add_atom_connector()
2097 connector->doublescan_allowed = true; in radeon_add_atom_connector()
2104 radeon_dig_connector->igp_lane_info = igp_lane_info; in radeon_add_atom_connector()
2105 radeon_connector->con_priv = radeon_dig_connector; in radeon_add_atom_connector()
2106 if (i2c_bus->valid) { in radeon_add_atom_connector()
2107 radeon_connector->ddc_bus = radeon_i2c_lookup(rdev, i2c_bus); in radeon_add_atom_connector()
2108 if (!radeon_connector->ddc_bus) in radeon_add_atom_connector()
2109 DRM_ERROR("DVI: Failed to assign ddc bus! Check dmesg for i2c errors.\n"); in radeon_add_atom_connector()
2111 ddc = &radeon_connector->ddc_bus->adapter; in radeon_add_atom_connector()
2113 drm_connector_init_with_ddc(dev, &radeon_connector->base, in radeon_add_atom_connector()
2116 ddc); in radeon_add_atom_connector()
2117 drm_connector_helper_add(&radeon_connector->base, &radeon_dvi_connector_helper_funcs); in radeon_add_atom_connector()
2119 drm_object_attach_property(&radeon_connector->base.base, in radeon_add_atom_connector()
2120 rdev->mode_info.coherent_mode_property, in radeon_add_atom_connector()
2123 drm_object_attach_property(&radeon_connector->base.base, in radeon_add_atom_connector()
2124 rdev->mode_info.underscan_property, in radeon_add_atom_connector()
2126 drm_object_attach_property(&radeon_connector->base.base, in radeon_add_atom_connector()
2127 rdev->mode_info.underscan_hborder_property, in radeon_add_atom_connector()
2129 drm_object_attach_property(&radeon_connector->base.base, in radeon_add_atom_connector()
2130 rdev->mode_info.underscan_vborder_property, in radeon_add_atom_connector()
2132 drm_object_attach_property(&radeon_connector->base.base, in radeon_add_atom_connector()
2133 rdev->mode_info.dither_property, in radeon_add_atom_connector()
2135 drm_object_attach_property(&radeon_connector->base.base, in radeon_add_atom_connector()
2136 dev->mode_config.scaling_mode_property, in radeon_add_atom_connector()
2140 drm_object_attach_property(&radeon_connector->base.base, in radeon_add_atom_connector()
2141 rdev->mode_info.audio_property, in radeon_add_atom_connector()
2143 radeon_connector->audio = RADEON_AUDIO_AUTO; in radeon_add_atom_connector()
2146 radeon_connector->dac_load_detect = true; in radeon_add_atom_connector()
2147 drm_object_attach_property(&radeon_connector->base.base, in radeon_add_atom_connector()
2148 rdev->mode_info.load_detect_property, in radeon_add_atom_connector()
2152 drm_object_attach_property(&radeon_connector->base.base, in radeon_add_atom_connector()
2153 rdev->mode_info.output_csc_property, in radeon_add_atom_connector()
2155 connector->interlace_allowed = true; in radeon_add_atom_connector()
2157 connector->doublescan_allowed = true; in radeon_add_atom_connector()
2159 connector->doublescan_allowed = false; in radeon_add_atom_connector()
2166 radeon_dig_connector->igp_lane_info = igp_lane_info; in radeon_add_atom_connector()
2167 radeon_connector->con_priv = radeon_dig_connector; in radeon_add_atom_connector()
2168 if (i2c_bus->valid) { in radeon_add_atom_connector()
2169 radeon_connector->ddc_bus = radeon_i2c_lookup(rdev, i2c_bus); in radeon_add_atom_connector()
2170 if (!radeon_connector->ddc_bus) in radeon_add_atom_connector()
2171 DRM_ERROR("HDMI: Failed to assign ddc bus! Check dmesg for i2c errors.\n"); in radeon_add_atom_connector()
2173 ddc = &radeon_connector->ddc_bus->adapter; in radeon_add_atom_connector()
2175 drm_connector_init_with_ddc(dev, &radeon_connector->base, in radeon_add_atom_connector()
2178 ddc); in radeon_add_atom_connector()
2179 drm_connector_helper_add(&radeon_connector->base, &radeon_dvi_connector_helper_funcs); in radeon_add_atom_connector()
2180 drm_object_attach_property(&radeon_connector->base.base, in radeon_add_atom_connector()
2181 rdev->mode_info.coherent_mode_property, in radeon_add_atom_connector()
2184 drm_object_attach_property(&radeon_connector->base.base, in radeon_add_atom_connector()
2185 rdev->mode_info.underscan_property, in radeon_add_atom_connector()
2187 drm_object_attach_property(&radeon_connector->base.base, in radeon_add_atom_connector()
2188 rdev->mode_info.underscan_hborder_property, in radeon_add_atom_connector()
2190 drm_object_attach_property(&radeon_connector->base.base, in radeon_add_atom_connector()
2191 rdev->mode_info.underscan_vborder_property, in radeon_add_atom_connector()
2193 drm_object_attach_property(&radeon_connector->base.base, in radeon_add_atom_connector()
2194 rdev->mode_info.dither_property, in radeon_add_atom_connector()
2196 drm_object_attach_property(&radeon_connector->base.base, in radeon_add_atom_connector()
2197 dev->mode_config.scaling_mode_property, in radeon_add_atom_connector()
2201 drm_object_attach_property(&radeon_connector->base.base, in radeon_add_atom_connector()
2202 rdev->mode_info.audio_property, in radeon_add_atom_connector()
2204 radeon_connector->audio = RADEON_AUDIO_AUTO; in radeon_add_atom_connector()
2207 drm_object_attach_property(&radeon_connector->base.base, in radeon_add_atom_connector()
2208 rdev->mode_info.output_csc_property, in radeon_add_atom_connector()
2211 connector->interlace_allowed = true; in radeon_add_atom_connector()
2213 connector->doublescan_allowed = true; in radeon_add_atom_connector()
2215 connector->doublescan_allowed = false; in radeon_add_atom_connector()
2221 radeon_dig_connector->igp_lane_info = igp_lane_info; in radeon_add_atom_connector()
2222 radeon_connector->con_priv = radeon_dig_connector; in radeon_add_atom_connector()
2223 if (i2c_bus->valid) { in radeon_add_atom_connector()
2224 radeon_connector->ddc_bus = radeon_i2c_lookup(rdev, i2c_bus); in radeon_add_atom_connector()
2225 if (radeon_connector->ddc_bus) { in radeon_add_atom_connector()
2227 ddc = &radeon_connector->ddc_bus->adapter; in radeon_add_atom_connector()
2229 DRM_ERROR("DP: Failed to assign ddc bus! Check dmesg for i2c errors.\n"); in radeon_add_atom_connector()
2232 drm_connector_init_with_ddc(dev, &radeon_connector->base, in radeon_add_atom_connector()
2235 ddc); in radeon_add_atom_connector()
2236 drm_connector_helper_add(&radeon_connector->base, &radeon_dp_connector_helper_funcs); in radeon_add_atom_connector()
2238 drm_object_attach_property(&radeon_connector->base.base, in radeon_add_atom_connector()
2239 rdev->mode_info.coherent_mode_property, in radeon_add_atom_connector()
2242 drm_object_attach_property(&radeon_connector->base.base, in radeon_add_atom_connector()
2243 rdev->mode_info.underscan_property, in radeon_add_atom_connector()
2245 drm_object_attach_property(&radeon_connector->base.base, in radeon_add_atom_connector()
2246 rdev->mode_info.underscan_hborder_property, in radeon_add_atom_connector()
2248 drm_object_attach_property(&radeon_connector->base.base, in radeon_add_atom_connector()
2249 rdev->mode_info.underscan_vborder_property, in radeon_add_atom_connector()
2251 drm_object_attach_property(&radeon_connector->base.base, in radeon_add_atom_connector()
2252 rdev->mode_info.dither_property, in radeon_add_atom_connector()
2254 drm_object_attach_property(&radeon_connector->base.base, in radeon_add_atom_connector()
2255 dev->mode_config.scaling_mode_property, in radeon_add_atom_connector()
2259 drm_object_attach_property(&radeon_connector->base.base, in radeon_add_atom_connector()
2260 rdev->mode_info.audio_property, in radeon_add_atom_connector()
2262 radeon_connector->audio = RADEON_AUDIO_AUTO; in radeon_add_atom_connector()
2265 drm_object_attach_property(&radeon_connector->base.base, in radeon_add_atom_connector()
2266 rdev->mode_info.output_csc_property, in radeon_add_atom_connector()
2268 connector->interlace_allowed = true; in radeon_add_atom_connector()
2270 connector->doublescan_allowed = false; in radeon_add_atom_connector()
2276 radeon_dig_connector->igp_lane_info = igp_lane_info; in radeon_add_atom_connector()
2277 radeon_connector->con_priv = radeon_dig_connector; in radeon_add_atom_connector()
2278 if (i2c_bus->valid) { in radeon_add_atom_connector()
2279 radeon_connector->ddc_bus = radeon_i2c_lookup(rdev, i2c_bus); in radeon_add_atom_connector()
2280 if (radeon_connector->ddc_bus) { in radeon_add_atom_connector()
2282 ddc = &radeon_connector->ddc_bus->adapter; in radeon_add_atom_connector()
2284 DRM_ERROR("DP: Failed to assign ddc bus! Check dmesg for i2c errors.\n"); in radeon_add_atom_connector()
2287 drm_connector_init_with_ddc(dev, &radeon_connector->base, in radeon_add_atom_connector()
2290 ddc); in radeon_add_atom_connector()
2291 drm_connector_helper_add(&radeon_connector->base, &radeon_dp_connector_helper_funcs); in radeon_add_atom_connector()
2292 drm_object_attach_property(&radeon_connector->base.base, in radeon_add_atom_connector()
2293 dev->mode_config.scaling_mode_property, in radeon_add_atom_connector()
2296 connector->interlace_allowed = false; in radeon_add_atom_connector()
2297 connector->doublescan_allowed = false; in radeon_add_atom_connector()
2302 drm_connector_init_with_ddc(dev, &radeon_connector->base, in radeon_add_atom_connector()
2305 ddc); in radeon_add_atom_connector()
2306 drm_connector_helper_add(&radeon_connector->base, &radeon_tv_connector_helper_funcs); in radeon_add_atom_connector()
2307 radeon_connector->dac_load_detect = true; in radeon_add_atom_connector()
2308 drm_object_attach_property(&radeon_connector->base.base, in radeon_add_atom_connector()
2309 rdev->mode_info.load_detect_property, in radeon_add_atom_connector()
2311 drm_object_attach_property(&radeon_connector->base.base, in radeon_add_atom_connector()
2312 rdev->mode_info.tv_std_property, in radeon_add_atom_connector()
2315 radeon_connector->hpd.hpd = RADEON_HPD_NONE; in radeon_add_atom_connector()
2316 connector->interlace_allowed = false; in radeon_add_atom_connector()
2317 connector->doublescan_allowed = false; in radeon_add_atom_connector()
2323 radeon_dig_connector->igp_lane_info = igp_lane_info; in radeon_add_atom_connector()
2324 radeon_connector->con_priv = radeon_dig_connector; in radeon_add_atom_connector()
2325 if (i2c_bus->valid) { in radeon_add_atom_connector()
2326 radeon_connector->ddc_bus = radeon_i2c_lookup(rdev, i2c_bus); in radeon_add_atom_connector()
2327 if (!radeon_connector->ddc_bus) in radeon_add_atom_connector()
2328 DRM_ERROR("LVDS: Failed to assign ddc bus! Check dmesg for i2c errors.\n"); in radeon_add_atom_connector()
2330 ddc = &radeon_connector->ddc_bus->adapter; in radeon_add_atom_connector()
2332 drm_connector_init_with_ddc(dev, &radeon_connector->base, in radeon_add_atom_connector()
2335 ddc); in radeon_add_atom_connector()
2336 drm_connector_helper_add(&radeon_connector->base, &radeon_lvds_connector_helper_funcs); in radeon_add_atom_connector()
2337 drm_object_attach_property(&radeon_connector->base.base, in radeon_add_atom_connector()
2338 dev->mode_config.scaling_mode_property, in radeon_add_atom_connector()
2341 connector->interlace_allowed = false; in radeon_add_atom_connector()
2342 connector->doublescan_allowed = false; in radeon_add_atom_connector()
2347 if (radeon_connector->hpd.hpd == RADEON_HPD_NONE) { in radeon_add_atom_connector()
2348 if (i2c_bus->valid) { in radeon_add_atom_connector()
2349 connector->polled = DRM_CONNECTOR_POLL_CONNECT | in radeon_add_atom_connector()
2353 connector->polled = DRM_CONNECTOR_POLL_HPD; in radeon_add_atom_connector()
2355 connector->display_info.subpixel_order = subpixel_order; in radeon_add_atom_connector()
2377 struct radeon_device *rdev = dev->dev_private; in radeon_add_legacy_connector()
2380 struct i2c_adapter *ddc = NULL; in radeon_add_legacy_connector() local
2394 list_for_each_entry(connector, &dev->mode_config.connector_list, head) { in radeon_add_legacy_connector()
2396 if (radeon_connector->connector_id == connector_id) { in radeon_add_legacy_connector()
2397 radeon_connector->devices |= supported_device; in radeon_add_legacy_connector()
2406 connector = &radeon_connector->base; in radeon_add_legacy_connector()
2408 radeon_connector->connector_id = connector_id; in radeon_add_legacy_connector()
2409 radeon_connector->devices = supported_device; in radeon_add_legacy_connector()
2410 radeon_connector->connector_object_id = connector_object_id; in radeon_add_legacy_connector()
2411 radeon_connector->hpd = *hpd; in radeon_add_legacy_connector()
2415 if (i2c_bus->valid) { in radeon_add_legacy_connector()
2416 radeon_connector->ddc_bus = radeon_i2c_lookup(rdev, i2c_bus); in radeon_add_legacy_connector()
2417 if (!radeon_connector->ddc_bus) in radeon_add_legacy_connector()
2418 DRM_ERROR("VGA: Failed to assign ddc bus! Check dmesg for i2c errors.\n"); in radeon_add_legacy_connector()
2420 ddc = &radeon_connector->ddc_bus->adapter; in radeon_add_legacy_connector()
2422 drm_connector_init_with_ddc(dev, &radeon_connector->base, in radeon_add_legacy_connector()
2425 ddc); in radeon_add_legacy_connector()
2426 drm_connector_helper_add(&radeon_connector->base, &radeon_vga_connector_helper_funcs); in radeon_add_legacy_connector()
2427 radeon_connector->dac_load_detect = true; in radeon_add_legacy_connector()
2428 drm_object_attach_property(&radeon_connector->base.base, in radeon_add_legacy_connector()
2429 rdev->mode_info.load_detect_property, in radeon_add_legacy_connector()
2432 radeon_connector->hpd.hpd = RADEON_HPD_NONE; in radeon_add_legacy_connector()
2433 connector->interlace_allowed = true; in radeon_add_legacy_connector()
2434 connector->doublescan_allowed = true; in radeon_add_legacy_connector()
2437 if (i2c_bus->valid) { in radeon_add_legacy_connector()
2438 radeon_connector->ddc_bus = radeon_i2c_lookup(rdev, i2c_bus); in radeon_add_legacy_connector()
2439 if (!radeon_connector->ddc_bus) in radeon_add_legacy_connector()
2440 DRM_ERROR("DVIA: Failed to assign ddc bus! Check dmesg for i2c errors.\n"); in radeon_add_legacy_connector()
2442 ddc = &radeon_connector->ddc_bus->adapter; in radeon_add_legacy_connector()
2444 drm_connector_init_with_ddc(dev, &radeon_connector->base, in radeon_add_legacy_connector()
2447 ddc); in radeon_add_legacy_connector()
2448 drm_connector_helper_add(&radeon_connector->base, &radeon_vga_connector_helper_funcs); in radeon_add_legacy_connector()
2449 radeon_connector->dac_load_detect = true; in radeon_add_legacy_connector()
2450 drm_object_attach_property(&radeon_connector->base.base, in radeon_add_legacy_connector()
2451 rdev->mode_info.load_detect_property, in radeon_add_legacy_connector()
2454 radeon_connector->hpd.hpd = RADEON_HPD_NONE; in radeon_add_legacy_connector()
2455 connector->interlace_allowed = true; in radeon_add_legacy_connector()
2456 connector->doublescan_allowed = true; in radeon_add_legacy_connector()
2460 if (i2c_bus->valid) { in radeon_add_legacy_connector()
2461 radeon_connector->ddc_bus = radeon_i2c_lookup(rdev, i2c_bus); in radeon_add_legacy_connector()
2462 if (!radeon_connector->ddc_bus) in radeon_add_legacy_connector()
2463 DRM_ERROR("DVI: Failed to assign ddc bus! Check dmesg for i2c errors.\n"); in radeon_add_legacy_connector()
2465 ddc = &radeon_connector->ddc_bus->adapter; in radeon_add_legacy_connector()
2467 drm_connector_init_with_ddc(dev, &radeon_connector->base, in radeon_add_legacy_connector()
2470 ddc); in radeon_add_legacy_connector()
2471 drm_connector_helper_add(&radeon_connector->base, &radeon_dvi_connector_helper_funcs); in radeon_add_legacy_connector()
2473 radeon_connector->dac_load_detect = true; in radeon_add_legacy_connector()
2474 drm_object_attach_property(&radeon_connector->base.base, in radeon_add_legacy_connector()
2475 rdev->mode_info.load_detect_property, in radeon_add_legacy_connector()
2479 connector->interlace_allowed = true; in radeon_add_legacy_connector()
2481 connector->doublescan_allowed = true; in radeon_add_legacy_connector()
2483 connector->doublescan_allowed = false; in radeon_add_legacy_connector()
2488 drm_connector_init_with_ddc(dev, &radeon_connector->base, in radeon_add_legacy_connector()
2491 ddc); in radeon_add_legacy_connector()
2492 drm_connector_helper_add(&radeon_connector->base, &radeon_tv_connector_helper_funcs); in radeon_add_legacy_connector()
2493 radeon_connector->dac_load_detect = true; in radeon_add_legacy_connector()
2499 if (rdev->family == CHIP_RS400 || rdev->family == CHIP_RS480) in radeon_add_legacy_connector()
2500 radeon_connector->dac_load_detect = false; in radeon_add_legacy_connector()
2501 drm_object_attach_property(&radeon_connector->base.base, in radeon_add_legacy_connector()
2502 rdev->mode_info.load_detect_property, in radeon_add_legacy_connector()
2503 radeon_connector->dac_load_detect); in radeon_add_legacy_connector()
2504 drm_object_attach_property(&radeon_connector->base.base, in radeon_add_legacy_connector()
2505 rdev->mode_info.tv_std_property, in radeon_add_legacy_connector()
2508 radeon_connector->hpd.hpd = RADEON_HPD_NONE; in radeon_add_legacy_connector()
2509 connector->interlace_allowed = false; in radeon_add_legacy_connector()
2510 connector->doublescan_allowed = false; in radeon_add_legacy_connector()
2513 if (i2c_bus->valid) { in radeon_add_legacy_connector()
2514 radeon_connector->ddc_bus = radeon_i2c_lookup(rdev, i2c_bus); in radeon_add_legacy_connector()
2515 if (!radeon_connector->ddc_bus) in radeon_add_legacy_connector()
2516 DRM_ERROR("LVDS: Failed to assign ddc bus! Check dmesg for i2c errors.\n"); in radeon_add_legacy_connector()
2518 ddc = &radeon_connector->ddc_bus->adapter; in radeon_add_legacy_connector()
2520 drm_connector_init_with_ddc(dev, &radeon_connector->base, in radeon_add_legacy_connector()
2523 ddc); in radeon_add_legacy_connector()
2524 drm_connector_helper_add(&radeon_connector->base, &radeon_lvds_connector_helper_funcs); in radeon_add_legacy_connector()
2525 drm_object_attach_property(&radeon_connector->base.base, in radeon_add_legacy_connector()
2526 dev->mode_config.scaling_mode_property, in radeon_add_legacy_connector()
2529 connector->interlace_allowed = false; in radeon_add_legacy_connector()
2530 connector->doublescan_allowed = false; in radeon_add_legacy_connector()
2534 if (radeon_connector->hpd.hpd == RADEON_HPD_NONE) { in radeon_add_legacy_connector()
2535 if (i2c_bus->valid) { in radeon_add_legacy_connector()
2536 connector->polled = DRM_CONNECTOR_POLL_CONNECT | in radeon_add_legacy_connector()
2540 connector->polled = DRM_CONNECTOR_POLL_HPD; in radeon_add_legacy_connector()
2542 connector->display_info.subpixel_order = subpixel_order; in radeon_add_legacy_connector()