[PATCH 02/39] drm/atomic: Convert drm_atomic_get_connector_state() to state accessor

Maxime Ripard mripard at kernel.org
Mon Aug 25 13:43:07 UTC 2025


The drm_atomic_get_existing_connector_state() looks up if a connector
state was already allocated in the global state before trying to
allocate a new one.

It does so using a hand-crafted version of
drm_atomic_get_existing_connector_state(), so let's convert to that
helper, even though it's currently deprecated.

Signed-off-by: Maxime Ripard <mripard at kernel.org>
---
 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 fe21f154e0fa030f85fb3d6d35e2684adcf36e26..660b081ff5d8c39061cebfb5ea122ac1e51677ad 100644
--- a/drivers/gpu/drm/drm_atomic.c
+++ b/drivers/gpu/drm/drm_atomic.c
@@ -1128,12 +1128,13 @@ drm_atomic_get_connector_state(struct drm_atomic_state *state,
 	struct drm_mode_config *config = &connector->dev->mode_config;
 	struct drm_connector_state *connector_state;
 
 	WARN_ON(!state->acquire_ctx);
 
-	if (state->connectors[index].state)
-		return state->connectors[index].state;
+	connector_state = drm_atomic_get_existing_connector_state(state, connector);
+	if (connector_state)
+		return connector_state;
 
 	ret = drm_modeset_lock(&config->connection_mutex, state->acquire_ctx);
 	if (ret)
 		return ERR_PTR(ret);
 

-- 
2.50.1



More information about the Freedreno mailing list