The vc4 VEC connector reset implementation creates a pristine state
and initializes the analog TV properties. It does not perform any
hardware reset.

Since this is equivalent to what atomic_create_state expects, convert
the reset function to an atomic_create_state hook that returns the
initialized state.

Reviewed-by: Maíra Canal <[email protected]>
Signed-off-by: Maxime Ripard <[email protected]>
---
Cc: "Maíra Canal" <[email protected]>
Cc: Dave Stevenson <[email protected]>
Cc: Raspberry Pi Kernel Maintenance <[email protected]>
---
 drivers/gpu/drm/vc4/vc4_vec.c | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/vc4/vc4_vec.c b/drivers/gpu/drm/vc4/vc4_vec.c
index 7ab77f97df31..d46c164c4393 100644
--- a/drivers/gpu/drm/vc4/vc4_vec.c
+++ b/drivers/gpu/drm/vc4/vc4_vec.c
@@ -378,8 +378,16 @@ vc4_vec_connector_detect(struct drm_connector *connector, 
bool force)
 }
 
-static void vc4_vec_connector_reset(struct drm_connector *connector)
+static struct drm_connector_state *
+vc4_vec_connector_create_state(struct drm_connector *connector)
 {
-       drm_atomic_helper_connector_reset(connector);
-       drm_atomic_helper_connector_tv_state_init(connector->state, connector);
+       struct drm_connector_state *connector_state;
+
+       connector_state = drm_atomic_helper_connector_create_state(connector);
+       if (IS_ERR(connector_state))
+               return connector_state;
+
+       drm_atomic_helper_connector_tv_state_init(connector_state, connector);
+
+       return connector_state;
 }
 
@@ -490,5 +498,5 @@ static const struct drm_connector_funcs 
vc4_vec_connector_funcs = {
        .detect = vc4_vec_connector_detect,
        .fill_modes = drm_helper_probe_single_connector_modes,
-       .reset = vc4_vec_connector_reset,
+       .atomic_create_state = vc4_vec_connector_create_state,
        .atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state,
        .atomic_destroy_state = drm_atomic_helper_connector_destroy_state,

-- 
2.55.0

Reply via email to