Lines Matching +full:e +full:- +full:ddc
1 // SPDX-License-Identifier: GPL-2.0+
44 * operation flags (&drm_bridge->ops) and bridge output type
45 * (&drm_bridge->type), as well as the DRM_BRIDGE_ATTACH_NO_CONNECTOR attach
50 * struct drm_bridge_connector - A connector backed by a chain of bridges
74 * hot-plug detection notification, if any (see &DRM_BRIDGE_OP_HPD).
103 /* -----------------------------------------------------------------------------
104 * Bridge Connector Hot-Plug Handling
115 drm_for_each_bridge_in_chain(bridge_connector->encoder, bridge) { in drm_bridge_connector_hpd_notify()
116 if (bridge->funcs->hpd_notify) in drm_bridge_connector_hpd_notify()
117 bridge->funcs->hpd_notify(bridge, status); in drm_bridge_connector_hpd_notify()
124 struct drm_connector *connector = &drm_bridge_connector->base; in drm_bridge_connector_handle_hpd()
125 struct drm_device *dev = connector->dev; in drm_bridge_connector_handle_hpd()
127 mutex_lock(&dev->mode_config.mutex); in drm_bridge_connector_handle_hpd()
128 connector->status = status; in drm_bridge_connector_handle_hpd()
129 mutex_unlock(&dev->mode_config.mutex); in drm_bridge_connector_handle_hpd()
155 struct drm_bridge *hpd = bridge_connector->bridge_hpd; in drm_bridge_connector_enable_hpd()
166 struct drm_bridge *hpd = bridge_connector->bridge_hpd; in drm_bridge_connector_disable_hpd()
172 /* -----------------------------------------------------------------------------
181 struct drm_bridge *detect = bridge_connector->bridge_detect; in drm_bridge_connector_detect()
185 status = detect->funcs->detect(detect); in drm_bridge_connector_detect()
189 switch (connector->connector_type) { in drm_bridge_connector_detect()
210 struct drm_encoder *encoder = bridge_connector->encoder; in drm_bridge_connector_debugfs_init()
213 list_for_each_entry(bridge, &encoder->bridge_chain, chain_node) { in drm_bridge_connector_debugfs_init()
214 if (bridge->funcs->debugfs_init) in drm_bridge_connector_debugfs_init()
215 bridge->funcs->debugfs_init(bridge, root); in drm_bridge_connector_debugfs_init()
225 if (bridge_connector->bridge_hdmi) in drm_bridge_connector_reset()
227 connector->state); in drm_bridge_connector_reset()
240 /* -----------------------------------------------------------------------------
282 bridge = bridge_connector->bridge_edid; in drm_bridge_connector_get_modes()
287 * Otherwise if the display pipeline reports modes (e.g. with a fixed in drm_bridge_connector_get_modes()
290 bridge = bridge_connector->bridge_modes; in drm_bridge_connector_get_modes()
292 return bridge->funcs->get_modes(bridge, connector); in drm_bridge_connector_get_modes()
296 * VGA output with the DDC bus unconnected. The KMS core will add the in drm_bridge_connector_get_modes()
318 bridge = bridge_connector->bridge_hdmi; in drm_bridge_connector_tmds_char_rate_valid()
322 if (bridge->funcs->hdmi_tmds_char_rate_valid) in drm_bridge_connector_tmds_char_rate_valid()
323 return bridge->funcs->hdmi_tmds_char_rate_valid(bridge, mode, tmds_rate); in drm_bridge_connector_tmds_char_rate_valid()
335 bridge = bridge_connector->bridge_hdmi; in drm_bridge_connector_clear_infoframe()
337 return -EINVAL; in drm_bridge_connector_clear_infoframe()
339 return bridge->funcs->hdmi_clear_infoframe(bridge, type); in drm_bridge_connector_clear_infoframe()
350 bridge = bridge_connector->bridge_hdmi; in drm_bridge_connector_write_infoframe()
352 return -EINVAL; in drm_bridge_connector_write_infoframe()
354 return bridge->funcs->hdmi_write_infoframe(bridge, type, buffer, len); in drm_bridge_connector_write_infoframe()
363 /* -----------------------------------------------------------------------------
368 * drm_bridge_connector_init - Initialise a connector for a chain of bridges
375 * (&drm_bridge->ops) and bridge output type (&drm_bridge->type), and none of
386 struct i2c_adapter *ddc = NULL; in drm_bridge_connector_init() local
395 return ERR_PTR(-ENOMEM); in drm_bridge_connector_init()
397 bridge_connector->encoder = encoder; in drm_bridge_connector_init()
403 connector = &bridge_connector->base; in drm_bridge_connector_init()
404 connector->interlace_allowed = true; in drm_bridge_connector_init()
415 if (!bridge->interlace_allowed) in drm_bridge_connector_init()
416 connector->interlace_allowed = false; in drm_bridge_connector_init()
418 if (bridge->ops & DRM_BRIDGE_OP_EDID) in drm_bridge_connector_init()
419 bridge_connector->bridge_edid = bridge; in drm_bridge_connector_init()
420 if (bridge->ops & DRM_BRIDGE_OP_HPD) in drm_bridge_connector_init()
421 bridge_connector->bridge_hpd = bridge; in drm_bridge_connector_init()
422 if (bridge->ops & DRM_BRIDGE_OP_DETECT) in drm_bridge_connector_init()
423 bridge_connector->bridge_detect = bridge; in drm_bridge_connector_init()
424 if (bridge->ops & DRM_BRIDGE_OP_MODES) in drm_bridge_connector_init()
425 bridge_connector->bridge_modes = bridge; in drm_bridge_connector_init()
426 if (bridge->ops & DRM_BRIDGE_OP_HDMI) { in drm_bridge_connector_init()
427 if (bridge_connector->bridge_hdmi) in drm_bridge_connector_init()
428 return ERR_PTR(-EBUSY); in drm_bridge_connector_init()
429 if (!bridge->funcs->hdmi_write_infoframe || in drm_bridge_connector_init()
430 !bridge->funcs->hdmi_clear_infoframe) in drm_bridge_connector_init()
431 return ERR_PTR(-EINVAL); in drm_bridge_connector_init()
433 bridge_connector->bridge_hdmi = bridge; in drm_bridge_connector_init()
435 if (bridge->supported_formats) in drm_bridge_connector_init()
436 supported_formats = bridge->supported_formats; in drm_bridge_connector_init()
437 if (bridge->max_bpc) in drm_bridge_connector_init()
438 max_bpc = bridge->max_bpc; in drm_bridge_connector_init()
442 connector_type = bridge->type; in drm_bridge_connector_init()
446 bridge->of_node) in drm_bridge_connector_init()
447 connector->fwnode = fwnode_handle_get(of_fwnode_handle(bridge->of_node)); in drm_bridge_connector_init()
450 if (bridge->ddc) in drm_bridge_connector_init()
451 ddc = bridge->ddc; in drm_bridge_connector_init()
458 return ERR_PTR(-EINVAL); in drm_bridge_connector_init()
460 if (bridge_connector->bridge_hdmi) in drm_bridge_connector_init()
462 bridge_connector->bridge_hdmi->vendor, in drm_bridge_connector_init()
463 bridge_connector->bridge_hdmi->product, in drm_bridge_connector_init()
466 connector_type, ddc, in drm_bridge_connector_init()
472 connector_type, ddc); in drm_bridge_connector_init()
478 if (bridge_connector->bridge_hpd) in drm_bridge_connector_init()
479 connector->polled = DRM_CONNECTOR_POLL_HPD; in drm_bridge_connector_init()
480 else if (bridge_connector->bridge_detect) in drm_bridge_connector_init()
481 connector->polled = DRM_CONNECTOR_POLL_CONNECT in drm_bridge_connector_init()