Skip to content

Commit ca7b6b7

Browse files
Laurent Pinchartsravnborg
authored andcommitted
drm: bridge: dw-hdmi: Store current connector in struct dw_hdmi
Store the connector that the bridge is currently wired to in the dw_hdmi structure. This is currently identical to the connector field, but will differ once the driver supports disabling connector creation. Signed-off-by: Laurent Pinchart <[email protected]> Reviewed-by: Neil Armstrong <[email protected]> Signed-off-by: Sam Ravnborg <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/20200526011505.31884-21-laurent.pinchart+renesas@ideasonboard.com
1 parent 3f588fd commit ca7b6b7

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

drivers/gpu/drm/bridge/synopsys/dw-hdmi.c

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,7 @@ struct dw_hdmi {
181181

182182
struct mutex mutex; /* for state below and previous_mode */
183183
enum drm_connector_force force; /* mutex-protected force state */
184+
struct drm_connector *curr_conn;/* current connector (only valid when !disabled) */
184185
bool disabled; /* DRM has disabled our bridge */
185186
bool bridge_is_on; /* indicates the bridge is on */
186187
bool rxsense; /* rxsense state */
@@ -2823,23 +2824,32 @@ static void dw_hdmi_bridge_mode_set(struct drm_bridge *bridge,
28232824
mutex_unlock(&hdmi->mutex);
28242825
}
28252826

2826-
static void dw_hdmi_bridge_disable(struct drm_bridge *bridge)
2827+
static void dw_hdmi_bridge_atomic_disable(struct drm_bridge *bridge,
2828+
struct drm_bridge_state *old_state)
28272829
{
28282830
struct dw_hdmi *hdmi = bridge->driver_private;
28292831

28302832
mutex_lock(&hdmi->mutex);
28312833
hdmi->disabled = true;
2834+
hdmi->curr_conn = NULL;
28322835
dw_hdmi_update_power(hdmi);
28332836
dw_hdmi_update_phy_mask(hdmi);
28342837
mutex_unlock(&hdmi->mutex);
28352838
}
28362839

2837-
static void dw_hdmi_bridge_enable(struct drm_bridge *bridge)
2840+
static void dw_hdmi_bridge_atomic_enable(struct drm_bridge *bridge,
2841+
struct drm_bridge_state *old_state)
28382842
{
28392843
struct dw_hdmi *hdmi = bridge->driver_private;
2844+
struct drm_atomic_state *state = old_state->base.state;
2845+
struct drm_connector *connector;
2846+
2847+
connector = drm_atomic_get_new_connector_for_encoder(state,
2848+
bridge->encoder);
28402849

28412850
mutex_lock(&hdmi->mutex);
28422851
hdmi->disabled = false;
2852+
hdmi->curr_conn = connector;
28432853
dw_hdmi_update_power(hdmi);
28442854
dw_hdmi_update_phy_mask(hdmi);
28452855
mutex_unlock(&hdmi->mutex);
@@ -2854,8 +2864,8 @@ static const struct drm_bridge_funcs dw_hdmi_bridge_funcs = {
28542864
.atomic_check = dw_hdmi_bridge_atomic_check,
28552865
.atomic_get_output_bus_fmts = dw_hdmi_bridge_atomic_get_output_bus_fmts,
28562866
.atomic_get_input_bus_fmts = dw_hdmi_bridge_atomic_get_input_bus_fmts,
2857-
.enable = dw_hdmi_bridge_enable,
2858-
.disable = dw_hdmi_bridge_disable,
2867+
.atomic_enable = dw_hdmi_bridge_atomic_enable,
2868+
.atomic_disable = dw_hdmi_bridge_atomic_disable,
28592869
.mode_set = dw_hdmi_bridge_mode_set,
28602870
.mode_valid = dw_hdmi_bridge_mode_valid,
28612871
};

0 commit comments

Comments
 (0)