Lines Matching +full:tile +full:- +full:cache

51  * Hence they are reference-counted using drm_connector_get() and
67 * For connectors which are not fixed (like built-in panels) the driver needs to
76 * Note drm_connector_[un]register() first take connector->lock and then
94 { DRM_MODE_CONNECTOR_DVII, "DVI-I" },
95 { DRM_MODE_CONNECTOR_DVID, "DVI-D" },
96 { DRM_MODE_CONNECTOR_DVIA, "DVI-A" },
103 { DRM_MODE_CONNECTOR_HDMIA, "HDMI-A" },
104 { DRM_MODE_CONNECTOR_HDMIB, "HDMI-B" },
132 * drm_get_connector_type_name - return a string for connector type
147 * drm_connector_get_cmdline_mode - reads the user's cmdline mode
150 * The kernel supports per-connector configuration of its consoles through
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()
170 if (mode->force) { in drm_connector_get_cmdline_mode()
171 DRM_INFO("forcing %s connector %s\n", connector->name, in drm_connector_get_cmdline_mode()
172 drm_get_connector_force_name(mode->force)); in drm_connector_get_cmdline_mode()
173 connector->force = mode->force; in drm_connector_get_cmdline_mode()
176 if (mode->panel_orientation != DRM_MODE_PANEL_ORIENTATION_UNKNOWN) { in drm_connector_get_cmdline_mode()
178 connector->name, mode->panel_orientation); in drm_connector_get_cmdline_mode()
180 mode->panel_orientation); in drm_connector_get_cmdline_mode()
184 connector->name, mode->name, in drm_connector_get_cmdline_mode()
185 mode->xres, mode->yres, in drm_connector_get_cmdline_mode()
186 mode->refresh_specified ? mode->refresh : 60, in drm_connector_get_cmdline_mode()
187 mode->rb ? " reduced blanking" : "", in drm_connector_get_cmdline_mode()
188 mode->margins ? " with margins" : "", in drm_connector_get_cmdline_mode()
189 mode->interlace ? " interlaced" : ""); in drm_connector_get_cmdline_mode()
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()
207 struct drm_mode_config *config = &dev->mode_config; in drm_connector_free_work_fn()
211 spin_lock_irqsave(&config->connector_list_lock, flags); in drm_connector_free_work_fn()
212 freed = llist_del_all(&config->connector_free_list); in drm_connector_free_work_fn()
213 spin_unlock_irqrestore(&config->connector_list_lock, flags); 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()
227 struct drm_mode_config *config = &dev->mode_config; in __drm_connector_init()
233 (!funcs->atomic_destroy_state || in __drm_connector_init()
234 !funcs->atomic_duplicate_state)); in __drm_connector_init()
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()
247 ret = ida_alloc_max(&config->connector_ida, 31, GFP_KERNEL); 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()
265 kasprintf(GFP_KERNEL, "%s-%d", in __drm_connector_init()
267 connector->connector_type_id); in __drm_connector_init()
268 if (!connector->name) { in __drm_connector_init()
269 ret = -ENOMEM; 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()
293 spin_lock_irq(&config->connector_list_lock); in __drm_connector_init()
294 list_add_tail(&connector->head, &config->connector_list); in __drm_connector_init()
295 config->num_connector++; in __drm_connector_init()
296 spin_unlock_irq(&config->connector_list_lock); in __drm_connector_init()
302 drm_object_attach_property(&connector->base, in __drm_connector_init()
303 config->dpms_property, 0); in __drm_connector_init()
305 drm_object_attach_property(&connector->base, in __drm_connector_init()
306 config->link_status_property, in __drm_connector_init()
309 drm_object_attach_property(&connector->base, in __drm_connector_init()
310 config->non_desktop_property, in __drm_connector_init()
312 drm_object_attach_property(&connector->base, in __drm_connector_init()
313 config->tile_property, 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
360 if (drm_WARN_ON(dev, !(funcs && funcs->destroy))) in drm_connector_init()
361 return -EINVAL; in drm_connector_init()
368 * drm_connector_init_with_ddc - Init a preallocated connector
397 if (drm_WARN_ON(dev, !(funcs && funcs->destroy))) in drm_connector_init_with_ddc()
398 return -EINVAL; in drm_connector_init_with_ddc()
413 * drmm_connector_init - Init a preallocated connector
424 * drm_connector_cleanup() in a DRM-managed action.
439 if (drm_WARN_ON(dev, funcs && funcs->destroy)) in drmm_connector_init()
440 return -EINVAL; in drmm_connector_init()
456 * drm_connector_attach_edid_property - attach edid property.
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()
468 config->edid_property, in drm_connector_attach_edid_property()
474 * drm_connector_attach_encoder - attach a connector to an 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()
500 return -EINVAL; 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
520 return connector->possible_encoders & drm_encoder_mask(encoder); in drm_connector_has_possible_encoder()
527 list_del(&mode->head); in drm_mode_remove()
528 drm_mode_destroy(connector->dev, mode); in drm_mode_remove()
532 * drm_connector_cleanup - cleans up an initialised connector
539 struct drm_device *dev = connector->dev; in drm_connector_cleanup()
545 if (WARN_ON(connector->registration_state == 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()
562 list_for_each_entry_safe(mode, t, &connector->modes, head) 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()
577 spin_lock_irq(&dev->mode_config.connector_list_lock); in drm_connector_cleanup()
578 list_del(&connector->head); in drm_connector_cleanup()
579 dev->mode_config.num_connector--; in drm_connector_cleanup()
580 spin_unlock_irq(&dev->mode_config.connector_list_lock); 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()
591 if (dev->registered) in drm_connector_cleanup()
597 * drm_connector_register - register a connector
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()
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()
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()
654 mutex_unlock(&connector->mutex); in drm_connector_register()
660 * drm_connector_unregister - unregister a connector
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()
690 connector->registration_state = DRM_CONNECTOR_UNREGISTERED; in drm_connector_unregister()
691 mutex_unlock(&connector->mutex); in drm_connector_unregister()
726 * drm_get_connector_status_name - return a string for connector status
746 * drm_get_connector_force_name - return a string for connector force
774 * drm_connector_list_iter_begin - initialize a connector_list iterator
786 iter->dev = dev; in drm_connector_list_iter_begin()
787 iter->conn = NULL; in drm_connector_list_iter_begin()
793 * Extra-safe connector put function that works in any context. Should only be
800 struct drm_mode_config *config = &conn->dev->mode_config; in __drm_connector_put_safe()
802 lockdep_assert_held(&config->connector_list_lock); in __drm_connector_put_safe()
804 if (!refcount_dec_and_test(&conn->base.refcount.refcount)) in __drm_connector_put_safe()
807 llist_add(&conn->free_node, &config->connector_free_list); in __drm_connector_put_safe()
808 schedule_work(&config->connector_free_work); in __drm_connector_put_safe()
812 * drm_connector_list_iter_next - return next connector
821 struct drm_connector *old_conn = iter->conn; in drm_connector_list_iter_next()
822 struct drm_mode_config *config = &iter->dev->mode_config; in drm_connector_list_iter_next()
826 spin_lock_irqsave(&config->connector_list_lock, flags); in drm_connector_list_iter_next()
827 lhead = old_conn ? &old_conn->head : &config->connector_list; in drm_connector_list_iter_next()
830 if (lhead->next == &config->connector_list) { in drm_connector_list_iter_next()
831 iter->conn = NULL; in drm_connector_list_iter_next()
835 lhead = lhead->next; in drm_connector_list_iter_next()
836 iter->conn = list_entry(lhead, struct drm_connector, head); in drm_connector_list_iter_next()
839 } while (!kref_get_unless_zero(&iter->conn->base.refcount)); in drm_connector_list_iter_next()
843 spin_unlock_irqrestore(&config->connector_list_lock, flags); in drm_connector_list_iter_next()
845 return iter->conn; in drm_connector_list_iter_next()
850 * drm_connector_list_iter_end - tear down a connector_list iterator
860 struct drm_mode_config *config = &iter->dev->mode_config; in drm_connector_list_iter_end()
863 iter->dev = NULL; in drm_connector_list_iter_end()
864 if (iter->conn) { in drm_connector_list_iter_end()
865 spin_lock_irqsave(&config->connector_list_lock, flags); in drm_connector_list_iter_end()
866 __drm_connector_put_safe(iter->conn); in drm_connector_list_iter_end()
867 spin_unlock_irqrestore(&config->connector_list_lock, flags); in drm_connector_list_iter_end()
883 * drm_get_subpixel_order_name - return a string for a given subpixel enum
911 * drm_display_info_set_bus_formats - set the supported bus formats
917 * See MEDIA_BUS_FMT_* definitions in include/uapi/linux/media-bus-format.h for
930 return -EINVAL; in drm_display_info_set_bus_formats()
936 return -ENOMEM; in drm_display_info_set_bus_formats()
939 kfree(info->bus_formats); in drm_display_info_set_bus_formats()
940 info->bus_formats = fmts; in drm_display_info_set_bus_formats()
941 info->num_bus_formats = num_formats; in drm_display_info_set_bus_formats()
977 { DRM_MODE_SUBCONNECTOR_Automatic, "Automatic" }, /* DVI-I and TV-out */
978 { DRM_MODE_SUBCONNECTOR_DVID, "DVI-D" }, /* DVI-I */
979 { DRM_MODE_SUBCONNECTOR_DVIA, "DVI-A" }, /* DVI-I */
984 { DRM_MODE_SUBCONNECTOR_Unknown, "Unknown" }, /* DVI-I, TV-out and DP */
985 { DRM_MODE_SUBCONNECTOR_DVID, "DVI-D" }, /* DVI-I */
986 { DRM_MODE_SUBCONNECTOR_DVIA, "DVI-A" }, /* DVI-I */
993 { DRM_MODE_TV_MODE_NTSC_443, "NTSC-443" },
994 { DRM_MODE_TV_MODE_NTSC_J, "NTSC-J" },
996 { DRM_MODE_TV_MODE_PAL_M, "PAL-M" },
997 { DRM_MODE_TV_MODE_PAL_N, "PAL-N" },
1003 * drm_get_tv_mode_from_name - Translates a TV mode name into its enum value in DRM_ENUM_NAME_FN()
1018 if (strlen(item->name) == len && !strncmp(item->name, name, len)) in DRM_ENUM_NAME_FN()
1019 return item->type; in DRM_ENUM_NAME_FN()
1022 return -EINVAL; in DRM_ENUM_NAME_FN()
1027 { DRM_MODE_SUBCONNECTOR_Automatic, "Automatic" }, /* DVI-I and TV-out */
1028 { DRM_MODE_SUBCONNECTOR_Composite, "Composite" }, /* TV-out */
1029 { DRM_MODE_SUBCONNECTOR_SVIDEO, "SVIDEO" }, /* TV-out */
1030 { DRM_MODE_SUBCONNECTOR_Component, "Component" }, /* TV-out */
1031 { DRM_MODE_SUBCONNECTOR_SCART, "SCART" }, /* TV-out */
1036 { DRM_MODE_SUBCONNECTOR_Unknown, "Unknown" }, /* DVI-I, TV-out and DP */
1037 { DRM_MODE_SUBCONNECTOR_Composite, "Composite" }, /* TV-out */
1038 { DRM_MODE_SUBCONNECTOR_SVIDEO, "SVIDEO" }, /* TV-out */
1039 { DRM_MODE_SUBCONNECTOR_Component, "Component" }, /* TV-out */
1040 { DRM_MODE_SUBCONNECTOR_SCART, "SCART" }, /* TV-out */
1046 { DRM_MODE_SUBCONNECTOR_Unknown, "Unknown" }, /* DVI-I, TV-out and DP */
1048 { DRM_MODE_SUBCONNECTOR_DVID, "DVI-D" }, /* DP */
1065 /* Standard Definition Colorimetry based on IEC 61966-2-4 */
1067 /* High Definition Colorimetry based on IEC 61966-2-4 */
1069 /* Colorimetry based on IEC 61966-2-1/Amendment 1 */
1071 /* Colorimetry based on IEC 61966-2-5 [33] */
1073 /* Colorimetry based on IEC 61966-2-5 */
1075 /* Colorimetry based on ITU-R BT.2020 */
1077 /* Colorimetry based on ITU-R BT.2020 */
1079 /* Colorimetry based on ITU-R BT.2020 */
1082 [DRM_MODE_COLORIMETRY_DCI_P3_RGB_D65] = "DCI-P3_RGB_D65",
1083 [DRM_MODE_COLORIMETRY_DCI_P3_RGB_THEATER] = "DCI-P3_RGB_Theater",
1085 /* Colorimetry based on scRGB (IEC 61966-2-2) */
1091 * drm_get_colorspace_name - return a string for color encoding
1121 * Format Table 2-120
1151 * User-space should not parse the EDID to obtain information exposed via
1153 * fixups to the EDID). For instance, user-space should not try to parse
1175 * The second issue is that the DPMS state is only well-defined when the
1192 * TILE:
1193 * Connector tile group property to indicate how a set of DRM connector
1194 * compose together into one logical screen. This is used by both high-res
1196 * DP MST sinks), or high-res integrated panels (like dual-link DSI) which
1197 * are not gen-locked. Note that for tiled panels which are genlocked, like
1198 * dual-link LVDS or dual-link DSI, the driver should try to not expose the
1202 * link-status:
1203 * Connector link-status property to indicate the status of link. The
1204 * default value of link-status is "GOOD". If something fails during or
1209 * When user-space receives the hotplug uevent and detects a "BAD"
1210 * link-status, the sink doesn't receive pixels anymore (e.g. the screen
1212 * changed. User-space is expected to pick a new mode if the current one
1213 * has disappeared and perform a new modeset with link-status set to
1214 * "GOOD" to re-enable the connector.
1217 * link-status, the other are unaffected (ie. the sinks still continue to
1220 * When user-space performs an atomic commit on a connector with a "BAD"
1221 * link-status without resetting the property to "GOOD", the sink may
1222 * still not receive pixels. When user-space performs an atomic commit
1223 * which resets the link-status property to "GOOD" without the
1226 * User-space can only change link-status to "GOOD", changing it to "BAD"
1227 * is a no-op.
1229 * For backwards compatibility with non-atomic userspace the kernel
1230 * tries to automatically set the link-status back to "GOOD" in the
1259 * -EINVAL.
1263 * - DESIRED state should be preserved until userspace de-asserts it by
1266 * - If the state is DESIRED, kernel should attempt to re-authenticate the
1269 * - Kernel sends uevent with the connector id and property id through
1273 * - DESIRED -> ENABLED (authentication success)
1274 * - ENABLED -> DESIRED (termination of authentication)
1275 * - Please note no uevents for userspace triggered property state changes,
1278 * - DESIRED/ENABLED -> UNDESIRED
1279 * - UNDESIRED -> DESIRED
1280 * - Userspace is responsible for polling the property or listen to uevents
1295 * - "HDCP Type0": DRM_MODE_HDCP_CONTENT_TYPE0 = 0
1296 * - "HDCP Type1": DRM_MODE_HDCP_CONTENT_TYPE1 = 1
1331 * then kernel will disable the HDCP and re-enable with new type in the
1342 * SDP packet (Non-audio INFOFRAME SDP v1.3) for DP. This is then
1360 * - Some layers are HDR and others are SDR
1361 * - HDR layers luminance is not same as sink
1404 * This property defines how a non-native mode is upscaled to the native
1424 * have a built-in scaler).
1427 * This property is used by DVI-I, TVout and DisplayPort to indicate different
1430 * For DVI-I and TVout there is also a matching property "select subconnector"
1434 * privacy-screen sw-state, privacy-screen hw-state:
1440 * "privacy-screen hw-state" is read-only and reflects the actual state
1441 * of the privacy-screen, possible values: "Enabled", "Disabled,
1442 * "Enabled-locked", "Disabled-locked". The locked states indicate
1444 * might be devices where the firmware-setup options, or a hardware
1445 * slider-switch, offer always on / off modes.
1447 * "privacy-screen sw-state" can be set to change the privacy-screen state
1448 * when not locked. In this case the driver must update the hw-state
1450 * sw-state property. Setting the sw-state property when the hw-state is
1452 * state to the set state when the hw-state becomes unlocked. E.g. if
1453 * "privacy-screen hw-state" is "Enabled-locked" and the sw-state
1455 * changing the slider-switch position, then the driver must set the
1458 * In some cases the privacy-screen's actual state might change outside of
1462 * In this case the driver must update both the hw-state and the sw-state
1464 * sw-state. Any pending sw-state requests are thus discarded.
1467 * the DRM master process means that userspace must not cache the value
1468 * of the sw-state. Caching the sw-state value and including it in later
1471 * privacy-screen sw-state in an atomic commit unless it wants to change
1497 return -ENOMEM; in drm_connector_create_standard_properties()
1498 dev->mode_config.edid_property = prop; in drm_connector_create_standard_properties()
1504 return -ENOMEM; in drm_connector_create_standard_properties()
1505 dev->mode_config.dpms_property = prop; in drm_connector_create_standard_properties()
1512 return -ENOMEM; in drm_connector_create_standard_properties()
1513 dev->mode_config.path_property = prop; in drm_connector_create_standard_properties()
1518 "TILE", 0); in drm_connector_create_standard_properties()
1520 return -ENOMEM; in drm_connector_create_standard_properties()
1521 dev->mode_config.tile_property = prop; in drm_connector_create_standard_properties()
1523 prop = drm_property_create_enum(dev, 0, "link-status", in drm_connector_create_standard_properties()
1527 return -ENOMEM; in drm_connector_create_standard_properties()
1528 dev->mode_config.link_status_property = prop; in drm_connector_create_standard_properties()
1530 prop = drm_property_create_bool(dev, DRM_MODE_PROP_IMMUTABLE, "non-desktop"); in drm_connector_create_standard_properties()
1532 return -ENOMEM; in drm_connector_create_standard_properties()
1533 dev->mode_config.non_desktop_property = prop; in drm_connector_create_standard_properties()
1538 return -ENOMEM; in drm_connector_create_standard_properties()
1539 dev->mode_config.hdr_output_metadata_property = prop; in drm_connector_create_standard_properties()
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.
1557 if (dev->mode_config.dvi_i_select_subconnector_property) in drm_mode_create_dvi_i_properties()
1565 dev->mode_config.dvi_i_select_subconnector_property = dvi_i_selector; in drm_mode_create_dvi_i_properties()
1571 dev->mode_config.dvi_i_subconnector_property = dvi_i_subconnector; in drm_mode_create_dvi_i_properties()
1578 * drm_connector_attach_dp_subconnector_property - create subconnector property for DP
1585 struct drm_mode_config *mode_config = &connector->dev->mode_config; in drm_connector_attach_dp_subconnector_property()
1587 if (!mode_config->dp_subconnector_property) in drm_connector_attach_dp_subconnector_property()
1588 mode_config->dp_subconnector_property = 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()
1596 mode_config->dp_subconnector_property, in drm_connector_attach_dp_subconnector_property()
1622 * The meaning of each content type is defined in CTA-861-G table 15.
1631 * - brightness
1632 * - contrast
1633 * - flicker reduction
1634 * - hue
1635 * - mode
1636 * - overscan
1637 * - saturation
1638 * - select subconnector
1648 * TV Mode is CCIR System M (aka 525-lines) together with
1651 * NTSC-443:
1653 * TV Mode is CCIR System M (aka 525-lines) together with
1657 * NTSC-J:
1659 * TV Mode is CCIR System M (aka 525-lines) together with
1665 * TV Mode is CCIR System B (aka 625-lines) together with
1668 * PAL-M:
1670 * TV Mode is CCIR System M (aka 525-lines) together with
1673 * PAL-N:
1682 * TV Mode is CCIR System B (aka 625-lines) together with
1690 * drm_connector_attach_content_type_property - attach content-type property
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
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()
1720 dev->mode_config.tv_left_margin_property, in drm_connector_attach_tv_margin_properties()
1722 drm_object_attach_property(&connector->base, in drm_connector_attach_tv_margin_properties()
1723 dev->mode_config.tv_right_margin_property, in drm_connector_attach_tv_margin_properties()
1725 drm_object_attach_property(&connector->base, in drm_connector_attach_tv_margin_properties()
1726 dev->mode_config.tv_top_margin_property, in drm_connector_attach_tv_margin_properties()
1728 drm_object_attach_property(&connector->base, in drm_connector_attach_tv_margin_properties()
1729 dev->mode_config.tv_bottom_margin_property, in drm_connector_attach_tv_margin_properties()
1735 * drm_mode_create_tv_margin_properties - create TV connector margin properties
1748 if (dev->mode_config.tv_left_margin_property) in drm_mode_create_tv_margin_properties()
1751 dev->mode_config.tv_left_margin_property = in drm_mode_create_tv_margin_properties()
1753 if (!dev->mode_config.tv_left_margin_property) in drm_mode_create_tv_margin_properties()
1754 return -ENOMEM; in drm_mode_create_tv_margin_properties()
1756 dev->mode_config.tv_right_margin_property = in drm_mode_create_tv_margin_properties()
1758 if (!dev->mode_config.tv_right_margin_property) in drm_mode_create_tv_margin_properties()
1759 return -ENOMEM; in drm_mode_create_tv_margin_properties()
1761 dev->mode_config.tv_top_margin_property = in drm_mode_create_tv_margin_properties()
1763 if (!dev->mode_config.tv_top_margin_property) in drm_mode_create_tv_margin_properties()
1764 return -ENOMEM; in drm_mode_create_tv_margin_properties()
1766 dev->mode_config.tv_bottom_margin_property = in drm_mode_create_tv_margin_properties()
1768 if (!dev->mode_config.tv_bottom_margin_property) in drm_mode_create_tv_margin_properties()
1769 return -ENOMEM; in drm_mode_create_tv_margin_properties()
1776 * drm_mode_create_tv_properties_legacy - create TV specific connector properties
1801 if (dev->mode_config.tv_select_subconnector_property) in drm_mode_create_tv_properties_legacy()
1814 dev->mode_config.tv_select_subconnector_property = tv_selector; in drm_mode_create_tv_properties_legacy()
1823 dev->mode_config.tv_subconnector_property = tv_subconnector; in drm_mode_create_tv_properties_legacy()
1832 dev->mode_config.legacy_tv_mode_property = in drm_mode_create_tv_properties_legacy()
1835 if (!dev->mode_config.legacy_tv_mode_property) in drm_mode_create_tv_properties_legacy()
1839 drm_property_add_enum(dev->mode_config.legacy_tv_mode_property, in drm_mode_create_tv_properties_legacy()
1843 dev->mode_config.tv_brightness_property = in drm_mode_create_tv_properties_legacy()
1845 if (!dev->mode_config.tv_brightness_property) in drm_mode_create_tv_properties_legacy()
1848 dev->mode_config.tv_contrast_property = in drm_mode_create_tv_properties_legacy()
1850 if (!dev->mode_config.tv_contrast_property) in drm_mode_create_tv_properties_legacy()
1853 dev->mode_config.tv_flicker_reduction_property = in drm_mode_create_tv_properties_legacy()
1855 if (!dev->mode_config.tv_flicker_reduction_property) in drm_mode_create_tv_properties_legacy()
1858 dev->mode_config.tv_overscan_property = in drm_mode_create_tv_properties_legacy()
1860 if (!dev->mode_config.tv_overscan_property) in drm_mode_create_tv_properties_legacy()
1863 dev->mode_config.tv_saturation_property = in drm_mode_create_tv_properties_legacy()
1865 if (!dev->mode_config.tv_saturation_property) in drm_mode_create_tv_properties_legacy()
1868 dev->mode_config.tv_hue_property = in drm_mode_create_tv_properties_legacy()
1870 if (!dev->mode_config.tv_hue_property) in drm_mode_create_tv_properties_legacy()
1875 return -ENOMEM; in drm_mode_create_tv_properties_legacy()
1880 * drm_mode_create_tv_properties - create TV specific connector properties
1897 if (dev->mode_config.tv_mode_property) in drm_mode_create_tv_properties()
1912 return -ENOMEM; in drm_mode_create_tv_properties()
1914 dev->mode_config.tv_mode_property = tv_mode; in drm_mode_create_tv_properties()
1921 * drm_mode_create_scaling_mode_property - create scaling mode property
1937 if (dev->mode_config.scaling_mode_property) in drm_mode_create_scaling_mode_property()
1945 dev->mode_config.scaling_mode_property = scaling_mode; in drm_mode_create_scaling_mode_property()
1999 * vertical front porch duration will be extended until page-flip or
2014 * drm_connector_attach_vrr_capable_property - creates the
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()
2034 return -ENOMEM; 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()
2045 * drm_connector_attach_scaling_mode_property - attach atomic scaling mode property
2051 * and can be used from &drm_connector_helper_funcs->atomic_check for validation.
2061 struct drm_device *dev = connector->dev; in drm_connector_attach_scaling_mode_property()
2065 (1U << ARRAY_SIZE(drm_scaling_mode_enum_list)) - 1; in drm_connector_attach_scaling_mode_property()
2069 return -EINVAL; in drm_connector_attach_scaling_mode_property()
2076 return -ENOMEM; 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()
2105 * drm_mode_create_aspect_ratio_property - create aspect ratio property
2116 if (dev->mode_config.aspect_ratio_property) in drm_mode_create_aspect_ratio_property()
2119 dev->mode_config.aspect_ratio_property = in drm_mode_create_aspect_ratio_property()
2124 if (dev->mode_config.aspect_ratio_property == NULL) in drm_mode_create_aspect_ratio_property()
2125 return -ENOMEM; in drm_mode_create_aspect_ratio_property()
2147 * - Set up CRTC DEGAMMA/CTM/GAMMA to convert to some sink
2149 * - Set this new property to let the sink know what it
2151 * - This property is just to inform sink what colorspace
2162 struct drm_device *dev = connector->dev; in drm_mode_create_colorspace_property()
2167 if (connector->colorspace_property) in drm_mode_create_colorspace_property()
2172 connector->base.id, connector->name); in drm_mode_create_colorspace_property()
2173 return -EINVAL; in drm_mode_create_colorspace_property()
2176 if ((supported_colorspaces & -BIT(DRM_MODE_COLORIMETRY_COUNT)) != 0) { in drm_mode_create_colorspace_property()
2178 connector->base.id, connector->name); in drm_mode_create_colorspace_property()
2179 return -EINVAL; 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()
2198 return -ENOMEM; in drm_mode_create_colorspace_property()
2204 * drm_mode_create_hdmi_colorspace_property - create hdmi colorspace property
2229 * drm_mode_create_dp_colorspace_property - create dp colorspace property
2254 * drm_mode_create_content_type_property - create content type property
2265 if (dev->mode_config.content_type_property) in drm_mode_create_content_type_property()
2268 dev->mode_config.content_type_property = in drm_mode_create_content_type_property()
2273 if (dev->mode_config.content_type_property == NULL) in drm_mode_create_content_type_property()
2274 return -ENOMEM; in drm_mode_create_content_type_property()
2281 * drm_mode_create_suggested_offset_properties - create suggests offset properties
2291 if (dev->mode_config.suggested_x_property && dev->mode_config.suggested_y_property) in drm_mode_create_suggested_offset_properties()
2294 dev->mode_config.suggested_x_property = in drm_mode_create_suggested_offset_properties()
2297 dev->mode_config.suggested_y_property = in drm_mode_create_suggested_offset_properties()
2300 if (dev->mode_config.suggested_x_property == NULL || in drm_mode_create_suggested_offset_properties()
2301 dev->mode_config.suggested_y_property == NULL) in drm_mode_create_suggested_offset_properties()
2302 return -ENOMEM; in drm_mode_create_suggested_offset_properties()
2308 * drm_connector_set_path_property - set tile property on connector
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()
2331 dev->mode_config.path_property); in drm_connector_set_path_property()
2337 * drm_connector_set_tile_property - set tile property on connector
2340 * This looks up the tile information for a connector, and creates a
2351 struct drm_device *dev = connector->dev; in drm_connector_set_tile_property()
2352 char tile[256]; in drm_connector_set_tile_property() local
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()
2361 dev->mode_config.tile_property); in drm_connector_set_tile_property()
2365 snprintf(tile, 256, "%d:%d:%d:%d:%d:%d:%d:%d", 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()
2373 strlen(tile) + 1, in drm_connector_set_tile_property()
2374 tile, in drm_connector_set_tile_property()
2375 &connector->base, in drm_connector_set_tile_property()
2376 dev->mode_config.tile_property); in drm_connector_set_tile_property()
2382 * drm_connector_set_link_status_property - Set link status property of a connector
2389 * hotplug uevent for userspace to re-check the valid modes through
2394 * re-training a link) without userspace's intervention.
2403 struct drm_device *dev = connector->dev; in drm_connector_set_link_status_property()
2405 drm_modeset_lock(&dev->mode_config.connection_mutex, NULL); in drm_connector_set_link_status_property()
2406 connector->state->link_status = link_status; in drm_connector_set_link_status_property()
2407 drm_modeset_unlock(&dev->mode_config.connection_mutex); in drm_connector_set_link_status_property()
2412 * drm_connector_attach_max_bpc_property - attach "max bpc" property
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()
2432 return -ENOMEM; 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()
2446 * drm_connector_attach_hdr_output_metadata_property - attach "HDR_OUTPUT_METADA" property
2457 struct drm_device *dev = connector->dev; in drm_connector_attach_hdr_output_metadata_property()
2458 struct drm_property *prop = dev->mode_config.hdr_output_metadata_property; 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()
2467 * drm_connector_attach_colorspace_property - attach "Colorspace" property
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()
2487 * drm_connector_atomic_hdr_metadata_equal - checks if the hdr metadata changed
2491 * This is used by HDR-enabled drivers to test whether the HDR metadata
2501 struct drm_property_blob *old_blob = old_state->hdr_output_metadata; in drm_connector_atomic_hdr_metadata_equal()
2502 struct drm_property_blob *new_blob = new_state->hdr_output_metadata; in drm_connector_atomic_hdr_metadata_equal()
2507 if (old_blob->length != new_blob->length) in drm_connector_atomic_hdr_metadata_equal()
2510 return !memcmp(old_blob->data, new_blob->data, old_blob->length); in drm_connector_atomic_hdr_metadata_equal()
2515 * drm_connector_set_vrr_capable_property - sets the variable refresh rate
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.
2544 * already been set is a no-op (e.g. the orientation has been overridden with
2548 * DRM_MODE_PANEL_ORIENTATION_UNKNOWN, in which case it is a no-op.
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()
2565 if (info->panel_orientation != DRM_MODE_PANEL_ORIENTATION_UNKNOWN) in drm_connector_set_panel_orientation()
2572 info->panel_orientation = panel_orientation; in drm_connector_set_panel_orientation()
2574 prop = dev->mode_config.panel_orientation_property; in drm_connector_set_panel_orientation()
2581 return -ENOMEM; in drm_connector_set_panel_orientation()
2583 dev->mode_config.panel_orientation_property = prop; in drm_connector_set_panel_orientation()
2586 drm_object_attach_property(&connector->base, prop, in drm_connector_set_panel_orientation()
2587 info->panel_orientation); in drm_connector_set_panel_orientation()
2593 * drm_connector_set_panel_orientation_with_quirk - set the
2595 * @connector: connector for which to init the panel-orientation property.
2623 * drm_connector_set_orientation_from_panel -
2625 * @connector: connector for which to init the panel-orientation property.
2640 if (panel && panel->funcs && panel->funcs->get_orientation) in drm_connector_set_orientation_from_panel()
2641 orientation = panel->funcs->get_orientation(panel); in drm_connector_set_orientation_from_panel()
2652 { PRIVACY_SCREEN_DISABLED_LOCKED, "Disabled-locked" },
2653 { PRIVACY_SCREEN_ENABLED_LOCKED, "Enabled-locked" },
2657 * drm_connector_create_privacy_screen_properties - create the drm connecter's
2658 * privacy-screen properties.
2659 * @connector: connector for which to create the privacy-screen properties
2661 * This function creates the "privacy-screen sw-state" and "privacy-screen
2662 * hw-state" properties for the connector. They are not attached.
2667 if (connector->privacy_screen_sw_state_property) in drm_connector_create_privacy_screen_properties()
2670 /* Note sw-state only supports the first 2 values of the enum */ 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()
2673 "privacy-screen sw-state", 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()
2679 "privacy-screen hw-state", in drm_connector_create_privacy_screen_properties()
2686 * drm_connector_attach_privacy_screen_properties - attach the drm connecter's
2687 * privacy-screen properties.
2688 * @connector: connector on which to attach the privacy-screen properties
2690 * This function attaches the "privacy-screen sw-state" and "privacy-screen
2691 * hw-state" properties to the connector. The initial state of both is set
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()
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()
2729 struct drm_device *dev = connector->dev; in drm_connector_privacy_screen_notifier()
2731 drm_modeset_lock(&dev->mode_config.connection_mutex, NULL); in drm_connector_privacy_screen_notifier()
2733 drm_modeset_unlock(&dev->mode_config.connection_mutex); in drm_connector_privacy_screen_notifier()
2736 connector->privacy_screen_sw_state_property); in drm_connector_privacy_screen_notifier()
2738 connector->privacy_screen_hw_state_property); in drm_connector_privacy_screen_notifier()
2744 * drm_connector_attach_privacy_screen_provider - attach a privacy-screen to
2746 * @connector: connector to attach the privacy-screen to
2749 * Create and attach the standard privacy-screen properties and register
2750 * a generic notifier for generating sysfs-connector-status-events
2751 * on external changes to the privacy-screen status.
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()
2769 * drm_connector_update_privacy_screen - update connector's privacy-screen sw-state
2770 * @connector_state: connector-state to update the privacy-screen for
2773 * privacy-screen.
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()
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()
2786 connector_state->privacy_screen_sw_state); in drm_connector_update_privacy_screen()
2788 drm_err(connector->dev, "Error updating privacy-screen sw_state\n"); in drm_connector_update_privacy_screen()
2801 int ret = -EINVAL; in drm_connector_set_obj_prop()
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()
2820 .value = conn_set_prop->value, in drm_connector_property_set_ioctl()
2821 .prop_id = conn_set_prop->prop_id, in drm_connector_property_set_ioctl()
2822 .obj_id = conn_set_prop->connector_id, in drm_connector_property_set_ioctl()
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()
2846 * If user-space hasn't configured the driver to expose the stereo 3D in drm_mode_expose_to_userspace()
2849 if (!file_priv->stereo_allowed && drm_mode_is_stereo(mode)) in drm_mode_expose_to_userspace()
2852 * If user-space hasn't configured the driver to expose the modes in drm_mode_expose_to_userspace()
2853 * with aspect-ratio, don't expose them. However if such a mode in drm_mode_expose_to_userspace()
2854 * is unique, let it be exposed, but reset the aspect-ratio flags in drm_mode_expose_to_userspace()
2855 * while preparing the list of user-modes. in drm_mode_expose_to_userspace()
2857 if (!file_priv->aspect_ratio_allowed) { in drm_mode_expose_to_userspace()
2861 if (mode_itr->expose_to_userspace && in drm_mode_expose_to_userspace()
2891 return -EOPNOTSUPP; in drm_mode_getconnector()
2895 connector = drm_connector_lookup(dev, file_priv, out_resp->connector_id); in drm_mode_getconnector()
2897 return -ENOENT; in drm_mode_getconnector()
2899 encoders_count = hweight32(connector->possible_encoders); in drm_mode_getconnector()
2901 if ((out_resp->count_encoders >= encoders_count) && encoders_count) { in drm_mode_getconnector()
2903 encoder_ptr = (uint32_t __user *)(unsigned long)(out_resp->encoders_ptr); in drm_mode_getconnector()
2906 if (put_user(encoder->base.id, encoder_ptr + copied)) { in drm_mode_getconnector()
2907 ret = -EFAULT; in drm_mode_getconnector()
2913 out_resp->count_encoders = encoders_count; 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()
2921 mutex_lock(&dev->mode_config.mutex); in drm_mode_getconnector()
2922 if (out_resp->count_modes == 0) { in drm_mode_getconnector()
2924 connector->funcs->fill_modes(connector, in drm_mode_getconnector()
2925 dev->mode_config.max_width, in drm_mode_getconnector()
2926 dev->mode_config.max_height); 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()
2937 /* delayed so we get modes regardless of pre-fill_modes state */ in drm_mode_getconnector()
2938 list_for_each_entry(mode, &connector->modes, head) { in drm_mode_getconnector()
2939 WARN_ON(mode->expose_to_userspace); in drm_mode_getconnector()
2941 if (drm_mode_expose_to_userspace(mode, &connector->modes, in drm_mode_getconnector()
2943 mode->expose_to_userspace = true; in drm_mode_getconnector()
2952 if ((out_resp->count_modes >= mode_count) && mode_count) { in drm_mode_getconnector()
2954 mode_ptr = (struct drm_mode_modeinfo __user *)(unsigned long)out_resp->modes_ptr; in drm_mode_getconnector()
2955 list_for_each_entry(mode, &connector->modes, head) { in drm_mode_getconnector()
2956 if (!mode->expose_to_userspace) in drm_mode_getconnector()
2960 mode->expose_to_userspace = false; in drm_mode_getconnector()
2964 * Reset aspect ratio flags of user-mode, if modes with in drm_mode_getconnector()
2965 * aspect-ratio are not supported. in drm_mode_getconnector()
2967 if (!file_priv->aspect_ratio_allowed) in drm_mode_getconnector()
2971 ret = -EFAULT; in drm_mode_getconnector()
2977 list_for_each_entry_continue(mode, &connector->modes, head) in drm_mode_getconnector()
2978 mode->expose_to_userspace = false; in drm_mode_getconnector()
2980 mutex_unlock(&dev->mode_config.mutex); in drm_mode_getconnector()
2988 list_for_each_entry(mode, &connector->modes, head) in drm_mode_getconnector()
2989 mode->expose_to_userspace = false; in drm_mode_getconnector()
2992 out_resp->count_modes = mode_count; in drm_mode_getconnector()
2993 mutex_unlock(&dev->mode_config.mutex); in drm_mode_getconnector()
2995 drm_modeset_lock(&dev->mode_config.connection_mutex, NULL); in drm_mode_getconnector()
2998 out_resp->encoder_id = encoder->base.id; in drm_mode_getconnector()
3000 out_resp->encoder_id = 0; in drm_mode_getconnector()
3005 ret = drm_mode_object_get_properties(&connector->base, file_priv->atomic, in drm_mode_getconnector()
3006 (uint32_t __user *)(unsigned long)(out_resp->props_ptr), in drm_mode_getconnector()
3007 (uint64_t __user *)(unsigned long)(out_resp->prop_values_ptr), in drm_mode_getconnector()
3008 &out_resp->count_props); in drm_mode_getconnector()
3009 drm_modeset_unlock(&dev->mode_config.connection_mutex); in drm_mode_getconnector()
3018 * drm_connector_find_by_fwnode - Find a connector based on the associated fwnode
3030 struct drm_connector *connector, *found = ERR_PTR(-ENODEV); in drm_connector_find_by_fwnode()
3033 return ERR_PTR(-ENODEV); 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()
3052 * drm_connector_oob_hotplug_event - Report out-of-band hotplug event to connector
3056 * driver / device. An example of this is some USB Type-C setups where the hardware
3057 * muxes the DisplayPort data and aux-lines but does not pass the altmode HPD
3060 * This function can be used to report these out-of-band events after obtaining
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()
3080 * DOC: Tile group
3082 * Tile groups are used to represent tiled monitors with a unique integer
3083 * identifier. Tiled monitors using DisplayID v1.3 have a unique 8-byte handle,
3084 * we store this in a tile group, so we have a common identifier for all tiles
3085 * in a monitor group. The property is called "TILE". Drivers can manage tile
3088 * the tile group information is exposed through a non-standard way.
3094 struct drm_device *dev = tg->dev; in drm_tile_group_free()
3096 mutex_lock(&dev->mode_config.idr_mutex); in drm_tile_group_free()
3097 idr_remove(&dev->mode_config.tile_idr, tg->id); in drm_tile_group_free()
3098 mutex_unlock(&dev->mode_config.idr_mutex); in drm_tile_group_free()
3103 * drm_mode_put_tile_group - drop a reference to a tile group.
3105 * @tg: tile group to drop reference to.
3107 * drop reference to tile group and free if 0.
3112 kref_put(&tg->refcount, drm_tile_group_free); in drm_mode_put_tile_group()
3117 * drm_mode_get_tile_group - get a reference to an existing tile group
3119 * @topology: 8-bytes unique per monitor.
3121 * Use the unique bytes to get a reference to an existing tile group.
3124 * tile group or NULL if not found.
3132 mutex_lock(&dev->mode_config.idr_mutex); in drm_mode_get_tile_group()
3133 idr_for_each_entry(&dev->mode_config.tile_idr, tg, id) { in drm_mode_get_tile_group()
3134 if (!memcmp(tg->group_data, topology, 8)) { in drm_mode_get_tile_group()
3135 if (!kref_get_unless_zero(&tg->refcount)) in drm_mode_get_tile_group()
3137 mutex_unlock(&dev->mode_config.idr_mutex); in drm_mode_get_tile_group()
3141 mutex_unlock(&dev->mode_config.idr_mutex); in drm_mode_get_tile_group()
3147 * drm_mode_create_tile_group - create a tile group from a displayid description
3149 * @topology: 8-bytes unique per monitor.
3151 * Create a tile group for the unique monitor, and get a unique
3152 * identifier for the tile group.
3155 * new tile group or NULL.
3167 kref_init(&tg->refcount); in drm_mode_create_tile_group()
3168 memcpy(tg->group_data, topology, 8); in drm_mode_create_tile_group()
3169 tg->dev = dev; in drm_mode_create_tile_group()
3171 mutex_lock(&dev->mode_config.idr_mutex); in drm_mode_create_tile_group()
3172 ret = idr_alloc(&dev->mode_config.tile_idr, tg, 1, 0, GFP_KERNEL); in drm_mode_create_tile_group()
3174 tg->id = ret; in drm_mode_create_tile_group()
3180 mutex_unlock(&dev->mode_config.idr_mutex); in drm_mode_create_tile_group()