aboutsummaryrefslogtreecommitdiffstats
path: root/include/drm
diff options
context:
space:
mode:
authorMaarten Lankhorst <maarten.lankhorst@linux.intel.com>2015-05-18 04:06:40 -0400
committerDaniel Vetter <daniel.vetter@ffwll.ch>2015-05-18 10:39:41 -0400
commit036ef5733ba433760a3512bb5f7a155946e2df05 (patch)
tree45fa24bd9722b147d1449e572e5f0e1e7433bd0b /include/drm
parent744b058827b3db9a4f6027522dd9c73a208c2d31 (diff)
drm/atomic: Allow drivers to subclass drm_atomic_state, v3
Drivers may need to store the state of shared resources, such as PLLs or FIFO space, into the atomic state. Allow this by making it possible to subclass drm_atomic_state. Changes since v1: - Change member names for functions to atomic_state_(alloc,clear) - Change __drm_atomic_state_new to drm_atomic_state_init - Allow free function to be overridden too, in case extra memory is allocated in alloc. Changes since v2: - Rename *_default_free to default_release, to make clear it doesn't free the state object itself. Cc: dri-devel@lists.freedesktop.org Acked-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'include/drm')
-rw-r--r--include/drm/drm_atomic.h5
-rw-r--r--include/drm/drm_crtc.h6
2 files changed, 11 insertions, 0 deletions
diff --git a/include/drm/drm_atomic.h b/include/drm/drm_atomic.h
index d78543067700..f0d3a7387d99 100644
--- a/include/drm/drm_atomic.h
+++ b/include/drm/drm_atomic.h
@@ -35,6 +35,11 @@ drm_atomic_state_alloc(struct drm_device *dev);
35void drm_atomic_state_clear(struct drm_atomic_state *state); 35void drm_atomic_state_clear(struct drm_atomic_state *state);
36void drm_atomic_state_free(struct drm_atomic_state *state); 36void drm_atomic_state_free(struct drm_atomic_state *state);
37 37
38int __must_check
39drm_atomic_state_init(struct drm_device *dev, struct drm_atomic_state *state);
40void drm_atomic_state_default_clear(struct drm_atomic_state *state);
41void drm_atomic_state_default_release(struct drm_atomic_state *state);
42
38struct drm_crtc_state * __must_check 43struct drm_crtc_state * __must_check
39drm_atomic_get_crtc_state(struct drm_atomic_state *state, 44drm_atomic_get_crtc_state(struct drm_atomic_state *state,
40 struct drm_crtc *crtc); 45 struct drm_crtc *crtc);
diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h
index 5626191f3af0..37c44f27cb9f 100644
--- a/include/drm/drm_crtc.h
+++ b/include/drm/drm_crtc.h
@@ -979,6 +979,9 @@ struct drm_mode_set {
979 * @atomic_check: check whether a given atomic state update is possible 979 * @atomic_check: check whether a given atomic state update is possible
980 * @atomic_commit: commit an atomic state update previously verified with 980 * @atomic_commit: commit an atomic state update previously verified with
981 * atomic_check() 981 * atomic_check()
982 * @atomic_state_alloc: allocate a new atomic state
983 * @atomic_state_clear: clear the atomic state
984 * @atomic_state_free: free the atomic state
982 * 985 *
983 * Some global (i.e. not per-CRTC, connector, etc) mode setting functions that 986 * Some global (i.e. not per-CRTC, connector, etc) mode setting functions that
984 * involve drivers. 987 * involve drivers.
@@ -994,6 +997,9 @@ struct drm_mode_config_funcs {
994 int (*atomic_commit)(struct drm_device *dev, 997 int (*atomic_commit)(struct drm_device *dev,
995 struct drm_atomic_state *a, 998 struct drm_atomic_state *a,
996 bool async); 999 bool async);
1000 struct drm_atomic_state *(*atomic_state_alloc)(struct drm_device *dev);
1001 void (*atomic_state_clear)(struct drm_atomic_state *state);
1002 void (*atomic_state_free)(struct drm_atomic_state *state);
997}; 1003};
998 1004
999/** 1005/**