kfree(hub_state);
}
+static struct drm_private_state *
+tegra_display_hub_create_state(struct drm_private_obj *obj)
+{
+ struct tegra_display_hub_state *hub_state;
+
+ hub_state = kzalloc_obj(*hub_state);
+ if (!hub_state)
+ return ERR_PTR(-ENOMEM);
+
+ __drm_atomic_helper_private_obj_create_state(obj, &hub_state->base);
+
+ return &hub_state->base;
+}
+
static const struct drm_private_state_funcs tegra_display_hub_state_funcs = {
+ .atomic_create_state = tegra_display_hub_create_state,
.atomic_duplicate_state = tegra_display_hub_duplicate_state,
.atomic_destroy_state = tegra_display_hub_destroy_state,
};
struct tegra_display_hub *hub = to_tegra_display_hub(client);
struct drm_device *drm = dev_get_drvdata(client->host);
struct tegra_drm *tegra = drm->dev_private;
- struct tegra_display_hub_state *state;
-
- state = kzalloc_obj(*state);
- if (!state)
- return -ENOMEM;
- drm_atomic_private_obj_init(drm, &hub->base, &state->base,
+ drm_atomic_private_obj_init(drm, &hub->base, NULL,
&tegra_display_hub_state_funcs);
tegra->hub = hub;