From fa02f9b2ff663b1d45df35d67c802f306f22ee48 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Tue, 30 Sep 2025 12:59:16 +0200 Subject: [PATCH] drm/atomic: Convert drm_atomic_get_connector_state() to use new connector state MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit The drm_atomic_get_connector_state() function calls a hand-rolled implementation of the deprecated drm_atomic_get_existing_connector_state() helper to get find if a connector state had already been allocated and was part of the given drm_atomic_state. At the point in time where drm_atomic_get_connector_state() can be called (ie, during atomic_check), the existing state is the new state and drm_atomic_get_existing_connector_state() can thus be replaced by drm_atomic_get_new_connector_state(). Reviewed-by: Luca Ceresoli Tested-by: Luca Ceresoli # on imx8mp Reviewed-by: Dmitry Baryshkov Reviewed-by: Ville Syrjälä Link: https://lore.kernel.org/r/20250930-drm-no-more-existing-state-v5-1-eeb9e1287907@kernel.org Signed-off-by: Maxime Ripard --- drivers/gpu/drm/drm_atomic.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c index ed5359a71f7e2..eeae4553894c1 100644 --- a/drivers/gpu/drm/drm_atomic.c +++ b/drivers/gpu/drm/drm_atomic.c @@ -1152,8 +1152,9 @@ drm_atomic_get_connector_state(struct drm_atomic_state *state, state->num_connector = alloc; } - if (state->connectors[index].state) - return state->connectors[index].state; + connector_state = drm_atomic_get_new_connector_state(state, connector); + if (connector_state) + return connector_state; connector_state = connector->funcs->atomic_duplicate_state(connector); if (!connector_state) -- 2.47.3