[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1421750935-4023-6-git-send-email-thierry.reding@gmail.com>
Date: Tue, 20 Jan 2015 11:48:24 +0100
From: Thierry Reding <thierry.reding@...il.com>
To: dri-devel@...ts.freedesktop.org
Cc: linux-tegra@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH 05/36] drm/atomic: Add drm_atomic_plane_get_crtc_state()
From: Thierry Reding <treding@...dia.com>
This function is useful to obtain the state of the CRTC that a plane is
being attached to.
Signed-off-by: Thierry Reding <treding@...dia.com>
---
include/drm/drm_atomic.h | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git a/include/drm/drm_atomic.h b/include/drm/drm_atomic.h
index 51168a8b723a..ddca107e5cce 100644
--- a/include/drm/drm_atomic.h
+++ b/include/drm/drm_atomic.h
@@ -75,4 +75,25 @@ int __must_check drm_atomic_check_only(struct drm_atomic_state *state);
int __must_check drm_atomic_commit(struct drm_atomic_state *state);
int __must_check drm_atomic_async_commit(struct drm_atomic_state *state);
+/**
+ * drm_atomic_plane_get_crtc_state - obtain atomic state of the CRTC that a
+ * plane is being attached to
+ * @state: atomic state of plane
+ *
+ * Getting the atomic state of the CRTC that a given plane being attached to
+ * is non-trivial. We need to look at the global atomic state that the plane
+ * state is part of and extract the CRTC state using the CRTC's index. Using
+ * the drm_atomic_get_crtc_state() helper we make sure to acquire the proper
+ * locks, too.
+ *
+ * RETURNS:
+ * The atomic state of the CRTC that the plane is being attached to, or an
+ * ERR_PTR()-encoded negative error code on failure.
+ */
+static inline struct drm_crtc_state *
+drm_atomic_plane_get_crtc_state(struct drm_plane_state *state)
+{
+ return drm_atomic_get_crtc_state(state->state, state->crtc);
+}
+
#endif /* DRM_ATOMIC_H_ */
--
2.1.3
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists