Lines Matching full:connector
56 * objects and initialized by setting the following fields. The connector is
58 * &struct drm_connector_funcs and a connector type, and then exposed to
62 * connectors to encoders 1:1, the connector should be attached at
75 * Global connector list for drm_connector_find_by_fwnode().
76 * Note drm_connector_[un]register() first take connector->lock and then
89 * Connector and encoder types.
132 * drm_get_connector_type_name - return a string for connector type
133 * @type: The connector type (DRM_MODE_CONNECTOR_*)
135 * Returns: the name of the connector type, or NULL if the type is not valid.
148 * @connector: connector to query
150 * The kernel supports per-connector configuration of its consoles through
153 * particular connector. This is typically only used during the early fbdev
156 static void drm_connector_get_cmdline_mode(struct drm_connector *connector) in drm_connector_get_cmdline_mode() argument
158 struct drm_cmdline_mode *mode = &connector->cmdline_mode; in drm_connector_get_cmdline_mode()
161 option = video_get_options(connector->name); in drm_connector_get_cmdline_mode()
166 connector, in drm_connector_get_cmdline_mode()
171 DRM_INFO("forcing %s connector %s\n", connector->name, in drm_connector_get_cmdline_mode()
173 connector->force = mode->force; in drm_connector_get_cmdline_mode()
177 DRM_INFO("cmdline forces connector %s panel_orientation to %d\n", in drm_connector_get_cmdline_mode()
178 connector->name, mode->panel_orientation); in drm_connector_get_cmdline_mode()
179 drm_connector_set_panel_orientation(connector, in drm_connector_get_cmdline_mode()
183 DRM_DEBUG_KMS("cmdline mode for connector %s %s %dx%d@%dHz%s%s%s\n", in drm_connector_get_cmdline_mode()
184 connector->name, mode->name, in drm_connector_get_cmdline_mode()
194 struct drm_connector *connector = in drm_connector_free() local
196 struct drm_device *dev = connector->dev; in drm_connector_free()
198 drm_mode_object_unregister(dev, &connector->base); in drm_connector_free()
199 connector->funcs->destroy(connector); in drm_connector_free()
204 struct drm_connector *connector, *n; in drm_connector_free_work_fn() local
215 llist_for_each_entry_safe(connector, n, freed, free_node) { in drm_connector_free_work_fn()
216 drm_mode_object_unregister(dev, &connector->base); in drm_connector_free_work_fn()
217 connector->funcs->destroy(connector); in drm_connector_free_work_fn()
222 struct drm_connector *connector, in __drm_connector_init() argument
236 ret = __drm_mode_object_add(dev, &connector->base, in __drm_connector_init()
242 connector->base.properties = &connector->properties; in __drm_connector_init()
243 connector->dev = dev; in __drm_connector_init()
244 connector->funcs = funcs; in __drm_connector_init()
246 /* connector index is used with 32bit bitmasks */ in __drm_connector_init()
249 DRM_DEBUG_KMS("Failed to allocate %s connector index: %d\n", in __drm_connector_init()
254 connector->index = ret; in __drm_connector_init()
257 connector->connector_type = connector_type; in __drm_connector_init()
258 connector->connector_type_id = in __drm_connector_init()
260 if (connector->connector_type_id < 0) { in __drm_connector_init()
261 ret = connector->connector_type_id; in __drm_connector_init()
264 connector->name = in __drm_connector_init()
267 connector->connector_type_id); in __drm_connector_init()
268 if (!connector->name) { in __drm_connector_init()
274 connector->ddc = ddc; in __drm_connector_init()
276 INIT_LIST_HEAD(&connector->global_connector_list_entry); in __drm_connector_init()
277 INIT_LIST_HEAD(&connector->probed_modes); in __drm_connector_init()
278 INIT_LIST_HEAD(&connector->modes); in __drm_connector_init()
279 mutex_init(&connector->mutex); in __drm_connector_init()
280 mutex_init(&connector->edid_override_mutex); in __drm_connector_init()
281 connector->edid_blob_ptr = NULL; in __drm_connector_init()
282 connector->epoch_counter = 0; in __drm_connector_init()
283 connector->tile_blob_ptr = NULL; in __drm_connector_init()
284 connector->status = connector_status_unknown; in __drm_connector_init()
285 connector->display_info.panel_orientation = in __drm_connector_init()
288 drm_connector_get_cmdline_mode(connector); in __drm_connector_init()
290 /* We should add connectors at the end to avoid upsetting the connector in __drm_connector_init()
294 list_add_tail(&connector->head, &config->connector_list); in __drm_connector_init()
300 drm_connector_attach_edid_property(connector); in __drm_connector_init()
302 drm_object_attach_property(&connector->base, in __drm_connector_init()
305 drm_object_attach_property(&connector->base, in __drm_connector_init()
309 drm_object_attach_property(&connector->base, in __drm_connector_init()
312 drm_object_attach_property(&connector->base, in __drm_connector_init()
317 drm_object_attach_property(&connector->base, config->prop_crtc_id, 0); in __drm_connector_init()
320 connector->debugfs_entry = NULL; in __drm_connector_init()
323 ida_free(connector_ida, connector->connector_type_id); in __drm_connector_init()
326 ida_free(&config->connector_ida, connector->index); in __drm_connector_init()
329 drm_mode_object_unregister(dev, &connector->base); in __drm_connector_init()
335 * drm_connector_init - Init a preallocated connector
337 * @connector: the connector to init
338 * @funcs: callbacks for this connector
339 * @connector_type: user visible type of the connector
341 * Initialises a preallocated connector. Connectors should be
342 * subclassed as part of driver connector objects.
345 * should call drm_connector_cleanup() and free the connector structure.
346 * The connector structure should not be allocated with devm_kzalloc().
356 struct drm_connector *connector, in drm_connector_init() argument
363 return __drm_connector_init(dev, connector, funcs, connector_type, NULL); in drm_connector_init()
368 * drm_connector_init_with_ddc - Init a preallocated connector
370 * @connector: the connector to init
371 * @funcs: callbacks for this connector
372 * @connector_type: user visible type of the connector
375 * Initialises a preallocated connector. Connectors should be
376 * subclassed as part of driver connector objects.
379 * should call drm_connector_cleanup() and free the connector structure.
380 * The connector structure should not be allocated with devm_kzalloc().
382 * Ensures that the ddc field of the connector is correctly set.
392 struct drm_connector *connector, in drm_connector_init_with_ddc() argument
400 return __drm_connector_init(dev, connector, funcs, connector_type, ddc); in drm_connector_init_with_ddc()
407 struct drm_connector *connector = ptr; in drm_connector_cleanup_action() local
409 drm_connector_cleanup(connector); in drm_connector_cleanup_action()
413 * drmm_connector_init - Init a preallocated 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 connector. Connectors should be
421 * subclassed as part of driver connector objects.
426 * The connector structure should be allocated with drmm_kzalloc().
432 struct drm_connector *connector, in drmm_connector_init() argument
442 ret = __drm_connector_init(dev, connector, funcs, connector_type, ddc); in drmm_connector_init()
447 connector); in drmm_connector_init()
457 * @connector: the connector
459 * Some connector types like DRM_MODE_CONNECTOR_VIRTUAL do not get a
463 void drm_connector_attach_edid_property(struct drm_connector *connector) in drm_connector_attach_edid_property() argument
465 struct drm_mode_config *config = &connector->dev->mode_config; in drm_connector_attach_edid_property()
467 drm_object_attach_property(&connector->base, in drm_connector_attach_edid_property()
474 * drm_connector_attach_encoder - attach a connector to an encoder
475 * @connector: connector to attach
476 * @encoder: encoder to attach @connector to
478 * This function links up a connector to an encoder. Note that the routing
485 int drm_connector_attach_encoder(struct drm_connector *connector, in drm_connector_attach_encoder() argument
490 * of connector to encoder in simple connector/encoder devices using a in drm_connector_attach_encoder()
491 * direct assignment of connector->encoder = encoder. This connection in drm_connector_attach_encoder()
499 if (WARN_ON(connector->encoder)) in drm_connector_attach_encoder()
502 connector->possible_encoders |= drm_encoder_mask(encoder); in drm_connector_attach_encoder()
509 * drm_connector_has_possible_encoder - check if the connector and encoder are
511 * @connector: the connector
515 * True if @encoder is one of the possible encoders for @connector.
517 bool drm_connector_has_possible_encoder(struct drm_connector *connector, in drm_connector_has_possible_encoder() argument
520 return connector->possible_encoders & drm_encoder_mask(encoder); in drm_connector_has_possible_encoder()
524 static void drm_mode_remove(struct drm_connector *connector, in drm_mode_remove() argument
528 drm_mode_destroy(connector->dev, mode); in drm_mode_remove()
532 * drm_connector_cleanup - cleans up an initialised connector
533 * @connector: connector to cleanup
535 * Cleans up the connector but doesn't free the object.
537 void drm_connector_cleanup(struct drm_connector *connector) in drm_connector_cleanup() argument
539 struct drm_device *dev = connector->dev; in drm_connector_cleanup()
542 /* The connector should have been removed from userspace long before in drm_connector_cleanup()
545 if (WARN_ON(connector->registration_state == in drm_connector_cleanup()
547 drm_connector_unregister(connector); in drm_connector_cleanup()
549 if (connector->privacy_screen) { in drm_connector_cleanup()
550 drm_privacy_screen_put(connector->privacy_screen); in drm_connector_cleanup()
551 connector->privacy_screen = NULL; in drm_connector_cleanup()
554 if (connector->tile_group) { in drm_connector_cleanup()
555 drm_mode_put_tile_group(dev, connector->tile_group); in drm_connector_cleanup()
556 connector->tile_group = NULL; in drm_connector_cleanup()
559 list_for_each_entry_safe(mode, t, &connector->probed_modes, head) in drm_connector_cleanup()
560 drm_mode_remove(connector, mode); in drm_connector_cleanup()
562 list_for_each_entry_safe(mode, t, &connector->modes, head) in drm_connector_cleanup()
563 drm_mode_remove(connector, mode); in drm_connector_cleanup()
565 ida_free(&drm_connector_enum_list[connector->connector_type].ida, in drm_connector_cleanup()
566 connector->connector_type_id); in drm_connector_cleanup()
568 ida_free(&dev->mode_config.connector_ida, connector->index); in drm_connector_cleanup()
570 kfree(connector->display_info.bus_formats); in drm_connector_cleanup()
571 kfree(connector->display_info.vics); in drm_connector_cleanup()
572 drm_mode_object_unregister(dev, &connector->base); in drm_connector_cleanup()
573 kfree(connector->name); in drm_connector_cleanup()
574 connector->name = NULL; in drm_connector_cleanup()
575 fwnode_handle_put(connector->fwnode); in drm_connector_cleanup()
576 connector->fwnode = NULL; in drm_connector_cleanup()
578 list_del(&connector->head); in drm_connector_cleanup()
582 WARN_ON(connector->state && !connector->funcs->atomic_destroy_state); in drm_connector_cleanup()
583 if (connector->state && connector->funcs->atomic_destroy_state) in drm_connector_cleanup()
584 connector->funcs->atomic_destroy_state(connector, in drm_connector_cleanup()
585 connector->state); in drm_connector_cleanup()
587 mutex_destroy(&connector->mutex); in drm_connector_cleanup()
589 memset(connector, 0, sizeof(*connector)); in drm_connector_cleanup()
597 * drm_connector_register - register a connector
598 * @connector: the connector to register
600 * Register userspace interfaces for a connector. Only call this for connectors
605 * When the connector is no longer available, callers must call
611 int drm_connector_register(struct drm_connector *connector) in drm_connector_register() argument
615 if (!connector->dev->registered) in drm_connector_register()
618 mutex_lock(&connector->mutex); in drm_connector_register()
619 if (connector->registration_state != DRM_CONNECTOR_INITIALIZING) in drm_connector_register()
622 ret = drm_sysfs_connector_add(connector); in drm_connector_register()
626 drm_debugfs_connector_add(connector); in drm_connector_register()
628 if (connector->funcs->late_register) { in drm_connector_register()
629 ret = connector->funcs->late_register(connector); in drm_connector_register()
634 drm_mode_object_register(connector->dev, &connector->base); in drm_connector_register()
636 connector->registration_state = DRM_CONNECTOR_REGISTERED; in drm_connector_register()
638 /* Let userspace know we have a new connector */ in drm_connector_register()
639 drm_sysfs_connector_hotplug_event(connector); in drm_connector_register()
641 if (connector->privacy_screen) in drm_connector_register()
642 drm_privacy_screen_register_notifier(connector->privacy_screen, in drm_connector_register()
643 &connector->privacy_screen_notifier); in drm_connector_register()
646 list_add_tail(&connector->global_connector_list_entry, &connector_list); in drm_connector_register()
651 drm_debugfs_connector_remove(connector); in drm_connector_register()
652 drm_sysfs_connector_remove(connector); in drm_connector_register()
654 mutex_unlock(&connector->mutex); in drm_connector_register()
660 * drm_connector_unregister - unregister a connector
661 * @connector: the connector to unregister
663 * Unregister userspace interfaces for a connector. Only call this for
667 void drm_connector_unregister(struct drm_connector *connector) in drm_connector_unregister() argument
669 mutex_lock(&connector->mutex); in drm_connector_unregister()
670 if (connector->registration_state != DRM_CONNECTOR_REGISTERED) { in drm_connector_unregister()
671 mutex_unlock(&connector->mutex); in drm_connector_unregister()
676 list_del_init(&connector->global_connector_list_entry); in drm_connector_unregister()
679 if (connector->privacy_screen) in drm_connector_unregister()
681 connector->privacy_screen, in drm_connector_unregister()
682 &connector->privacy_screen_notifier); in drm_connector_unregister()
684 if (connector->funcs->early_unregister) in drm_connector_unregister()
685 connector->funcs->early_unregister(connector); in drm_connector_unregister()
687 drm_sysfs_connector_remove(connector); in drm_connector_unregister()
688 drm_debugfs_connector_remove(connector); in drm_connector_unregister()
690 connector->registration_state = DRM_CONNECTOR_UNREGISTERED; in drm_connector_unregister()
691 mutex_unlock(&connector->mutex); in drm_connector_unregister()
697 struct drm_connector *connector; in drm_connector_unregister_all() local
701 drm_for_each_connector_iter(connector, &conn_iter) in drm_connector_unregister_all()
702 drm_connector_unregister(connector); in drm_connector_unregister_all()
708 struct drm_connector *connector; in drm_connector_register_all() local
713 drm_for_each_connector_iter(connector, &conn_iter) { in drm_connector_register_all()
714 ret = drm_connector_register(connector); in drm_connector_register_all()
726 * drm_get_connector_status_name - return a string for connector status
727 * @status: connector status to compute name of
732 * Returns: connector status string
746 * drm_get_connector_force_name - return a string for connector force
747 * @force: connector force to get name of
793 * Extra-safe connector put function that works in any context. Should only be
795 * actually release the connector when dropping our final reference.
812 * drm_connector_list_iter_next - return next connector
815 * Returns: the next connector for @iter, or NULL when the list walk has
838 /* loop until it's not a zombie connector */ in drm_connector_list_iter_next()
947 /* Optional connector properties. */
1139 * DOC: standard connector properties
1156 * Legacy property for setting the power state of the connector. For atomic
1159 * connector is linked to. Drivers should never set this property directly,
1176 * connector is connected to a CRTC. In atomic the DRM core enforces that
1183 * Summarizing: Only set "DPMS" when the connector is known to be enabled,
1187 * Connector path property to identify how this sink is physically
1193 * Connector tile group property to indicate how a set of DRM connector
1203 * Connector link-status property to indicate the status of link. The
1214 * "GOOD" to re-enable the connector.
1220 * When user-space performs an atomic commit on a connector with a "BAD"
1269 * - Kernel sends uevent with the connector id and property id through
1337 * Connector property to enable userspace to send HDR Metadata to
1382 * property to the connector during initialization.
1387 * Mode object ID of the &drm_crtc this connector should be connected to.
1428 * connector subtypes. Enum values more or less match with those from main
1429 * connector types.
1475 * Add margins to the connector's viewport. This is typically used to
1545 * drm_mode_create_dvi_i_properties - create DVI-I specific connector properties
1548 * Called by a driver the first time a DVI-I connector is made.
1579 * @connector: drm_connector to attach property
1581 * Called by a driver when DP connector is created.
1583 void drm_connector_attach_dp_subconnector_property(struct drm_connector *connector) in drm_connector_attach_dp_subconnector_property() argument
1585 struct drm_mode_config *mode_config = &connector->dev->mode_config; in drm_connector_attach_dp_subconnector_property()
1589 drm_property_create_enum(connector->dev, in drm_connector_attach_dp_subconnector_property()
1595 drm_object_attach_property(&connector->base, in drm_connector_attach_dp_subconnector_property()
1602 * DOC: HDMI connector properties
1641 * DOC: Analog TV Connector Properties
1644 * Indicates the TV Mode used on an analog TV connector. The value
1691 * @connector: connector to attach content type property on.
1693 * Called by a driver the first time a HDMI connector is made.
1697 int drm_connector_attach_content_type_property(struct drm_connector *connector) in drm_connector_attach_content_type_property() argument
1699 if (!drm_mode_create_content_type_property(connector->dev)) in drm_connector_attach_content_type_property()
1700 drm_object_attach_property(&connector->base, in drm_connector_attach_content_type_property()
1701 connector->dev->mode_config.content_type_property, in drm_connector_attach_content_type_property()
1708 * drm_connector_attach_tv_margin_properties - attach TV connector margin
1710 * @connector: DRM connector
1712 * Called by a driver when it needs to attach TV margin props to a connector.
1715 void drm_connector_attach_tv_margin_properties(struct drm_connector *connector) in drm_connector_attach_tv_margin_properties() argument
1717 struct drm_device *dev = connector->dev; in drm_connector_attach_tv_margin_properties()
1719 drm_object_attach_property(&connector->base, in drm_connector_attach_tv_margin_properties()
1722 drm_object_attach_property(&connector->base, in drm_connector_attach_tv_margin_properties()
1725 drm_object_attach_property(&connector->base, in drm_connector_attach_tv_margin_properties()
1728 drm_object_attach_property(&connector->base, in drm_connector_attach_tv_margin_properties()
1735 * drm_mode_create_tv_margin_properties - create TV connector margin properties
1738 * Called by a driver's HDMI connector initialization routine, this function
1740 * function for an SDTV connector, it's already called from
1776 * drm_mode_create_tv_properties_legacy - create TV specific connector properties
1782 * the TV specific connector properties for a given device. Caller is
1786 * NOTE: This functions registers the deprecated "mode" connector
1805 * Basic connector properties in drm_mode_create_tv_properties_legacy()
1880 * drm_mode_create_tv_properties - create TV specific connector properties
1885 * the TV specific connector properties for a given device.
2007 * from the minimum supported variable refresh rate for the connector.
2016 * @connector: connector to create the vrr_capable property on.
2019 * variable refresh rate capability for a connector.
2025 struct drm_connector *connector) in drm_connector_attach_vrr_capable_property() argument
2027 struct drm_device *dev = connector->dev; in drm_connector_attach_vrr_capable_property()
2030 if (!connector->vrr_capable_property) { in drm_connector_attach_vrr_capable_property()
2036 connector->vrr_capable_property = prop; in drm_connector_attach_vrr_capable_property()
2037 drm_object_attach_property(&connector->base, prop, 0); in drm_connector_attach_vrr_capable_property()
2046 * @connector: connector to attach scaling mode property on.
2058 int drm_connector_attach_scaling_mode_property(struct drm_connector *connector, in drm_connector_attach_scaling_mode_property() argument
2061 struct drm_device *dev = connector->dev; in drm_connector_attach_scaling_mode_property()
2095 drm_object_attach_property(&connector->base, in drm_connector_attach_scaling_mode_property()
2098 connector->scaling_mode_property = scaling_mode_property; in drm_connector_attach_scaling_mode_property()
2132 * DOC: standard connector properties
2155 * drm_mode_create_hdmi_colorspace_property() is used for HDMI connector and
2156 * drm_mode_create_dp_colorspace_property() is used for DP connector.
2159 static int drm_mode_create_colorspace_property(struct drm_connector *connector, in drm_mode_create_colorspace_property() argument
2162 struct drm_device *dev = connector->dev; in drm_mode_create_colorspace_property()
2167 if (connector->colorspace_property) in drm_mode_create_colorspace_property()
2171 drm_err(dev, "No supported colorspaces provded on [CONNECTOR:%d:%s]\n", in drm_mode_create_colorspace_property()
2172 connector->base.id, connector->name); in drm_mode_create_colorspace_property()
2177 drm_err(dev, "Unknown colorspace provded on [CONNECTOR:%d:%s]\n", in drm_mode_create_colorspace_property()
2178 connector->base.id, connector->name); in drm_mode_create_colorspace_property()
2192 connector->colorspace_property = in drm_mode_create_colorspace_property()
2197 if (!connector->colorspace_property) in drm_mode_create_colorspace_property()
2205 * @connector: connector to create the Colorspace property on.
2214 int drm_mode_create_hdmi_colorspace_property(struct drm_connector *connector, in drm_mode_create_hdmi_colorspace_property() argument
2224 return drm_mode_create_colorspace_property(connector, colorspaces); in drm_mode_create_hdmi_colorspace_property()
2230 * @connector: connector to create the Colorspace property on.
2239 int drm_mode_create_dp_colorspace_property(struct drm_connector *connector, in drm_mode_create_dp_colorspace_property() argument
2249 return drm_mode_create_colorspace_property(connector, colorspaces); in drm_mode_create_dp_colorspace_property()
2308 * drm_connector_set_path_property - set tile property on connector
2309 * @connector: connector to set property on.
2313 * connector path. This is mainly used for DisplayPort MST where
2320 int drm_connector_set_path_property(struct drm_connector *connector, in drm_connector_set_path_property() argument
2323 struct drm_device *dev = connector->dev; in drm_connector_set_path_property()
2327 &connector->path_blob_ptr, in drm_connector_set_path_property()
2330 &connector->base, in drm_connector_set_path_property()
2337 * drm_connector_set_tile_property - set tile property on connector
2338 * @connector: connector to set property on.
2340 * This looks up the tile information for a connector, and creates a
2349 int drm_connector_set_tile_property(struct drm_connector *connector) in drm_connector_set_tile_property() argument
2351 struct drm_device *dev = connector->dev; in drm_connector_set_tile_property()
2355 if (!connector->has_tile) { in drm_connector_set_tile_property()
2357 &connector->tile_blob_ptr, in drm_connector_set_tile_property()
2360 &connector->base, in drm_connector_set_tile_property()
2366 connector->tile_group->id, connector->tile_is_single_monitor, in drm_connector_set_tile_property()
2367 connector->num_h_tile, connector->num_v_tile, in drm_connector_set_tile_property()
2368 connector->tile_h_loc, connector->tile_v_loc, in drm_connector_set_tile_property()
2369 connector->tile_h_size, connector->tile_v_size); in drm_connector_set_tile_property()
2372 &connector->tile_blob_ptr, in drm_connector_set_tile_property()
2375 &connector->base, in drm_connector_set_tile_property()
2382 * drm_connector_set_link_status_property - Set link status property of a connector
2383 * @connector: drm connector
2400 void drm_connector_set_link_status_property(struct drm_connector *connector, in drm_connector_set_link_status_property() argument
2403 struct drm_device *dev = connector->dev; in drm_connector_set_link_status_property()
2406 connector->state->link_status = link_status; in drm_connector_set_link_status_property()
2413 * @connector: connector to attach max bpc property on.
2414 * @min: The minimum bit depth supported by the connector.
2415 * @max: The maximum bit depth supported by the connector.
2417 * This is used to add support for limiting the bit depth on a connector.
2422 int drm_connector_attach_max_bpc_property(struct drm_connector *connector, in drm_connector_attach_max_bpc_property() argument
2425 struct drm_device *dev = connector->dev; in drm_connector_attach_max_bpc_property()
2428 prop = connector->max_bpc_property; in drm_connector_attach_max_bpc_property()
2434 connector->max_bpc_property = prop; in drm_connector_attach_max_bpc_property()
2437 drm_object_attach_property(&connector->base, prop, max); in drm_connector_attach_max_bpc_property()
2438 connector->state->max_requested_bpc = max; in drm_connector_attach_max_bpc_property()
2439 connector->state->max_bpc = max; in drm_connector_attach_max_bpc_property()
2447 * @connector: connector to attach the property on.
2455 int drm_connector_attach_hdr_output_metadata_property(struct drm_connector *connector) in drm_connector_attach_hdr_output_metadata_property() argument
2457 struct drm_device *dev = connector->dev; in drm_connector_attach_hdr_output_metadata_property()
2460 drm_object_attach_property(&connector->base, prop, 0); in drm_connector_attach_hdr_output_metadata_property()
2468 * @connector: connector to attach the property on.
2476 int drm_connector_attach_colorspace_property(struct drm_connector *connector) in drm_connector_attach_colorspace_property() argument
2478 struct drm_property *prop = connector->colorspace_property; in drm_connector_attach_colorspace_property()
2480 drm_object_attach_property(&connector->base, prop, DRM_MODE_COLORIMETRY_DEFAULT); in drm_connector_attach_colorspace_property()
2488 * @old_state: old connector state to compare
2489 * @new_state: new connector state to compare
2492 * have changed between two different connector state (and thus probably
2516 * capable property for a connector
2517 * @connector: drm connector
2518 * @capable: True if the connector is variable refresh rate capable
2521 * variable refresh rate over a connector.
2524 struct drm_connector *connector, bool capable) in drm_connector_set_vrr_capable_property() argument
2526 if (!connector->vrr_capable_property) in drm_connector_set_vrr_capable_property()
2529 drm_object_property_set_value(&connector->base, in drm_connector_set_vrr_capable_property()
2530 connector->vrr_capable_property, in drm_connector_set_vrr_capable_property()
2536 * drm_connector_set_panel_orientation - sets the connector's panel_orientation
2537 * @connector: connector for which to set the panel-orientation property.
2540 * This function sets the connector's panel_orientation and attaches
2541 * a "panel orientation" property to the connector.
2543 * Calling this function on a connector where the panel_orientation has
2557 struct drm_connector *connector, in drm_connector_set_panel_orientation() argument
2560 struct drm_device *dev = connector->dev; in drm_connector_set_panel_orientation()
2561 struct drm_display_info *info = &connector->display_info; in drm_connector_set_panel_orientation()
2586 drm_object_attach_property(&connector->base, prop, in drm_connector_set_panel_orientation()
2594 * connector's panel_orientation after checking for quirks
2595 * @connector: connector for which to init the panel-orientation property.
2607 struct drm_connector *connector, in drm_connector_set_panel_orientation_with_quirk() argument
2617 return drm_connector_set_panel_orientation(connector, in drm_connector_set_panel_orientation_with_quirk()
2624 * set the connector's panel_orientation from panel's callback.
2625 * @connector: connector for which to init the panel-orientation property.
2635 struct drm_connector *connector, in drm_connector_set_orientation_from_panel() argument
2645 return drm_connector_set_panel_orientation(connector, orientation); in drm_connector_set_orientation_from_panel()
2659 * @connector: connector for which to create the privacy-screen properties
2662 * hw-state" properties for the connector. They are not attached.
2665 drm_connector_create_privacy_screen_properties(struct drm_connector *connector) in drm_connector_create_privacy_screen_properties() argument
2667 if (connector->privacy_screen_sw_state_property) in drm_connector_create_privacy_screen_properties()
2671 connector->privacy_screen_sw_state_property = in drm_connector_create_privacy_screen_properties()
2672 drm_property_create_enum(connector->dev, DRM_MODE_PROP_ENUM, in drm_connector_create_privacy_screen_properties()
2676 connector->privacy_screen_hw_state_property = in drm_connector_create_privacy_screen_properties()
2677 drm_property_create_enum(connector->dev, in drm_connector_create_privacy_screen_properties()
2688 * @connector: connector on which to attach the privacy-screen properties
2691 * hw-state" properties to the connector. The initial state of both is set
2695 drm_connector_attach_privacy_screen_properties(struct drm_connector *connector) in drm_connector_attach_privacy_screen_properties() argument
2697 if (!connector->privacy_screen_sw_state_property) in drm_connector_attach_privacy_screen_properties()
2700 drm_object_attach_property(&connector->base, in drm_connector_attach_privacy_screen_properties()
2701 connector->privacy_screen_sw_state_property, in drm_connector_attach_privacy_screen_properties()
2704 drm_object_attach_property(&connector->base, in drm_connector_attach_privacy_screen_properties()
2705 connector->privacy_screen_hw_state_property, in drm_connector_attach_privacy_screen_properties()
2711 struct drm_connector *connector, bool set_sw_state) in drm_connector_update_privacy_screen_properties() argument
2715 drm_privacy_screen_get_state(connector->privacy_screen, in drm_connector_update_privacy_screen_properties()
2719 connector->state->privacy_screen_sw_state = sw_state; in drm_connector_update_privacy_screen_properties()
2720 drm_object_property_set_value(&connector->base, in drm_connector_update_privacy_screen_properties()
2721 connector->privacy_screen_hw_state_property, hw_state); in drm_connector_update_privacy_screen_properties()
2727 struct drm_connector *connector = in drm_connector_privacy_screen_notifier() local
2729 struct drm_device *dev = connector->dev; in drm_connector_privacy_screen_notifier()
2732 drm_connector_update_privacy_screen_properties(connector, true); in drm_connector_privacy_screen_notifier()
2735 drm_sysfs_connector_property_event(connector, in drm_connector_privacy_screen_notifier()
2736 connector->privacy_screen_sw_state_property); in drm_connector_privacy_screen_notifier()
2737 drm_sysfs_connector_property_event(connector, in drm_connector_privacy_screen_notifier()
2738 connector->privacy_screen_hw_state_property); in drm_connector_privacy_screen_notifier()
2745 * the connector
2746 * @connector: connector to attach the privacy-screen to
2750 * a generic notifier for generating sysfs-connector-status-events
2753 * call drm_privacy_screen_put() on it when the connector is destroyed.
2756 struct drm_connector *connector, struct drm_privacy_screen *priv) in drm_connector_attach_privacy_screen_provider() argument
2758 connector->privacy_screen = priv; in drm_connector_attach_privacy_screen_provider()
2759 connector->privacy_screen_notifier.notifier_call = in drm_connector_attach_privacy_screen_provider()
2762 drm_connector_create_privacy_screen_properties(connector); in drm_connector_attach_privacy_screen_provider()
2763 drm_connector_update_privacy_screen_properties(connector, true); in drm_connector_attach_privacy_screen_provider()
2764 drm_connector_attach_privacy_screen_properties(connector); in drm_connector_attach_privacy_screen_provider()
2769 * drm_connector_update_privacy_screen - update connector's privacy-screen sw-state
2770 * @connector_state: connector-state to update the privacy-screen for
2772 * This function calls drm_privacy_screen_set_sw_state() on the connector's
2775 * If the connector has no privacy-screen, then this is a no-op.
2779 struct drm_connector *connector = connector_state->connector; in drm_connector_update_privacy_screen() local
2782 if (!connector->privacy_screen) in drm_connector_update_privacy_screen()
2785 ret = drm_privacy_screen_set_sw_state(connector->privacy_screen, in drm_connector_update_privacy_screen()
2788 drm_err(connector->dev, "Error updating privacy-screen sw_state\n"); in drm_connector_update_privacy_screen()
2793 drm_connector_update_privacy_screen_properties(connector, false); in drm_connector_update_privacy_screen()
2802 struct drm_connector *connector = obj_to_connector(obj); in drm_connector_set_obj_prop() local
2805 if (property == connector->dev->mode_config.dpms_property) { in drm_connector_set_obj_prop()
2806 ret = (*connector->funcs->dpms)(connector, (int)value); in drm_connector_set_obj_prop()
2807 } else if (connector->funcs->set_property) in drm_connector_set_obj_prop()
2808 ret = connector->funcs->set_property(connector, property, value); in drm_connector_set_obj_prop()
2811 drm_object_property_set_value(&connector->base, property, value); in drm_connector_set_obj_prop()
2830 static struct drm_encoder *drm_connector_get_encoder(struct drm_connector *connector) in drm_connector_get_encoder() argument
2835 if (connector->state) in drm_connector_get_encoder()
2836 return connector->state->best_encoder; in drm_connector_get_encoder()
2837 return connector->encoder; in drm_connector_get_encoder()
2878 struct drm_connector *connector; in drm_mode_getconnector() local
2895 connector = drm_connector_lookup(dev, file_priv, out_resp->connector_id); in drm_mode_getconnector()
2896 if (!connector) in drm_mode_getconnector()
2899 encoders_count = hweight32(connector->possible_encoders); in drm_mode_getconnector()
2905 drm_connector_for_each_possible_encoder(connector, encoder) { in drm_mode_getconnector()
2915 out_resp->connector_id = connector->base.id; in drm_mode_getconnector()
2916 out_resp->connector_type = connector->connector_type; in drm_mode_getconnector()
2917 out_resp->connector_type_id = connector->connector_type_id; in drm_mode_getconnector()
2924 connector->funcs->fill_modes(connector, in drm_mode_getconnector()
2928 …drm_dbg_kms(dev, "User-space requested a forced probe on [CONNECTOR:%d:%s] but is not the DRM mast… in drm_mode_getconnector()
2929 connector->base.id, connector->name); in drm_mode_getconnector()
2932 out_resp->mm_width = connector->display_info.width_mm; in drm_mode_getconnector()
2933 out_resp->mm_height = connector->display_info.height_mm; in drm_mode_getconnector()
2934 out_resp->subpixel = connector->display_info.subpixel_order; in drm_mode_getconnector()
2935 out_resp->connection = connector->status; in drm_mode_getconnector()
2938 list_for_each_entry(mode, &connector->modes, head) { in drm_mode_getconnector()
2941 if (drm_mode_expose_to_userspace(mode, &connector->modes, in drm_mode_getconnector()
2955 list_for_each_entry(mode, &connector->modes, head) { in drm_mode_getconnector()
2977 list_for_each_entry_continue(mode, &connector->modes, head) in drm_mode_getconnector()
2988 list_for_each_entry(mode, &connector->modes, head) in drm_mode_getconnector()
2996 encoder = drm_connector_get_encoder(connector); in drm_mode_getconnector()
3005 ret = drm_mode_object_get_properties(&connector->base, file_priv->atomic, in drm_mode_getconnector()
3012 drm_connector_put(connector); in drm_mode_getconnector()
3018 * drm_connector_find_by_fwnode - Find a connector based on the associated fwnode
3022 * a connector is found a reference to the connector is returned. The caller must
3024 * connector.
3026 * Returns: A reference to the found connector or an ERR_PTR().
3030 struct drm_connector *connector, *found = ERR_PTR(-ENODEV); in drm_connector_find_by_fwnode() local
3037 list_for_each_entry(connector, &connector_list, global_connector_list_entry) { in drm_connector_find_by_fwnode()
3038 if (connector->fwnode == fwnode || in drm_connector_find_by_fwnode()
3039 (connector->fwnode && connector->fwnode->secondary == fwnode)) { in drm_connector_find_by_fwnode()
3040 drm_connector_get(connector); in drm_connector_find_by_fwnode()
3041 found = connector; in drm_connector_find_by_fwnode()
3052 * drm_connector_oob_hotplug_event - Report out-of-band hotplug event to connector
3065 struct drm_connector *connector; in drm_connector_oob_hotplug_event() local
3067 connector = drm_connector_find_by_fwnode(connector_fwnode); in drm_connector_oob_hotplug_event()
3068 if (IS_ERR(connector)) in drm_connector_oob_hotplug_event()
3071 if (connector->funcs->oob_hotplug_event) in drm_connector_oob_hotplug_event()
3072 connector->funcs->oob_hotplug_event(connector); in drm_connector_oob_hotplug_event()
3074 drm_connector_put(connector); in drm_connector_oob_hotplug_event()