Lines Matching full:commit
53 * This helper library provides implementations of check and commit functions on
60 * drm_atomic_helper_check() and for the commit callback with
334 * atomic check or commit, this is racy. But that's OK: all we care in update_connector_routing()
1247 * Drivers can use this for building their own atomic commit if they don't have
1402 * drm_atomic_helper_commit_modeset_disables - modeset commit to disable outputs
1410 * drm_atomic_helper_commit_planes(), which is what the default commit function
1449 * drm_atomic_helper_commit_modeset_enables - modeset commit to enable outputs
1457 * drm_atomic_helper_commit_planes(), which is what the default commit function
1489 else if (funcs->commit) in drm_atomic_helper_commit_modeset_enables()
1490 funcs->commit(crtc); in drm_atomic_helper_commit_modeset_enables()
1524 else if (funcs->commit) in drm_atomic_helper_commit_modeset_enables()
1525 funcs->commit(encoder); in drm_atomic_helper_commit_modeset_enables()
1589 * around depending upon whether an atomic commit is blocking or
1590 * non-blocking. For non-blocking commit all waiting needs to happen after
1635 * Helper to, after atomic commit, wait for vblanks on all affected
1641 * Drivers using the nonblocking commit tracking support initialized by calling
1695 * Helper to, after atomic commit, wait for page flips on all affected
1702 * This requires that drivers use the nonblocking commit tracking support
1712 struct drm_crtc_commit *commit = old_state->crtcs[i].commit; in drm_atomic_helper_wait_for_flip_done() local
1717 if (!crtc || !commit) in drm_atomic_helper_wait_for_flip_done()
1720 ret = wait_for_completion_timeout(&commit->flip_done, 10 * HZ); in drm_atomic_helper_wait_for_flip_done()
1732 * drm_atomic_helper_commit_tail - commit atomic update to hardware
1738 * enabled to perform a commit. Otherwise, see
1765 * drm_atomic_helper_commit_tail_rpm - commit atomic update to hardware
1771 * commit. Otherwise, one should use the default implementation
1808 * We're measuring the _entire_ commit, so the time will vary depending in commit_tail()
1861 * This helper will check if it is possible to commit the state asynchronously.
1865 * It will return 0 if the commit can happen in an asynchronous fashion or error
1867 * fails the commit should be treated like a normal synchronous commit.
1919 * Don't do an async update if there is an outstanding commit modifying in drm_atomic_helper_async_check()
1923 if (old_plane_state->commit && in drm_atomic_helper_async_check()
1924 !try_wait_for_completion(&old_plane_state->commit->hw_done)) { in drm_atomic_helper_async_check()
1926 "[PLANE:%d:%s] inflight previous commit preventing async commit\n", in drm_atomic_helper_async_check()
1941 * drm_atomic_helper_async_commit - commit state asynchronously
1989 * drm_atomic_helper_commit - commit validated state object
2041 * when the hw goes bonghits. Which means we can commit the new state on in drm_atomic_helper_commit()
2064 * NOTE: Commit work has multiple phases, first hardware commit, then in drm_atomic_helper_commit()
2084 * DOC: implementing nonblocking commit
2089 * asynchronous context used to commit the hardware state.
2098 * 2. Synchronize with any outstanding nonblocking commit worker threads which
2106 * individual commit in parallel - userspace is supposed to do that if it cares.
2117 * (nonblocking) commits, both due to locking and due to commit sequencing
2122 * locks means concurrent callers never see inconsistent state. Note that commit
2129 * commit helpers: a) pre-plane commit b) plane commit c) post-plane commit and
2138 struct drm_crtc_commit *commit, *stall_commit = NULL; in stall_checks() local
2145 list_for_each_entry(commit, &crtc->commit_list, commit_entry) { in stall_checks()
2147 completed = try_wait_for_completion(&commit->flip_done); in stall_checks()
2150 * commit with nonblocking ones. in stall_checks()
2155 "[CRTC:%d:%s] busy with a previous commit\n", in stall_checks()
2161 stall_commit = drm_crtc_commit_get(commit); in stall_checks()
2173 * stalling on 2nd previous commit means triple-buffer won't ever stall. in stall_checks()
2188 struct drm_crtc_commit *commit = container_of(completion, in release_crtc_commit() local
2189 typeof(*commit), in release_crtc_commit()
2192 drm_crtc_commit_put(commit); in release_crtc_commit()
2195 static void init_commit(struct drm_crtc_commit *commit, struct drm_crtc *crtc) in init_commit() argument
2197 init_completion(&commit->flip_done); in init_commit()
2198 init_completion(&commit->hw_done); in init_commit()
2199 init_completion(&commit->cleanup_done); in init_commit()
2200 INIT_LIST_HEAD(&commit->commit_entry); in init_commit()
2201 kref_init(&commit->ref); in init_commit()
2202 commit->crtc = crtc; in init_commit()
2213 return new_crtc_state->commit; in crtc_or_fake_commit()
2228 * drm_atomic_helper_setup_commit - setup possibly nonblocking commit
2233 * nonblocking commits. Drivers using the nonblocking commit infrastructure
2237 * Drivers that need to extend the commit setup to private objects can use the
2244 * and its stall parameter, for when a driver's commit hooks look at the
2247 * Completion of the hardware commit step must be signalled using
2281 struct drm_crtc_commit *commit; in drm_atomic_helper_setup_commit() local
2288 commit = kzalloc(sizeof(*commit), GFP_KERNEL); in drm_atomic_helper_setup_commit()
2289 if (!commit) in drm_atomic_helper_setup_commit()
2292 init_commit(commit, crtc); in drm_atomic_helper_setup_commit()
2294 new_crtc_state->commit = commit; in drm_atomic_helper_setup_commit()
2306 complete_all(&commit->flip_done); in drm_atomic_helper_setup_commit()
2312 complete_all(&commit->flip_done); in drm_atomic_helper_setup_commit()
2317 commit->event = kzalloc(sizeof(*commit->event), in drm_atomic_helper_setup_commit()
2319 if (!commit->event) in drm_atomic_helper_setup_commit()
2322 new_crtc_state->event = commit->event; in drm_atomic_helper_setup_commit()
2325 new_crtc_state->event->base.completion = &commit->flip_done; in drm_atomic_helper_setup_commit()
2327 drm_crtc_commit_get(commit); in drm_atomic_helper_setup_commit()
2329 commit->abort_completion = true; in drm_atomic_helper_setup_commit()
2331 state->crtcs[i].commit = commit; in drm_atomic_helper_setup_commit()
2332 drm_crtc_commit_get(commit); in drm_atomic_helper_setup_commit()
2338 * commit with nonblocking ones. in drm_atomic_helper_setup_commit()
2340 if (nonblock && old_conn_state->commit && in drm_atomic_helper_setup_commit()
2341 !try_wait_for_completion(&old_conn_state->commit->flip_done)) { in drm_atomic_helper_setup_commit()
2343 "[CONNECTOR:%d:%s] busy with a previous commit\n", in drm_atomic_helper_setup_commit()
2350 commit = crtc_or_fake_commit(state, new_conn_state->crtc ?: old_conn_state->crtc); in drm_atomic_helper_setup_commit()
2351 if (!commit) in drm_atomic_helper_setup_commit()
2354 new_conn_state->commit = drm_crtc_commit_get(commit); in drm_atomic_helper_setup_commit()
2360 * commit with nonblocking ones. in drm_atomic_helper_setup_commit()
2362 if (nonblock && old_plane_state->commit && in drm_atomic_helper_setup_commit()
2363 !try_wait_for_completion(&old_plane_state->commit->flip_done)) { in drm_atomic_helper_setup_commit()
2365 "[PLANE:%d:%s] busy with a previous commit\n", in drm_atomic_helper_setup_commit()
2372 commit = crtc_or_fake_commit(state, new_plane_state->crtc ?: old_plane_state->crtc); in drm_atomic_helper_setup_commit()
2373 if (!commit) in drm_atomic_helper_setup_commit()
2376 new_plane_state->commit = drm_crtc_commit_get(commit); in drm_atomic_helper_setup_commit()
2410 ret = drm_crtc_commit_wait(old_crtc_state->commit); in drm_atomic_helper_wait_for_dependencies()
2413 "[CRTC:%d:%s] commit wait timed out\n", in drm_atomic_helper_wait_for_dependencies()
2418 ret = drm_crtc_commit_wait(old_conn_state->commit); in drm_atomic_helper_wait_for_dependencies()
2421 "[CONNECTOR:%d:%s] commit wait timed out\n", in drm_atomic_helper_wait_for_dependencies()
2426 ret = drm_crtc_commit_wait(old_plane_state->commit); in drm_atomic_helper_wait_for_dependencies()
2429 "[PLANE:%d:%s] commit wait timed out\n", in drm_atomic_helper_wait_for_dependencies()
2477 * drm_atomic_helper_commit_hw_done - setup possible nonblocking commit
2480 * This function is used to signal completion of the hardware commit step. After
2495 struct drm_crtc_commit *commit; in drm_atomic_helper_commit_hw_done() local
2499 commit = new_crtc_state->commit; in drm_atomic_helper_commit_hw_done()
2500 if (!commit) in drm_atomic_helper_commit_hw_done()
2504 * copy new_crtc_state->commit to old_crtc_state->commit, in drm_atomic_helper_commit_hw_done()
2508 if (old_crtc_state->commit) in drm_atomic_helper_commit_hw_done()
2509 drm_crtc_commit_put(old_crtc_state->commit); in drm_atomic_helper_commit_hw_done()
2511 old_crtc_state->commit = drm_crtc_commit_get(commit); in drm_atomic_helper_commit_hw_done()
2515 complete_all(&commit->hw_done); in drm_atomic_helper_commit_hw_done()
2526 * drm_atomic_helper_commit_cleanup_done - signal completion of commit
2540 struct drm_crtc_commit *commit; in drm_atomic_helper_commit_cleanup_done() local
2544 commit = old_crtc_state->commit; in drm_atomic_helper_commit_cleanup_done()
2545 if (WARN_ON(!commit)) in drm_atomic_helper_commit_cleanup_done()
2548 complete_all(&commit->cleanup_done); in drm_atomic_helper_commit_cleanup_done()
2549 WARN_ON(!try_wait_for_completion(&commit->hw_done)); in drm_atomic_helper_commit_cleanup_done()
2552 list_del(&commit->commit_entry); in drm_atomic_helper_commit_cleanup_done()
2564 * drm_atomic_helper_prepare_planes - prepare plane resources before commit
2662 * when aborting an atomic commit. For cleaning up after a successful commit
2694 * drm_atomic_helper_commit_planes - commit plane state
2825 * a later commit might have already released the plane state. in drm_atomic_helper_commit_planes()
2837 * drm_atomic_helper_commit_planes_on_crtc - commit plane state for a CRTC
2851 * resolve them through ordering of commit calls or through some other means.
2952 * drm_atomic_helper_cleanup_planes - cleanup plane resources after commit
3000 * 4. Actually commit the hardware state.
3025 struct drm_crtc_commit *commit; in drm_atomic_helper_swap_state() local
3040 commit = old_crtc_state->commit; in drm_atomic_helper_swap_state()
3042 if (!commit) in drm_atomic_helper_swap_state()
3045 ret = wait_for_completion_interruptible(&commit->hw_done); in drm_atomic_helper_swap_state()
3051 commit = old_conn_state->commit; in drm_atomic_helper_swap_state()
3053 if (!commit) in drm_atomic_helper_swap_state()
3056 ret = wait_for_completion_interruptible(&commit->hw_done); in drm_atomic_helper_swap_state()
3062 commit = old_plane_state->commit; in drm_atomic_helper_swap_state()
3064 if (!commit) in drm_atomic_helper_swap_state()
3067 ret = wait_for_completion_interruptible(&commit->hw_done); in drm_atomic_helper_swap_state()
3092 if (new_crtc_state->commit) { in drm_atomic_helper_swap_state()
3094 list_add(&new_crtc_state->commit->commit_entry, in drm_atomic_helper_swap_state()
3098 new_crtc_state->commit->event = NULL; in drm_atomic_helper_swap_state()
3541 * drm_atomic_helper_commit_duplicated_state - commit duplicated state
3542 * @state: duplicated atomic state to commit
3543 * @ctx: pointer to acquire_ctx to use for commit.
3547 * be fixed up before commit.