Am 08.09.26 um 16:47 schrieb Maxime Ripard:
[...]
-static void mtk_plane_reset(struct drm_plane *plane)
+static struct drm_plane_state *mtk_plane_create_state(struct drm_plane *plane)
  {
        struct mtk_plane_state *state;
+       state = kzalloc_obj(*state);

I think check-patch will warn about a missing empty line.

+       if (!state)
+               return ERR_PTR(-ENOMEM);
- if (plane->state) {
-               __drm_atomic_helper_plane_destroy_state(plane->state);
-
-               state = to_mtk_plane_state(plane->state);
-               memset(state, 0, sizeof(*state));
-       } else {
-               state = kzalloc_obj(*state);
-               if (!state)
-                       return;
-       }
-
-       __drm_atomic_helper_plane_reset(plane, &state->base);
+       __drm_atomic_helper_plane_state_init(&state->base, plane);
state->base.plane = plane;
        state->pending.format = DRM_FORMAT_RGB565;
        state->pending.modifier = DRM_FORMAT_MOD_LINEAR;

I can't find where these settings come from.

+
+       return &state->base;
  }
static struct drm_plane_state *mtk_plane_duplicate_state(struct drm_plane *plane)
  {
        struct mtk_plane_state *old_state = to_mtk_plane_state(plane->state);
@@ -219,11 +213,11 @@ static void mtk_plane_atomic_async_update(struct 
drm_plane *plane,
static const struct drm_plane_funcs mtk_plane_funcs = {
        .update_plane = drm_atomic_helper_update_plane,
        .disable_plane = drm_atomic_helper_disable_plane,
        .destroy = drm_plane_cleanup,
-       .reset = mtk_plane_reset,
+       .atomic_create_state = mtk_plane_create_state,
        .atomic_duplicate_state = mtk_plane_duplicate_state,
        .atomic_destroy_state = mtk_plane_destroy_state,
        .format_mod_supported = mtk_plane_format_mod_supported,
  };

--
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstr. 146, 90461 Nürnberg, Germany, www.suse.com
GF: Jochen Jaser, Andrew McDonald, (HRB 36809, AG Nürnberg)


Reply via email to