Lines Matching refs:connector

57  * objects and initialized by setting the following fields. The connector is
59 * &struct drm_connector_funcs and a connector type, and then exposed to
63 * connectors to encoders 1:1, the connector should be attached at
76 * Global connector list for drm_connector_find_by_fwnode().
77 * Note drm_connector_[un]register() first take connector->lock and then
133 * drm_get_connector_type_name - return a string for connector type
134 * @type: The connector type (DRM_MODE_CONNECTOR_*)
136 * Returns: the name of the connector type, or NULL if the type is not valid.
149 * @connector: connector to query
151 * The kernel supports per-connector configuration of its consoles through
154 * particular connector. This is typically only used during the early fbdev
157 static void drm_connector_get_cmdline_mode(struct drm_connector *connector)
159 struct drm_cmdline_mode *mode = &connector->cmdline_mode;
162 option = video_get_options(connector->name);
167 connector,
172 DRM_INFO("forcing %s connector %s\n", connector->name,
174 connector->force = mode->force;
178 DRM_INFO("cmdline forces connector %s panel_orientation to %d\n",
179 connector->name, mode->panel_orientation);
180 drm_connector_set_panel_orientation(connector,
184 DRM_DEBUG_KMS("cmdline mode for connector %s %s %dx%d@%dHz%s%s%s\n",
185 connector->name, mode->name,
195 struct drm_connector *connector =
197 struct drm_device *dev = connector->dev;
199 drm_mode_object_unregister(dev, &connector->base);
200 connector->funcs->destroy(connector);
205 struct drm_connector *connector, *n;
216 llist_for_each_entry_safe(connector, n, freed, free_node) {
217 drm_mode_object_unregister(dev, &connector->base);
218 connector->funcs->destroy(connector);
223 struct drm_connector *connector,
237 ret = __drm_mode_object_add(dev, &connector->base,
243 connector->base.properties = &connector->properties;
244 connector->dev = dev;
245 connector->funcs = funcs;
247 /* connector index is used with 32bit bitmasks */
250 DRM_DEBUG_KMS("Failed to allocate %s connector index: %d\n",
255 connector->index = ret;
258 connector->connector_type = connector_type;
259 connector->connector_type_id =
261 if (connector->connector_type_id < 0) {
262 ret = connector->connector_type_id;
265 connector->name =
268 connector->connector_type_id);
269 if (!connector->name) {
275 connector->ddc = ddc;
277 INIT_LIST_HEAD(&connector->head);
278 INIT_LIST_HEAD(&connector->global_connector_list_entry);
279 INIT_LIST_HEAD(&connector->probed_modes);
280 INIT_LIST_HEAD(&connector->modes);
281 mutex_init(&connector->mutex);
282 mutex_init(&connector->eld_mutex);
283 mutex_init(&connector->edid_override_mutex);
284 mutex_init(&connector->hdmi.infoframes.lock);
285 mutex_init(&connector->hdmi_audio.lock);
286 connector->edid_blob_ptr = NULL;
287 connector->epoch_counter = 0;
288 connector->tile_blob_ptr = NULL;
289 connector->status = connector_status_unknown;
290 connector->display_info.panel_orientation =
293 drm_connector_get_cmdline_mode(connector);
297 drm_connector_attach_edid_property(connector);
299 drm_object_attach_property(&connector->base,
302 drm_object_attach_property(&connector->base,
306 drm_object_attach_property(&connector->base,
309 drm_object_attach_property(&connector->base,
314 drm_object_attach_property(&connector->base, config->prop_crtc_id, 0);
317 connector->debugfs_entry = NULL;
320 ida_free(connector_ida, connector->connector_type_id);
323 ida_free(&config->connector_ida, connector->index);
326 drm_mode_object_unregister(dev, &connector->base);
331 static void drm_connector_add(struct drm_connector *connector)
333 struct drm_device *dev = connector->dev;
336 if (drm_WARN_ON(dev, !list_empty(&connector->head)))
340 list_add_tail(&connector->head, &config->connector_list);
345 static void drm_connector_remove(struct drm_connector *connector)
347 struct drm_device *dev = connector->dev;
351 * before the connector is registered and added to the list.
353 if (list_empty(&connector->head))
357 list_del_init(&connector->head);
363 struct drm_connector *connector,
370 ret = drm_connector_init_only(dev, connector, funcs, connector_type, ddc);
374 drm_connector_add(connector);
380 * drm_connector_init - Init a preallocated connector
382 * @connector: the connector to init
383 * @funcs: callbacks for this connector
384 * @connector_type: user visible type of the connector
386 * Initialises a preallocated connector. Connectors should be
387 * subclassed as part of driver connector objects.
390 * should call drm_connector_cleanup() and free the connector structure.
391 * The connector structure should not be allocated with devm_kzalloc().
401 struct drm_connector *connector,
408 return drm_connector_init_and_add(dev, connector, funcs, connector_type, NULL);
413 * drm_connector_dynamic_init - Init a preallocated dynamic connector
415 * @connector: the connector to init
416 * @funcs: callbacks for this connector
417 * @connector_type: user visible type of the connector
420 * Initialises a preallocated dynamic connector. Connectors should be
421 * subclassed as part of driver connector objects. The connector
432 * To remove the connector the driver must call drm_connector_unregister()
435 * drm_connector_cleanup() and free the connector structure.
441 struct drm_connector *connector,
449 return drm_connector_init_only(dev, connector, funcs, connector_type, ddc);
454 * drm_connector_init_with_ddc - Init a preallocated connector
456 * @connector: the connector to init
457 * @funcs: callbacks for this connector
458 * @connector_type: user visible type of the connector
461 * Initialises a preallocated connector. Connectors should be
462 * subclassed as part of driver connector objects.
465 * should call drm_connector_cleanup() and free the connector structure.
466 * The connector structure should not be allocated with devm_kzalloc().
468 * Ensures that the ddc field of the connector is correctly set.
478 struct drm_connector *connector,
486 return drm_connector_init_and_add(dev, connector, funcs, connector_type, ddc);
493 struct drm_connector *connector = ptr;
495 drm_connector_cleanup(connector);
499 * drmm_connector_init - Init a preallocated connector
501 * @connector: the connector to init
502 * @funcs: callbacks for this connector
503 * @connector_type: user visible type of the connector
506 * Initialises a preallocated connector. Connectors should be
507 * subclassed as part of driver connector objects.
512 * The connector structure should be allocated with drmm_kzalloc().
520 struct drm_connector *connector,
530 ret = drm_connector_init_and_add(dev, connector, funcs, connector_type, ddc);
535 connector);
544 * drmm_connector_hdmi_init - Init a preallocated HDMI connector
546 * @connector: A pointer to the HDMI connector to init
549 * @funcs: callbacks for this connector
550 * @hdmi_funcs: HDMI-related callbacks for this connector
551 * @connector_type: user visible type of the connector
554 * @max_bpc: Maximum bits per char the HDMI connector supports
556 * Initialises a preallocated HDMI connector. Connectors can be
557 * subclassed as part of driver connector objects.
562 * The connector structure should be allocated with drmm_kzalloc().
570 struct drm_connector *connector,
595 if (connector->ycbcr_420_allowed != !!(supported_formats & BIT(HDMI_COLORSPACE_YUV420)))
601 ret = drmm_connector_init(dev, connector, funcs, connector_type, ddc);
605 connector->hdmi.supported_formats = supported_formats;
606 strtomem_pad(connector->hdmi.vendor, vendor, 0);
607 strtomem_pad(connector->hdmi.product, product, 0);
611 * connector to have a state.
613 if (connector->funcs->reset)
614 connector->funcs->reset(connector);
616 drm_connector_attach_max_bpc_property(connector, 8, max_bpc);
617 connector->max_bpc = max_bpc;
620 drm_connector_attach_hdr_output_metadata_property(connector);
622 connector->hdmi.funcs = hdmi_funcs;
630 * @connector: the connector
632 * Some connector types like DRM_MODE_CONNECTOR_VIRTUAL do not get a
636 void drm_connector_attach_edid_property(struct drm_connector *connector)
638 struct drm_mode_config *config = &connector->dev->mode_config;
640 drm_object_attach_property(&connector->base,
647 * drm_connector_attach_encoder - attach a connector to an encoder
648 * @connector: connector to attach
649 * @encoder: encoder to attach @connector to
651 * This function links up a connector to an encoder. Note that the routing
658 int drm_connector_attach_encoder(struct drm_connector *connector,
663 * of connector to encoder in simple connector/encoder devices using a
664 * direct assignment of connector->encoder = encoder. This connection
672 if (WARN_ON(connector->encoder))
675 connector->possible_encoders |= drm_encoder_mask(encoder);
682 * drm_connector_has_possible_encoder - check if the connector and encoder are
684 * @connector: the connector
688 * True if @encoder is one of the possible encoders for @connector.
690 bool drm_connector_has_possible_encoder(struct drm_connector *connector,
693 return connector->possible_encoders & drm_encoder_mask(encoder);
697 static void drm_mode_remove(struct drm_connector *connector,
701 drm_mode_destroy(connector->dev, mode);
705 * drm_connector_cleanup - cleans up an initialised connector
706 * @connector: connector to cleanup
708 * Cleans up the connector but doesn't free the object.
710 void drm_connector_cleanup(struct drm_connector *connector)
712 struct drm_device *dev = connector->dev;
715 /* The connector should have been removed from userspace long before
718 if (WARN_ON(connector->registration_state ==
720 drm_connector_unregister(connector);
722 platform_device_unregister(connector->hdmi_audio.codec_pdev);
724 if (connector->privacy_screen) {
725 drm_privacy_screen_put(connector->privacy_screen);
726 connector->privacy_screen = NULL;
729 if (connector->tile_group) {
730 drm_mode_put_tile_group(dev, connector->tile_group);
731 connector->tile_group = NULL;
734 list_for_each_entry_safe(mode, t, &connector->probed_modes, head)
735 drm_mode_remove(connector, mode);
737 list_for_each_entry_safe(mode, t, &connector->modes, head)
738 drm_mode_remove(connector, mode);
740 ida_free(&drm_connector_enum_list[connector->connector_type].ida,
741 connector->connector_type_id);
743 ida_free(&dev->mode_config.connector_ida, connector->index);
745 kfree(connector->display_info.bus_formats);
746 kfree(connector->display_info.vics);
747 drm_mode_object_unregister(dev, &connector->base);
748 kfree(connector->name);
749 connector->name = NULL;
750 fwnode_handle_put(connector->fwnode);
751 connector->fwnode = NULL;
753 drm_connector_remove(connector);
755 WARN_ON(connector->state && !connector->funcs->atomic_destroy_state);
756 if (connector->state && connector->funcs->atomic_destroy_state)
757 connector->funcs->atomic_destroy_state(connector,
758 connector->state);
760 mutex_destroy(&connector->hdmi_audio.lock);
761 mutex_destroy(&connector->hdmi.infoframes.lock);
762 mutex_destroy(&connector->mutex);
764 memset(connector, 0, sizeof(*connector));
772 * drm_connector_register - register a connector
773 * @connector: the connector to register
775 * Register userspace interfaces for a connector. Drivers shouldn't call this
780 * When the connector is no longer available, callers must call
789 int drm_connector_register(struct drm_connector *connector)
793 if (!connector->dev->registered)
796 mutex_lock(&connector->mutex);
797 if (connector->registration_state != DRM_CONNECTOR_INITIALIZING)
800 ret = drm_sysfs_connector_add(connector);
804 drm_debugfs_connector_add(connector);
806 if (connector->funcs->late_register) {
807 ret = connector->funcs->late_register(connector);
812 ret = drm_sysfs_connector_add_late(connector);
816 drm_mode_object_register(connector->dev, &connector->base);
818 connector->registration_state = DRM_CONNECTOR_REGISTERED;
820 /* Let userspace know we have a new connector */
821 drm_sysfs_connector_hotplug_event(connector);
823 if (connector->privacy_screen)
824 drm_privacy_screen_register_notifier(connector->privacy_screen,
825 &connector->privacy_screen_notifier);
828 list_add_tail(&connector->global_connector_list_entry, &connector_list);
833 if (connector->funcs->early_unregister)
834 connector->funcs->early_unregister(connector);
836 drm_debugfs_connector_remove(connector);
837 drm_sysfs_connector_remove(connector);
839 mutex_unlock(&connector->mutex);
845 * drm_connector_dynamic_register - register a dynamic connector
846 * @connector: the connector to register
848 * Register userspace interfaces for a connector. Only call this for connectors
852 * When the connector is no longer available the driver must call
858 int drm_connector_dynamic_register(struct drm_connector *connector)
860 /* Was the connector inited already? */
861 if (WARN_ON(!(connector->funcs && connector->funcs->destroy)))
864 drm_connector_add(connector);
866 return drm_connector_register(connector);
871 * drm_connector_unregister - unregister a connector
872 * @connector: the connector to unregister
874 * Unregister userspace interfaces for a connector. Drivers should call this
883 void drm_connector_unregister(struct drm_connector *connector)
885 mutex_lock(&connector->mutex);
886 if (connector->registration_state != DRM_CONNECTOR_REGISTERED) {
887 mutex_unlock(&connector->mutex);
892 list_del_init(&connector->global_connector_list_entry);
895 if (connector->privacy_screen)
897 connector->privacy_screen,
898 &connector->privacy_screen_notifier);
900 drm_sysfs_connector_remove_early(connector);
902 if (connector->funcs->early_unregister)
903 connector->funcs->early_unregister(connector);
905 drm_debugfs_connector_remove(connector);
906 drm_sysfs_connector_remove(connector);
908 connector->registration_state = DRM_CONNECTOR_UNREGISTERED;
909 mutex_unlock(&connector->mutex);
915 struct drm_connector *connector;
919 drm_for_each_connector_iter(connector, &conn_iter)
920 drm_connector_unregister(connector);
926 struct drm_connector *connector;
931 drm_for_each_connector_iter(connector, &conn_iter) {
932 ret = drm_connector_register(connector);
944 * drm_get_connector_status_name - return a string for connector status
945 * @status: connector status to compute name of
950 * Returns: connector status string
964 * drm_get_connector_force_name - return a string for connector force
965 * @force: connector force to get name of
1011 * Extra-safe connector put function that works in any context. Should only be
1013 * actually release the connector when dropping our final reference.
1030 * drm_connector_list_iter_next - return next connector
1033 * Returns: the next connector for @iter, or NULL when the list walk has
1056 /* loop until it's not a zombie connector */
1165 /* Optional connector properties. */
1364 * drm_hdmi_connector_get_broadcast_rgb_name - Return a string for HDMI connector RGB broadcast selection
1388 * drm_hdmi_connector_get_output_format_name() - Return a string for HDMI connector output format
1405 * DOC: standard connector properties
1422 * Legacy property for setting the power state of the connector. For atomic
1425 * connector is linked to. Drivers should never set this property directly,
1446 * connector is connected to a CRTC. In atomic the DRM core enforces that
1453 * Summarizing: Only set "DPMS" when the connector is known to be enabled,
1465 * parent connector and ``<ports>`` is a hyphen-separated list of DP MST
1469 * Connector tile group property to indicate how a set of DRM connector
1490 * "GOOD" to re-enable the connector.
1496 * When user-space performs an atomic commit on a connector with a "BAD"
1545 * - Kernel sends uevent with the connector id and property id through
1658 * property to the connector during initialization.
1663 * Mode object ID of the &drm_crtc this connector should be connected to.
1704 * connector subtypes. Enum values more or less match with those from main
1705 * connector types.
1751 * Add margins to the connector's viewport. This is typically used to
1821 * drm_mode_create_dvi_i_properties - create DVI-I specific connector properties
1824 * Called by a driver the first time a DVI-I connector is made.
1855 * @connector: drm_connector to attach property
1857 * Called by a driver when DP connector is created.
1859 void drm_connector_attach_dp_subconnector_property(struct drm_connector *connector)
1861 struct drm_mode_config *mode_config = &connector->dev->mode_config;
1865 drm_property_create_enum(connector->dev,
1871 drm_object_attach_property(&connector->base,
1878 * DOC: HDMI connector properties
1888 * The CRTC attached to the connector must be configured by user-space to
1952 * Indicates the TV Mode used on an analog TV connector. The value
2005 * @connector: connector to attach content type property on.
2007 * Called by a driver the first time a HDMI connector is made.
2011 int drm_connector_attach_content_type_property(struct drm_connector *connector)
2013 if (!drm_mode_create_content_type_property(connector->dev))
2014 drm_object_attach_property(&connector->base,
2015 connector->dev->mode_config.content_type_property,
2022 * drm_connector_attach_tv_margin_properties - attach TV connector margin
2024 * @connector: DRM connector
2026 * Called by a driver when it needs to attach TV margin props to a connector.
2029 void drm_connector_attach_tv_margin_properties(struct drm_connector *connector)
2031 struct drm_device *dev = connector->dev;
2033 drm_object_attach_property(&connector->base,
2036 drm_object_attach_property(&connector->base,
2039 drm_object_attach_property(&connector->base,
2042 drm_object_attach_property(&connector->base,
2049 * drm_mode_create_tv_margin_properties - create TV connector margin properties
2052 * Called by a driver's HDMI connector initialization routine, this function
2054 * function for an SDTV connector, it's already called from
2090 * drm_mode_create_tv_properties_legacy - create TV specific connector properties
2096 * the TV specific connector properties for a given device. Caller is
2100 * NOTE: This functions registers the deprecated "mode" connector
2119 * Basic connector properties
2194 * drm_mode_create_tv_properties - create TV specific connector properties
2199 * the TV specific connector properties for a given device.
2321 * from the minimum supported variable refresh rate for the connector.
2330 * @connector: connector to create the vrr_capable property on.
2333 * variable refresh rate capability for a connector.
2339 struct drm_connector *connector)
2341 struct drm_device *dev = connector->dev;
2344 if (!connector->vrr_capable_property) {
2350 connector->vrr_capable_property = prop;
2351 drm_object_attach_property(&connector->base, prop, 0);
2360 * @connector: connector to attach scaling mode property on.
2372 int drm_connector_attach_scaling_mode_property(struct drm_connector *connector,
2375 struct drm_device *dev = connector->dev;
2409 drm_object_attach_property(&connector->base,
2412 connector->scaling_mode_property = scaling_mode_property;
2446 * DOC: standard connector properties
2516 * drm_mode_create_hdmi_colorspace_property() is used for HDMI connector and
2517 * drm_mode_create_dp_colorspace_property() is used for DP connector.
2520 static int drm_mode_create_colorspace_property(struct drm_connector *connector,
2523 struct drm_device *dev = connector->dev;
2528 if (connector->colorspace_property)
2533 connector->base.id, connector->name);
2539 connector->base.id, connector->name);
2553 connector->colorspace_property =
2558 if (!connector->colorspace_property)
2566 * @connector: connector to create the Colorspace property on.
2575 int drm_mode_create_hdmi_colorspace_property(struct drm_connector *connector,
2585 return drm_mode_create_colorspace_property(connector, colorspaces);
2591 * @connector: connector to create the Colorspace property on.
2600 int drm_mode_create_dp_colorspace_property(struct drm_connector *connector,
2610 return drm_mode_create_colorspace_property(connector, colorspaces);
2669 * drm_connector_set_path_property - set tile property on connector
2670 * @connector: connector to set property on.
2674 * connector path. This is mainly used for DisplayPort MST where
2681 int drm_connector_set_path_property(struct drm_connector *connector,
2684 struct drm_device *dev = connector->dev;
2688 &connector->path_blob_ptr,
2691 &connector->base,
2698 * drm_connector_set_tile_property - set tile property on connector
2699 * @connector: connector to set property on.
2701 * This looks up the tile information for a connector, and creates a
2710 int drm_connector_set_tile_property(struct drm_connector *connector)
2712 struct drm_device *dev = connector->dev;
2716 if (!connector->has_tile) {
2718 &connector->tile_blob_ptr,
2721 &connector->base,
2727 connector->tile_group->id, connector->tile_is_single_monitor,
2728 connector->num_h_tile, connector->num_v_tile,
2729 connector->tile_h_loc, connector->tile_v_loc,
2730 connector->tile_h_size, connector->tile_v_size);
2733 &connector->tile_blob_ptr,
2736 &connector->base,
2743 * drm_connector_set_link_status_property - Set link status property of a connector
2744 * @connector: drm connector
2761 void drm_connector_set_link_status_property(struct drm_connector *connector,
2764 struct drm_device *dev = connector->dev;
2767 connector->state->link_status = link_status;
2774 * @connector: connector to attach max bpc property on.
2775 * @min: The minimum bit depth supported by the connector.
2776 * @max: The maximum bit depth supported by the connector.
2778 * This is used to add support for limiting the bit depth on a connector.
2783 int drm_connector_attach_max_bpc_property(struct drm_connector *connector,
2786 struct drm_device *dev = connector->dev;
2789 prop = connector->max_bpc_property;
2795 connector->max_bpc_property = prop;
2798 drm_object_attach_property(&connector->base, prop, max);
2799 connector->state->max_requested_bpc = max;
2800 connector->state->max_bpc = max;
2808 * @connector: connector to attach the property on.
2816 int drm_connector_attach_hdr_output_metadata_property(struct drm_connector *connector)
2818 struct drm_device *dev = connector->dev;
2821 drm_object_attach_property(&connector->base, prop, 0);
2829 * @connector: connector to attach the property on.
2831 * This is used to add support for forcing the RGB range on a connector
2836 int drm_connector_attach_broadcast_rgb_property(struct drm_connector *connector)
2838 struct drm_device *dev = connector->dev;
2841 prop = connector->broadcast_rgb_property;
2850 connector->broadcast_rgb_property = prop;
2853 drm_object_attach_property(&connector->base, prop,
2862 * @connector: connector to attach the property on.
2870 int drm_connector_attach_colorspace_property(struct drm_connector *connector)
2872 struct drm_property *prop = connector->colorspace_property;
2874 drm_object_attach_property(&connector->base, prop, DRM_MODE_COLORIMETRY_DEFAULT);
2882 * @old_state: old connector state to compare
2883 * @new_state: new connector state to compare
2886 * have changed between two different connector state (and thus probably
2910 * capable property for a connector
2911 * @connector: drm connector
2912 * @capable: True if the connector is variable refresh rate capable
2915 * variable refresh rate over a connector.
2918 struct drm_connector *connector, bool capable)
2920 if (!connector->vrr_capable_property)
2923 drm_object_property_set_value(&connector->base,
2924 connector->vrr_capable_property,
2930 * drm_connector_set_panel_orientation - sets the connector's panel_orientation
2931 * @connector: connector for which to set the panel-orientation property.
2934 * This function sets the connector's panel_orientation and attaches
2935 * a "panel orientation" property to the connector.
2937 * Calling this function on a connector where the panel_orientation has
2951 struct drm_connector *connector,
2954 struct drm_device *dev = connector->dev;
2955 struct drm_display_info *info = &connector->display_info;
2980 drm_object_attach_property(&connector->base, prop,
2988 * connector's panel_orientation after checking for quirks
2989 * @connector: connector for which to init the panel-orientation property.
3001 struct drm_connector *connector,
3011 return drm_connector_set_panel_orientation(connector,
3018 * set the connector's panel_orientation from panel's callback.
3019 * @connector: connector for which to init the panel-orientation property.
3029 struct drm_connector *connector,
3039 return drm_connector_set_panel_orientation(connector, orientation);
3053 * @connector: connector for which to create the privacy-screen properties
3056 * hw-state" properties for the connector. They are not attached.
3059 drm_connector_create_privacy_screen_properties(struct drm_connector *connector)
3061 if (connector->privacy_screen_sw_state_property)
3065 connector->privacy_screen_sw_state_property =
3066 drm_property_create_enum(connector->dev, DRM_MODE_PROP_ENUM,
3070 connector->privacy_screen_hw_state_property =
3071 drm_property_create_enum(connector->dev,
3082 * @connector: connector on which to attach the privacy-screen properties
3085 * hw-state" properties to the connector. The initial state of both is set
3089 drm_connector_attach_privacy_screen_properties(struct drm_connector *connector)
3091 if (!connector->privacy_screen_sw_state_property)
3094 drm_object_attach_property(&connector->base,
3095 connector->privacy_screen_sw_state_property,
3098 drm_object_attach_property(&connector->base,
3099 connector->privacy_screen_hw_state_property,
3105 struct drm_connector *connector, bool set_sw_state)
3109 drm_privacy_screen_get_state(connector->privacy_screen,
3113 connector->state->privacy_screen_sw_state = sw_state;
3114 drm_object_property_set_value(&connector->base,
3115 connector->privacy_screen_hw_state_property, hw_state);
3121 struct drm_connector *connector =
3123 struct drm_device *dev = connector->dev;
3126 drm_connector_update_privacy_screen_properties(connector, true);
3129 drm_sysfs_connector_property_event(connector,
3130 connector->privacy_screen_sw_state_property);
3131 drm_sysfs_connector_property_event(connector,
3132 connector->privacy_screen_hw_state_property);
3139 * the connector
3140 * @connector: connector to attach the privacy-screen to
3144 * a generic notifier for generating sysfs-connector-status-events
3147 * call drm_privacy_screen_put() on it when the connector is destroyed.
3150 struct drm_connector *connector, struct drm_privacy_screen *priv)
3152 connector->privacy_screen = priv;
3153 connector->privacy_screen_notifier.notifier_call =
3156 drm_connector_create_privacy_screen_properties(connector);
3157 drm_connector_update_privacy_screen_properties(connector, true);
3158 drm_connector_attach_privacy_screen_properties(connector);
3163 * drm_connector_update_privacy_screen - update connector's privacy-screen sw-state
3164 * @connector_state: connector-state to update the privacy-screen for
3166 * This function calls drm_privacy_screen_set_sw_state() on the connector's
3169 * If the connector has no privacy-screen, then this is a no-op.
3173 struct drm_connector *connector = connector_state->connector;
3176 if (!connector->privacy_screen)
3179 ret = drm_privacy_screen_set_sw_state(connector->privacy_screen,
3182 drm_err(connector->dev, "Error updating privacy-screen sw_state\n");
3187 drm_connector_update_privacy_screen_properties(connector, false);
3196 struct drm_connector *connector = obj_to_connector(obj);
3199 if (property == connector->dev->mode_config.dpms_property) {
3200 ret = (*connector->funcs->dpms)(connector, (int)value);
3201 } else if (connector->funcs->set_property)
3202 ret = connector->funcs->set_property(connector, property, value);
3205 drm_object_property_set_value(&connector->base, property, value);
3224 static struct drm_encoder *drm_connector_get_encoder(struct drm_connector *connector)
3229 if (connector->state)
3230 return connector->state->best_encoder;
3231 return connector->encoder;
3272 struct drm_connector *connector;
3289 connector = drm_connector_lookup(dev, file_priv, out_resp->connector_id);
3290 if (!connector)
3293 encoders_count = hweight32(connector->possible_encoders);
3299 drm_connector_for_each_possible_encoder(connector, encoder) {
3309 out_resp->connector_id = connector->base.id;
3310 out_resp->connector_type = connector->connector_type;
3311 out_resp->connector_type_id = connector->connector_type_id;
3318 connector->funcs->fill_modes(connector,
3323 connector->base.id, connector->name);
3326 out_resp->mm_width = connector->display_info.width_mm;
3327 out_resp->mm_height = connector->display_info.height_mm;
3328 out_resp->subpixel = connector->display_info.subpixel_order;
3329 out_resp->connection = connector->status;
3332 list_for_each_entry(mode, &connector->modes, head) {
3335 if (drm_mode_expose_to_userspace(mode, &connector->modes,
3349 list_for_each_entry(mode, &connector->modes, head) {
3371 list_for_each_entry_continue(mode, &connector->modes, head)
3382 list_for_each_entry(mode, &connector->modes, head)
3390 encoder = drm_connector_get_encoder(connector);
3399 ret = drm_mode_object_get_properties(&connector->base, file_priv->atomic,
3406 drm_connector_put(connector);
3412 * drm_connector_find_by_fwnode - Find a connector based on the associated fwnode
3416 * a connector is found a reference to the connector is returned. The caller must
3418 * connector.
3420 * Returns: A reference to the found connector or an ERR_PTR().
3424 struct drm_connector *connector, *found = ERR_PTR(-ENODEV);
3431 list_for_each_entry(connector, &connector_list, global_connector_list_entry) {
3432 if (connector->fwnode == fwnode ||
3433 (connector->fwnode && connector->fwnode->secondary == fwnode)) {
3434 drm_connector_get(connector);
3435 found = connector;
3446 * drm_connector_oob_hotplug_event - Report out-of-band hotplug event to connector
3461 struct drm_connector *connector;
3463 connector = drm_connector_find_by_fwnode(connector_fwnode);
3464 if (IS_ERR(connector))
3467 if (connector->funcs->oob_hotplug_event)
3468 connector->funcs->oob_hotplug_event(connector, status);
3470 drm_connector_put(connector);