diff options
author | Thierry Reding <treding@nvidia.com> | 2015-01-28 08:54:32 -0500 |
---|---|---|
committer | Thierry Reding <treding@nvidia.com> | 2015-04-02 12:48:32 -0400 |
commit | f5e7840b0c4368f8cdbb055188c2a0eef50c3052 (patch) | |
tree | 820a100556fa6062025f6cf3b4f64d735ce9892d /include/drm | |
parent | 42e9ce0523699b3f3383b7c5c0bcc2657a77d0ca (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.h | 14 |
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 */ |
89 | void drm_atomic_helper_crtc_reset(struct drm_crtc *crtc); | 89 | void drm_atomic_helper_crtc_reset(struct drm_crtc *crtc); |
90 | void __drm_atomic_helper_crtc_duplicate_state(struct drm_crtc *crtc, | ||
91 | struct drm_crtc_state *state); | ||
90 | struct drm_crtc_state * | 92 | struct drm_crtc_state * |
91 | drm_atomic_helper_crtc_duplicate_state(struct drm_crtc *crtc); | 93 | drm_atomic_helper_crtc_duplicate_state(struct drm_crtc *crtc); |
94 | void __drm_atomic_helper_crtc_destroy_state(struct drm_crtc *crtc, | ||
95 | struct drm_crtc_state *state); | ||
92 | void drm_atomic_helper_crtc_destroy_state(struct drm_crtc *crtc, | 96 | void drm_atomic_helper_crtc_destroy_state(struct drm_crtc *crtc, |
93 | struct drm_crtc_state *state); | 97 | struct drm_crtc_state *state); |
94 | 98 | ||
95 | void drm_atomic_helper_plane_reset(struct drm_plane *plane); | 99 | void drm_atomic_helper_plane_reset(struct drm_plane *plane); |
100 | void __drm_atomic_helper_plane_duplicate_state(struct drm_plane *plane, | ||
101 | struct drm_plane_state *state); | ||
96 | struct drm_plane_state * | 102 | struct drm_plane_state * |
97 | drm_atomic_helper_plane_duplicate_state(struct drm_plane *plane); | 103 | drm_atomic_helper_plane_duplicate_state(struct drm_plane *plane); |
104 | void __drm_atomic_helper_plane_destroy_state(struct drm_plane *plane, | ||
105 | struct drm_plane_state *state); | ||
98 | void drm_atomic_helper_plane_destroy_state(struct drm_plane *plane, | 106 | void drm_atomic_helper_plane_destroy_state(struct drm_plane *plane, |
99 | struct drm_plane_state *state); | 107 | struct drm_plane_state *state); |
100 | 108 | ||
101 | void drm_atomic_helper_connector_reset(struct drm_connector *connector); | 109 | void drm_atomic_helper_connector_reset(struct drm_connector *connector); |
110 | void | ||
111 | __drm_atomic_helper_connector_duplicate_state(struct drm_connector *connector, | ||
112 | struct drm_connector_state *state); | ||
102 | struct drm_connector_state * | 113 | struct drm_connector_state * |
103 | drm_atomic_helper_connector_duplicate_state(struct drm_connector *connector); | 114 | drm_atomic_helper_connector_duplicate_state(struct drm_connector *connector); |
115 | void | ||
116 | __drm_atomic_helper_connector_destroy_state(struct drm_connector *connector, | ||
117 | struct drm_connector_state *state); | ||
104 | void drm_atomic_helper_connector_destroy_state(struct drm_connector *connector, | 118 | void drm_atomic_helper_connector_destroy_state(struct drm_connector *connector, |
105 | struct drm_connector_state *state); | 119 | struct drm_connector_state *state); |
106 | 120 | ||