summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/drm_atomic_helper.c
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2015-01-22 16:36:24 +0100
committerDaniel Vetter <daniel.vetter@ffwll.ch>2015-01-27 10:02:43 +0100
commitee0a89cf3c2c550e6d877dda21dd2947afb90cb6 (patch)
tree9da7f98114ddc7ca085a169b0a881efc1c80b273 /drivers/gpu/drm/drm_atomic_helper.c
parentf02ad907cd9e7fe3a6405d2d005840912f1ed258 (diff)
drm/atomic-helpers: Saner encoder/crtc callbacks
For historical reasons going all the way back to how the Xrandr code was implemented the semantics of the callbacks used to enable/disable crtcs and encoders are ... interesting. But with atomic helpers all that complexity has been binned, with only a well-defined on/off action left. Unfortunately the names stuck. Let's fix that by adding enable/disable hooks every, make them the preferred variant for atomic and update documentations. Later on we add debug warnings when drivers have deprecated hooks. But while everything is in-flight with lots of drivers converting to atomic that's a bit too much - better wait for things to settle a bit first. v2: Fix kerneldoc, reported by Wu Fengguang. Reviewed-by: Thierry Reding <treding@nvidia.com> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Diffstat (limited to 'drivers/gpu/drm/drm_atomic_helper.c')
-rw-r--r--drivers/gpu/drm/drm_atomic_helper.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c
index d0c3611402da..379b6c833bb2 100644
--- a/drivers/gpu/drm/drm_atomic_helper.c
+++ b/drivers/gpu/drm/drm_atomic_helper.c
@@ -599,7 +599,7 @@ disable_outputs(struct drm_device *dev, struct drm_atomic_state *old_state)
encoder->bridge->funcs->disable(encoder->bridge);
/* Right function depends upon target state. */
- if (connector->state->crtc)
+ if (connector->state->crtc && funcs->prepare)
funcs->prepare(encoder);
else if (funcs->disable)
funcs->disable(encoder);
@@ -628,7 +628,7 @@ disable_outputs(struct drm_device *dev, struct drm_atomic_state *old_state)
funcs = crtc->helper_private;
/* Right function depends upon target state. */
- if (crtc->state->enable)
+ if (crtc->state->enable && funcs->prepare)
funcs->prepare(crtc);
else if (funcs->disable)
funcs->disable(crtc);
@@ -792,8 +792,12 @@ void drm_atomic_helper_commit_post_planes(struct drm_device *dev,
funcs = crtc->helper_private;
- if (crtc->state->enable)
- funcs->commit(crtc);
+ if (crtc->state->enable) {
+ if (funcs->enable)
+ funcs->enable(crtc);
+ else
+ funcs->commit(crtc);
+ }
}
for (i = 0; i < old_state->num_connector; i++) {
@@ -819,7 +823,10 @@ void drm_atomic_helper_commit_post_planes(struct drm_device *dev,
if (encoder->bridge)
encoder->bridge->funcs->pre_enable(encoder->bridge);
- funcs->commit(encoder);
+ if (funcs->enable)
+ funcs->enable(encoder);
+ else
+ funcs->commit(encoder);
if (encoder->bridge)
encoder->bridge->funcs->enable(encoder->bridge);