The ast DisplayPort connector reset implementation creates a custom state subclass, but only initializes a pristine state without resetting any hardware. This is equivalent to what atomic_create_state expects. Convert to it.
Signed-off-by: Maxime Ripard <[email protected]> --- Cc: Dave Airlie <[email protected]> Cc: Jocelyn Falempe <[email protected]> --- drivers/gpu/drm/ast/ast_dp.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/drivers/gpu/drm/ast/ast_dp.c b/drivers/gpu/drm/ast/ast_dp.c index f22c0c215a21..7708169d0254 100644 --- a/drivers/gpu/drm/ast/ast_dp.c +++ b/drivers/gpu/drm/ast/ast_dp.c @@ -467,21 +467,22 @@ static int ast_astdp_connector_helper_detect_ctx(struct drm_connector *connector static const struct drm_connector_helper_funcs ast_astdp_connector_helper_funcs = { .get_modes = ast_astdp_connector_helper_get_modes, .detect_ctx = ast_astdp_connector_helper_detect_ctx, }; -static void ast_astdp_connector_reset(struct drm_connector *connector) +static struct drm_connector_state *ast_astdp_connector_create_state(struct drm_connector *connector) { - struct ast_astdp_connector_state *astdp_state = kzalloc_obj(*astdp_state); + struct ast_astdp_connector_state *astdp_state; - if (connector->state) - connector->funcs->atomic_destroy_state(connector, connector->state); + astdp_state = kzalloc_obj(*astdp_state); + if (!astdp_state) + return ERR_PTR(-ENOMEM); - if (astdp_state) - __drm_atomic_helper_connector_reset(connector, &astdp_state->base); - else - __drm_atomic_helper_connector_reset(connector, NULL); + __drm_atomic_helper_connector_state_init(&astdp_state->base, + connector); + + return &astdp_state->base; } static struct drm_connector_state * ast_astdp_connector_atomic_duplicate_state(struct drm_connector *connector) { @@ -511,11 +512,11 @@ static void ast_astdp_connector_atomic_destroy_state(struct drm_connector *conne __drm_atomic_helper_connector_destroy_state(&astdp_state->base); kfree(astdp_state); } static const struct drm_connector_funcs ast_astdp_connector_funcs = { - .reset = ast_astdp_connector_reset, + .atomic_create_state = ast_astdp_connector_create_state, .fill_modes = drm_helper_probe_single_connector_modes, .destroy = drm_connector_cleanup, .atomic_duplicate_state = ast_astdp_connector_atomic_duplicate_state, .atomic_destroy_state = ast_astdp_connector_atomic_destroy_state, }; -- 2.55.0
