+
+struct drm_atomic_state *
+dm_atomic_state_alloc(struct drm_device *dev)
+{
+ struct dm_atomic_state *state = kzalloc(sizeof(*state), GFP_KERNEL);
+
+ if (!state || drm_atomic_state_init(dev, &state->base) < 0) {
+ kfree(state);
+ return NULL;
+ }
+
+ return &state->base;
+}
+
+void dm_atomic_state_clear(struct drm_atomic_state *s)
+{
+ struct dm_atomic_state *state = to_dm_atomic_state(s);
+ drm_atomic_state_default_clear(&state->base);
+}
+
+
+static void dm_atomic_state_free(struct drm_atomic_state *state)
+{
+ struct dm_atomic_state *dm_state = to_dm_atomic_state(state);
+
+ drm_atomic_state_default_release(state);
+
+ kfree(dm_state);
+}
+
+
+