aboutsummaryrefslogtreecommitdiffstats
path: root/include/drm/drm_atomic_helper.h
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2014-07-27 13:46:52 +0200
committerDaniel Vetter <daniel.vetter@ffwll.ch>2014-11-06 21:02:21 +0100
commit042652ed95996a9ef6dcddddc53b5d8bc7fa887e (patch)
tree100c6e0d445ba8a0e94387f828c34a0c5e7a7c60 /include/drm/drm_atomic_helper.h
parentdrm: Atomic crtc/connector updates using crtc/plane helper interfaces (diff)
downloadlinux-dev-042652ed95996a9ef6dcddddc53b5d8bc7fa887e.tar.xz
linux-dev-042652ed95996a9ef6dcddddc53b5d8bc7fa887e.zip
drm/atomic-helper: implementatations for legacy interfaces
Well, except page_flip since that requires async commit, which isn't there yet. For the functions which changes planes there's a bit of trickery involved to keep the fb refcounting working. But otherwise fairly straight-forward atomic updates. The property setting functions are still a bit incomplete. Once we have generic properties (e.g. rotation, but also all the properties needed by the atomic ioctl) we need to filter those out and parse them in the helper. Preferrably with the same function as used by the real atomic ioctl implementation. v2: Fixup kerneldoc, reported by Paulo. v3: Add missing EXPORT_SYMBOL. v4: We need to look at the crtc of the modeset, not some random leftover one from a previous loop when udpating the connector->crtc routing. Also push some local variables into inner loops to avoid these kinds of bugs. v5: Adjust semantics - drivers now own the atomic state upon successfully synchronous commit. v6: Use the set_crtc_for_plane function to assign the crtc, since otherwise the book-keeping is off. v7: - Improve comments. - Filter out the crtc of the ->set_config call when recomputing crtc_state->enabled: We should compute the same state, but not doing so will give us a good chance to catch bugs and inconsistencies - the atomic helper's atomic_check function re-validates this again. - Fix the set_config implementation logic when disabling the crtc: We still need to update the output routing to disable all the connectors properly in the state. Caught by the atomic_check functions, so at least that part worked ;-) Also add some WARN_ONs to ensure ->set_config preconditions all apply. v8: Fixup an embarrassing h/vdisplay mixup. v9: Shuffled bad squash to the right patch, spotted by Daniel v10: Use set_crtc_for_connector as suggested by Sean. v11: Daniel Thompson noticed that my error handling is inconsistent and that in a few cases I didn't handle fatal errors (i.e. not -EDEADLK). Fix this by consolidate the ww mutex backoff handling into one check in the fail: block and flatten the error control flow everywhere else. v12: Review and discussion with Sean: - One spelling fix. - Correctly skip the crtc from the set_config set when recomputing ->enable state. That should allow us to catch any bugs in higher levels in computing that state (which is supplied to the ->set_config implementation). I've screwed this up and Sean spotted that the current code is pointless. Cc: Sean Paul <seanpaul@chromium.org> Cc: Daniel Thompson <daniel.thompson@linaro.org> Cc: Sean Paul <seanpaul@chromium.org> Cc: Daniel Thompson <daniel.thompson@linaro.org> Cc: Paulo Zanoni <przanoni@gmail.com> Reviewed-by: Sean Paul <seanpaul@chromium.org> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'include/drm/drm_atomic_helper.h')
-rw-r--r--include/drm/drm_atomic_helper.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/include/drm/drm_atomic_helper.h b/include/drm/drm_atomic_helper.h
index 9781ce739e10..8cd6fe7a48e5 100644
--- a/include/drm/drm_atomic_helper.h
+++ b/include/drm/drm_atomic_helper.h
@@ -49,4 +49,25 @@ void drm_atomic_helper_cleanup_planes(struct drm_device *dev,
void drm_atomic_helper_swap_state(struct drm_device *dev,
struct drm_atomic_state *state);
+/* implementations for legacy interfaces */
+int drm_atomic_helper_update_plane(struct drm_plane *plane,
+ struct drm_crtc *crtc,
+ struct drm_framebuffer *fb,
+ int crtc_x, int crtc_y,
+ unsigned int crtc_w, unsigned int crtc_h,
+ uint32_t src_x, uint32_t src_y,
+ uint32_t src_w, uint32_t src_h);
+int drm_atomic_helper_disable_plane(struct drm_plane *plane);
+int drm_atomic_helper_set_config(struct drm_mode_set *set);
+
+int drm_atomic_helper_crtc_set_property(struct drm_crtc *crtc,
+ struct drm_property *property,
+ uint64_t val);
+int drm_atomic_helper_plane_set_property(struct drm_plane *plane,
+ struct drm_property *property,
+ uint64_t val);
+int drm_atomic_helper_connector_set_property(struct drm_connector *connector,
+ struct drm_property *property,
+ uint64_t val);
+
#endif /* DRM_ATOMIC_HELPER_H_ */