Commit 191be002 authored by Xin Ji's avatar Xin Ji Committed by Robert Foss

drm/bridge: anx7625: Add bridge helper atomic conversion

Add bridge helper atomic conversion.
Reviewed-by: default avatarRobert Foss <robert.foss@linaro.org>
Signed-off-by: default avatarXin Ji <xji@analogixsemi.com>
Signed-off-by: default avatarRobert Foss <robert.foss@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20220106100127.1862702-1-xji@analogixsemi.com
parent 0f299473
......@@ -1911,25 +1911,54 @@ static bool anx7625_bridge_mode_fixup(struct drm_bridge *bridge,
return true;
}
static void anx7625_bridge_enable(struct drm_bridge *bridge)
static int anx7625_bridge_atomic_check(struct drm_bridge *bridge,
struct drm_bridge_state *bridge_state,
struct drm_crtc_state *crtc_state,
struct drm_connector_state *conn_state)
{
struct anx7625_data *ctx = bridge_to_anx7625(bridge);
struct device *dev = &ctx->client->dev;
DRM_DEV_DEBUG_DRIVER(dev, "drm enable\n");
dev_dbg(dev, "drm bridge atomic check\n");
return anx7625_bridge_mode_fixup(bridge, &crtc_state->mode,
&crtc_state->adjusted_mode);
}
static void anx7625_bridge_atomic_enable(struct drm_bridge *bridge,
struct drm_bridge_state *state)
{
struct anx7625_data *ctx = bridge_to_anx7625(bridge);
struct device *dev = &ctx->client->dev;
struct drm_connector *connector;
dev_dbg(dev, "drm atomic enable\n");
if (!bridge->encoder) {
dev_err(dev, "Parent encoder object not found");
return;
}
connector = drm_atomic_get_new_connector_for_encoder(state->base.state,
bridge->encoder);
if (!connector)
return;
ctx->connector = connector;
pm_runtime_get_sync(dev);
anx7625_dp_start(ctx);
}
static void anx7625_bridge_disable(struct drm_bridge *bridge)
static void anx7625_bridge_atomic_disable(struct drm_bridge *bridge,
struct drm_bridge_state *old)
{
struct anx7625_data *ctx = bridge_to_anx7625(bridge);
struct device *dev = &ctx->client->dev;
DRM_DEV_DEBUG_DRIVER(dev, "drm disable\n");
dev_dbg(dev, "drm atomic disable\n");
ctx->connector = NULL;
anx7625_dp_stop(ctx);
pm_runtime_put_sync(dev);
......@@ -1959,11 +1988,14 @@ static struct edid *anx7625_bridge_get_edid(struct drm_bridge *bridge,
static const struct drm_bridge_funcs anx7625_bridge_funcs = {
.attach = anx7625_bridge_attach,
.disable = anx7625_bridge_disable,
.mode_valid = anx7625_bridge_mode_valid,
.mode_set = anx7625_bridge_mode_set,
.mode_fixup = anx7625_bridge_mode_fixup,
.enable = anx7625_bridge_enable,
.atomic_check = anx7625_bridge_atomic_check,
.atomic_enable = anx7625_bridge_atomic_enable,
.atomic_disable = anx7625_bridge_atomic_disable,
.atomic_duplicate_state = drm_atomic_helper_bridge_duplicate_state,
.atomic_destroy_state = drm_atomic_helper_bridge_destroy_state,
.atomic_reset = drm_atomic_helper_bridge_reset,
.detect = anx7625_bridge_detect,
.get_edid = anx7625_bridge_get_edid,
};
......
......@@ -407,6 +407,7 @@ struct anx7625_data {
u8 display_timing_valid;
struct drm_bridge bridge;
u8 bridge_attached;
struct drm_connector *connector;
struct mipi_dsi_device *dsi;
};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment