[PATCH 39/39] drm/atomic: Document __drm_private_objs_state state pointer
Maxime Ripard
mripard at kernel.org
Mon Aug 25 13:43:44 UTC 2025
While the old and new state pointers are somewhat self-explanatory, the
state pointer and its relation to the other two really isn't.
Now that we've cleaned up everything and it isn't used in any
modesetting path, we can document what it's still useful for: to free
the right state when we free the global state.
Signed-off-by: Maxime Ripard <mripard at kernel.org>
---
include/drm/drm_atomic.h | 16 +++++++++++++++-
1 file changed, 15 insertions(+), 1 deletion(-)
diff --git a/include/drm/drm_atomic.h b/include/drm/drm_atomic.h
index e8edf33ab260c03c81e16917a6a5a7d9648d46c9..a7e75bb0bdc6a38eb83c07b844dd97af48006f0f 100644
--- a/include/drm/drm_atomic.h
+++ b/include/drm/drm_atomic.h
@@ -383,11 +383,25 @@ struct drm_private_state {
struct drm_private_obj *obj;
};
struct __drm_private_objs_state {
struct drm_private_obj *ptr;
- struct drm_private_state *state, *old_state, *new_state;
+
+ /**
+ * @state:
+ *
+ * Used to track the @drm_private_state we will need to free
+ * when tearing down the associated &drm_atomic_state.
+ *
+ * Before a commit, and the call to
+ * drm_atomic_helper_swap_state() in particular, it points to
+ * the same state than @new_state. After a commit, it points to
+ * the same state than @old_state.
+ */
+ struct drm_private_state *state;
+
+ struct drm_private_state *old_state, *new_state;
};
/**
* struct drm_atomic_state - Atomic commit structure
*
--
2.50.1
More information about the Freedreno
mailing list