/* * Helpers to control vblanks while we flush.. basically just to ensure * that vblank accounting is switched on, so we get valid seqn/timestamp * on pageflip events (if requested)
*/
if (!(state->legacy_cursor_update || state->async_update)) returnfalse;
/* any connector change, means slow path: */
for_each_new_connector_in_state(state, connector, connector_state, i) returnfalse;
for_each_new_crtc_in_state(state, crtc, crtc_state, i) { if (drm_atomic_crtc_needs_modeset(crtc_state)) returnfalse; if (!crtc_state->active) returnfalse; if (++num_crtcs > 1) returnfalse;
*async_crtc = crtc;
}
returntrue;
}
/* Get bitmask of crtcs that will need to be flushed. The bitmask * can be used with for_each_crtc_mask() iterator, to iterate * effected crtcs without needing to preserve the atomic state.
*/ staticunsigned get_crtc_mask(struct drm_atomic_state *state)
{ struct drm_crtc_state *crtc_state; struct drm_crtc *crtc; unsigned i, mask = 0;
/* * Ensure any previous (potentially async) commit has * completed:
*/
lock_crtcs(kms, crtc_mask);
trace_msm_atomic_wait_flush_start(crtc_mask);
kms->funcs->wait_flush(kms, crtc_mask);
trace_msm_atomic_wait_flush_finish(crtc_mask);
atomic_set(&kms->fault_snapshot_capture, 0);
/* * Now that there is no in-progress flush, prepare the * current update:
*/ if (kms->funcs->prepare_commit)
kms->funcs->prepare_commit(kms, state);
/* * Push atomic updates down to hardware:
*/
drm_atomic_helper_commit_modeset_disables(dev, state);
drm_atomic_helper_commit_planes(dev, state, 0);
drm_atomic_helper_commit_modeset_enables(dev, state);
if (async) { struct msm_pending_timer *timer =
&kms->pending_timers[drm_crtc_index(async_crtc)];
/* async updates are limited to single-crtc updates: */
WARN_ON(crtc_mask != drm_crtc_mask(async_crtc));
/* * Start timer if we don't already have an update pending * on this crtc:
*/ if (!(kms->pending_crtc_mask & crtc_mask)) {
ktime_t vsync_time, wakeup_time;
kms->pending_crtc_mask |= crtc_mask;
if (drm_crtc_next_vblank_start(async_crtc, &vsync_time)) goto fallback;
kms->funcs->disable_commit(kms);
unlock_crtcs(kms, crtc_mask); /* * At this point, from drm core's perspective, we * are done with the atomic update, so we can just * go ahead and signal that it is done:
*/
drm_atomic_helper_commit_hw_done(state);
drm_atomic_helper_cleanup_planes(dev, state);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.