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 <laurent.pinchart+renesas@ideasonboard.com> Reviewed-by: Neil Armstrong <narmstrong@baylibre.com> Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Link: https://patchwork.freedesktop.org/patch/msgid/20200526011505.31884-21-laurent.pinchart+renesas@ideasonboard.com
This commit is contained in:
parent
3f588fda4b
commit
ca7b6b7176
|
@ -181,6 +181,7 @@ struct dw_hdmi {
|
||||||
|
|
||||||
struct mutex mutex; /* for state below and previous_mode */
|
struct mutex mutex; /* for state below and previous_mode */
|
||||||
enum drm_connector_force force; /* mutex-protected force state */
|
enum drm_connector_force force; /* mutex-protected force state */
|
||||||
|
struct drm_connector *curr_conn;/* current connector (only valid when !disabled) */
|
||||||
bool disabled; /* DRM has disabled our bridge */
|
bool disabled; /* DRM has disabled our bridge */
|
||||||
bool bridge_is_on; /* indicates the bridge is on */
|
bool bridge_is_on; /* indicates the bridge is on */
|
||||||
bool rxsense; /* rxsense state */
|
bool rxsense; /* rxsense state */
|
||||||
|
@ -2823,23 +2824,32 @@ static void dw_hdmi_bridge_mode_set(struct drm_bridge *bridge,
|
||||||
mutex_unlock(&hdmi->mutex);
|
mutex_unlock(&hdmi->mutex);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void dw_hdmi_bridge_disable(struct drm_bridge *bridge)
|
static void dw_hdmi_bridge_atomic_disable(struct drm_bridge *bridge,
|
||||||
|
struct drm_bridge_state *old_state)
|
||||||
{
|
{
|
||||||
struct dw_hdmi *hdmi = bridge->driver_private;
|
struct dw_hdmi *hdmi = bridge->driver_private;
|
||||||
|
|
||||||
mutex_lock(&hdmi->mutex);
|
mutex_lock(&hdmi->mutex);
|
||||||
hdmi->disabled = true;
|
hdmi->disabled = true;
|
||||||
|
hdmi->curr_conn = NULL;
|
||||||
dw_hdmi_update_power(hdmi);
|
dw_hdmi_update_power(hdmi);
|
||||||
dw_hdmi_update_phy_mask(hdmi);
|
dw_hdmi_update_phy_mask(hdmi);
|
||||||
mutex_unlock(&hdmi->mutex);
|
mutex_unlock(&hdmi->mutex);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void dw_hdmi_bridge_enable(struct drm_bridge *bridge)
|
static void dw_hdmi_bridge_atomic_enable(struct drm_bridge *bridge,
|
||||||
|
struct drm_bridge_state *old_state)
|
||||||
{
|
{
|
||||||
struct dw_hdmi *hdmi = bridge->driver_private;
|
struct dw_hdmi *hdmi = bridge->driver_private;
|
||||||
|
struct drm_atomic_state *state = old_state->base.state;
|
||||||
|
struct drm_connector *connector;
|
||||||
|
|
||||||
|
connector = drm_atomic_get_new_connector_for_encoder(state,
|
||||||
|
bridge->encoder);
|
||||||
|
|
||||||
mutex_lock(&hdmi->mutex);
|
mutex_lock(&hdmi->mutex);
|
||||||
hdmi->disabled = false;
|
hdmi->disabled = false;
|
||||||
|
hdmi->curr_conn = connector;
|
||||||
dw_hdmi_update_power(hdmi);
|
dw_hdmi_update_power(hdmi);
|
||||||
dw_hdmi_update_phy_mask(hdmi);
|
dw_hdmi_update_phy_mask(hdmi);
|
||||||
mutex_unlock(&hdmi->mutex);
|
mutex_unlock(&hdmi->mutex);
|
||||||
|
@ -2854,8 +2864,8 @@ static const struct drm_bridge_funcs dw_hdmi_bridge_funcs = {
|
||||||
.atomic_check = dw_hdmi_bridge_atomic_check,
|
.atomic_check = dw_hdmi_bridge_atomic_check,
|
||||||
.atomic_get_output_bus_fmts = dw_hdmi_bridge_atomic_get_output_bus_fmts,
|
.atomic_get_output_bus_fmts = dw_hdmi_bridge_atomic_get_output_bus_fmts,
|
||||||
.atomic_get_input_bus_fmts = dw_hdmi_bridge_atomic_get_input_bus_fmts,
|
.atomic_get_input_bus_fmts = dw_hdmi_bridge_atomic_get_input_bus_fmts,
|
||||||
.enable = dw_hdmi_bridge_enable,
|
.atomic_enable = dw_hdmi_bridge_atomic_enable,
|
||||||
.disable = dw_hdmi_bridge_disable,
|
.atomic_disable = dw_hdmi_bridge_atomic_disable,
|
||||||
.mode_set = dw_hdmi_bridge_mode_set,
|
.mode_set = dw_hdmi_bridge_mode_set,
|
||||||
.mode_valid = dw_hdmi_bridge_mode_valid,
|
.mode_valid = dw_hdmi_bridge_mode_valid,
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue