diff options
author | Brian Starkey <brian.starkey@arm.com> | 2016-10-13 05:47:08 -0400 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2016-10-17 02:07:11 -0400 |
commit | d807ed1c55fb1b2dcfb2bc49385e227f6bee7669 (patch) | |
tree | d6422d386983b3e6bd1da80b536ba64751ba30c0 | |
parent | f7741aa75e76440f4e9ecfe512feebe9bce33ca8 (diff) |
drm: atomic: Clarify documentation around drm_atomic_crtc_needs_modeset
Add some additional comments to more explicitly describe the meaning and
usage of the three CRTC modeset detection booleans: mode_changed,
connectors_changed and active_changed.
Suggested-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Brian Starkey <brian.starkey@arm.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/1476352028-16701-1-git-send-email-brian.starkey@arm.com
-rw-r--r-- | drivers/gpu/drm/drm_atomic_helper.c | 9 | ||||
-rw-r--r-- | include/drm/drm_atomic.h | 11 | ||||
-rw-r--r-- | include/drm/drm_crtc.h | 5 |
3 files changed, 20 insertions, 5 deletions
diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c index c3f83476f996..36f83fe5ec46 100644 --- a/drivers/gpu/drm/drm_atomic_helper.c +++ b/drivers/gpu/drm/drm_atomic_helper.c | |||
@@ -458,10 +458,11 @@ mode_fixup(struct drm_atomic_state *state) | |||
458 | * removed from the crtc. | 458 | * removed from the crtc. |
459 | * crtc_state->active_changed is set when crtc_state->active changes, | 459 | * crtc_state->active_changed is set when crtc_state->active changes, |
460 | * which is used for dpms. | 460 | * which is used for dpms. |
461 | * See also: drm_atomic_crtc_needs_modeset() | ||
461 | * | 462 | * |
462 | * IMPORTANT: | 463 | * IMPORTANT: |
463 | * | 464 | * |
464 | * Drivers which update ->mode_changed (e.g. in their ->atomic_check hooks if a | 465 | * Drivers which set ->mode_changed (e.g. in their ->atomic_check hooks if a |
465 | * plane update can't be done without a full modeset) _must_ call this function | 466 | * plane update can't be done without a full modeset) _must_ call this function |
466 | * afterwards after that change. It is permitted to call this function multiple | 467 | * afterwards after that change. It is permitted to call this function multiple |
467 | * times for the same update, e.g. when the ->atomic_check functions depend upon | 468 | * times for the same update, e.g. when the ->atomic_check functions depend upon |
@@ -510,9 +511,9 @@ drm_atomic_helper_check_modeset(struct drm_device *dev, | |||
510 | 511 | ||
511 | for_each_connector_in_state(state, connector, connector_state, i) { | 512 | for_each_connector_in_state(state, connector, connector_state, i) { |
512 | /* | 513 | /* |
513 | * This only sets crtc->mode_changed for routing changes, | 514 | * This only sets crtc->connectors_changed for routing changes, |
514 | * drivers must set crtc->mode_changed themselves when connector | 515 | * drivers must set crtc->connectors_changed themselves when |
515 | * properties need to be updated. | 516 | * connector properties need to be updated. |
516 | */ | 517 | */ |
517 | ret = update_connector_routing(state, connector, | 518 | ret = update_connector_routing(state, connector, |
518 | connector_state); | 519 | connector_state); |
diff --git a/include/drm/drm_atomic.h b/include/drm/drm_atomic.h index 9701f2dfb784..c52f99415c55 100644 --- a/include/drm/drm_atomic.h +++ b/include/drm/drm_atomic.h | |||
@@ -365,8 +365,17 @@ int __must_check drm_atomic_nonblocking_commit(struct drm_atomic_state *state); | |||
365 | * | 365 | * |
366 | * To give drivers flexibility struct &drm_crtc_state has 3 booleans to track | 366 | * To give drivers flexibility struct &drm_crtc_state has 3 booleans to track |
367 | * whether the state CRTC changed enough to need a full modeset cycle: | 367 | * whether the state CRTC changed enough to need a full modeset cycle: |
368 | * connectors_changed, mode_changed and active_change. This helper simply | 368 | * connectors_changed, mode_changed and active_changed. This helper simply |
369 | * combines these three to compute the overall need for a modeset for @state. | 369 | * combines these three to compute the overall need for a modeset for @state. |
370 | * | ||
371 | * The atomic helper code sets these booleans, but drivers can and should | ||
372 | * change them appropriately to accurately represent whether a modeset is | ||
373 | * really needed. In general, drivers should avoid full modesets whenever | ||
374 | * possible. | ||
375 | * | ||
376 | * For example if the CRTC mode has changed, and the hardware is able to enact | ||
377 | * the requested mode change without going through a full modeset, the driver | ||
378 | * should clear mode_changed during its ->atomic_check. | ||
370 | */ | 379 | */ |
371 | static inline bool | 380 | static inline bool |
372 | drm_atomic_crtc_needs_modeset(struct drm_crtc_state *state) | 381 | drm_atomic_crtc_needs_modeset(struct drm_crtc_state *state) |
diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h index 0aa292526567..92246619947c 100644 --- a/include/drm/drm_crtc.h +++ b/include/drm/drm_crtc.h | |||
@@ -116,6 +116,11 @@ struct drm_plane_helper_funcs; | |||
116 | * never return in a failure from the ->atomic_check callback. Userspace assumes | 116 | * never return in a failure from the ->atomic_check callback. Userspace assumes |
117 | * that a DPMS On will always succeed. In other words: @enable controls resource | 117 | * that a DPMS On will always succeed. In other words: @enable controls resource |
118 | * assignment, @active controls the actual hardware state. | 118 | * assignment, @active controls the actual hardware state. |
119 | * | ||
120 | * The three booleans active_changed, connectors_changed and mode_changed are | ||
121 | * intended to indicate whether a full modeset is needed, rather than strictly | ||
122 | * describing what has changed in a commit. | ||
123 | * See also: drm_atomic_crtc_needs_modeset() | ||
119 | */ | 124 | */ |
120 | struct drm_crtc_state { | 125 | struct drm_crtc_state { |
121 | struct drm_crtc *crtc; | 126 | struct drm_crtc *crtc; |