diff options
author | Liu Ying <gnuiyl@gmail.com> | 2016-08-26 03:30:38 -0400 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2016-08-29 04:21:52 -0400 |
commit | c9ac8b4c5caf493fba8c43f1bd02f687ffccb429 (patch) | |
tree | caf90eb60ad9fbb9d71b05107f2d027c963ca52d | |
parent | 315486c665333a49be20643c9137d9641f32e2b7 (diff) |
drm/atomic-helper: Add atomic_disable CRTC helper callback
Some display controllers need plane(s) to be disabled together with
the relevant CRTC, e.g., the IPUv3 display controller for imx-drm.
This patch adds atomic_disable CRTC helper callback so that
old_crtc_state(as a parameter of the callback) could be used
to get the active plane(s) of the old CRTC state for disable operation.
Suggested-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Philipp Zabel <p.zabel@pengutronix.de>
Cc: David Airlie <airlied@linux.ie>
Cc: Russell King <linux@armlinux.org.uk>
Cc: Peter Senna Tschudin <peter.senna@gmail.com>
Cc: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Liu Ying <gnuiyl@gmail.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/1472196644-30563-2-git-send-email-gnuiyl@gmail.com
-rw-r--r-- | drivers/gpu/drm/drm_atomic_helper.c | 2 | ||||
-rw-r--r-- | include/drm/drm_modeset_helper_vtables.h | 24 |
2 files changed, 26 insertions, 0 deletions
diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c index 9abe0a242f96..4828b9b860de 100644 --- a/drivers/gpu/drm/drm_atomic_helper.c +++ b/drivers/gpu/drm/drm_atomic_helper.c | |||
@@ -749,6 +749,8 @@ disable_outputs(struct drm_device *dev, struct drm_atomic_state *old_state) | |||
749 | /* Right function depends upon target state. */ | 749 | /* Right function depends upon target state. */ |
750 | if (crtc->state->enable && funcs->prepare) | 750 | if (crtc->state->enable && funcs->prepare) |
751 | funcs->prepare(crtc); | 751 | funcs->prepare(crtc); |
752 | else if (funcs->atomic_disable) | ||
753 | funcs->atomic_disable(crtc, old_crtc_state); | ||
752 | else if (funcs->disable) | 754 | else if (funcs->disable) |
753 | funcs->disable(crtc); | 755 | funcs->disable(crtc); |
754 | else | 756 | else |
diff --git a/include/drm/drm_modeset_helper_vtables.h b/include/drm/drm_modeset_helper_vtables.h index 6c8d3dad66ec..10e449c86dbd 100644 --- a/include/drm/drm_modeset_helper_vtables.h +++ b/include/drm/drm_modeset_helper_vtables.h | |||
@@ -266,6 +266,8 @@ struct drm_crtc_helper_funcs { | |||
266 | * disable anything at the CRTC level. To ensure that runtime PM | 266 | * disable anything at the CRTC level. To ensure that runtime PM |
267 | * handling (using either DPMS or the new "ACTIVE" property) works | 267 | * handling (using either DPMS or the new "ACTIVE" property) works |
268 | * @disable must be the inverse of @enable for atomic drivers. | 268 | * @disable must be the inverse of @enable for atomic drivers. |
269 | * Atomic drivers should consider to use @atomic_disable instead of | ||
270 | * this one. | ||
269 | * | 271 | * |
270 | * NOTE: | 272 | * NOTE: |
271 | * | 273 | * |
@@ -391,6 +393,28 @@ struct drm_crtc_helper_funcs { | |||
391 | */ | 393 | */ |
392 | void (*atomic_flush)(struct drm_crtc *crtc, | 394 | void (*atomic_flush)(struct drm_crtc *crtc, |
393 | struct drm_crtc_state *old_crtc_state); | 395 | struct drm_crtc_state *old_crtc_state); |
396 | |||
397 | /** | ||
398 | * @atomic_disable: | ||
399 | * | ||
400 | * This callback should be used to disable the CRTC. With the atomic | ||
401 | * drivers it is called after all encoders connected to this CRTC have | ||
402 | * been shut off already using their own ->disable hook. If that | ||
403 | * sequence is too simple drivers can just add their own hooks and call | ||
404 | * it from this CRTC callback here by looping over all encoders | ||
405 | * connected to it using for_each_encoder_on_crtc(). | ||
406 | * | ||
407 | * This hook is used only by atomic helpers. Atomic drivers don't | ||
408 | * need to implement it if there's no need to disable anything at the | ||
409 | * CRTC level. | ||
410 | * | ||
411 | * Comparing to @disable, this one provides the additional input | ||
412 | * parameter @old_crtc_state which could be used to access the old | ||
413 | * state. Atomic drivers should consider to use this one instead | ||
414 | * of @disable. | ||
415 | */ | ||
416 | void (*atomic_disable)(struct drm_crtc *crtc, | ||
417 | struct drm_crtc_state *old_crtc_state); | ||
394 | }; | 418 | }; |
395 | 419 | ||
396 | /** | 420 | /** |