Lines Matching +full:e +full:- +full:ddc

2  * Copyright 2007-8 Advanced Micro Devices, Inc.
45 struct drm_device *dev = connector->dev; in amdgpu_connector_hotplug()
49 /* bail if the connector does not have hpd pin, e.g., in amdgpu_connector_hotplug()
52 if (amdgpu_connector->hpd.hpd == AMDGPU_HPD_NONE) in amdgpu_connector_hotplug()
55 amdgpu_display_hpd_set_polarity(adev, amdgpu_connector->hpd.hpd); in amdgpu_connector_hotplug()
58 if (connector->dpms != DRM_MODE_DPMS_ON) in amdgpu_connector_hotplug()
62 if (connector->connector_type == DRM_MODE_CONNECTOR_DisplayPort) { in amdgpu_connector_hotplug()
64 amdgpu_connector->con_priv; in amdgpu_connector_hotplug()
67 if (dig_connector->dp_sink_type != CONNECTOR_OBJECT_ID_DISPLAYPORT) in amdgpu_connector_hotplug()
71 dig_connector->dp_sink_type = amdgpu_atombios_dp_get_sinktype(amdgpu_connector); in amdgpu_connector_hotplug()
72 /* don't do anything if sink is not display port, i.e., in amdgpu_connector_hotplug()
73 * passive dp->(dvi|hdmi) adaptor in amdgpu_connector_hotplug()
75 if (dig_connector->dp_sink_type == CONNECTOR_OBJECT_ID_DISPLAYPORT && in amdgpu_connector_hotplug()
76 amdgpu_display_hpd_sense(adev, amdgpu_connector->hpd.hpd) && in amdgpu_connector_hotplug()
93 struct drm_crtc *crtc = encoder->crtc; in amdgpu_connector_property_change_mode()
95 if (crtc && crtc->enabled) { in amdgpu_connector_property_change_mode()
96 drm_crtc_helper_set_mode(crtc, &crtc->mode, in amdgpu_connector_property_change_mode()
97 crtc->x, crtc->y, crtc->primary->fb); in amdgpu_connector_property_change_mode()
108 switch (connector->connector_type) { in amdgpu_connector_get_monitor_bpc()
111 if (amdgpu_connector->use_digital) { in amdgpu_connector_get_monitor_bpc()
112 if (connector->display_info.is_hdmi) { in amdgpu_connector_get_monitor_bpc()
113 if (connector->display_info.bpc) in amdgpu_connector_get_monitor_bpc()
114 bpc = connector->display_info.bpc; in amdgpu_connector_get_monitor_bpc()
120 if (connector->display_info.is_hdmi) { in amdgpu_connector_get_monitor_bpc()
121 if (connector->display_info.bpc) in amdgpu_connector_get_monitor_bpc()
122 bpc = connector->display_info.bpc; in amdgpu_connector_get_monitor_bpc()
126 dig_connector = amdgpu_connector->con_priv; in amdgpu_connector_get_monitor_bpc()
127 if ((dig_connector->dp_sink_type == CONNECTOR_OBJECT_ID_DISPLAYPORT) || in amdgpu_connector_get_monitor_bpc()
128 (dig_connector->dp_sink_type == CONNECTOR_OBJECT_ID_eDP) || in amdgpu_connector_get_monitor_bpc()
129 connector->display_info.is_hdmi) { in amdgpu_connector_get_monitor_bpc()
130 if (connector->display_info.bpc) in amdgpu_connector_get_monitor_bpc()
131 bpc = connector->display_info.bpc; in amdgpu_connector_get_monitor_bpc()
136 if (connector->display_info.bpc) in amdgpu_connector_get_monitor_bpc()
137 bpc = connector->display_info.bpc; in amdgpu_connector_get_monitor_bpc()
140 connector->helper_private; in amdgpu_connector_get_monitor_bpc()
141 struct drm_encoder *encoder = connector_funcs->best_encoder(connector); in amdgpu_connector_get_monitor_bpc()
143 struct amdgpu_encoder_atom_dig *dig = amdgpu_encoder->enc_priv; in amdgpu_connector_get_monitor_bpc()
145 if (dig->lcd_misc & ATOM_PANEL_MISC_V13_6BIT_PER_COLOR) in amdgpu_connector_get_monitor_bpc()
147 else if (dig->lcd_misc & ATOM_PANEL_MISC_V13_8BIT_PER_COLOR) in amdgpu_connector_get_monitor_bpc()
153 if (connector->display_info.is_hdmi) { in amdgpu_connector_get_monitor_bpc()
155 * Pre DCE-8 hw can't handle > 12 bpc, and more than 12 bpc doesn't make in amdgpu_connector_get_monitor_bpc()
158 * required by the HDMI-1.3 spec. Clamp to a safe 12 bpc maximum. in amdgpu_connector_get_monitor_bpc()
162 connector->name, bpc); in amdgpu_connector_get_monitor_bpc()
167 if (connector->display_info.max_tmds_clock > 0) { in amdgpu_connector_get_monitor_bpc()
169 mode_clock = amdgpu_connector->pixelclock_for_modeset; in amdgpu_connector_get_monitor_bpc()
172 max_tmds_clock = connector->display_info.max_tmds_clock; in amdgpu_connector_get_monitor_bpc()
175 connector->name, mode_clock, max_tmds_clock); in amdgpu_connector_get_monitor_bpc()
179 if ((connector->display_info.edid_hdmi_rgb444_dc_modes & DRM_EDID_HDMI_DC_30) && in amdgpu_connector_get_monitor_bpc()
186 connector->name, bpc); in amdgpu_connector_get_monitor_bpc()
192 connector->name, bpc); in amdgpu_connector_get_monitor_bpc()
197 connector->name); in amdgpu_connector_get_monitor_bpc()
204 connector->name); in amdgpu_connector_get_monitor_bpc()
209 connector->name, connector->display_info.bpc, bpc); in amdgpu_connector_get_monitor_bpc()
220 const struct drm_connector_helper_funcs *connector_funcs = connector->helper_private; in amdgpu_connector_update_scratch_regs()
223 best_encoder = connector_funcs->best_encoder(connector); in amdgpu_connector_update_scratch_regs()
242 if (encoder->encoder_type == encoder_type) in amdgpu_connector_find_encoder()
252 return drm_edid_duplicate(drm_edid_raw(adev->mode_info.bios_hardcoded_edid)); in amdgpu_connector_get_hardcoded_edid()
257 struct drm_device *dev = connector->dev; in amdgpu_connector_get_edid()
261 if (amdgpu_connector->edid) in amdgpu_connector_get_edid()
265 if (amdgpu_connector->router.ddc_valid) in amdgpu_connector_get_edid()
270 amdgpu_connector->ddc_bus->has_aux) { in amdgpu_connector_get_edid()
271 amdgpu_connector->edid = drm_get_edid(connector, in amdgpu_connector_get_edid()
272 &amdgpu_connector->ddc_bus->aux.ddc); in amdgpu_connector_get_edid()
273 } else if ((connector->connector_type == DRM_MODE_CONNECTOR_DisplayPort) || in amdgpu_connector_get_edid()
274 (connector->connector_type == DRM_MODE_CONNECTOR_eDP)) { in amdgpu_connector_get_edid()
275 struct amdgpu_connector_atom_dig *dig = amdgpu_connector->con_priv; in amdgpu_connector_get_edid()
277 if ((dig->dp_sink_type == CONNECTOR_OBJECT_ID_DISPLAYPORT || in amdgpu_connector_get_edid()
278 dig->dp_sink_type == CONNECTOR_OBJECT_ID_eDP) && in amdgpu_connector_get_edid()
279 amdgpu_connector->ddc_bus->has_aux) in amdgpu_connector_get_edid()
280 amdgpu_connector->edid = drm_get_edid(connector, in amdgpu_connector_get_edid()
281 &amdgpu_connector->ddc_bus->aux.ddc); in amdgpu_connector_get_edid()
282 else if (amdgpu_connector->ddc_bus) in amdgpu_connector_get_edid()
283 amdgpu_connector->edid = drm_get_edid(connector, in amdgpu_connector_get_edid()
284 &amdgpu_connector->ddc_bus->adapter); in amdgpu_connector_get_edid()
285 } else if (amdgpu_connector->ddc_bus) { in amdgpu_connector_get_edid()
286 amdgpu_connector->edid = drm_get_edid(connector, in amdgpu_connector_get_edid()
287 &amdgpu_connector->ddc_bus->adapter); in amdgpu_connector_get_edid()
290 if (!amdgpu_connector->edid) { in amdgpu_connector_get_edid()
292 if (((connector->connector_type == DRM_MODE_CONNECTOR_LVDS) || in amdgpu_connector_get_edid()
293 (connector->connector_type == DRM_MODE_CONNECTOR_eDP))) { in amdgpu_connector_get_edid()
294 amdgpu_connector->edid = amdgpu_connector_get_hardcoded_edid(adev); in amdgpu_connector_get_edid()
295 drm_connector_update_edid_property(connector, amdgpu_connector->edid); in amdgpu_connector_get_edid()
304 kfree(amdgpu_connector->edid); in amdgpu_connector_free_edid()
305 amdgpu_connector->edid = NULL; in amdgpu_connector_free_edid()
313 if (amdgpu_connector->edid) { in amdgpu_connector_ddc_get_modes()
314 drm_connector_update_edid_property(connector, amdgpu_connector->edid); in amdgpu_connector_ddc_get_modes()
315 ret = drm_add_edid_modes(connector, amdgpu_connector->edid); in amdgpu_connector_ddc_get_modes()
344 if (!list_empty(&connector->probed_modes)) { in amdgpu_get_native_mode()
346 list_first_entry(&connector->probed_modes, in amdgpu_get_native_mode()
349 amdgpu_encoder->native_mode = *preferred_mode; in amdgpu_get_native_mode()
351 amdgpu_encoder->native_mode.clock = 0; in amdgpu_get_native_mode()
358 struct drm_device *dev = encoder->dev; in amdgpu_connector_lcd_native_mode()
361 struct drm_display_mode *native_mode = &amdgpu_encoder->native_mode; in amdgpu_connector_lcd_native_mode()
363 if (native_mode->hdisplay != 0 && in amdgpu_connector_lcd_native_mode()
364 native_mode->vdisplay != 0 && in amdgpu_connector_lcd_native_mode()
365 native_mode->clock != 0) { in amdgpu_connector_lcd_native_mode()
370 mode->type = DRM_MODE_TYPE_PREFERRED | DRM_MODE_TYPE_DRIVER; in amdgpu_connector_lcd_native_mode()
373 DRM_DEBUG_KMS("Adding native panel mode %s\n", mode->name); in amdgpu_connector_lcd_native_mode()
374 } else if (native_mode->hdisplay != 0 && in amdgpu_connector_lcd_native_mode()
375 native_mode->vdisplay != 0) { in amdgpu_connector_lcd_native_mode()
383 mode = drm_cvt_mode(dev, native_mode->hdisplay, native_mode->vdisplay, 60, true, false, false); in amdgpu_connector_lcd_native_mode()
387 mode->type = DRM_MODE_TYPE_PREFERRED | DRM_MODE_TYPE_DRIVER; in amdgpu_connector_lcd_native_mode()
388 DRM_DEBUG_KMS("Adding cvt approximation of native panel mode %s\n", mode->name); in amdgpu_connector_lcd_native_mode()
396 struct drm_device *dev = encoder->dev; in amdgpu_connector_add_common_modes()
399 struct drm_display_mode *native_mode = &amdgpu_encoder->native_mode; in amdgpu_connector_add_common_modes()
425 if (amdgpu_encoder->devices & (ATOM_DEVICE_TV_SUPPORT)) { in amdgpu_connector_add_common_modes()
430 if (amdgpu_encoder->devices & (ATOM_DEVICE_LCD_SUPPORT)) { in amdgpu_connector_add_common_modes()
431 if (common_modes[i].w > native_mode->hdisplay || in amdgpu_connector_add_common_modes()
432 common_modes[i].h > native_mode->vdisplay || in amdgpu_connector_add_common_modes()
433 (common_modes[i].w == native_mode->hdisplay && in amdgpu_connector_add_common_modes()
434 common_modes[i].h == native_mode->vdisplay)) in amdgpu_connector_add_common_modes()
452 struct drm_device *dev = connector->dev; in amdgpu_connector_set_property()
457 if (property == adev->mode_info.coherent_mode_property) { in amdgpu_connector_set_property()
468 if (!amdgpu_encoder->enc_priv) in amdgpu_connector_set_property()
471 dig = amdgpu_encoder->enc_priv; in amdgpu_connector_set_property()
473 if (dig->coherent_mode != new_coherent_mode) { in amdgpu_connector_set_property()
474 dig->coherent_mode = new_coherent_mode; in amdgpu_connector_set_property()
475 amdgpu_connector_property_change_mode(&amdgpu_encoder->base); in amdgpu_connector_set_property()
479 if (property == adev->mode_info.audio_property) { in amdgpu_connector_set_property()
488 if (amdgpu_connector->audio != val) { in amdgpu_connector_set_property()
489 amdgpu_connector->audio = val; in amdgpu_connector_set_property()
490 amdgpu_connector_property_change_mode(&amdgpu_encoder->base); in amdgpu_connector_set_property()
494 if (property == adev->mode_info.dither_property) { in amdgpu_connector_set_property()
503 if (amdgpu_connector->dither != val) { in amdgpu_connector_set_property()
504 amdgpu_connector->dither = val; in amdgpu_connector_set_property()
505 amdgpu_connector_property_change_mode(&amdgpu_encoder->base); in amdgpu_connector_set_property()
509 if (property == adev->mode_info.underscan_property) { in amdgpu_connector_set_property()
517 if (amdgpu_encoder->underscan_type != val) { in amdgpu_connector_set_property()
518 amdgpu_encoder->underscan_type = val; in amdgpu_connector_set_property()
519 amdgpu_connector_property_change_mode(&amdgpu_encoder->base); in amdgpu_connector_set_property()
523 if (property == adev->mode_info.underscan_hborder_property) { in amdgpu_connector_set_property()
531 if (amdgpu_encoder->underscan_hborder != val) { in amdgpu_connector_set_property()
532 amdgpu_encoder->underscan_hborder = val; in amdgpu_connector_set_property()
533 amdgpu_connector_property_change_mode(&amdgpu_encoder->base); in amdgpu_connector_set_property()
537 if (property == adev->mode_info.underscan_vborder_property) { in amdgpu_connector_set_property()
545 if (amdgpu_encoder->underscan_vborder != val) { in amdgpu_connector_set_property()
546 amdgpu_encoder->underscan_vborder = val; in amdgpu_connector_set_property()
547 amdgpu_connector_property_change_mode(&amdgpu_encoder->base); in amdgpu_connector_set_property()
551 if (property == adev->mode_info.load_detect_property) { in amdgpu_connector_set_property()
556 amdgpu_connector->dac_load_detect = false; in amdgpu_connector_set_property()
558 amdgpu_connector->dac_load_detect = true; in amdgpu_connector_set_property()
561 if (property == dev->mode_config.scaling_mode_property) { in amdgpu_connector_set_property()
564 if (connector->encoder) { in amdgpu_connector_set_property()
565 amdgpu_encoder = to_amdgpu_encoder(connector->encoder); in amdgpu_connector_set_property()
567 const struct drm_connector_helper_funcs *connector_funcs = connector->helper_private; in amdgpu_connector_set_property()
569 amdgpu_encoder = to_amdgpu_encoder(connector_funcs->best_encoder(connector)); in amdgpu_connector_set_property()
588 if (amdgpu_encoder->rmx_type == rmx_type) in amdgpu_connector_set_property()
592 (amdgpu_encoder->native_mode.clock == 0)) in amdgpu_connector_set_property()
595 amdgpu_encoder->rmx_type = rmx_type; in amdgpu_connector_set_property()
597 amdgpu_connector_property_change_mode(&amdgpu_encoder->base); in amdgpu_connector_set_property()
608 struct drm_display_mode *native_mode = &amdgpu_encoder->native_mode; in amdgpu_connector_fixup_lcd_native_mode()
612 list_for_each_entry_safe(mode, t, &connector->probed_modes, head) { in amdgpu_connector_fixup_lcd_native_mode()
613 if (mode->type & DRM_MODE_TYPE_PREFERRED) { in amdgpu_connector_fixup_lcd_native_mode()
614 if (mode->hdisplay != native_mode->hdisplay || in amdgpu_connector_fixup_lcd_native_mode()
615 mode->vdisplay != native_mode->vdisplay) in amdgpu_connector_fixup_lcd_native_mode()
621 if (!native_mode->clock) { in amdgpu_connector_fixup_lcd_native_mode()
622 list_for_each_entry_safe(mode, t, &connector->probed_modes, head) { in amdgpu_connector_fixup_lcd_native_mode()
623 if (mode->hdisplay == native_mode->hdisplay && in amdgpu_connector_fixup_lcd_native_mode()
624 mode->vdisplay == native_mode->vdisplay) { in amdgpu_connector_fixup_lcd_native_mode()
633 if (!native_mode->clock) { in amdgpu_connector_fixup_lcd_native_mode()
635 amdgpu_encoder->rmx_type = RMX_OFF; in amdgpu_connector_fixup_lcd_native_mode()
667 connector->display_info.width_mm = mode->width_mm; in amdgpu_connector_lvds_get_modes()
668 connector->display_info.height_mm = mode->height_mm; in amdgpu_connector_lvds_get_modes()
681 if ((mode->hdisplay < 320) || (mode->vdisplay < 240)) in amdgpu_connector_lvds_mode_valid()
686 struct drm_display_mode *native_mode = &amdgpu_encoder->native_mode; in amdgpu_connector_lvds_mode_valid()
691 if ((mode->hdisplay > native_mode->hdisplay) || in amdgpu_connector_lvds_mode_valid()
692 (mode->vdisplay > native_mode->vdisplay)) in amdgpu_connector_lvds_mode_valid()
695 /* if scaling is disabled, block non-native modes */ in amdgpu_connector_lvds_mode_valid()
696 if (amdgpu_encoder->rmx_type == RMX_OFF) { in amdgpu_connector_lvds_mode_valid()
697 if ((mode->hdisplay != native_mode->hdisplay) || in amdgpu_connector_lvds_mode_valid()
698 (mode->vdisplay != native_mode->vdisplay)) in amdgpu_connector_lvds_mode_valid()
715 r = pm_runtime_get_sync(connector->dev->dev); in amdgpu_connector_lvds_detect()
717 pm_runtime_put_autosuspend(connector->dev->dev); in amdgpu_connector_lvds_detect()
724 struct drm_display_mode *native_mode = &amdgpu_encoder->native_mode; in amdgpu_connector_lvds_detect()
727 if (native_mode->hdisplay >= 320 && native_mode->vdisplay >= 240) in amdgpu_connector_lvds_detect()
734 if (amdgpu_connector->edid) in amdgpu_connector_lvds_detect()
741 pm_runtime_mark_last_busy(connector->dev->dev); in amdgpu_connector_lvds_detect()
742 pm_runtime_put_autosuspend(connector->dev->dev); in amdgpu_connector_lvds_detect()
752 if (amdgpu_connector->ddc_bus && amdgpu_connector->ddc_bus->has_aux) { in amdgpu_connector_unregister()
753 drm_dp_aux_unregister(&amdgpu_connector->ddc_bus->aux); in amdgpu_connector_unregister()
754 amdgpu_connector->ddc_bus->has_aux = false; in amdgpu_connector_unregister()
763 kfree(amdgpu_connector->con_priv); in amdgpu_connector_destroy()
773 struct drm_device *dev = connector->dev; in amdgpu_connector_set_lcd_property()
778 if (property != dev->mode_config.scaling_mode_property) in amdgpu_connector_set_lcd_property()
781 if (connector->encoder) in amdgpu_connector_set_lcd_property()
782 amdgpu_encoder = to_amdgpu_encoder(connector->encoder); in amdgpu_connector_set_lcd_property()
784 const struct drm_connector_helper_funcs *connector_funcs = connector->helper_private; in amdgpu_connector_set_lcd_property()
786 amdgpu_encoder = to_amdgpu_encoder(connector_funcs->best_encoder(connector)); in amdgpu_connector_set_lcd_property()
805 if (amdgpu_encoder->rmx_type == rmx_type) in amdgpu_connector_set_lcd_property()
808 amdgpu_encoder->rmx_type = rmx_type; in amdgpu_connector_set_lcd_property()
810 amdgpu_connector_property_change_mode(&amdgpu_encoder->base); in amdgpu_connector_set_lcd_property()
844 struct drm_device *dev = connector->dev; in amdgpu_connector_vga_mode_valid()
849 if ((mode->clock / 10) > adev->clock.max_pixel_clock) in amdgpu_connector_vga_mode_valid()
866 r = pm_runtime_get_sync(connector->dev->dev); in amdgpu_connector_vga_detect()
868 pm_runtime_put_autosuspend(connector->dev->dev); in amdgpu_connector_vga_detect()
877 if (amdgpu_connector->ddc_bus) in amdgpu_connector_vga_detect()
880 amdgpu_connector->detected_by_load = false; in amdgpu_connector_vga_detect()
884 if (!amdgpu_connector->edid) { in amdgpu_connector_vga_detect()
886 connector->name); in amdgpu_connector_vga_detect()
889 amdgpu_connector->use_digital = in amdgpu_connector_vga_detect()
890 !!(amdgpu_connector->edid->input & DRM_EDID_INPUT_DIGITAL); in amdgpu_connector_vga_detect()
893 * with a shared ddc line (often vga + hdmi) in amdgpu_connector_vga_detect()
895 if (amdgpu_connector->use_digital && amdgpu_connector->shared_ddc) { in amdgpu_connector_vga_detect()
909 if (amdgpu_connector->detected_by_load) in amdgpu_connector_vga_detect()
910 ret = connector->status; in amdgpu_connector_vga_detect()
914 if (amdgpu_connector->dac_load_detect && encoder) { in amdgpu_connector_vga_detect()
915 encoder_funcs = encoder->helper_private; in amdgpu_connector_vga_detect()
916 ret = encoder_funcs->detect(encoder, connector); in amdgpu_connector_vga_detect()
918 amdgpu_connector->detected_by_load = true; in amdgpu_connector_vga_detect()
926 pm_runtime_mark_last_busy(connector->dev->dev); in amdgpu_connector_vga_detect()
927 pm_runtime_put_autosuspend(connector->dev->dev); in amdgpu_connector_vga_detect()
951 struct drm_device *dev = connector->dev; in amdgpu_connector_check_hpd_status_unchanged()
956 if (amdgpu_connector->hpd.hpd != AMDGPU_HPD_NONE) { in amdgpu_connector_check_hpd_status_unchanged()
957 if (amdgpu_display_hpd_sense(adev, amdgpu_connector->hpd.hpd)) in amdgpu_connector_check_hpd_status_unchanged()
961 if (connector->status == status) in amdgpu_connector_check_hpd_status_unchanged()
975 struct drm_device *dev = connector->dev; in amdgpu_connector_shared_ddc()
978 if (amdgpu_connector->shared_ddc && *status == connector_status_connected) { in amdgpu_connector_shared_ddc()
985 if (list_amdgpu_connector->shared_ddc && in amdgpu_connector_shared_ddc()
986 list_amdgpu_connector->ddc_bus->rec.i2c_id == in amdgpu_connector_shared_ddc()
987 amdgpu_connector->ddc_bus->rec.i2c_id) { in amdgpu_connector_shared_ddc()
989 if (list_connector->connector_type != DRM_MODE_CONNECTOR_VGA) { in amdgpu_connector_shared_ddc()
992 amdgpu_connector->hpd.hpd)) { in amdgpu_connector_shared_ddc()
1005 * Do a DDC probe, if DDC probe passes, get the full EDID so
1007 * If the monitor is an analog monitor or we got no DDC,
1009 * If we got no DDC, we do load detection on the DAC encoder object.
1010 * If we got analog DDC or load detection passes on the DAC encoder
1017 struct drm_device *dev = connector->dev; in amdgpu_connector_dvi_detect()
1026 r = pm_runtime_get_sync(connector->dev->dev); in amdgpu_connector_dvi_detect()
1028 pm_runtime_put_autosuspend(connector->dev->dev); in amdgpu_connector_dvi_detect()
1033 if (amdgpu_connector->detected_hpd_without_ddc) { in amdgpu_connector_dvi_detect()
1035 amdgpu_connector->detected_hpd_without_ddc = false; in amdgpu_connector_dvi_detect()
1039 ret = connector->status; in amdgpu_connector_dvi_detect()
1043 if (amdgpu_connector->ddc_bus) { in amdgpu_connector_dvi_detect()
1046 /* Sometimes the pins required for the DDC probe on DVI in amdgpu_connector_dvi_detect()
1048 * for HPD do. If the DDC probe fails even though we had an HPD in amdgpu_connector_dvi_detect()
1052 amdgpu_display_hpd_sense(adev, amdgpu_connector->hpd.hpd)) { in amdgpu_connector_dvi_detect()
1053 DRM_DEBUG_KMS("hpd detected without ddc, retrying in 1 second\n"); in amdgpu_connector_dvi_detect()
1054 amdgpu_connector->detected_hpd_without_ddc = true; in amdgpu_connector_dvi_detect()
1055 schedule_delayed_work(&adev->hotplug_work, in amdgpu_connector_dvi_detect()
1061 amdgpu_connector->detected_by_load = false; in amdgpu_connector_dvi_detect()
1065 if (!amdgpu_connector->edid) { in amdgpu_connector_dvi_detect()
1067 connector->name); in amdgpu_connector_dvi_detect()
1071 amdgpu_connector->use_digital = in amdgpu_connector_dvi_detect()
1072 !!(amdgpu_connector->edid->input & DRM_EDID_INPUT_DIGITAL); in amdgpu_connector_dvi_detect()
1075 * with a shared ddc line (often vga + hdmi) in amdgpu_connector_dvi_detect()
1077 if ((!amdgpu_connector->use_digital) && amdgpu_connector->shared_ddc) { in amdgpu_connector_dvi_detect()
1085 * shared DDC line and we have boards with DVI-D + HDMI with a shared in amdgpu_connector_dvi_detect()
1086 * DDC line. The latter is more complex because with DVI<->HDMI adapters in amdgpu_connector_dvi_detect()
1093 if ((ret == connector_status_connected) && (amdgpu_connector->use_digital == true)) in amdgpu_connector_dvi_detect()
1096 /* DVI-D and HDMI-A are digital only */ in amdgpu_connector_dvi_detect()
1097 if ((connector->connector_type == DRM_MODE_CONNECTOR_DVID) || in amdgpu_connector_dvi_detect()
1098 (connector->connector_type == DRM_MODE_CONNECTOR_HDMIA)) in amdgpu_connector_dvi_detect()
1106 if (amdgpu_connector->detected_by_load) in amdgpu_connector_dvi_detect()
1107 ret = connector->status; in amdgpu_connector_dvi_detect()
1112 if (amdgpu_connector->dac_load_detect) { in amdgpu_connector_dvi_detect()
1116 if (encoder->encoder_type != DRM_MODE_ENCODER_DAC && in amdgpu_connector_dvi_detect()
1117 encoder->encoder_type != DRM_MODE_ENCODER_TVDAC) in amdgpu_connector_dvi_detect()
1120 encoder_funcs = encoder->helper_private; in amdgpu_connector_dvi_detect()
1121 if (encoder_funcs->detect) { in amdgpu_connector_dvi_detect()
1124 /* deal with analog monitors without DDC */ in amdgpu_connector_dvi_detect()
1125 ret = encoder_funcs->detect(encoder, connector); in amdgpu_connector_dvi_detect()
1127 amdgpu_connector->use_digital = false; in amdgpu_connector_dvi_detect()
1130 amdgpu_connector->detected_by_load = true; in amdgpu_connector_dvi_detect()
1135 amdgpu_connector->use_digital = true; in amdgpu_connector_dvi_detect()
1136 lret = encoder_funcs->detect(encoder, connector); in amdgpu_connector_dvi_detect()
1138 encoder->encoder_type, lret); in amdgpu_connector_dvi_detect()
1140 amdgpu_connector->use_digital = false; in amdgpu_connector_dvi_detect()
1153 pm_runtime_mark_last_busy(connector->dev->dev); in amdgpu_connector_dvi_detect()
1154 pm_runtime_put_autosuspend(connector->dev->dev); in amdgpu_connector_dvi_detect()
1168 if (amdgpu_connector->use_digital == true) { in amdgpu_connector_dvi_encoder()
1169 if (encoder->encoder_type == DRM_MODE_ENCODER_TMDS) in amdgpu_connector_dvi_encoder()
1172 if (encoder->encoder_type == DRM_MODE_ENCODER_DAC || in amdgpu_connector_dvi_encoder()
1173 encoder->encoder_type == DRM_MODE_ENCODER_TVDAC) in amdgpu_connector_dvi_encoder()
1192 if (connector->force == DRM_FORCE_ON) in amdgpu_connector_dvi_force()
1193 amdgpu_connector->use_digital = false; in amdgpu_connector_dvi_force()
1194 if (connector->force == DRM_FORCE_ON_DIGITAL) in amdgpu_connector_dvi_force()
1195 amdgpu_connector->use_digital = true; in amdgpu_connector_dvi_force()
1201 struct drm_device *dev = connector->dev; in amdgpu_connector_dvi_mode_valid()
1207 if (amdgpu_connector->use_digital && (mode->clock > 165000)) { in amdgpu_connector_dvi_mode_valid()
1208 if ((amdgpu_connector->connector_object_id == CONNECTOR_OBJECT_ID_DUAL_LINK_DVI_I) || in amdgpu_connector_dvi_mode_valid()
1209 (amdgpu_connector->connector_object_id == CONNECTOR_OBJECT_ID_DUAL_LINK_DVI_D) || in amdgpu_connector_dvi_mode_valid()
1210 (amdgpu_connector->connector_object_id == CONNECTOR_OBJECT_ID_HDMI_TYPE_B)) { in amdgpu_connector_dvi_mode_valid()
1212 } else if (connector->display_info.is_hdmi) { in amdgpu_connector_dvi_mode_valid()
1214 if (mode->clock > 340000) in amdgpu_connector_dvi_mode_valid()
1224 if ((mode->clock / 10) > adev->clock.max_pixel_clock) in amdgpu_connector_dvi_mode_valid()
1249 struct amdgpu_connector_atom_dig *amdgpu_dig_connector = amdgpu_connector->con_priv; in amdgpu_connector_dp_get_modes()
1253 if ((connector->connector_type == DRM_MODE_CONNECTOR_eDP) || in amdgpu_connector_dp_get_modes()
1254 (connector->connector_type == DRM_MODE_CONNECTOR_LVDS)) { in amdgpu_connector_dp_get_modes()
1257 if (connector->connector_type == DRM_MODE_CONNECTOR_eDP) { in amdgpu_connector_dp_get_modes()
1258 if (!amdgpu_dig_connector->edp_on) in amdgpu_connector_dp_get_modes()
1263 if (!amdgpu_dig_connector->edp_on) in amdgpu_connector_dp_get_modes()
1267 /* need to setup ddc on the bridge */ in amdgpu_connector_dp_get_modes()
1295 connector->display_info.width_mm = mode->width_mm; in amdgpu_connector_dp_get_modes()
1296 connector->display_info.height_mm = mode->height_mm; in amdgpu_connector_dp_get_modes()
1301 /* need to setup ddc on the bridge */ in amdgpu_connector_dp_get_modes()
1324 switch (amdgpu_encoder->encoder_id) { in amdgpu_connector_encoder_get_dp_bridge_encoder_id()
1327 return amdgpu_encoder->encoder_id; in amdgpu_connector_encoder_get_dp_bridge_encoder_id()
1344 if (amdgpu_encoder->caps & ATOM_ENCODER_CAP_RECORD_HBR2) in amdgpu_connector_encoder_is_hbr2()
1353 struct drm_device *dev = connector->dev; in amdgpu_connector_is_dp12_capable()
1356 if ((adev->clock.default_dispclk >= 53900) && in amdgpu_connector_is_dp12_capable()
1367 struct drm_device *dev = connector->dev; in amdgpu_connector_dp_detect()
1371 struct amdgpu_connector_atom_dig *amdgpu_dig_connector = amdgpu_connector->con_priv; in amdgpu_connector_dp_detect()
1376 r = pm_runtime_get_sync(connector->dev->dev); in amdgpu_connector_dp_detect()
1378 pm_runtime_put_autosuspend(connector->dev->dev); in amdgpu_connector_dp_detect()
1384 ret = connector->status; in amdgpu_connector_dp_detect()
1390 if ((connector->connector_type == DRM_MODE_CONNECTOR_eDP) || in amdgpu_connector_dp_detect()
1391 (connector->connector_type == DRM_MODE_CONNECTOR_LVDS)) { in amdgpu_connector_dp_detect()
1394 struct drm_display_mode *native_mode = &amdgpu_encoder->native_mode; in amdgpu_connector_dp_detect()
1397 if (native_mode->hdisplay >= 320 && native_mode->vdisplay >= 240) in amdgpu_connector_dp_detect()
1401 amdgpu_dig_connector->dp_sink_type = CONNECTOR_OBJECT_ID_DISPLAYPORT; in amdgpu_connector_dp_detect()
1402 if (!amdgpu_dig_connector->edp_on) in amdgpu_connector_dp_detect()
1407 if (!amdgpu_dig_connector->edp_on) in amdgpu_connector_dp_detect()
1413 amdgpu_dig_connector->dp_sink_type = CONNECTOR_OBJECT_ID_DISPLAYPORT; in amdgpu_connector_dp_detect()
1418 /* setup ddc on the bridge */ in amdgpu_connector_dp_detect()
1421 /* try DDC */ in amdgpu_connector_dp_detect()
1424 else if (amdgpu_connector->dac_load_detect) { /* try load detection */ in amdgpu_connector_dp_detect()
1425 const struct drm_encoder_helper_funcs *encoder_funcs = encoder->helper_private; in amdgpu_connector_dp_detect()
1427 ret = encoder_funcs->detect(encoder, connector); in amdgpu_connector_dp_detect()
1431 amdgpu_dig_connector->dp_sink_type = in amdgpu_connector_dp_detect()
1433 if (amdgpu_display_hpd_sense(adev, amdgpu_connector->hpd.hpd)) { in amdgpu_connector_dp_detect()
1435 if (amdgpu_dig_connector->dp_sink_type == CONNECTOR_OBJECT_ID_DISPLAYPORT) in amdgpu_connector_dp_detect()
1438 if (amdgpu_dig_connector->dp_sink_type == CONNECTOR_OBJECT_ID_DISPLAYPORT) { in amdgpu_connector_dp_detect()
1442 /* try non-aux ddc (DP to DVI/HDMI/etc. adapter) */ in amdgpu_connector_dp_detect()
1453 pm_runtime_mark_last_busy(connector->dev->dev); in amdgpu_connector_dp_detect()
1454 pm_runtime_put_autosuspend(connector->dev->dev); in amdgpu_connector_dp_detect()
1457 if (connector->connector_type == DRM_MODE_CONNECTOR_DisplayPort || in amdgpu_connector_dp_detect()
1458 connector->connector_type == DRM_MODE_CONNECTOR_eDP) in amdgpu_connector_dp_detect()
1459 drm_dp_set_subconnector_property(&amdgpu_connector->base, in amdgpu_connector_dp_detect()
1461 amdgpu_dig_connector->dpcd, in amdgpu_connector_dp_detect()
1462 amdgpu_dig_connector->downstream_ports); in amdgpu_connector_dp_detect()
1470 struct amdgpu_connector_atom_dig *amdgpu_dig_connector = amdgpu_connector->con_priv; in amdgpu_connector_dp_mode_valid()
1474 if ((connector->connector_type == DRM_MODE_CONNECTOR_eDP) || in amdgpu_connector_dp_mode_valid()
1475 (connector->connector_type == DRM_MODE_CONNECTOR_LVDS)) { in amdgpu_connector_dp_mode_valid()
1478 if ((mode->hdisplay < 320) || (mode->vdisplay < 240)) in amdgpu_connector_dp_mode_valid()
1483 struct drm_display_mode *native_mode = &amdgpu_encoder->native_mode; in amdgpu_connector_dp_mode_valid()
1488 if ((mode->hdisplay > native_mode->hdisplay) || in amdgpu_connector_dp_mode_valid()
1489 (mode->vdisplay > native_mode->vdisplay)) in amdgpu_connector_dp_mode_valid()
1492 /* if scaling is disabled, block non-native modes */ in amdgpu_connector_dp_mode_valid()
1493 if (amdgpu_encoder->rmx_type == RMX_OFF) { in amdgpu_connector_dp_mode_valid()
1494 if ((mode->hdisplay != native_mode->hdisplay) || in amdgpu_connector_dp_mode_valid()
1495 (mode->vdisplay != native_mode->vdisplay)) in amdgpu_connector_dp_mode_valid()
1501 if ((amdgpu_dig_connector->dp_sink_type == CONNECTOR_OBJECT_ID_DISPLAYPORT) || in amdgpu_connector_dp_mode_valid()
1502 (amdgpu_dig_connector->dp_sink_type == CONNECTOR_OBJECT_ID_eDP)) { in amdgpu_connector_dp_mode_valid()
1505 if (connector->display_info.is_hdmi) { in amdgpu_connector_dp_mode_valid()
1507 if (mode->clock > 340000) in amdgpu_connector_dp_mode_valid()
1510 if (mode->clock > 165000) in amdgpu_connector_dp_mode_valid()
1525 if (amdgpu_connector->ddc_bus->has_aux) { in amdgpu_connector_late_register()
1526 amdgpu_connector->ddc_bus->aux.dev = amdgpu_connector->base.kdev; in amdgpu_connector_late_register()
1527 r = drm_dp_aux_register(&amdgpu_connector->ddc_bus->aux); in amdgpu_connector_late_register()
1578 struct i2c_adapter *ddc = NULL; in amdgpu_connector_add() local
1591 if (amdgpu_connector->connector_id == connector_id) { in amdgpu_connector_add()
1592 amdgpu_connector->devices |= supported_device; in amdgpu_connector_add()
1596 if (amdgpu_connector->ddc_bus && i2c_bus->valid) { in amdgpu_connector_add()
1597 if (amdgpu_connector->ddc_bus->rec.i2c_id == i2c_bus->i2c_id) { in amdgpu_connector_add()
1598 amdgpu_connector->shared_ddc = true; in amdgpu_connector_add()
1601 if (amdgpu_connector->router_bus && router->ddc_valid && in amdgpu_connector_add()
1602 (amdgpu_connector->router.router_id == router->router_id)) { in amdgpu_connector_add()
1603 amdgpu_connector->shared_ddc = false; in amdgpu_connector_add()
1611 list_for_each_entry(encoder, &dev->mode_config.encoder_list, head) { in amdgpu_connector_add()
1613 if (amdgpu_encoder->devices & supported_device) { in amdgpu_connector_add()
1614 switch (amdgpu_encoder->encoder_id) { in amdgpu_connector_add()
1629 connector = &amdgpu_connector->base; in amdgpu_connector_add()
1631 amdgpu_connector->connector_id = connector_id; in amdgpu_connector_add()
1632 amdgpu_connector->devices = supported_device; in amdgpu_connector_add()
1633 amdgpu_connector->shared_ddc = shared_ddc; in amdgpu_connector_add()
1634 amdgpu_connector->connector_object_id = connector_object_id; in amdgpu_connector_add()
1635 amdgpu_connector->hpd = *hpd; in amdgpu_connector_add()
1637 amdgpu_connector->router = *router; in amdgpu_connector_add()
1638 if (router->ddc_valid || router->cd_valid) { in amdgpu_connector_add()
1639 amdgpu_connector->router_bus = amdgpu_i2c_lookup(adev, &router->i2c_info); in amdgpu_connector_add()
1640 if (!amdgpu_connector->router_bus) in amdgpu_connector_add()
1648 amdgpu_connector->con_priv = amdgpu_dig_connector; in amdgpu_connector_add()
1649 if (i2c_bus->valid) { in amdgpu_connector_add()
1650 amdgpu_connector->ddc_bus = amdgpu_i2c_lookup(adev, i2c_bus); in amdgpu_connector_add()
1651 if (amdgpu_connector->ddc_bus) { in amdgpu_connector_add()
1653 ddc = &amdgpu_connector->ddc_bus->adapter; in amdgpu_connector_add()
1655 DRM_ERROR("DP: Failed to assign ddc bus! Check dmesg for i2c errors.\n"); in amdgpu_connector_add()
1662 drm_connector_init_with_ddc(dev, &amdgpu_connector->base, in amdgpu_connector_add()
1665 ddc); in amdgpu_connector_add()
1666 drm_connector_helper_add(&amdgpu_connector->base, in amdgpu_connector_add()
1668 connector->interlace_allowed = true; in amdgpu_connector_add()
1669 connector->doublescan_allowed = true; in amdgpu_connector_add()
1670 amdgpu_connector->dac_load_detect = true; in amdgpu_connector_add()
1671 drm_object_attach_property(&amdgpu_connector->base.base, in amdgpu_connector_add()
1672 adev->mode_info.load_detect_property, in amdgpu_connector_add()
1674 drm_object_attach_property(&amdgpu_connector->base.base, in amdgpu_connector_add()
1675 dev->mode_config.scaling_mode_property, in amdgpu_connector_add()
1683 drm_connector_init_with_ddc(dev, &amdgpu_connector->base, in amdgpu_connector_add()
1686 ddc); in amdgpu_connector_add()
1687 drm_connector_helper_add(&amdgpu_connector->base, in amdgpu_connector_add()
1689 drm_object_attach_property(&amdgpu_connector->base.base, in amdgpu_connector_add()
1690 adev->mode_info.underscan_property, in amdgpu_connector_add()
1692 drm_object_attach_property(&amdgpu_connector->base.base, in amdgpu_connector_add()
1693 adev->mode_info.underscan_hborder_property, in amdgpu_connector_add()
1695 drm_object_attach_property(&amdgpu_connector->base.base, in amdgpu_connector_add()
1696 adev->mode_info.underscan_vborder_property, in amdgpu_connector_add()
1699 drm_object_attach_property(&amdgpu_connector->base.base, in amdgpu_connector_add()
1700 dev->mode_config.scaling_mode_property, in amdgpu_connector_add()
1703 drm_object_attach_property(&amdgpu_connector->base.base, in amdgpu_connector_add()
1704 adev->mode_info.dither_property, in amdgpu_connector_add()
1708 drm_object_attach_property(&amdgpu_connector->base.base, in amdgpu_connector_add()
1709 adev->mode_info.audio_property, in amdgpu_connector_add()
1711 amdgpu_connector->audio = AMDGPU_AUDIO_AUTO; in amdgpu_connector_add()
1715 connector->interlace_allowed = true; in amdgpu_connector_add()
1717 connector->doublescan_allowed = true; in amdgpu_connector_add()
1719 connector->doublescan_allowed = false; in amdgpu_connector_add()
1721 amdgpu_connector->dac_load_detect = true; in amdgpu_connector_add()
1722 drm_object_attach_property(&amdgpu_connector->base.base, in amdgpu_connector_add()
1723 adev->mode_info.load_detect_property, in amdgpu_connector_add()
1729 drm_connector_init_with_ddc(dev, &amdgpu_connector->base, in amdgpu_connector_add()
1732 ddc); in amdgpu_connector_add()
1733 drm_connector_helper_add(&amdgpu_connector->base, in amdgpu_connector_add()
1735 drm_object_attach_property(&amdgpu_connector->base.base, in amdgpu_connector_add()
1736 dev->mode_config.scaling_mode_property, in amdgpu_connector_add()
1739 connector->interlace_allowed = false; in amdgpu_connector_add()
1740 connector->doublescan_allowed = false; in amdgpu_connector_add()
1746 if (i2c_bus->valid) { in amdgpu_connector_add()
1747 amdgpu_connector->ddc_bus = amdgpu_i2c_lookup(adev, i2c_bus); in amdgpu_connector_add()
1748 if (!amdgpu_connector->ddc_bus) in amdgpu_connector_add()
1749 DRM_ERROR("VGA: Failed to assign ddc bus! Check dmesg for i2c errors.\n"); in amdgpu_connector_add()
1751 ddc = &amdgpu_connector->ddc_bus->adapter; in amdgpu_connector_add()
1753 drm_connector_init_with_ddc(dev, &amdgpu_connector->base, in amdgpu_connector_add()
1756 ddc); in amdgpu_connector_add()
1757 drm_connector_helper_add(&amdgpu_connector->base, &amdgpu_connector_vga_helper_funcs); in amdgpu_connector_add()
1758 amdgpu_connector->dac_load_detect = true; in amdgpu_connector_add()
1759 drm_object_attach_property(&amdgpu_connector->base.base, in amdgpu_connector_add()
1760 adev->mode_info.load_detect_property, in amdgpu_connector_add()
1762 drm_object_attach_property(&amdgpu_connector->base.base, in amdgpu_connector_add()
1763 dev->mode_config.scaling_mode_property, in amdgpu_connector_add()
1766 amdgpu_connector->hpd.hpd = AMDGPU_HPD_NONE; in amdgpu_connector_add()
1767 connector->interlace_allowed = true; in amdgpu_connector_add()
1768 connector->doublescan_allowed = true; in amdgpu_connector_add()
1771 if (i2c_bus->valid) { in amdgpu_connector_add()
1772 amdgpu_connector->ddc_bus = amdgpu_i2c_lookup(adev, i2c_bus); in amdgpu_connector_add()
1773 if (!amdgpu_connector->ddc_bus) in amdgpu_connector_add()
1774 DRM_ERROR("DVIA: Failed to assign ddc bus! Check dmesg for i2c errors.\n"); in amdgpu_connector_add()
1776 ddc = &amdgpu_connector->ddc_bus->adapter; in amdgpu_connector_add()
1778 drm_connector_init_with_ddc(dev, &amdgpu_connector->base, in amdgpu_connector_add()
1781 ddc); in amdgpu_connector_add()
1782 drm_connector_helper_add(&amdgpu_connector->base, &amdgpu_connector_vga_helper_funcs); in amdgpu_connector_add()
1783 amdgpu_connector->dac_load_detect = true; in amdgpu_connector_add()
1784 drm_object_attach_property(&amdgpu_connector->base.base, in amdgpu_connector_add()
1785 adev->mode_info.load_detect_property, in amdgpu_connector_add()
1787 drm_object_attach_property(&amdgpu_connector->base.base, in amdgpu_connector_add()
1788 dev->mode_config.scaling_mode_property, in amdgpu_connector_add()
1791 amdgpu_connector->hpd.hpd = AMDGPU_HPD_NONE; in amdgpu_connector_add()
1792 connector->interlace_allowed = true; in amdgpu_connector_add()
1793 connector->doublescan_allowed = true; in amdgpu_connector_add()
1800 amdgpu_connector->con_priv = amdgpu_dig_connector; in amdgpu_connector_add()
1801 if (i2c_bus->valid) { in amdgpu_connector_add()
1802 amdgpu_connector->ddc_bus = amdgpu_i2c_lookup(adev, i2c_bus); in amdgpu_connector_add()
1803 if (!amdgpu_connector->ddc_bus) in amdgpu_connector_add()
1804 DRM_ERROR("DVI: Failed to assign ddc bus! Check dmesg for i2c errors.\n"); in amdgpu_connector_add()
1806 ddc = &amdgpu_connector->ddc_bus->adapter; in amdgpu_connector_add()
1808 drm_connector_init_with_ddc(dev, &amdgpu_connector->base, in amdgpu_connector_add()
1811 ddc); in amdgpu_connector_add()
1812 drm_connector_helper_add(&amdgpu_connector->base, &amdgpu_connector_dvi_helper_funcs); in amdgpu_connector_add()
1814 drm_object_attach_property(&amdgpu_connector->base.base, in amdgpu_connector_add()
1815 adev->mode_info.coherent_mode_property, in amdgpu_connector_add()
1817 drm_object_attach_property(&amdgpu_connector->base.base, in amdgpu_connector_add()
1818 adev->mode_info.underscan_property, in amdgpu_connector_add()
1820 drm_object_attach_property(&amdgpu_connector->base.base, in amdgpu_connector_add()
1821 adev->mode_info.underscan_hborder_property, in amdgpu_connector_add()
1823 drm_object_attach_property(&amdgpu_connector->base.base, in amdgpu_connector_add()
1824 adev->mode_info.underscan_vborder_property, in amdgpu_connector_add()
1826 drm_object_attach_property(&amdgpu_connector->base.base, in amdgpu_connector_add()
1827 dev->mode_config.scaling_mode_property, in amdgpu_connector_add()
1831 drm_object_attach_property(&amdgpu_connector->base.base, in amdgpu_connector_add()
1832 adev->mode_info.audio_property, in amdgpu_connector_add()
1834 amdgpu_connector->audio = AMDGPU_AUDIO_AUTO; in amdgpu_connector_add()
1836 drm_object_attach_property(&amdgpu_connector->base.base, in amdgpu_connector_add()
1837 adev->mode_info.dither_property, in amdgpu_connector_add()
1840 amdgpu_connector->dac_load_detect = true; in amdgpu_connector_add()
1841 drm_object_attach_property(&amdgpu_connector->base.base, in amdgpu_connector_add()
1842 adev->mode_info.load_detect_property, in amdgpu_connector_add()
1845 connector->interlace_allowed = true; in amdgpu_connector_add()
1847 connector->doublescan_allowed = true; in amdgpu_connector_add()
1849 connector->doublescan_allowed = false; in amdgpu_connector_add()
1856 amdgpu_connector->con_priv = amdgpu_dig_connector; in amdgpu_connector_add()
1857 if (i2c_bus->valid) { in amdgpu_connector_add()
1858 amdgpu_connector->ddc_bus = amdgpu_i2c_lookup(adev, i2c_bus); in amdgpu_connector_add()
1859 if (!amdgpu_connector->ddc_bus) in amdgpu_connector_add()
1860 DRM_ERROR("HDMI: Failed to assign ddc bus! Check dmesg for i2c errors.\n"); in amdgpu_connector_add()
1862 ddc = &amdgpu_connector->ddc_bus->adapter; in amdgpu_connector_add()
1864 drm_connector_init_with_ddc(dev, &amdgpu_connector->base, in amdgpu_connector_add()
1867 ddc); in amdgpu_connector_add()
1868 drm_connector_helper_add(&amdgpu_connector->base, &amdgpu_connector_dvi_helper_funcs); in amdgpu_connector_add()
1869 drm_object_attach_property(&amdgpu_connector->base.base, in amdgpu_connector_add()
1870 adev->mode_info.coherent_mode_property, in amdgpu_connector_add()
1872 drm_object_attach_property(&amdgpu_connector->base.base, in amdgpu_connector_add()
1873 adev->mode_info.underscan_property, in amdgpu_connector_add()
1875 drm_object_attach_property(&amdgpu_connector->base.base, in amdgpu_connector_add()
1876 adev->mode_info.underscan_hborder_property, in amdgpu_connector_add()
1878 drm_object_attach_property(&amdgpu_connector->base.base, in amdgpu_connector_add()
1879 adev->mode_info.underscan_vborder_property, in amdgpu_connector_add()
1881 drm_object_attach_property(&amdgpu_connector->base.base, in amdgpu_connector_add()
1882 dev->mode_config.scaling_mode_property, in amdgpu_connector_add()
1885 drm_object_attach_property(&amdgpu_connector->base.base, in amdgpu_connector_add()
1886 adev->mode_info.audio_property, in amdgpu_connector_add()
1888 amdgpu_connector->audio = AMDGPU_AUDIO_AUTO; in amdgpu_connector_add()
1890 drm_object_attach_property(&amdgpu_connector->base.base, in amdgpu_connector_add()
1891 adev->mode_info.dither_property, in amdgpu_connector_add()
1894 connector->interlace_allowed = true; in amdgpu_connector_add()
1896 connector->doublescan_allowed = true; in amdgpu_connector_add()
1898 connector->doublescan_allowed = false; in amdgpu_connector_add()
1904 amdgpu_connector->con_priv = amdgpu_dig_connector; in amdgpu_connector_add()
1905 if (i2c_bus->valid) { in amdgpu_connector_add()
1906 amdgpu_connector->ddc_bus = amdgpu_i2c_lookup(adev, i2c_bus); in amdgpu_connector_add()
1907 if (amdgpu_connector->ddc_bus) { in amdgpu_connector_add()
1909 ddc = &amdgpu_connector->ddc_bus->adapter; in amdgpu_connector_add()
1911 DRM_ERROR("DP: Failed to assign ddc bus! Check dmesg for i2c errors.\n"); in amdgpu_connector_add()
1914 drm_connector_init_with_ddc(dev, &amdgpu_connector->base, in amdgpu_connector_add()
1917 ddc); in amdgpu_connector_add()
1918 drm_connector_helper_add(&amdgpu_connector->base, &amdgpu_connector_dp_helper_funcs); in amdgpu_connector_add()
1920 drm_object_attach_property(&amdgpu_connector->base.base, in amdgpu_connector_add()
1921 adev->mode_info.coherent_mode_property, in amdgpu_connector_add()
1923 drm_object_attach_property(&amdgpu_connector->base.base, in amdgpu_connector_add()
1924 adev->mode_info.underscan_property, in amdgpu_connector_add()
1926 drm_object_attach_property(&amdgpu_connector->base.base, in amdgpu_connector_add()
1927 adev->mode_info.underscan_hborder_property, in amdgpu_connector_add()
1929 drm_object_attach_property(&amdgpu_connector->base.base, in amdgpu_connector_add()
1930 adev->mode_info.underscan_vborder_property, in amdgpu_connector_add()
1932 drm_object_attach_property(&amdgpu_connector->base.base, in amdgpu_connector_add()
1933 dev->mode_config.scaling_mode_property, in amdgpu_connector_add()
1936 drm_object_attach_property(&amdgpu_connector->base.base, in amdgpu_connector_add()
1937 adev->mode_info.audio_property, in amdgpu_connector_add()
1939 amdgpu_connector->audio = AMDGPU_AUDIO_AUTO; in amdgpu_connector_add()
1941 drm_object_attach_property(&amdgpu_connector->base.base, in amdgpu_connector_add()
1942 adev->mode_info.dither_property, in amdgpu_connector_add()
1944 connector->interlace_allowed = true; in amdgpu_connector_add()
1946 connector->doublescan_allowed = false; in amdgpu_connector_add()
1952 amdgpu_connector->con_priv = amdgpu_dig_connector; in amdgpu_connector_add()
1953 if (i2c_bus->valid) { in amdgpu_connector_add()
1954 amdgpu_connector->ddc_bus = amdgpu_i2c_lookup(adev, i2c_bus); in amdgpu_connector_add()
1955 if (amdgpu_connector->ddc_bus) { in amdgpu_connector_add()
1957 ddc = &amdgpu_connector->ddc_bus->adapter; in amdgpu_connector_add()
1959 DRM_ERROR("DP: Failed to assign ddc bus! Check dmesg for i2c errors.\n"); in amdgpu_connector_add()
1962 drm_connector_init_with_ddc(dev, &amdgpu_connector->base, in amdgpu_connector_add()
1965 ddc); in amdgpu_connector_add()
1966 drm_connector_helper_add(&amdgpu_connector->base, &amdgpu_connector_dp_helper_funcs); in amdgpu_connector_add()
1967 drm_object_attach_property(&amdgpu_connector->base.base, in amdgpu_connector_add()
1968 dev->mode_config.scaling_mode_property, in amdgpu_connector_add()
1971 connector->interlace_allowed = false; in amdgpu_connector_add()
1972 connector->doublescan_allowed = false; in amdgpu_connector_add()
1978 amdgpu_connector->con_priv = amdgpu_dig_connector; in amdgpu_connector_add()
1979 if (i2c_bus->valid) { in amdgpu_connector_add()
1980 amdgpu_connector->ddc_bus = amdgpu_i2c_lookup(adev, i2c_bus); in amdgpu_connector_add()
1981 if (!amdgpu_connector->ddc_bus) in amdgpu_connector_add()
1982 DRM_ERROR("LVDS: Failed to assign ddc bus! Check dmesg for i2c errors.\n"); in amdgpu_connector_add()
1984 ddc = &amdgpu_connector->ddc_bus->adapter; in amdgpu_connector_add()
1986 drm_connector_init_with_ddc(dev, &amdgpu_connector->base, in amdgpu_connector_add()
1989 ddc); in amdgpu_connector_add()
1990 drm_connector_helper_add(&amdgpu_connector->base, &amdgpu_connector_lvds_helper_funcs); in amdgpu_connector_add()
1991 drm_object_attach_property(&amdgpu_connector->base.base, in amdgpu_connector_add()
1992 dev->mode_config.scaling_mode_property, in amdgpu_connector_add()
1995 connector->interlace_allowed = false; in amdgpu_connector_add()
1996 connector->doublescan_allowed = false; in amdgpu_connector_add()
2001 if (amdgpu_connector->hpd.hpd == AMDGPU_HPD_NONE) { in amdgpu_connector_add()
2002 if (i2c_bus->valid) { in amdgpu_connector_add()
2003 connector->polled = DRM_CONNECTOR_POLL_CONNECT | in amdgpu_connector_add()
2007 connector->polled = DRM_CONNECTOR_POLL_HPD; in amdgpu_connector_add()
2009 connector->display_info.subpixel_order = subpixel_order; in amdgpu_connector_add()
2016 drm_connector_attach_dp_subconnector_property(&amdgpu_connector->base); in amdgpu_connector_add()