On 14/10/26 14:27, Maxime Ripard wrote:
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.
Signed-off-by: Maxime Ripard <[email protected]>
Reviewed-by: Maíra Canal <[email protected]>
Best regards,
- Maíra
---
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 98cece1e48d8..43124ffc7349 100644
--- a/drivers/gpu/drm/vc4/vc4_vec.c
+++ b/drivers/gpu/drm/vc4/vc4_vec.c
@@ -376,14 +376,22 @@ static enum drm_connector_status
vc4_vec_connector_detect(struct drm_connector *connector, bool force)
{
return connector_status_unknown;
}
-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;
}
static int
vc4_vec_connector_set_property(struct drm_connector *connector,
struct drm_connector_state *state,
@@ -488,11 +496,11 @@ vc4_vec_connector_get_property(struct drm_connector
*connector,
}
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,
.atomic_get_property = vc4_vec_connector_get_property,
.atomic_set_property = vc4_vec_connector_set_property,
};