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 mutex_init(&connector->hdmi.infoframes.lock); in __drm_connector_init()
282 connector->edid_blob_ptr = NULL; in __drm_connector_init()
283 connector->epoch_counter = 0; in __drm_connector_init()
284 connector->tile_blob_ptr = NULL; in __drm_connector_init()
285 connector->status = connector_status_unknown; in __drm_connector_init()
286 connector->display_info.panel_orientation = in __drm_connector_init()
289 drm_connector_get_cmdline_mode(connector); in __drm_connector_init()
291 /* We should add connectors at the end to avoid upsetting the connector in __drm_connector_init()
295 list_add_tail(&connector->head, &config->connector_list); in __drm_connector_init()
301 drm_connector_attach_edid_property(connector); in __drm_connector_init()
303 drm_object_attach_property(&connector->base, in __drm_connector_init()
306 drm_object_attach_property(&connector->base, in __drm_connector_init()
310 drm_object_attach_property(&connector->base, in __drm_connector_init()
313 drm_object_attach_property(&connector->base, in __drm_connector_init()
318 drm_object_attach_property(&connector->base, config->prop_crtc_id, 0); in __drm_connector_init()
321 connector->debugfs_entry = NULL; in __drm_connector_init()
324 ida_free(connector_ida, connector->connector_type_id); in __drm_connector_init()
327 ida_free(&config->connector_ida, connector->index); in __drm_connector_init()
330 drm_mode_object_unregister(dev, &connector->base); in __drm_connector_init()
336 * drm_connector_init - Init a preallocated connector
338 * @connector: the connector to init
339 * @funcs: callbacks for this connector
340 * @connector_type: user visible type of the connector
342 * Initialises a preallocated connector. Connectors should be
343 * subclassed as part of driver connector objects.
346 * should call drm_connector_cleanup() and free the connector structure.
347 * The connector structure should not be allocated with devm_kzalloc().
357 struct drm_connector *connector, in drm_connector_init() argument
364 return __drm_connector_init(dev, connector, funcs, connector_type, NULL); in drm_connector_init()
369 * drm_connector_init_with_ddc - Init a preallocated connector
371 * @connector: the connector to init
372 * @funcs: callbacks for this connector
373 * @connector_type: user visible type of the connector
376 * Initialises a preallocated connector. Connectors should be
377 * subclassed as part of driver connector objects.
380 * should call drm_connector_cleanup() and free the connector structure.
381 * The connector structure should not be allocated with devm_kzalloc().
383 * Ensures that the ddc field of the connector is correctly set.
393 struct drm_connector *connector, in drm_connector_init_with_ddc() argument
401 return __drm_connector_init(dev, connector, funcs, connector_type, ddc); in drm_connector_init_with_ddc()
408 struct drm_connector *connector = ptr; in drm_connector_cleanup_action() local
410 drm_connector_cleanup(connector); in drm_connector_cleanup_action()
414 * drmm_connector_init - Init a preallocated connector
416 * @connector: the connector to init
417 * @funcs: callbacks for this connector
418 * @connector_type: user visible type of the connector
421 * Initialises a preallocated connector. Connectors should be
422 * subclassed as part of driver connector objects.
427 * The connector structure should be allocated with drmm_kzalloc().
435 struct drm_connector *connector, in drmm_connector_init() argument
445 ret = __drm_connector_init(dev, connector, funcs, connector_type, ddc); in drmm_connector_init()
450 connector); in drmm_connector_init()
459 * drmm_connector_hdmi_init - Init a preallocated HDMI connector
461 * @connector: A pointer to the HDMI connector to init
464 * @funcs: callbacks for this connector
465 * @hdmi_funcs: HDMI-related callbacks for this connector
466 * @connector_type: user visible type of the connector
469 * @max_bpc: Maximum bits per char the HDMI connector supports
471 * Initialises a preallocated HDMI connector. Connectors can be
472 * subclassed as part of driver connector objects.
477 * The connector structure should be allocated with drmm_kzalloc().
485 struct drm_connector *connector, in drmm_connector_hdmi_init() argument
513 ret = drmm_connector_init(dev, connector, funcs, connector_type, ddc); in drmm_connector_hdmi_init()
517 connector->hdmi.supported_formats = supported_formats; in drmm_connector_hdmi_init()
518 strtomem_pad(connector->hdmi.vendor, vendor, 0); in drmm_connector_hdmi_init()
519 strtomem_pad(connector->hdmi.product, product, 0); in drmm_connector_hdmi_init()
523 * connector to have a state. in drmm_connector_hdmi_init()
525 if (connector->funcs->reset) in drmm_connector_hdmi_init()
526 connector->funcs->reset(connector); in drmm_connector_hdmi_init()
528 drm_connector_attach_max_bpc_property(connector, 8, max_bpc); in drmm_connector_hdmi_init()
529 connector->max_bpc = max_bpc; in drmm_connector_hdmi_init()
532 drm_connector_attach_hdr_output_metadata_property(connector); in drmm_connector_hdmi_init()
534 connector->hdmi.funcs = hdmi_funcs; in drmm_connector_hdmi_init()
542 * @connector: the connector
544 * Some connector types like DRM_MODE_CONNECTOR_VIRTUAL do not get a
548 void drm_connector_attach_edid_property(struct drm_connector *connector) in drm_connector_attach_edid_property() argument
550 struct drm_mode_config *config = &connector->dev->mode_config; in drm_connector_attach_edid_property()
552 drm_object_attach_property(&connector->base, in drm_connector_attach_edid_property()
559 * drm_connector_attach_encoder - attach a connector to an encoder
560 * @connector: connector to attach
561 * @encoder: encoder to attach @connector to
563 * This function links up a connector to an encoder. Note that the routing
570 int drm_connector_attach_encoder(struct drm_connector *connector, in drm_connector_attach_encoder() argument
575 * of connector to encoder in simple connector/encoder devices using a in drm_connector_attach_encoder()
576 * direct assignment of connector->encoder = encoder. This connection in drm_connector_attach_encoder()
584 if (WARN_ON(connector->encoder)) in drm_connector_attach_encoder()
587 connector->possible_encoders |= drm_encoder_mask(encoder); in drm_connector_attach_encoder()
594 * drm_connector_has_possible_encoder - check if the connector and encoder are
596 * @connector: the connector
600 * True if @encoder is one of the possible encoders for @connector.
602 bool drm_connector_has_possible_encoder(struct drm_connector *connector, in drm_connector_has_possible_encoder() argument
605 return connector->possible_encoders & drm_encoder_mask(encoder); in drm_connector_has_possible_encoder()
609 static void drm_mode_remove(struct drm_connector *connector, in drm_mode_remove() argument
613 drm_mode_destroy(connector->dev, mode); in drm_mode_remove()
617 * drm_connector_cleanup - cleans up an initialised connector
618 * @connector: connector to cleanup
620 * Cleans up the connector but doesn't free the object.
622 void drm_connector_cleanup(struct drm_connector *connector) in drm_connector_cleanup() argument
624 struct drm_device *dev = connector->dev; in drm_connector_cleanup()
627 /* The connector should have been removed from userspace long before in drm_connector_cleanup()
630 if (WARN_ON(connector->registration_state == in drm_connector_cleanup()
632 drm_connector_unregister(connector); in drm_connector_cleanup()
634 if (connector->privacy_screen) { in drm_connector_cleanup()
635 drm_privacy_screen_put(connector->privacy_screen); in drm_connector_cleanup()
636 connector->privacy_screen = NULL; in drm_connector_cleanup()
639 if (connector->tile_group) { in drm_connector_cleanup()
640 drm_mode_put_tile_group(dev, connector->tile_group); in drm_connector_cleanup()
641 connector->tile_group = NULL; in drm_connector_cleanup()
644 list_for_each_entry_safe(mode, t, &connector->probed_modes, head) in drm_connector_cleanup()
645 drm_mode_remove(connector, mode); in drm_connector_cleanup()
647 list_for_each_entry_safe(mode, t, &connector->modes, head) in drm_connector_cleanup()
648 drm_mode_remove(connector, mode); in drm_connector_cleanup()
650 ida_free(&drm_connector_enum_list[connector->connector_type].ida, in drm_connector_cleanup()
651 connector->connector_type_id); in drm_connector_cleanup()
653 ida_free(&dev->mode_config.connector_ida, connector->index); in drm_connector_cleanup()
655 kfree(connector->display_info.bus_formats); in drm_connector_cleanup()
656 kfree(connector->display_info.vics); in drm_connector_cleanup()
657 drm_mode_object_unregister(dev, &connector->base); in drm_connector_cleanup()
658 kfree(connector->name); in drm_connector_cleanup()
659 connector->name = NULL; in drm_connector_cleanup()
660 fwnode_handle_put(connector->fwnode); in drm_connector_cleanup()
661 connector->fwnode = NULL; in drm_connector_cleanup()
663 list_del(&connector->head); in drm_connector_cleanup()
667 WARN_ON(connector->state && !connector->funcs->atomic_destroy_state); in drm_connector_cleanup()
668 if (connector->state && connector->funcs->atomic_destroy_state) in drm_connector_cleanup()
669 connector->funcs->atomic_destroy_state(connector, in drm_connector_cleanup()
670 connector->state); in drm_connector_cleanup()
672 mutex_destroy(&connector->hdmi.infoframes.lock); in drm_connector_cleanup()
673 mutex_destroy(&connector->mutex); in drm_connector_cleanup()
675 memset(connector, 0, sizeof(*connector)); in drm_connector_cleanup()
683 * drm_connector_register - register a connector
684 * @connector: the connector to register
686 * Register userspace interfaces for a connector. Only call this for connectors
691 * When the connector is no longer available, callers must call
697 int drm_connector_register(struct drm_connector *connector) in drm_connector_register() argument
701 if (!connector->dev->registered) in drm_connector_register()
704 mutex_lock(&connector->mutex); in drm_connector_register()
705 if (connector->registration_state != DRM_CONNECTOR_INITIALIZING) in drm_connector_register()
708 ret = drm_sysfs_connector_add(connector); in drm_connector_register()
712 drm_debugfs_connector_add(connector); in drm_connector_register()
714 if (connector->funcs->late_register) { in drm_connector_register()
715 ret = connector->funcs->late_register(connector); in drm_connector_register()
720 ret = drm_sysfs_connector_add_late(connector); in drm_connector_register()
724 drm_mode_object_register(connector->dev, &connector->base); in drm_connector_register()
726 connector->registration_state = DRM_CONNECTOR_REGISTERED; in drm_connector_register()
728 /* Let userspace know we have a new connector */ in drm_connector_register()
729 drm_sysfs_connector_hotplug_event(connector); in drm_connector_register()
731 if (connector->privacy_screen) in drm_connector_register()
732 drm_privacy_screen_register_notifier(connector->privacy_screen, in drm_connector_register()
733 &connector->privacy_screen_notifier); in drm_connector_register()
736 list_add_tail(&connector->global_connector_list_entry, &connector_list); in drm_connector_register()
741 if (connector->funcs->early_unregister) in drm_connector_register()
742 connector->funcs->early_unregister(connector); in drm_connector_register()
744 drm_debugfs_connector_remove(connector); in drm_connector_register()
745 drm_sysfs_connector_remove(connector); in drm_connector_register()
747 mutex_unlock(&connector->mutex); in drm_connector_register()
753 * drm_connector_unregister - unregister a connector
754 * @connector: the connector to unregister
756 * Unregister userspace interfaces for a connector. Only call this for
760 void drm_connector_unregister(struct drm_connector *connector) in drm_connector_unregister() argument
762 mutex_lock(&connector->mutex); in drm_connector_unregister()
763 if (connector->registration_state != DRM_CONNECTOR_REGISTERED) { in drm_connector_unregister()
764 mutex_unlock(&connector->mutex); in drm_connector_unregister()
769 list_del_init(&connector->global_connector_list_entry); in drm_connector_unregister()
772 if (connector->privacy_screen) in drm_connector_unregister()
774 connector->privacy_screen, in drm_connector_unregister()
775 &connector->privacy_screen_notifier); in drm_connector_unregister()
777 drm_sysfs_connector_remove_early(connector); in drm_connector_unregister()
779 if (connector->funcs->early_unregister) in drm_connector_unregister()
780 connector->funcs->early_unregister(connector); in drm_connector_unregister()
782 drm_debugfs_connector_remove(connector); in drm_connector_unregister()
783 drm_sysfs_connector_remove(connector); in drm_connector_unregister()
785 connector->registration_state = DRM_CONNECTOR_UNREGISTERED; in drm_connector_unregister()
786 mutex_unlock(&connector->mutex); in drm_connector_unregister()
792 struct drm_connector *connector; in drm_connector_unregister_all() local
796 drm_for_each_connector_iter(connector, &conn_iter) in drm_connector_unregister_all()
797 drm_connector_unregister(connector); in drm_connector_unregister_all()
803 struct drm_connector *connector; in drm_connector_register_all() local
808 drm_for_each_connector_iter(connector, &conn_iter) { in drm_connector_register_all()
809 ret = drm_connector_register(connector); in drm_connector_register_all()
821 * drm_get_connector_status_name - return a string for connector status
822 * @status: connector status to compute name of
827 * Returns: connector status string
841 * drm_get_connector_force_name - return a string for connector force
842 * @force: connector force to get name of
888 * Extra-safe connector put function that works in any context. Should only be
890 * actually release the connector when dropping our final reference.
907 * drm_connector_list_iter_next - return next connector
910 * Returns: the next connector for @iter, or NULL when the list walk has
933 /* loop until it's not a zombie connector */ in drm_connector_list_iter_next()
1042 /* Optional connector properties. */
1241 …* drm_hdmi_connector_get_broadcast_rgb_name - Return a string for HDMI connector RGB broadcast sel…
1265 * drm_hdmi_connector_get_output_format_name() - Return a string for HDMI connector output format
1282 * DOC: standard connector properties
1299 * Legacy property for setting the power state of the connector. For atomic
1302 * connector is linked to. Drivers should never set this property directly,
1319 * connector is connected to a CRTC. In atomic the DRM core enforces that
1326 * Summarizing: Only set "DPMS" when the connector is known to be enabled,
1330 * Connector path property to identify how this sink is physically
1338 * parent connector and ``<ports>`` is a hyphen-separated list of DP MST
1342 * Connector tile group property to indicate how a set of DRM connector
1352 * Connector link-status property to indicate the status of link. The
1363 * "GOOD" to re-enable the connector.
1369 * When user-space performs an atomic commit on a connector with a "BAD"
1418 * - Kernel sends uevent with the connector id and property id through
1486 * Connector property to enable userspace to send HDR Metadata to
1531 * property to the connector during initialization.
1536 * Mode object ID of the &drm_crtc this connector should be connected to.
1577 * connector subtypes. Enum values more or less match with those from main
1578 * connector types.
1624 * Add margins to the connector's viewport. This is typically used to
1694 * drm_mode_create_dvi_i_properties - create DVI-I specific connector properties
1697 * Called by a driver the first time a DVI-I connector is made.
1728 * @connector: drm_connector to attach property
1730 * Called by a driver when DP connector is created.
1732 void drm_connector_attach_dp_subconnector_property(struct drm_connector *connector) in drm_connector_attach_dp_subconnector_property() argument
1734 struct drm_mode_config *mode_config = &connector->dev->mode_config; in drm_connector_attach_dp_subconnector_property()
1738 drm_property_create_enum(connector->dev, in drm_connector_attach_dp_subconnector_property()
1744 drm_object_attach_property(&connector->base, in drm_connector_attach_dp_subconnector_property()
1751 * DOC: HDMI connector properties
1761 * The CRTC attached to the connector must be configured by user-space to
1822 * DOC: Analog TV Connector Properties
1825 * Indicates the TV Mode used on an analog TV connector. The value
1878 * @connector: connector to attach content type property on.
1880 * Called by a driver the first time a HDMI connector is made.
1884 int drm_connector_attach_content_type_property(struct drm_connector *connector) in drm_connector_attach_content_type_property() argument
1886 if (!drm_mode_create_content_type_property(connector->dev)) in drm_connector_attach_content_type_property()
1887 drm_object_attach_property(&connector->base, in drm_connector_attach_content_type_property()
1888 connector->dev->mode_config.content_type_property, in drm_connector_attach_content_type_property()
1895 * drm_connector_attach_tv_margin_properties - attach TV connector margin
1897 * @connector: DRM connector
1899 * Called by a driver when it needs to attach TV margin props to a connector.
1902 void drm_connector_attach_tv_margin_properties(struct drm_connector *connector) in drm_connector_attach_tv_margin_properties() argument
1904 struct drm_device *dev = connector->dev; in drm_connector_attach_tv_margin_properties()
1906 drm_object_attach_property(&connector->base, in drm_connector_attach_tv_margin_properties()
1909 drm_object_attach_property(&connector->base, in drm_connector_attach_tv_margin_properties()
1912 drm_object_attach_property(&connector->base, in drm_connector_attach_tv_margin_properties()
1915 drm_object_attach_property(&connector->base, in drm_connector_attach_tv_margin_properties()
1922 * drm_mode_create_tv_margin_properties - create TV connector margin properties
1925 * Called by a driver's HDMI connector initialization routine, this function
1927 * function for an SDTV connector, it's already called from
1963 * drm_mode_create_tv_properties_legacy - create TV specific connector properties
1969 * the TV specific connector properties for a given device. Caller is
1973 * NOTE: This functions registers the deprecated "mode" connector
1992 * Basic connector properties in drm_mode_create_tv_properties_legacy()
2067 * drm_mode_create_tv_properties - create TV specific connector properties
2072 * the TV specific connector properties for a given device.
2194 * from the minimum supported variable refresh rate for the connector.
2203 * @connector: connector to create the vrr_capable property on.
2206 * variable refresh rate capability for a connector.
2212 struct drm_connector *connector) in drm_connector_attach_vrr_capable_property() argument
2214 struct drm_device *dev = connector->dev; in drm_connector_attach_vrr_capable_property()
2217 if (!connector->vrr_capable_property) { in drm_connector_attach_vrr_capable_property()
2223 connector->vrr_capable_property = prop; in drm_connector_attach_vrr_capable_property()
2224 drm_object_attach_property(&connector->base, prop, 0); in drm_connector_attach_vrr_capable_property()
2233 * @connector: connector to attach scaling mode property on.
2245 int drm_connector_attach_scaling_mode_property(struct drm_connector *connector, in drm_connector_attach_scaling_mode_property() argument
2248 struct drm_device *dev = connector->dev; in drm_connector_attach_scaling_mode_property()
2282 drm_object_attach_property(&connector->base, in drm_connector_attach_scaling_mode_property()
2285 connector->scaling_mode_property = scaling_mode_property; in drm_connector_attach_scaling_mode_property()
2319 * DOC: standard connector properties
2389 * drm_mode_create_hdmi_colorspace_property() is used for HDMI connector and
2390 * drm_mode_create_dp_colorspace_property() is used for DP connector.
2393 static int drm_mode_create_colorspace_property(struct drm_connector *connector, in drm_mode_create_colorspace_property() argument
2396 struct drm_device *dev = connector->dev; in drm_mode_create_colorspace_property()
2401 if (connector->colorspace_property) in drm_mode_create_colorspace_property()
2405 drm_err(dev, "No supported colorspaces provded on [CONNECTOR:%d:%s]\n", in drm_mode_create_colorspace_property()
2406 connector->base.id, connector->name); in drm_mode_create_colorspace_property()
2411 drm_err(dev, "Unknown colorspace provded on [CONNECTOR:%d:%s]\n", in drm_mode_create_colorspace_property()
2412 connector->base.id, connector->name); in drm_mode_create_colorspace_property()
2426 connector->colorspace_property = in drm_mode_create_colorspace_property()
2431 if (!connector->colorspace_property) in drm_mode_create_colorspace_property()
2439 * @connector: connector to create the Colorspace property on.
2448 int drm_mode_create_hdmi_colorspace_property(struct drm_connector *connector, in drm_mode_create_hdmi_colorspace_property() argument
2458 return drm_mode_create_colorspace_property(connector, colorspaces); in drm_mode_create_hdmi_colorspace_property()
2464 * @connector: connector to create the Colorspace property on.
2473 int drm_mode_create_dp_colorspace_property(struct drm_connector *connector, in drm_mode_create_dp_colorspace_property() argument
2483 return drm_mode_create_colorspace_property(connector, colorspaces); in drm_mode_create_dp_colorspace_property()
2542 * drm_connector_set_path_property - set tile property on connector
2543 * @connector: connector to set property on.
2547 * connector path. This is mainly used for DisplayPort MST where
2554 int drm_connector_set_path_property(struct drm_connector *connector, in drm_connector_set_path_property() argument
2557 struct drm_device *dev = connector->dev; in drm_connector_set_path_property()
2561 &connector->path_blob_ptr, in drm_connector_set_path_property()
2564 &connector->base, in drm_connector_set_path_property()
2571 * drm_connector_set_tile_property - set tile property on connector
2572 * @connector: connector to set property on.
2574 * This looks up the tile information for a connector, and creates a
2583 int drm_connector_set_tile_property(struct drm_connector *connector) in drm_connector_set_tile_property() argument
2585 struct drm_device *dev = connector->dev; in drm_connector_set_tile_property()
2589 if (!connector->has_tile) { in drm_connector_set_tile_property()
2591 &connector->tile_blob_ptr, in drm_connector_set_tile_property()
2594 &connector->base, in drm_connector_set_tile_property()
2600 connector->tile_group->id, connector->tile_is_single_monitor, in drm_connector_set_tile_property()
2601 connector->num_h_tile, connector->num_v_tile, in drm_connector_set_tile_property()
2602 connector->tile_h_loc, connector->tile_v_loc, in drm_connector_set_tile_property()
2603 connector->tile_h_size, connector->tile_v_size); in drm_connector_set_tile_property()
2606 &connector->tile_blob_ptr, in drm_connector_set_tile_property()
2609 &connector->base, in drm_connector_set_tile_property()
2616 * drm_connector_set_link_status_property - Set link status property of a connector
2617 * @connector: drm connector
2634 void drm_connector_set_link_status_property(struct drm_connector *connector, in drm_connector_set_link_status_property() argument
2637 struct drm_device *dev = connector->dev; in drm_connector_set_link_status_property()
2640 connector->state->link_status = link_status; in drm_connector_set_link_status_property()
2647 * @connector: connector to attach max bpc property on.
2648 * @min: The minimum bit depth supported by the connector.
2649 * @max: The maximum bit depth supported by the connector.
2651 * This is used to add support for limiting the bit depth on a connector.
2656 int drm_connector_attach_max_bpc_property(struct drm_connector *connector, in drm_connector_attach_max_bpc_property() argument
2659 struct drm_device *dev = connector->dev; in drm_connector_attach_max_bpc_property()
2662 prop = connector->max_bpc_property; in drm_connector_attach_max_bpc_property()
2668 connector->max_bpc_property = prop; in drm_connector_attach_max_bpc_property()
2671 drm_object_attach_property(&connector->base, prop, max); in drm_connector_attach_max_bpc_property()
2672 connector->state->max_requested_bpc = max; in drm_connector_attach_max_bpc_property()
2673 connector->state->max_bpc = max; in drm_connector_attach_max_bpc_property()
2681 * @connector: connector to attach the property on.
2689 int drm_connector_attach_hdr_output_metadata_property(struct drm_connector *connector) in drm_connector_attach_hdr_output_metadata_property() argument
2691 struct drm_device *dev = connector->dev; in drm_connector_attach_hdr_output_metadata_property()
2694 drm_object_attach_property(&connector->base, prop, 0); in drm_connector_attach_hdr_output_metadata_property()
2702 * @connector: connector to attach the property on.
2704 * This is used to add support for forcing the RGB range on a connector
2709 int drm_connector_attach_broadcast_rgb_property(struct drm_connector *connector) in drm_connector_attach_broadcast_rgb_property() argument
2711 struct drm_device *dev = connector->dev; in drm_connector_attach_broadcast_rgb_property()
2714 prop = connector->broadcast_rgb_property; in drm_connector_attach_broadcast_rgb_property()
2723 connector->broadcast_rgb_property = prop; in drm_connector_attach_broadcast_rgb_property()
2726 drm_object_attach_property(&connector->base, prop, in drm_connector_attach_broadcast_rgb_property()
2735 * @connector: connector to attach the property on.
2743 int drm_connector_attach_colorspace_property(struct drm_connector *connector) in drm_connector_attach_colorspace_property() argument
2745 struct drm_property *prop = connector->colorspace_property; in drm_connector_attach_colorspace_property()
2747 drm_object_attach_property(&connector->base, prop, DRM_MODE_COLORIMETRY_DEFAULT); in drm_connector_attach_colorspace_property()
2755 * @old_state: old connector state to compare
2756 * @new_state: new connector state to compare
2759 * have changed between two different connector state (and thus probably
2783 * capable property for a connector
2784 * @connector: drm connector
2785 * @capable: True if the connector is variable refresh rate capable
2788 * variable refresh rate over a connector.
2791 struct drm_connector *connector, bool capable) in drm_connector_set_vrr_capable_property() argument
2793 if (!connector->vrr_capable_property) in drm_connector_set_vrr_capable_property()
2796 drm_object_property_set_value(&connector->base, in drm_connector_set_vrr_capable_property()
2797 connector->vrr_capable_property, in drm_connector_set_vrr_capable_property()
2803 * drm_connector_set_panel_orientation - sets the connector's panel_orientation
2804 * @connector: connector for which to set the panel-orientation property.
2807 * This function sets the connector's panel_orientation and attaches
2808 * a "panel orientation" property to the connector.
2810 * Calling this function on a connector where the panel_orientation has
2824 struct drm_connector *connector, in drm_connector_set_panel_orientation() argument
2827 struct drm_device *dev = connector->dev; in drm_connector_set_panel_orientation()
2828 struct drm_display_info *info = &connector->display_info; in drm_connector_set_panel_orientation()
2853 drm_object_attach_property(&connector->base, prop, in drm_connector_set_panel_orientation()
2861 * connector's panel_orientation after checking for quirks
2862 * @connector: connector for which to init the panel-orientation property.
2874 struct drm_connector *connector, in drm_connector_set_panel_orientation_with_quirk() argument
2884 return drm_connector_set_panel_orientation(connector, in drm_connector_set_panel_orientation_with_quirk()
2891 * set the connector's panel_orientation from panel's callback.
2892 * @connector: connector for which to init the panel-orientation property.
2902 struct drm_connector *connector, in drm_connector_set_orientation_from_panel() argument
2912 return drm_connector_set_panel_orientation(connector, orientation); in drm_connector_set_orientation_from_panel()
2926 * @connector: connector for which to create the privacy-screen properties
2929 * hw-state" properties for the connector. They are not attached.
2932 drm_connector_create_privacy_screen_properties(struct drm_connector *connector) in drm_connector_create_privacy_screen_properties() argument
2934 if (connector->privacy_screen_sw_state_property) in drm_connector_create_privacy_screen_properties()
2938 connector->privacy_screen_sw_state_property = in drm_connector_create_privacy_screen_properties()
2939 drm_property_create_enum(connector->dev, DRM_MODE_PROP_ENUM, in drm_connector_create_privacy_screen_properties()
2943 connector->privacy_screen_hw_state_property = in drm_connector_create_privacy_screen_properties()
2944 drm_property_create_enum(connector->dev, in drm_connector_create_privacy_screen_properties()
2955 * @connector: connector on which to attach the privacy-screen properties
2958 * hw-state" properties to the connector. The initial state of both is set
2962 drm_connector_attach_privacy_screen_properties(struct drm_connector *connector) in drm_connector_attach_privacy_screen_properties() argument
2964 if (!connector->privacy_screen_sw_state_property) in drm_connector_attach_privacy_screen_properties()
2967 drm_object_attach_property(&connector->base, in drm_connector_attach_privacy_screen_properties()
2968 connector->privacy_screen_sw_state_property, in drm_connector_attach_privacy_screen_properties()
2971 drm_object_attach_property(&connector->base, in drm_connector_attach_privacy_screen_properties()
2972 connector->privacy_screen_hw_state_property, in drm_connector_attach_privacy_screen_properties()
2978 struct drm_connector *connector, bool set_sw_state) in drm_connector_update_privacy_screen_properties() argument
2982 drm_privacy_screen_get_state(connector->privacy_screen, in drm_connector_update_privacy_screen_properties()
2986 connector->state->privacy_screen_sw_state = sw_state; in drm_connector_update_privacy_screen_properties()
2987 drm_object_property_set_value(&connector->base, in drm_connector_update_privacy_screen_properties()
2988 connector->privacy_screen_hw_state_property, hw_state); in drm_connector_update_privacy_screen_properties()
2994 struct drm_connector *connector = in drm_connector_privacy_screen_notifier() local
2996 struct drm_device *dev = connector->dev; in drm_connector_privacy_screen_notifier()
2999 drm_connector_update_privacy_screen_properties(connector, true); in drm_connector_privacy_screen_notifier()
3002 drm_sysfs_connector_property_event(connector, in drm_connector_privacy_screen_notifier()
3003 connector->privacy_screen_sw_state_property); in drm_connector_privacy_screen_notifier()
3004 drm_sysfs_connector_property_event(connector, in drm_connector_privacy_screen_notifier()
3005 connector->privacy_screen_hw_state_property); in drm_connector_privacy_screen_notifier()
3012 * the connector
3013 * @connector: connector to attach the privacy-screen to
3017 * a generic notifier for generating sysfs-connector-status-events
3020 * call drm_privacy_screen_put() on it when the connector is destroyed.
3023 struct drm_connector *connector, struct drm_privacy_screen *priv) in drm_connector_attach_privacy_screen_provider() argument
3025 connector->privacy_screen = priv; in drm_connector_attach_privacy_screen_provider()
3026 connector->privacy_screen_notifier.notifier_call = in drm_connector_attach_privacy_screen_provider()
3029 drm_connector_create_privacy_screen_properties(connector); in drm_connector_attach_privacy_screen_provider()
3030 drm_connector_update_privacy_screen_properties(connector, true); in drm_connector_attach_privacy_screen_provider()
3031 drm_connector_attach_privacy_screen_properties(connector); in drm_connector_attach_privacy_screen_provider()
3036 * drm_connector_update_privacy_screen - update connector's privacy-screen sw-state
3037 * @connector_state: connector-state to update the privacy-screen for
3039 * This function calls drm_privacy_screen_set_sw_state() on the connector's
3042 * If the connector has no privacy-screen, then this is a no-op.
3046 struct drm_connector *connector = connector_state->connector; in drm_connector_update_privacy_screen() local
3049 if (!connector->privacy_screen) in drm_connector_update_privacy_screen()
3052 ret = drm_privacy_screen_set_sw_state(connector->privacy_screen, in drm_connector_update_privacy_screen()
3055 drm_err(connector->dev, "Error updating privacy-screen sw_state\n"); in drm_connector_update_privacy_screen()
3060 drm_connector_update_privacy_screen_properties(connector, false); in drm_connector_update_privacy_screen()
3069 struct drm_connector *connector = obj_to_connector(obj); in drm_connector_set_obj_prop() local
3072 if (property == connector->dev->mode_config.dpms_property) { in drm_connector_set_obj_prop()
3073 ret = (*connector->funcs->dpms)(connector, (int)value); in drm_connector_set_obj_prop()
3074 } else if (connector->funcs->set_property) in drm_connector_set_obj_prop()
3075 ret = connector->funcs->set_property(connector, property, value); in drm_connector_set_obj_prop()
3078 drm_object_property_set_value(&connector->base, property, value); in drm_connector_set_obj_prop()
3097 static struct drm_encoder *drm_connector_get_encoder(struct drm_connector *connector) in drm_connector_get_encoder() argument
3102 if (connector->state) in drm_connector_get_encoder()
3103 return connector->state->best_encoder; in drm_connector_get_encoder()
3104 return connector->encoder; in drm_connector_get_encoder()
3145 struct drm_connector *connector; in drm_mode_getconnector() local
3162 connector = drm_connector_lookup(dev, file_priv, out_resp->connector_id); in drm_mode_getconnector()
3163 if (!connector) in drm_mode_getconnector()
3166 encoders_count = hweight32(connector->possible_encoders); in drm_mode_getconnector()
3172 drm_connector_for_each_possible_encoder(connector, encoder) { in drm_mode_getconnector()
3182 out_resp->connector_id = connector->base.id; in drm_mode_getconnector()
3183 out_resp->connector_type = connector->connector_type; in drm_mode_getconnector()
3184 out_resp->connector_type_id = connector->connector_type_id; in drm_mode_getconnector()
3191 connector->funcs->fill_modes(connector, in drm_mode_getconnector()
3195 …drm_dbg_kms(dev, "User-space requested a forced probe on [CONNECTOR:%d:%s] but is not the DRM mast… in drm_mode_getconnector()
3196 connector->base.id, connector->name); in drm_mode_getconnector()
3199 out_resp->mm_width = connector->display_info.width_mm; in drm_mode_getconnector()
3200 out_resp->mm_height = connector->display_info.height_mm; in drm_mode_getconnector()
3201 out_resp->subpixel = connector->display_info.subpixel_order; in drm_mode_getconnector()
3202 out_resp->connection = connector->status; in drm_mode_getconnector()
3205 list_for_each_entry(mode, &connector->modes, head) { in drm_mode_getconnector()
3208 if (drm_mode_expose_to_userspace(mode, &connector->modes, in drm_mode_getconnector()
3222 list_for_each_entry(mode, &connector->modes, head) { in drm_mode_getconnector()
3244 list_for_each_entry_continue(mode, &connector->modes, head) in drm_mode_getconnector()
3255 list_for_each_entry(mode, &connector->modes, head) in drm_mode_getconnector()
3263 encoder = drm_connector_get_encoder(connector); in drm_mode_getconnector()
3272 ret = drm_mode_object_get_properties(&connector->base, file_priv->atomic, in drm_mode_getconnector()
3279 drm_connector_put(connector); in drm_mode_getconnector()
3285 * drm_connector_find_by_fwnode - Find a connector based on the associated fwnode
3289 * a connector is found a reference to the connector is returned. The caller must
3291 * connector.
3293 * Returns: A reference to the found connector or an ERR_PTR().
3297 struct drm_connector *connector, *found = ERR_PTR(-ENODEV); in drm_connector_find_by_fwnode() local
3304 list_for_each_entry(connector, &connector_list, global_connector_list_entry) { in drm_connector_find_by_fwnode()
3305 if (connector->fwnode == fwnode || in drm_connector_find_by_fwnode()
3306 (connector->fwnode && connector->fwnode->secondary == fwnode)) { in drm_connector_find_by_fwnode()
3307 drm_connector_get(connector); in drm_connector_find_by_fwnode()
3308 found = connector; in drm_connector_find_by_fwnode()
3319 * drm_connector_oob_hotplug_event - Report out-of-band hotplug event to connector
3334 struct drm_connector *connector; in drm_connector_oob_hotplug_event() local
3336 connector = drm_connector_find_by_fwnode(connector_fwnode); in drm_connector_oob_hotplug_event()
3337 if (IS_ERR(connector)) in drm_connector_oob_hotplug_event()
3340 if (connector->funcs->oob_hotplug_event) in drm_connector_oob_hotplug_event()
3341 connector->funcs->oob_hotplug_event(connector, status); in drm_connector_oob_hotplug_event()
3343 drm_connector_put(connector); in drm_connector_oob_hotplug_event()