aboutsummaryrefslogtreecommitdiffstats
path: root/include/drm
diff options
context:
space:
mode:
authorThierry Reding <treding@nvidia.com>2015-01-28 08:54:32 -0500
committerThierry Reding <treding@nvidia.com>2015-04-02 12:48:32 -0400
commitf5e7840b0c4368f8cdbb055188c2a0eef50c3052 (patch)
tree820a100556fa6062025f6cf3b4f64d735ce9892d /include/drm
parent42e9ce0523699b3f3383b7c5c0bcc2657a77d0ca (diff)
drm/atomic: Add helpers for state-subclassing drivers
Drivers that subclass CRTC, plane or connector state need to carefully duplicate the code that the atomic helpers have. This is bound to cause breakage eventually because it requires auditing all drivers and update them when code is added to the helpers. In order to avoid that, implement new helpers that perform the required steps when copying and destroying state. These new helpers are exported so that state-subclassing drivers can use them. The default helpers are implemented using them as well, providing a single location that needs to be changed when adding to base atomic states. Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> Reviewed-by: Eric Anholt <eric@anholt.net> Signed-off-by: Thierry Reding <treding@nvidia.com>
Diffstat (limited to 'include/drm')
-rw-r--r--include/drm/drm_atomic_helper.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/include/drm/drm_atomic_helper.h b/include/drm/drm_atomic_helper.h
index 8039d54a7441..e2086372ef61 100644
--- a/include/drm/drm_atomic_helper.h
+++ b/include/drm/drm_atomic_helper.h
@@ -87,20 +87,34 @@ void drm_atomic_helper_connector_dpms(struct drm_connector *connector,
87 87
88/* default implementations for state handling */ 88/* default implementations for state handling */
89void drm_atomic_helper_crtc_reset(struct drm_crtc *crtc); 89void drm_atomic_helper_crtc_reset(struct drm_crtc *crtc);
90void __drm_atomic_helper_crtc_duplicate_state(struct drm_crtc *crtc,
91 struct drm_crtc_state *state);
90struct drm_crtc_state * 92struct drm_crtc_state *
91drm_atomic_helper_crtc_duplicate_state(struct drm_crtc *crtc); 93drm_atomic_helper_crtc_duplicate_state(struct drm_crtc *crtc);
94void __drm_atomic_helper_crtc_destroy_state(struct drm_crtc *crtc,
95 struct drm_crtc_state *state);
92void drm_atomic_helper_crtc_destroy_state(struct drm_crtc *crtc, 96void drm_atomic_helper_crtc_destroy_state(struct drm_crtc *crtc,
93 struct drm_crtc_state *state); 97 struct drm_crtc_state *state);
94 98
95void drm_atomic_helper_plane_reset(struct drm_plane *plane); 99void drm_atomic_helper_plane_reset(struct drm_plane *plane);
100void __drm_atomic_helper_plane_duplicate_state(struct drm_plane *plane,
101 struct drm_plane_state *state);
96struct drm_plane_state * 102struct drm_plane_state *
97drm_atomic_helper_plane_duplicate_state(struct drm_plane *plane); 103drm_atomic_helper_plane_duplicate_state(struct drm_plane *plane);
104void __drm_atomic_helper_plane_destroy_state(struct drm_plane *plane,
105 struct drm_plane_state *state);
98void drm_atomic_helper_plane_destroy_state(struct drm_plane *plane, 106void drm_atomic_helper_plane_destroy_state(struct drm_plane *plane,
99 struct drm_plane_state *state); 107 struct drm_plane_state *state);
100 108
101void drm_atomic_helper_connector_reset(struct drm_connector *connector); 109void drm_atomic_helper_connector_reset(struct drm_connector *connector);
110void
111__drm_atomic_helper_connector_duplicate_state(struct drm_connector *connector,
112 struct drm_connector_state *state);
102struct drm_connector_state * 113struct drm_connector_state *
103drm_atomic_helper_connector_duplicate_state(struct drm_connector *connector); 114drm_atomic_helper_connector_duplicate_state(struct drm_connector *connector);
115void
116__drm_atomic_helper_connector_destroy_state(struct drm_connector *connector,
117 struct drm_connector_state *state);
104void drm_atomic_helper_connector_destroy_state(struct drm_connector *connector, 118void drm_atomic_helper_connector_destroy_state(struct drm_connector *connector,
105 struct drm_connector_state *state); 119 struct drm_connector_state *state);
106 120