1
0
Fork 0

drm/bridge: Pass down connector to drm bridge detect hook

In some application scenarios, we hope to get the corresponding
connector when the bridge's detect hook is invoked.

In most cases, we can get the connector by drm_atomic_get_connector_for_encoder
if the encoder attached to the bridge is enabled, however there will
still be some scenarios where the detect hook of the bridge is called
but the corresponding encoder has not been enabled yet. For instance,
this occurs when the device is hot plug in for the first time.

Since the call to bridge's detect is initiated by the connector, passing
down the corresponding connector directly will make things simpler.

Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Link: https://lore.kernel.org/r/20250703125027.311109-3-andyshrk@163.com
[DB: added the chunk to the cdn-dp driver]
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
This commit is contained in:
dvab-sarma 2025-12-04 18:04:43 -06:00
parent 2bef665401
commit 5ba93ec015
30 changed files with 128 additions and 52 deletions

View file

@ -518,21 +518,23 @@ struct drm_bridge_funcs {
*/
struct drm_bridge_state *(*atomic_reset)(struct drm_bridge *bridge);
/**
* @detect:
*
* Check if anything is attached to the bridge output.
*
* This callback is optional, if not implemented the bridge will be
* considered as always having a component attached to its output.
* Bridges that implement this callback shall set the
* DRM_BRIDGE_OP_DETECT flag in their &drm_bridge->ops.
*
* RETURNS:
*
* drm_connector_status indicating the bridge output status.
*/
enum drm_connector_status (*detect)(struct drm_bridge *bridge);
// /**
// * @detect:
// *
// * Check if anything is attached to the bridge output.
// *
// * This callback is optional, if not implemented the bridge will be
// * considered as always having a component attached to its output.
// * Bridges that implement this callback shall set the
// * DRM_BRIDGE_OP_DETECT flag in their &drm_bridge->ops.
// *
// * RETURNS:
// *
// * drm_connector_status indicating the bridge output status.
// */
// enum drm_connector_status (*detect)(struct drm_bridge *bridge);
enum drm_connector_status (*detect)(struct drm_bridge *bridge,
struct drm_connector *connector);
/**
* @detect_ctx:
@ -1070,7 +1072,9 @@ drm_atomic_helper_bridge_propagate_bus_fmt(struct drm_bridge *bridge,
u32 output_fmt,
unsigned int *num_input_fmts);
enum drm_connector_status drm_bridge_detect(struct drm_bridge *bridge);
//enum drm_connector_status drm_bridge_detect(struct drm_bridge *bridge);
enum drm_connector_status
drm_bridge_detect(struct drm_bridge *bridge, struct drm_connector *connector);
int drm_bridge_detect_ctx(struct drm_bridge *bridge,
struct drm_connector *connector,
struct drm_modeset_acquire_ctx *ctx);