Lines Matching refs:connector

90 			   struct drm_connector *connector,  in drm_mode_validate_pipeline()  argument
94 struct drm_device *dev = connector->dev; in drm_mode_validate_pipeline()
99 ret = drm_connector_mode_valid(connector, mode, ctx, status); in drm_mode_validate_pipeline()
104 drm_connector_for_each_possible_encoder(connector, encoder) { in drm_mode_validate_pipeline()
119 &connector->display_info, in drm_mode_validate_pipeline()
144 static int drm_helper_probe_add_cmdline_mode(struct drm_connector *connector) in drm_helper_probe_add_cmdline_mode() argument
149 cmdline_mode = &connector->cmdline_mode; in drm_helper_probe_add_cmdline_mode()
154 list_for_each_entry(mode, &connector->probed_modes, head) { in drm_helper_probe_add_cmdline_mode()
170 mode = drm_mode_create_from_cmdline_mode(connector->dev, in drm_helper_probe_add_cmdline_mode()
175 drm_mode_probed_add(connector, mode); in drm_helper_probe_add_cmdline_mode()
203 drm_connector_mode_valid(struct drm_connector *connector, in drm_connector_mode_valid() argument
209 connector->helper_private; in drm_connector_mode_valid()
215 ret = connector_funcs->mode_valid_ctx(connector, mode, ctx, in drm_connector_mode_valid()
218 *status = connector_funcs->mode_valid(connector, mode); in drm_connector_mode_valid()
227 struct drm_connector *connector; in drm_kms_helper_disable_hpd() local
231 drm_for_each_connector_iter(connector, &conn_iter) { in drm_kms_helper_disable_hpd()
233 connector->helper_private; in drm_kms_helper_disable_hpd()
236 funcs->disable_hpd(connector); in drm_kms_helper_disable_hpd()
244 struct drm_connector *connector; in drm_kms_helper_enable_hpd() local
248 drm_for_each_connector_iter(connector, &conn_iter) { in drm_kms_helper_enable_hpd()
250 connector->helper_private; in drm_kms_helper_enable_hpd()
253 funcs->enable_hpd(connector); in drm_kms_helper_enable_hpd()
255 if (connector->polled & (DRM_CONNECTOR_POLL_CONNECT | in drm_kms_helper_enable_hpd()
341 drm_helper_probe_detect_ctx(struct drm_connector *connector, bool force) in drm_helper_probe_detect_ctx() argument
343 const struct drm_connector_helper_funcs *funcs = connector->helper_private; in drm_helper_probe_detect_ctx()
350 ret = drm_modeset_lock(&connector->dev->mode_config.connection_mutex, &ctx); in drm_helper_probe_detect_ctx()
353 ret = funcs->detect_ctx(connector, &ctx, force); in drm_helper_probe_detect_ctx()
354 else if (connector->funcs->detect) in drm_helper_probe_detect_ctx()
355 ret = connector->funcs->detect(connector, force); in drm_helper_probe_detect_ctx()
368 if (ret != connector->status) in drm_helper_probe_detect_ctx()
369 connector->epoch_counter += 1; in drm_helper_probe_detect_ctx()
388 drm_helper_probe_detect(struct drm_connector *connector, in drm_helper_probe_detect() argument
392 const struct drm_connector_helper_funcs *funcs = connector->helper_private; in drm_helper_probe_detect()
393 struct drm_device *dev = connector->dev; in drm_helper_probe_detect()
397 return drm_helper_probe_detect_ctx(connector, force); in drm_helper_probe_detect()
404 ret = funcs->detect_ctx(connector, ctx, force); in drm_helper_probe_detect()
405 else if (connector->funcs->detect) in drm_helper_probe_detect()
406 ret = connector->funcs->detect(connector, force); in drm_helper_probe_detect()
410 if (ret != connector->status) in drm_helper_probe_detect()
411 connector->epoch_counter += 1; in drm_helper_probe_detect()
417 static int drm_helper_probe_get_modes(struct drm_connector *connector) in drm_helper_probe_get_modes() argument
420 connector->helper_private; in drm_helper_probe_get_modes()
423 count = connector_funcs->get_modes(connector); in drm_helper_probe_get_modes()
427 drm_err(connector->dev, ".get_modes() returned %pe\n", in drm_helper_probe_get_modes()
436 if (count == 0 && connector->status == connector_status_connected) in drm_helper_probe_get_modes()
437 count = drm_edid_override_connector_update(connector); in drm_helper_probe_get_modes()
442 static int __drm_helper_update_and_validate(struct drm_connector *connector, in __drm_helper_update_and_validate() argument
446 struct drm_device *dev = connector->dev; in __drm_helper_update_and_validate()
451 drm_connector_list_update(connector); in __drm_helper_update_and_validate()
453 if (connector->interlace_allowed) in __drm_helper_update_and_validate()
455 if (connector->doublescan_allowed) in __drm_helper_update_and_validate()
457 if (connector->stereo_allowed) in __drm_helper_update_and_validate()
460 list_for_each_entry(mode, &connector->modes, head) { in __drm_helper_update_and_validate()
476 ret = drm_mode_validate_pipeline(mode, connector, ctx, in __drm_helper_update_and_validate()
491 mode->status = drm_mode_validate_ycbcr420(mode, connector); in __drm_helper_update_and_validate()
556 int drm_helper_probe_single_connector_modes(struct drm_connector *connector, in drm_helper_probe_single_connector_modes() argument
559 struct drm_device *dev = connector->dev; in drm_helper_probe_single_connector_modes()
569 DRM_DEBUG_KMS("[CONNECTOR:%d:%s]\n", connector->base.id, in drm_helper_probe_single_connector_modes()
570 connector->name); in drm_helper_probe_single_connector_modes()
581 list_for_each_entry(mode, &connector->modes, head) in drm_helper_probe_single_connector_modes()
584 old_status = connector->status; in drm_helper_probe_single_connector_modes()
586 if (connector->force) { in drm_helper_probe_single_connector_modes()
587 if (connector->force == DRM_FORCE_ON || in drm_helper_probe_single_connector_modes()
588 connector->force == DRM_FORCE_ON_DIGITAL) in drm_helper_probe_single_connector_modes()
589 connector->status = connector_status_connected; in drm_helper_probe_single_connector_modes()
591 connector->status = connector_status_disconnected; in drm_helper_probe_single_connector_modes()
592 if (connector->funcs->force) in drm_helper_probe_single_connector_modes()
593 connector->funcs->force(connector); in drm_helper_probe_single_connector_modes()
595 ret = drm_helper_probe_detect(connector, &ctx, true); in drm_helper_probe_single_connector_modes()
603 connector->status = ret; in drm_helper_probe_single_connector_modes()
612 if (old_status != connector->status) { in drm_helper_probe_single_connector_modes()
614 connector->base.id, in drm_helper_probe_single_connector_modes()
615 connector->name, in drm_helper_probe_single_connector_modes()
617 drm_get_connector_status_name(connector->status)); in drm_helper_probe_single_connector_modes()
639 if (connector->status == connector_status_disconnected) { in drm_helper_probe_single_connector_modes()
641 connector->base.id, connector->name); in drm_helper_probe_single_connector_modes()
642 drm_connector_update_edid_property(connector, NULL); in drm_helper_probe_single_connector_modes()
643 drm_mode_prune_invalid(dev, &connector->modes, false); in drm_helper_probe_single_connector_modes()
647 count = drm_helper_probe_get_modes(connector); in drm_helper_probe_single_connector_modes()
649 if (count == 0 && (connector->status == connector_status_connected || in drm_helper_probe_single_connector_modes()
650 connector->status == connector_status_unknown)) { in drm_helper_probe_single_connector_modes()
651 count = drm_add_modes_noedid(connector, 1024, 768); in drm_helper_probe_single_connector_modes()
658 if (connector->connector_type == DRM_MODE_CONNECTOR_DisplayPort) in drm_helper_probe_single_connector_modes()
659 drm_set_preferred_mode(connector, 640, 480); in drm_helper_probe_single_connector_modes()
661 count += drm_helper_probe_add_cmdline_mode(connector); in drm_helper_probe_single_connector_modes()
663 ret = __drm_helper_update_and_validate(connector, maxX, maxY, &ctx); in drm_helper_probe_single_connector_modes()
670 drm_mode_prune_invalid(dev, &connector->modes, true); in drm_helper_probe_single_connector_modes()
679 if (list_empty(&connector->modes) && in drm_helper_probe_single_connector_modes()
680 connector->connector_type == DRM_MODE_CONNECTOR_DisplayPort) { in drm_helper_probe_single_connector_modes()
681 count = drm_add_modes_noedid(connector, 640, 480); in drm_helper_probe_single_connector_modes()
682 ret = __drm_helper_update_and_validate(connector, maxX, maxY, &ctx); in drm_helper_probe_single_connector_modes()
687 drm_mode_prune_invalid(dev, &connector->modes, true); in drm_helper_probe_single_connector_modes()
694 if (list_empty(&connector->modes)) in drm_helper_probe_single_connector_modes()
697 drm_mode_sort(&connector->modes); in drm_helper_probe_single_connector_modes()
699 DRM_DEBUG_KMS("[CONNECTOR:%d:%s] probed modes :\n", connector->base.id, in drm_helper_probe_single_connector_modes()
700 connector->name); in drm_helper_probe_single_connector_modes()
701 list_for_each_entry(mode, &connector->modes, head) { in drm_helper_probe_single_connector_modes()
747 void drm_kms_helper_connector_hotplug_event(struct drm_connector *connector) in drm_kms_helper_connector_hotplug_event() argument
749 struct drm_device *dev = connector->dev; in drm_kms_helper_connector_hotplug_event()
752 drm_sysfs_connector_hotplug_event(connector); in drm_kms_helper_connector_hotplug_event()
764 struct drm_connector *connector; in output_poll_execute() local
789 drm_for_each_connector_iter(connector, &conn_iter) { in output_poll_execute()
791 if (connector->force) in output_poll_execute()
796 if (!connector->polled || connector->polled == DRM_CONNECTOR_POLL_HPD) in output_poll_execute()
799 old_status = connector->status; in output_poll_execute()
803 !(connector->polled & DRM_CONNECTOR_POLL_DISCONNECT)) in output_poll_execute()
808 old_epoch_counter = connector->epoch_counter; in output_poll_execute()
809 connector->status = drm_helper_probe_detect(connector, NULL, false); in output_poll_execute()
810 if (old_epoch_counter != connector->epoch_counter) { in output_poll_execute()
826 if (connector->status == connector_status_unknown) { in output_poll_execute()
827 connector->status = old_status; in output_poll_execute()
832 new = drm_get_connector_status_name(connector->status); in output_poll_execute()
836 connector->base.id, in output_poll_execute()
837 connector->name, in output_poll_execute()
840 connector->base.id, connector->name, in output_poll_execute()
841 old_epoch_counter, connector->epoch_counter); in output_poll_execute()
952 static bool check_connector_changed(struct drm_connector *connector) in check_connector_changed() argument
954 struct drm_device *dev = connector->dev; in check_connector_changed()
959 drm_WARN_ON(dev, !(connector->polled & DRM_CONNECTOR_POLL_HPD)); in check_connector_changed()
963 old_status = connector->status; in check_connector_changed()
964 old_epoch_counter = connector->epoch_counter; in check_connector_changed()
965 connector->status = drm_helper_probe_detect(connector, NULL, false); in check_connector_changed()
967 if (old_epoch_counter == connector->epoch_counter) { in check_connector_changed()
969 connector->base.id, in check_connector_changed()
970 connector->name, in check_connector_changed()
971 connector->epoch_counter); in check_connector_changed()
977 connector->base.id, in check_connector_changed()
978 connector->name, in check_connector_changed()
980 drm_get_connector_status_name(connector->status)); in check_connector_changed()
983 connector->base.id, in check_connector_changed()
984 connector->name, in check_connector_changed()
986 connector->epoch_counter); in check_connector_changed()
1012 bool drm_connector_helper_hpd_irq_event(struct drm_connector *connector) in drm_connector_helper_hpd_irq_event() argument
1014 struct drm_device *dev = connector->dev; in drm_connector_helper_hpd_irq_event()
1018 changed = check_connector_changed(connector); in drm_connector_helper_hpd_irq_event()
1022 drm_kms_helper_connector_hotplug_event(connector); in drm_connector_helper_hpd_irq_event()
1024 connector->base.id, in drm_connector_helper_hpd_irq_event()
1025 connector->name); in drm_connector_helper_hpd_irq_event()
1061 struct drm_connector *connector, *first_changed_connector = NULL; in drm_helper_hpd_irq_event() local
1070 drm_for_each_connector_iter(connector, &conn_iter) { in drm_helper_hpd_irq_event()
1072 if (!(connector->polled & DRM_CONNECTOR_POLL_HPD)) in drm_helper_hpd_irq_event()
1075 if (check_connector_changed(connector)) { in drm_helper_hpd_irq_event()
1077 drm_connector_get(connector); in drm_helper_hpd_irq_event()
1078 first_changed_connector = connector; in drm_helper_hpd_irq_event()
1137 int drm_connector_helper_get_modes_from_ddc(struct drm_connector *connector) in drm_connector_helper_get_modes_from_ddc() argument
1142 if (!connector->ddc) in drm_connector_helper_get_modes_from_ddc()
1145 edid = drm_get_edid(connector, connector->ddc); in drm_connector_helper_get_modes_from_ddc()
1148 drm_connector_update_edid_property(connector, edid); in drm_connector_helper_get_modes_from_ddc()
1151 count = drm_add_edid_modes(connector, edid); in drm_connector_helper_get_modes_from_ddc()
1171 int drm_connector_helper_get_modes_fixed(struct drm_connector *connector, in drm_connector_helper_get_modes_fixed() argument
1174 struct drm_device *dev = connector->dev; in drm_connector_helper_get_modes_fixed()
1188 drm_mode_probed_add(connector, mode); in drm_connector_helper_get_modes_fixed()
1191 connector->display_info.width_mm = mode->width_mm; in drm_connector_helper_get_modes_fixed()
1193 connector->display_info.height_mm = mode->height_mm; in drm_connector_helper_get_modes_fixed()
1212 int drm_connector_helper_get_modes(struct drm_connector *connector) in drm_connector_helper_get_modes() argument
1217 drm_edid = drm_edid_read(connector); in drm_connector_helper_get_modes()
1225 drm_edid_connector_update(connector, drm_edid); in drm_connector_helper_get_modes()
1227 count = drm_edid_connector_add_modes(connector); in drm_connector_helper_get_modes()
1248 int drm_connector_helper_tv_get_modes(struct drm_connector *connector) in drm_connector_helper_tv_get_modes() argument
1250 struct drm_device *dev = connector->dev; in drm_connector_helper_tv_get_modes()
1253 struct drm_cmdline_mode *cmdline = &connector->cmdline_mode; in drm_connector_helper_tv_get_modes()
1274 if (drm_object_property_get_default_value(&connector->base, in drm_connector_helper_tv_get_modes()
1310 drm_mode_probed_add(connector, mode); in drm_connector_helper_tv_get_modes()