Lines Matching full:connector

54  * objects and initialized by setting the following fields. The connector is
56 * &struct drm_connector_funcs and a connector type, and then exposed to
60 * connectors to encoders 1:1, the connector should be attached at
73 * Global connector list for drm_connector_find_by_fwnode().
74 * Note drm_connector_[un]register() first take connector->lock and then
87 * Connector and encoder types.
130 * drm_get_connector_type_name - return a string for connector type
131 * @type: The connector type (DRM_MODE_CONNECTOR_*)
133 * Returns: the name of the connector type, or NULL if the type is not valid.
146 * @connector: connector to query
148 * The kernel supports per-connector configuration of its consoles through
151 * particular connector. This is typically only used during the early fbdev
154 static void drm_connector_get_cmdline_mode(struct drm_connector *connector) in drm_connector_get_cmdline_mode() argument
156 struct drm_cmdline_mode *mode = &connector->cmdline_mode; in drm_connector_get_cmdline_mode()
159 if (fb_get_options(connector->name, &option)) in drm_connector_get_cmdline_mode()
163 connector, in drm_connector_get_cmdline_mode()
168 DRM_INFO("forcing %s connector %s\n", connector->name, in drm_connector_get_cmdline_mode()
170 connector->force = mode->force; in drm_connector_get_cmdline_mode()
174 DRM_INFO("cmdline forces connector %s panel_orientation to %d\n", in drm_connector_get_cmdline_mode()
175 connector->name, mode->panel_orientation); in drm_connector_get_cmdline_mode()
176 drm_connector_set_panel_orientation(connector, in drm_connector_get_cmdline_mode()
180 DRM_DEBUG_KMS("cmdline mode for connector %s %s %dx%d@%dHz%s%s%s\n", in drm_connector_get_cmdline_mode()
181 connector->name, mode->name, in drm_connector_get_cmdline_mode()
191 struct drm_connector *connector = in drm_connector_free() local
193 struct drm_device *dev = connector->dev; in drm_connector_free()
195 drm_mode_object_unregister(dev, &connector->base); in drm_connector_free()
196 connector->funcs->destroy(connector); in drm_connector_free()
201 struct drm_connector *connector, *n; in drm_connector_free_work_fn() local
212 llist_for_each_entry_safe(connector, n, freed, free_node) { in drm_connector_free_work_fn()
213 drm_mode_object_unregister(dev, &connector->base); in drm_connector_free_work_fn()
214 connector->funcs->destroy(connector); in drm_connector_free_work_fn()
219 struct drm_connector *connector, in __drm_connector_init() argument
233 ret = __drm_mode_object_add(dev, &connector->base, in __drm_connector_init()
239 connector->base.properties = &connector->properties; in __drm_connector_init()
240 connector->dev = dev; in __drm_connector_init()
241 connector->funcs = funcs; in __drm_connector_init()
243 /* connector index is used with 32bit bitmasks */ in __drm_connector_init()
246 DRM_DEBUG_KMS("Failed to allocate %s connector index: %d\n", in __drm_connector_init()
251 connector->index = ret; in __drm_connector_init()
254 connector->connector_type = connector_type; in __drm_connector_init()
255 connector->connector_type_id = in __drm_connector_init()
257 if (connector->connector_type_id < 0) { in __drm_connector_init()
258 ret = connector->connector_type_id; in __drm_connector_init()
261 connector->name = in __drm_connector_init()
264 connector->connector_type_id); in __drm_connector_init()
265 if (!connector->name) { in __drm_connector_init()
271 connector->ddc = ddc; in __drm_connector_init()
273 INIT_LIST_HEAD(&connector->global_connector_list_entry); in __drm_connector_init()
274 INIT_LIST_HEAD(&connector->probed_modes); in __drm_connector_init()
275 INIT_LIST_HEAD(&connector->modes); in __drm_connector_init()
276 mutex_init(&connector->mutex); in __drm_connector_init()
277 connector->edid_blob_ptr = NULL; in __drm_connector_init()
278 connector->epoch_counter = 0; in __drm_connector_init()
279 connector->tile_blob_ptr = NULL; in __drm_connector_init()
280 connector->status = connector_status_unknown; in __drm_connector_init()
281 connector->display_info.panel_orientation = in __drm_connector_init()
284 drm_connector_get_cmdline_mode(connector); in __drm_connector_init()
286 /* We should add connectors at the end to avoid upsetting the connector in __drm_connector_init()
290 list_add_tail(&connector->head, &config->connector_list); in __drm_connector_init()
296 drm_connector_attach_edid_property(connector); in __drm_connector_init()
298 drm_object_attach_property(&connector->base, in __drm_connector_init()
301 drm_object_attach_property(&connector->base, in __drm_connector_init()
305 drm_object_attach_property(&connector->base, in __drm_connector_init()
308 drm_object_attach_property(&connector->base, in __drm_connector_init()
313 drm_object_attach_property(&connector->base, config->prop_crtc_id, 0); in __drm_connector_init()
316 connector->debugfs_entry = NULL; in __drm_connector_init()
319 ida_free(connector_ida, connector->connector_type_id); in __drm_connector_init()
322 ida_free(&config->connector_ida, connector->index); in __drm_connector_init()
325 drm_mode_object_unregister(dev, &connector->base); in __drm_connector_init()
331 * drm_connector_init - Init a preallocated connector
333 * @connector: the connector to init
334 * @funcs: callbacks for this connector
335 * @connector_type: user visible type of the connector
337 * Initialises a preallocated connector. Connectors should be
338 * subclassed as part of driver connector objects.
341 * should call drm_connector_cleanup() and free the connector structure.
342 * The connector structure should not be allocated with devm_kzalloc().
352 struct drm_connector *connector, in drm_connector_init() argument
359 return __drm_connector_init(dev, connector, funcs, connector_type, NULL); in drm_connector_init()
364 * drm_connector_init_with_ddc - Init a preallocated connector
366 * @connector: the connector to init
367 * @funcs: callbacks for this connector
368 * @connector_type: user visible type of the connector
371 * Initialises a preallocated connector. Connectors should be
372 * subclassed as part of driver connector objects.
375 * should call drm_connector_cleanup() and free the connector structure.
376 * The connector structure should not be allocated with devm_kzalloc().
378 * Ensures that the ddc field of the connector is correctly set.
388 struct drm_connector *connector, in drm_connector_init_with_ddc() argument
396 return __drm_connector_init(dev, connector, funcs, connector_type, ddc); in drm_connector_init_with_ddc()
403 struct drm_connector *connector = ptr; in drm_connector_cleanup_action() local
405 drm_connector_cleanup(connector); in drm_connector_cleanup_action()
409 * drmm_connector_init - Init a preallocated connector
411 * @connector: the connector to init
412 * @funcs: callbacks for this connector
413 * @connector_type: user visible type of the connector
416 * Initialises a preallocated connector. Connectors should be
417 * subclassed as part of driver connector objects.
422 * The connector structure should be allocated with drmm_kzalloc().
428 struct drm_connector *connector, in drmm_connector_init() argument
438 ret = __drm_connector_init(dev, connector, funcs, connector_type, ddc); in drmm_connector_init()
443 connector); in drmm_connector_init()
453 * @connector: the connector
455 * Some connector types like DRM_MODE_CONNECTOR_VIRTUAL do not get a
459 void drm_connector_attach_edid_property(struct drm_connector *connector) in drm_connector_attach_edid_property() argument
461 struct drm_mode_config *config = &connector->dev->mode_config; in drm_connector_attach_edid_property()
463 drm_object_attach_property(&connector->base, in drm_connector_attach_edid_property()
470 * drm_connector_attach_encoder - attach a connector to an encoder
471 * @connector: connector to attach
472 * @encoder: encoder to attach @connector to
474 * This function links up a connector to an encoder. Note that the routing
481 int drm_connector_attach_encoder(struct drm_connector *connector, in drm_connector_attach_encoder() argument
486 * of connector to encoder in simple connector/encoder devices using a in drm_connector_attach_encoder()
487 * direct assignment of connector->encoder = encoder. This connection in drm_connector_attach_encoder()
495 if (WARN_ON(connector->encoder)) in drm_connector_attach_encoder()
498 connector->possible_encoders |= drm_encoder_mask(encoder); in drm_connector_attach_encoder()
505 * drm_connector_has_possible_encoder - check if the connector and encoder are
507 * @connector: the connector
511 * True if @encoder is one of the possible encoders for @connector.
513 bool drm_connector_has_possible_encoder(struct drm_connector *connector, in drm_connector_has_possible_encoder() argument
516 return connector->possible_encoders & drm_encoder_mask(encoder); in drm_connector_has_possible_encoder()
520 static void drm_mode_remove(struct drm_connector *connector, in drm_mode_remove() argument
524 drm_mode_destroy(connector->dev, mode); in drm_mode_remove()
528 * drm_connector_cleanup - cleans up an initialised connector
529 * @connector: connector to cleanup
531 * Cleans up the connector but doesn't free the object.
533 void drm_connector_cleanup(struct drm_connector *connector) in drm_connector_cleanup() argument
535 struct drm_device *dev = connector->dev; in drm_connector_cleanup()
538 /* The connector should have been removed from userspace long before in drm_connector_cleanup()
541 if (WARN_ON(connector->registration_state == in drm_connector_cleanup()
543 drm_connector_unregister(connector); in drm_connector_cleanup()
545 if (connector->privacy_screen) { in drm_connector_cleanup()
546 drm_privacy_screen_put(connector->privacy_screen); in drm_connector_cleanup()
547 connector->privacy_screen = NULL; in drm_connector_cleanup()
550 if (connector->tile_group) { in drm_connector_cleanup()
551 drm_mode_put_tile_group(dev, connector->tile_group); in drm_connector_cleanup()
552 connector->tile_group = NULL; in drm_connector_cleanup()
555 list_for_each_entry_safe(mode, t, &connector->probed_modes, head) in drm_connector_cleanup()
556 drm_mode_remove(connector, mode); in drm_connector_cleanup()
558 list_for_each_entry_safe(mode, t, &connector->modes, head) in drm_connector_cleanup()
559 drm_mode_remove(connector, mode); in drm_connector_cleanup()
561 ida_free(&drm_connector_enum_list[connector->connector_type].ida, in drm_connector_cleanup()
562 connector->connector_type_id); in drm_connector_cleanup()
564 ida_free(&dev->mode_config.connector_ida, connector->index); in drm_connector_cleanup()
566 kfree(connector->display_info.bus_formats); in drm_connector_cleanup()
567 drm_mode_object_unregister(dev, &connector->base); in drm_connector_cleanup()
568 kfree(connector->name); in drm_connector_cleanup()
569 connector->name = NULL; in drm_connector_cleanup()
570 fwnode_handle_put(connector->fwnode); in drm_connector_cleanup()
571 connector->fwnode = NULL; in drm_connector_cleanup()
573 list_del(&connector->head); in drm_connector_cleanup()
577 WARN_ON(connector->state && !connector->funcs->atomic_destroy_state); in drm_connector_cleanup()
578 if (connector->state && connector->funcs->atomic_destroy_state) in drm_connector_cleanup()
579 connector->funcs->atomic_destroy_state(connector, in drm_connector_cleanup()
580 connector->state); in drm_connector_cleanup()
582 mutex_destroy(&connector->mutex); in drm_connector_cleanup()
584 memset(connector, 0, sizeof(*connector)); in drm_connector_cleanup()
589 * drm_connector_register - register a connector
590 * @connector: the connector to register
592 * Register userspace interfaces for a connector. Only call this for connectors
597 * When the connector is no longer available, callers must call
603 int drm_connector_register(struct drm_connector *connector) in drm_connector_register() argument
607 if (!connector->dev->registered) in drm_connector_register()
610 mutex_lock(&connector->mutex); in drm_connector_register()
611 if (connector->registration_state != DRM_CONNECTOR_INITIALIZING) in drm_connector_register()
614 ret = drm_sysfs_connector_add(connector); in drm_connector_register()
618 drm_debugfs_connector_add(connector); in drm_connector_register()
620 if (connector->funcs->late_register) { in drm_connector_register()
621 ret = connector->funcs->late_register(connector); in drm_connector_register()
626 drm_mode_object_register(connector->dev, &connector->base); in drm_connector_register()
628 connector->registration_state = DRM_CONNECTOR_REGISTERED; in drm_connector_register()
630 /* Let userspace know we have a new connector */ in drm_connector_register()
631 drm_sysfs_connector_hotplug_event(connector); in drm_connector_register()
633 if (connector->privacy_screen) in drm_connector_register()
634 drm_privacy_screen_register_notifier(connector->privacy_screen, in drm_connector_register()
635 &connector->privacy_screen_notifier); in drm_connector_register()
638 list_add_tail(&connector->global_connector_list_entry, &connector_list); in drm_connector_register()
643 drm_debugfs_connector_remove(connector); in drm_connector_register()
644 drm_sysfs_connector_remove(connector); in drm_connector_register()
646 mutex_unlock(&connector->mutex); in drm_connector_register()
652 * drm_connector_unregister - unregister a connector
653 * @connector: the connector to unregister
655 * Unregister userspace interfaces for a connector. Only call this for
659 void drm_connector_unregister(struct drm_connector *connector) in drm_connector_unregister() argument
661 mutex_lock(&connector->mutex); in drm_connector_unregister()
662 if (connector->registration_state != DRM_CONNECTOR_REGISTERED) { in drm_connector_unregister()
663 mutex_unlock(&connector->mutex); in drm_connector_unregister()
668 list_del_init(&connector->global_connector_list_entry); in drm_connector_unregister()
671 if (connector->privacy_screen) in drm_connector_unregister()
673 connector->privacy_screen, in drm_connector_unregister()
674 &connector->privacy_screen_notifier); in drm_connector_unregister()
676 if (connector->funcs->early_unregister) in drm_connector_unregister()
677 connector->funcs->early_unregister(connector); in drm_connector_unregister()
679 drm_sysfs_connector_remove(connector); in drm_connector_unregister()
680 drm_debugfs_connector_remove(connector); in drm_connector_unregister()
682 connector->registration_state = DRM_CONNECTOR_UNREGISTERED; in drm_connector_unregister()
683 mutex_unlock(&connector->mutex); in drm_connector_unregister()
689 struct drm_connector *connector; in drm_connector_unregister_all() local
693 drm_for_each_connector_iter(connector, &conn_iter) in drm_connector_unregister_all()
694 drm_connector_unregister(connector); in drm_connector_unregister_all()
700 struct drm_connector *connector; in drm_connector_register_all() local
705 drm_for_each_connector_iter(connector, &conn_iter) { in drm_connector_register_all()
706 ret = drm_connector_register(connector); in drm_connector_register_all()
718 * drm_get_connector_status_name - return a string for connector status
719 * @status: connector status to compute name of
724 * Returns: connector status string
738 * drm_get_connector_force_name - return a string for connector force
739 * @force: connector force to get name of
785 * Extra-safe connector put function that works in any context. Should only be
787 * actually release the connector when dropping our final reference.
804 * drm_connector_list_iter_next - return next connector
807 * Returns: the next connector for @iter, or NULL when the list walk has
830 /* loop until it's not a zombie connector */ in drm_connector_list_iter_next()
939 /* Optional connector properties. */
1075 * DOC: standard connector properties
1092 * Legacy property for setting the power state of the connector. For atomic
1095 * connector is linked to. Drivers should never set this property directly,
1112 * connector is connected to a CRTC. In atomic the DRM core enforces that
1119 * Summarizing: Only set "DPMS" when the connector is known to be enabled,
1123 * Connector path property to identify how this sink is physically
1129 * Connector tile group property to indicate how a set of DRM connector
1139 * Connector link-status property to indicate the status of link. The
1150 * "GOOD" to re-enable the connector.
1156 * When user-space performs an atomic commit on a connector with a "BAD"
1205 * - Kernel sends uevent with the connector id and property id through
1273 * Connector property to enable userspace to send HDR Metadata to
1318 * property to the connector during initialization.
1323 * Mode object ID of the &drm_crtc this connector should be connected to.
1364 * connector subtypes. Enum values more or less match with those from main
1365 * connector types.
1467 * drm_mode_create_dvi_i_properties - create DVI-I specific connector properties
1470 * Called by a driver the first time a DVI-I connector is made.
1501 * @connector: drm_connector to attach property
1503 * Called by a driver when DP connector is created.
1505 void drm_connector_attach_dp_subconnector_property(struct drm_connector *connector) in drm_connector_attach_dp_subconnector_property() argument
1507 struct drm_mode_config *mode_config = &connector->dev->mode_config; in drm_connector_attach_dp_subconnector_property()
1511 drm_property_create_enum(connector->dev, in drm_connector_attach_dp_subconnector_property()
1517 drm_object_attach_property(&connector->base, in drm_connector_attach_dp_subconnector_property()
1524 * DOC: HDMI connector properties
1553 * @connector: connector to attach content type property on.
1555 * Called by a driver the first time a HDMI connector is made.
1559 int drm_connector_attach_content_type_property(struct drm_connector *connector) in drm_connector_attach_content_type_property() argument
1561 if (!drm_mode_create_content_type_property(connector->dev)) in drm_connector_attach_content_type_property()
1562 drm_object_attach_property(&connector->base, in drm_connector_attach_content_type_property()
1563 connector->dev->mode_config.content_type_property, in drm_connector_attach_content_type_property()
1570 * drm_connector_attach_tv_margin_properties - attach TV connector margin
1572 * @connector: DRM connector
1574 * Called by a driver when it needs to attach TV margin props to a connector.
1577 void drm_connector_attach_tv_margin_properties(struct drm_connector *connector) in drm_connector_attach_tv_margin_properties() argument
1579 struct drm_device *dev = connector->dev; in drm_connector_attach_tv_margin_properties()
1581 drm_object_attach_property(&connector->base, in drm_connector_attach_tv_margin_properties()
1584 drm_object_attach_property(&connector->base, in drm_connector_attach_tv_margin_properties()
1587 drm_object_attach_property(&connector->base, in drm_connector_attach_tv_margin_properties()
1590 drm_object_attach_property(&connector->base, in drm_connector_attach_tv_margin_properties()
1597 * drm_mode_create_tv_margin_properties - create TV connector margin properties
1600 * Called by a driver's HDMI connector initialization routine, this function
1602 * function for an SDTV connector, it's already called from
1638 * drm_mode_create_tv_properties - create TV specific connector properties
1644 * the TV specific connector properties for a given device. Caller is
1663 * Basic connector properties in drm_mode_create_tv_properties()
1822 * from the minimum supported variable refresh rate for the connector.
1831 * @connector: connector to create the vrr_capable property on.
1834 * variable refresh rate capability for a connector.
1840 struct drm_connector *connector) in drm_connector_attach_vrr_capable_property() argument
1842 struct drm_device *dev = connector->dev; in drm_connector_attach_vrr_capable_property()
1845 if (!connector->vrr_capable_property) { in drm_connector_attach_vrr_capable_property()
1851 connector->vrr_capable_property = prop; in drm_connector_attach_vrr_capable_property()
1852 drm_object_attach_property(&connector->base, prop, 0); in drm_connector_attach_vrr_capable_property()
1861 * @connector: connector to attach scaling mode property on.
1873 int drm_connector_attach_scaling_mode_property(struct drm_connector *connector, in drm_connector_attach_scaling_mode_property() argument
1876 struct drm_device *dev = connector->dev; in drm_connector_attach_scaling_mode_property()
1910 drm_object_attach_property(&connector->base, in drm_connector_attach_scaling_mode_property()
1913 connector->scaling_mode_property = scaling_mode_property; in drm_connector_attach_scaling_mode_property()
1947 * DOC: standard connector properties
1970 * drm_mode_create_hdmi_colorspace_property() is used for HDMI connector and
1971 * drm_mode_create_dp_colorspace_property() is used for DP connector.
1976 * @connector: connector to create the Colorspace property on.
1984 int drm_mode_create_hdmi_colorspace_property(struct drm_connector *connector) in drm_mode_create_hdmi_colorspace_property() argument
1986 struct drm_device *dev = connector->dev; in drm_mode_create_hdmi_colorspace_property()
1988 if (connector->colorspace_property) in drm_mode_create_hdmi_colorspace_property()
1991 connector->colorspace_property = in drm_mode_create_hdmi_colorspace_property()
1996 if (!connector->colorspace_property) in drm_mode_create_hdmi_colorspace_property()
2005 * @connector: connector to create the Colorspace property on.
2013 int drm_mode_create_dp_colorspace_property(struct drm_connector *connector) in drm_mode_create_dp_colorspace_property() argument
2015 struct drm_device *dev = connector->dev; in drm_mode_create_dp_colorspace_property()
2017 if (connector->colorspace_property) in drm_mode_create_dp_colorspace_property()
2020 connector->colorspace_property = in drm_mode_create_dp_colorspace_property()
2025 if (!connector->colorspace_property) in drm_mode_create_dp_colorspace_property()
2087 * drm_connector_set_path_property - set tile property on connector
2088 * @connector: connector to set property on.
2092 * connector path. This is mainly used for DisplayPort MST where
2099 int drm_connector_set_path_property(struct drm_connector *connector, in drm_connector_set_path_property() argument
2102 struct drm_device *dev = connector->dev; in drm_connector_set_path_property()
2106 &connector->path_blob_ptr, in drm_connector_set_path_property()
2109 &connector->base, in drm_connector_set_path_property()
2116 * drm_connector_set_tile_property - set tile property on connector
2117 * @connector: connector to set property on.
2119 * This looks up the tile information for a connector, and creates a
2128 int drm_connector_set_tile_property(struct drm_connector *connector) in drm_connector_set_tile_property() argument
2130 struct drm_device *dev = connector->dev; in drm_connector_set_tile_property()
2134 if (!connector->has_tile) { in drm_connector_set_tile_property()
2136 &connector->tile_blob_ptr, in drm_connector_set_tile_property()
2139 &connector->base, in drm_connector_set_tile_property()
2145 connector->tile_group->id, connector->tile_is_single_monitor, in drm_connector_set_tile_property()
2146 connector->num_h_tile, connector->num_v_tile, in drm_connector_set_tile_property()
2147 connector->tile_h_loc, connector->tile_v_loc, in drm_connector_set_tile_property()
2148 connector->tile_h_size, connector->tile_v_size); in drm_connector_set_tile_property()
2151 &connector->tile_blob_ptr, in drm_connector_set_tile_property()
2154 &connector->base, in drm_connector_set_tile_property()
2161 * drm_connector_set_link_status_property - Set link status property of a connector
2162 * @connector: drm connector
2179 void drm_connector_set_link_status_property(struct drm_connector *connector, in drm_connector_set_link_status_property() argument
2182 struct drm_device *dev = connector->dev; in drm_connector_set_link_status_property()
2185 connector->state->link_status = link_status; in drm_connector_set_link_status_property()
2192 * @connector: connector to attach max bpc property on.
2193 * @min: The minimum bit depth supported by the connector.
2194 * @max: The maximum bit depth supported by the connector.
2196 * This is used to add support for limiting the bit depth on a connector.
2201 int drm_connector_attach_max_bpc_property(struct drm_connector *connector, in drm_connector_attach_max_bpc_property() argument
2204 struct drm_device *dev = connector->dev; in drm_connector_attach_max_bpc_property()
2207 prop = connector->max_bpc_property; in drm_connector_attach_max_bpc_property()
2213 connector->max_bpc_property = prop; in drm_connector_attach_max_bpc_property()
2216 drm_object_attach_property(&connector->base, prop, max); in drm_connector_attach_max_bpc_property()
2217 connector->state->max_requested_bpc = max; in drm_connector_attach_max_bpc_property()
2218 connector->state->max_bpc = max; in drm_connector_attach_max_bpc_property()
2226 * @connector: connector to attach the property on.
2234 int drm_connector_attach_hdr_output_metadata_property(struct drm_connector *connector) in drm_connector_attach_hdr_output_metadata_property() argument
2236 struct drm_device *dev = connector->dev; in drm_connector_attach_hdr_output_metadata_property()
2239 drm_object_attach_property(&connector->base, prop, 0); in drm_connector_attach_hdr_output_metadata_property()
2247 * @connector: connector to attach the property on.
2255 int drm_connector_attach_colorspace_property(struct drm_connector *connector) in drm_connector_attach_colorspace_property() argument
2257 struct drm_property *prop = connector->colorspace_property; in drm_connector_attach_colorspace_property()
2259 drm_object_attach_property(&connector->base, prop, DRM_MODE_COLORIMETRY_DEFAULT); in drm_connector_attach_colorspace_property()
2267 * @old_state: old connector state to compare
2268 * @new_state: new connector state to compare
2271 * have changed between two different connector state (and thus probably
2295 * capable property for a connector
2296 * @connector: drm connector
2297 * @capable: True if the connector is variable refresh rate capable
2300 * variable refresh rate over a connector.
2303 struct drm_connector *connector, bool capable) in drm_connector_set_vrr_capable_property() argument
2305 if (!connector->vrr_capable_property) in drm_connector_set_vrr_capable_property()
2308 drm_object_property_set_value(&connector->base, in drm_connector_set_vrr_capable_property()
2309 connector->vrr_capable_property, in drm_connector_set_vrr_capable_property()
2315 * drm_connector_set_panel_orientation - sets the connector's panel_orientation
2316 * @connector: connector for which to set the panel-orientation property.
2319 * This function sets the connector's panel_orientation and attaches
2320 * a "panel orientation" property to the connector.
2322 * Calling this function on a connector where the panel_orientation has
2336 struct drm_connector *connector, in drm_connector_set_panel_orientation() argument
2339 struct drm_device *dev = connector->dev; in drm_connector_set_panel_orientation()
2340 struct drm_display_info *info = &connector->display_info; in drm_connector_set_panel_orientation()
2365 drm_object_attach_property(&connector->base, prop, in drm_connector_set_panel_orientation()
2373 * connector's panel_orientation after checking for quirks
2374 * @connector: connector for which to init the panel-orientation property.
2386 struct drm_connector *connector, in drm_connector_set_panel_orientation_with_quirk() argument
2396 return drm_connector_set_panel_orientation(connector, in drm_connector_set_panel_orientation_with_quirk()
2403 * set the connector's panel_orientation from panel's callback.
2404 * @connector: connector for which to init the panel-orientation property.
2414 struct drm_connector *connector, in drm_connector_set_orientation_from_panel() argument
2424 return drm_connector_set_panel_orientation(connector, orientation); in drm_connector_set_orientation_from_panel()
2438 * @connector: connector for which to create the privacy-screen properties
2441 * hw-state" properties for the connector. They are not attached.
2444 drm_connector_create_privacy_screen_properties(struct drm_connector *connector) in drm_connector_create_privacy_screen_properties() argument
2446 if (connector->privacy_screen_sw_state_property) in drm_connector_create_privacy_screen_properties()
2450 connector->privacy_screen_sw_state_property = in drm_connector_create_privacy_screen_properties()
2451 drm_property_create_enum(connector->dev, DRM_MODE_PROP_ENUM, in drm_connector_create_privacy_screen_properties()
2455 connector->privacy_screen_hw_state_property = in drm_connector_create_privacy_screen_properties()
2456 drm_property_create_enum(connector->dev, in drm_connector_create_privacy_screen_properties()
2467 * @connector: connector on which to attach the privacy-screen properties
2470 * hw-state" properties to the connector. The initial state of both is set
2474 drm_connector_attach_privacy_screen_properties(struct drm_connector *connector) in drm_connector_attach_privacy_screen_properties() argument
2476 if (!connector->privacy_screen_sw_state_property) in drm_connector_attach_privacy_screen_properties()
2479 drm_object_attach_property(&connector->base, in drm_connector_attach_privacy_screen_properties()
2480 connector->privacy_screen_sw_state_property, in drm_connector_attach_privacy_screen_properties()
2483 drm_object_attach_property(&connector->base, in drm_connector_attach_privacy_screen_properties()
2484 connector->privacy_screen_hw_state_property, in drm_connector_attach_privacy_screen_properties()
2490 struct drm_connector *connector, bool set_sw_state) in drm_connector_update_privacy_screen_properties() argument
2494 drm_privacy_screen_get_state(connector->privacy_screen, in drm_connector_update_privacy_screen_properties()
2498 connector->state->privacy_screen_sw_state = sw_state; in drm_connector_update_privacy_screen_properties()
2499 drm_object_property_set_value(&connector->base, in drm_connector_update_privacy_screen_properties()
2500 connector->privacy_screen_hw_state_property, hw_state); in drm_connector_update_privacy_screen_properties()
2506 struct drm_connector *connector = in drm_connector_privacy_screen_notifier() local
2508 struct drm_device *dev = connector->dev; in drm_connector_privacy_screen_notifier()
2511 drm_connector_update_privacy_screen_properties(connector, true); in drm_connector_privacy_screen_notifier()
2514 drm_sysfs_connector_status_event(connector, in drm_connector_privacy_screen_notifier()
2515 connector->privacy_screen_sw_state_property); in drm_connector_privacy_screen_notifier()
2516 drm_sysfs_connector_status_event(connector, in drm_connector_privacy_screen_notifier()
2517 connector->privacy_screen_hw_state_property); in drm_connector_privacy_screen_notifier()
2524 * the connector
2525 * @connector: connector to attach the privacy-screen to
2529 * a generic notifier for generating sysfs-connector-status-events
2532 * call drm_privacy_screen_put() on it when the connector is destroyed.
2535 struct drm_connector *connector, struct drm_privacy_screen *priv) in drm_connector_attach_privacy_screen_provider() argument
2537 connector->privacy_screen = priv; in drm_connector_attach_privacy_screen_provider()
2538 connector->privacy_screen_notifier.notifier_call = in drm_connector_attach_privacy_screen_provider()
2541 drm_connector_create_privacy_screen_properties(connector); in drm_connector_attach_privacy_screen_provider()
2542 drm_connector_update_privacy_screen_properties(connector, true); in drm_connector_attach_privacy_screen_provider()
2543 drm_connector_attach_privacy_screen_properties(connector); in drm_connector_attach_privacy_screen_provider()
2548 * drm_connector_update_privacy_screen - update connector's privacy-screen sw-state
2549 * @connector_state: connector-state to update the privacy-screen for
2551 * This function calls drm_privacy_screen_set_sw_state() on the connector's
2554 * If the connector has no privacy-screen, then this is a no-op.
2558 struct drm_connector *connector = connector_state->connector; in drm_connector_update_privacy_screen() local
2561 if (!connector->privacy_screen) in drm_connector_update_privacy_screen()
2564 ret = drm_privacy_screen_set_sw_state(connector->privacy_screen, in drm_connector_update_privacy_screen()
2567 drm_err(connector->dev, "Error updating privacy-screen sw_state\n"); in drm_connector_update_privacy_screen()
2572 drm_connector_update_privacy_screen_properties(connector, false); in drm_connector_update_privacy_screen()
2581 struct drm_connector *connector = obj_to_connector(obj); in drm_connector_set_obj_prop() local
2584 if (property == connector->dev->mode_config.dpms_property) { in drm_connector_set_obj_prop()
2585 ret = (*connector->funcs->dpms)(connector, (int)value); in drm_connector_set_obj_prop()
2586 } else if (connector->funcs->set_property) in drm_connector_set_obj_prop()
2587 ret = connector->funcs->set_property(connector, property, value); in drm_connector_set_obj_prop()
2590 drm_object_property_set_value(&connector->base, property, value); in drm_connector_set_obj_prop()
2609 static struct drm_encoder *drm_connector_get_encoder(struct drm_connector *connector) in drm_connector_get_encoder() argument
2614 if (connector->state) in drm_connector_get_encoder()
2615 return connector->state->best_encoder; in drm_connector_get_encoder()
2616 return connector->encoder; in drm_connector_get_encoder()
2657 struct drm_connector *connector; in drm_mode_getconnector() local
2674 connector = drm_connector_lookup(dev, file_priv, out_resp->connector_id); in drm_mode_getconnector()
2675 if (!connector) in drm_mode_getconnector()
2678 encoders_count = hweight32(connector->possible_encoders); in drm_mode_getconnector()
2684 drm_connector_for_each_possible_encoder(connector, encoder) { in drm_mode_getconnector()
2694 out_resp->connector_id = connector->base.id; in drm_mode_getconnector()
2695 out_resp->connector_type = connector->connector_type; in drm_mode_getconnector()
2696 out_resp->connector_type_id = connector->connector_type_id; in drm_mode_getconnector()
2703 connector->funcs->fill_modes(connector, in drm_mode_getconnector()
2707 …drm_dbg_kms(dev, "User-space requested a forced probe on [CONNECTOR:%d:%s] but is not the DRM mast… in drm_mode_getconnector()
2708 connector->base.id, connector->name); in drm_mode_getconnector()
2711 out_resp->mm_width = connector->display_info.width_mm; in drm_mode_getconnector()
2712 out_resp->mm_height = connector->display_info.height_mm; in drm_mode_getconnector()
2713 out_resp->subpixel = connector->display_info.subpixel_order; in drm_mode_getconnector()
2714 out_resp->connection = connector->status; in drm_mode_getconnector()
2717 list_for_each_entry(mode, &connector->modes, head) { in drm_mode_getconnector()
2720 if (drm_mode_expose_to_userspace(mode, &connector->modes, in drm_mode_getconnector()
2734 list_for_each_entry(mode, &connector->modes, head) { in drm_mode_getconnector()
2756 list_for_each_entry_continue(mode, &connector->modes, head) in drm_mode_getconnector()
2767 list_for_each_entry(mode, &connector->modes, head) in drm_mode_getconnector()
2775 encoder = drm_connector_get_encoder(connector); in drm_mode_getconnector()
2784 ret = drm_mode_object_get_properties(&connector->base, file_priv->atomic, in drm_mode_getconnector()
2791 drm_connector_put(connector); in drm_mode_getconnector()
2797 * drm_connector_find_by_fwnode - Find a connector based on the associated fwnode
2801 * a connector is found a reference to the connector is returned. The caller must
2803 * connector.
2805 * Returns: A reference to the found connector or an ERR_PTR().
2809 struct drm_connector *connector, *found = ERR_PTR(-ENODEV); in drm_connector_find_by_fwnode() local
2816 list_for_each_entry(connector, &connector_list, global_connector_list_entry) { in drm_connector_find_by_fwnode()
2817 if (connector->fwnode == fwnode || in drm_connector_find_by_fwnode()
2818 (connector->fwnode && connector->fwnode->secondary == fwnode)) { in drm_connector_find_by_fwnode()
2819 drm_connector_get(connector); in drm_connector_find_by_fwnode()
2820 found = connector; in drm_connector_find_by_fwnode()
2831 * drm_connector_oob_hotplug_event - Report out-of-band hotplug event to connector
2844 struct drm_connector *connector; in drm_connector_oob_hotplug_event() local
2846 connector = drm_connector_find_by_fwnode(connector_fwnode); in drm_connector_oob_hotplug_event()
2847 if (IS_ERR(connector)) in drm_connector_oob_hotplug_event()
2850 if (connector->funcs->oob_hotplug_event) in drm_connector_oob_hotplug_event()
2851 connector->funcs->oob_hotplug_event(connector); in drm_connector_oob_hotplug_event()
2853 drm_connector_put(connector); in drm_connector_oob_hotplug_event()