summaryrefslogtreecommitdiffstats
path: root/include/drm
diff options
context:
space:
mode:
authorDaniel Vetter2016-06-02 00:06:34 +0200
committerDaniel Vetter2016-06-02 17:20:32 +0200
commit5d943aa6c0d424f4d4a1c96fb2fa2a81e55e1e85 (patch)
tree775a58cf68b7d87a5d394575d2ecee6c1f9d4e9a /include/drm
parentdrm: Consolidate plane arrays in drm_atomic_state (diff)
downloadkernel-qcow2-linux-5d943aa6c0d424f4d4a1c96fb2fa2a81e55e1e85.tar.gz
kernel-qcow2-linux-5d943aa6c0d424f4d4a1c96fb2fa2a81e55e1e85.tar.xz
kernel-qcow2-linux-5d943aa6c0d424f4d4a1c96fb2fa2a81e55e1e85.zip
drm: Consolidate crtc arrays in drm_atomic_state
It's silly to have 2 mallocs when we could tie these two together. Also, Gustavo adds another one in his per-crtc out-fence patches. And I want to add more stuff here for nonblocking commit helpers. In the future we can use this to store a pointer to the preceeding state, making an atomic update entirely free-standing. This will be needed to be able to queue them up with a depth > 1. Cc: Gustavo Padovan <gustavo@padovan.org> Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> Link: http://patchwork.freedesktop.org/patch/msgid/1464818821-5736-12-git-send-email-daniel.vetter@ffwll.ch
Diffstat (limited to 'include/drm')
-rw-r--r--include/drm/drm_atomic.h10
-rw-r--r--include/drm/drm_crtc.h8
2 files changed, 11 insertions, 7 deletions
diff --git a/include/drm/drm_atomic.h b/include/drm/drm_atomic.h
index 8e616d39353b..d9504dfcd1cc 100644
--- a/include/drm/drm_atomic.h
+++ b/include/drm/drm_atomic.h
@@ -71,7 +71,7 @@ static inline struct drm_crtc_state *
drm_atomic_get_existing_crtc_state(struct drm_atomic_state *state,
struct drm_crtc *crtc)
{
- return state->crtc_states[drm_crtc_index(crtc)];
+ return state->crtcs[drm_crtc_index(crtc)].state;
}
/**
@@ -183,11 +183,11 @@ int __must_check drm_atomic_nonblocking_commit(struct drm_atomic_state *state);
(__i)++) \
for_each_if (connector)
-#define for_each_crtc_in_state(state, crtc, crtc_state, __i) \
+#define for_each_crtc_in_state(__state, crtc, crtc_state, __i) \
for ((__i) = 0; \
- (__i) < (state)->dev->mode_config.num_crtc && \
- ((crtc) = (state)->crtcs[__i], \
- (crtc_state) = (state)->crtc_states[__i], 1); \
+ (__i) < (__state)->dev->mode_config.num_crtc && \
+ ((crtc) = (__state)->crtcs[__i].ptr, \
+ (crtc_state) = (__state)->crtcs[__i].state, 1); \
(__i)++) \
for_each_if (crtc_state)
diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h
index 821398ce52d0..07a410144b07 100644
--- a/include/drm/drm_crtc.h
+++ b/include/drm/drm_crtc.h
@@ -1698,6 +1698,11 @@ struct __drm_planes_state {
struct drm_plane_state *state;
};
+struct __drm_crtcs_state {
+ struct drm_crtc *ptr;
+ struct drm_crtc_state *state;
+};
+
struct __drm_connnectors_state {
struct drm_connector *ptr;
struct drm_connector_state *state;
@@ -1722,8 +1727,7 @@ struct drm_atomic_state {
bool legacy_cursor_update : 1;
bool legacy_set_config : 1;
struct __drm_planes_state *planes;
- struct drm_crtc **crtcs;
- struct drm_crtc_state **crtc_states;
+ struct __drm_crtcs_state *crtcs;
int num_connector;
struct __drm_connnectors_state *connectors;