Lines Matching full:commit
52 * This helper library provides implementations of check and commit functions on
59 * drm_atomic_helper_check() and for the commit callback with
333 * atomic check or commit, this is racy. But that's OK: all we care in update_connector_routing()
1244 * Drivers can use this for building their own atomic commit if they don't have
1399 * drm_atomic_helper_commit_modeset_disables - modeset commit to disable outputs
1407 * drm_atomic_helper_commit_planes(), which is what the default commit function
1446 * drm_atomic_helper_commit_modeset_enables - modeset commit to enable outputs
1454 * drm_atomic_helper_commit_planes(), which is what the default commit function
1486 else if (funcs->commit) in drm_atomic_helper_commit_modeset_enables()
1487 funcs->commit(crtc); in drm_atomic_helper_commit_modeset_enables()
1521 else if (funcs->commit) in drm_atomic_helper_commit_modeset_enables()
1522 funcs->commit(encoder); in drm_atomic_helper_commit_modeset_enables()
1586 * around depending upon whether an atomic commit is blocking or
1587 * non-blocking. For non-blocking commit all waiting needs to happen after
1632 * Helper to, after atomic commit, wait for vblanks on all affected
1638 * Drivers using the nonblocking commit tracking support initialized by calling
1692 * Helper to, after atomic commit, wait for page flips on all affected
1699 * This requires that drivers use the nonblocking commit tracking support
1709 struct drm_crtc_commit *commit = old_state->crtcs[i].commit; in drm_atomic_helper_wait_for_flip_done() local
1714 if (!crtc || !commit) in drm_atomic_helper_wait_for_flip_done()
1717 ret = wait_for_completion_timeout(&commit->flip_done, 10 * HZ); in drm_atomic_helper_wait_for_flip_done()
1729 * drm_atomic_helper_commit_tail - commit atomic update to hardware
1735 * enabled to perform a commit. Otherwise, see
1762 * drm_atomic_helper_commit_tail_rpm - commit atomic update to hardware
1768 * commit. Otherwise, one should use the default implementation
1805 * We're measuring the _entire_ commit, so the time will vary depending in commit_tail()
1858 * This helper will check if it is possible to commit the state asynchronously.
1862 * It will return 0 if the commit can happen in an asynchronous fashion or error
1864 * fails the commit should be treated like a normal synchronous commit.
1916 * Don't do an async update if there is an outstanding commit modifying in drm_atomic_helper_async_check()
1920 if (old_plane_state->commit && in drm_atomic_helper_async_check()
1921 !try_wait_for_completion(&old_plane_state->commit->hw_done)) { in drm_atomic_helper_async_check()
1923 "[PLANE:%d:%s] inflight previous commit preventing async commit\n", in drm_atomic_helper_async_check()
1938 * drm_atomic_helper_async_commit - commit state asynchronously
1986 * drm_atomic_helper_commit - commit validated state object
2038 * when the hw goes bonghits. Which means we can commit the new state on in drm_atomic_helper_commit()
2061 * NOTE: Commit work has multiple phases, first hardware commit, then in drm_atomic_helper_commit()
2081 * DOC: implementing nonblocking commit
2086 * asynchronous context used to commit the hardware state.
2095 * 2. Synchronize with any outstanding nonblocking commit worker threads which
2103 * individual commit in parallel - userspace is supposed to do that if it cares.
2114 * (nonblocking) commits, both due to locking and due to commit sequencing
2119 * locks means concurrent callers never see inconsistent state. Note that commit
2126 * commit helpers: a) pre-plane commit b) plane commit c) post-plane commit and
2135 struct drm_crtc_commit *commit, *stall_commit = NULL; in stall_checks() local
2142 list_for_each_entry(commit, &crtc->commit_list, commit_entry) { in stall_checks()
2144 completed = try_wait_for_completion(&commit->flip_done); in stall_checks()
2147 * commit with nonblocking ones. in stall_checks()
2152 "[CRTC:%d:%s] busy with a previous commit\n", in stall_checks()
2158 stall_commit = drm_crtc_commit_get(commit); in stall_checks()
2170 * stalling on 2nd previous commit means triple-buffer won't ever stall. in stall_checks()
2185 struct drm_crtc_commit *commit = container_of(completion, in release_crtc_commit() local
2186 typeof(*commit), in release_crtc_commit()
2189 drm_crtc_commit_put(commit); in release_crtc_commit()
2192 static void init_commit(struct drm_crtc_commit *commit, struct drm_crtc *crtc) in init_commit() argument
2194 init_completion(&commit->flip_done); in init_commit()
2195 init_completion(&commit->hw_done); in init_commit()
2196 init_completion(&commit->cleanup_done); in init_commit()
2197 INIT_LIST_HEAD(&commit->commit_entry); in init_commit()
2198 kref_init(&commit->ref); in init_commit()
2199 commit->crtc = crtc; in init_commit()
2210 return new_crtc_state->commit; in crtc_or_fake_commit()
2225 * drm_atomic_helper_setup_commit - setup possibly nonblocking commit
2230 * nonblocking commits. Drivers using the nonblocking commit infrastructure
2234 * Drivers that need to extend the commit setup to private objects can use the
2241 * and its stall parameter, for when a driver's commit hooks look at the
2244 * Completion of the hardware commit step must be signalled using
2279 struct drm_crtc_commit *commit; in drm_atomic_helper_setup_commit() local
2286 commit = kzalloc(sizeof(*commit), GFP_KERNEL); in drm_atomic_helper_setup_commit()
2287 if (!commit) in drm_atomic_helper_setup_commit()
2290 init_commit(commit, crtc); in drm_atomic_helper_setup_commit()
2292 new_crtc_state->commit = commit; in drm_atomic_helper_setup_commit()
2304 complete_all(&commit->flip_done); in drm_atomic_helper_setup_commit()
2310 complete_all(&commit->flip_done); in drm_atomic_helper_setup_commit()
2315 commit->event = kzalloc(sizeof(*commit->event), in drm_atomic_helper_setup_commit()
2317 if (!commit->event) in drm_atomic_helper_setup_commit()
2320 new_crtc_state->event = commit->event; in drm_atomic_helper_setup_commit()
2323 new_crtc_state->event->base.completion = &commit->flip_done; in drm_atomic_helper_setup_commit()
2325 drm_crtc_commit_get(commit); in drm_atomic_helper_setup_commit()
2327 commit->abort_completion = true; in drm_atomic_helper_setup_commit()
2329 state->crtcs[i].commit = commit; in drm_atomic_helper_setup_commit()
2330 drm_crtc_commit_get(commit); in drm_atomic_helper_setup_commit()
2336 * commit with nonblocking ones. in drm_atomic_helper_setup_commit()
2338 if (nonblock && old_conn_state->commit && in drm_atomic_helper_setup_commit()
2339 !try_wait_for_completion(&old_conn_state->commit->flip_done)) { in drm_atomic_helper_setup_commit()
2341 "[CONNECTOR:%d:%s] busy with a previous commit\n", in drm_atomic_helper_setup_commit()
2348 commit = crtc_or_fake_commit(state, new_conn_state->crtc ?: old_conn_state->crtc); in drm_atomic_helper_setup_commit()
2349 if (!commit) in drm_atomic_helper_setup_commit()
2352 new_conn_state->commit = drm_crtc_commit_get(commit); in drm_atomic_helper_setup_commit()
2358 * commit with nonblocking ones. in drm_atomic_helper_setup_commit()
2360 if (nonblock && old_plane_state->commit && in drm_atomic_helper_setup_commit()
2361 !try_wait_for_completion(&old_plane_state->commit->flip_done)) { in drm_atomic_helper_setup_commit()
2363 "[PLANE:%d:%s] busy with a previous commit\n", in drm_atomic_helper_setup_commit()
2370 commit = crtc_or_fake_commit(state, new_plane_state->crtc ?: old_plane_state->crtc); in drm_atomic_helper_setup_commit()
2371 if (!commit) in drm_atomic_helper_setup_commit()
2374 new_plane_state->commit = drm_crtc_commit_get(commit); in drm_atomic_helper_setup_commit()
2408 ret = drm_crtc_commit_wait(old_crtc_state->commit); in drm_atomic_helper_wait_for_dependencies()
2411 "[CRTC:%d:%s] commit wait timed out\n", in drm_atomic_helper_wait_for_dependencies()
2416 ret = drm_crtc_commit_wait(old_conn_state->commit); in drm_atomic_helper_wait_for_dependencies()
2419 "[CONNECTOR:%d:%s] commit wait timed out\n", in drm_atomic_helper_wait_for_dependencies()
2424 ret = drm_crtc_commit_wait(old_plane_state->commit); in drm_atomic_helper_wait_for_dependencies()
2427 "[PLANE:%d:%s] commit wait timed out\n", in drm_atomic_helper_wait_for_dependencies()
2475 * drm_atomic_helper_commit_hw_done - setup possible nonblocking commit
2478 * This function is used to signal completion of the hardware commit step. After
2493 struct drm_crtc_commit *commit; in drm_atomic_helper_commit_hw_done() local
2497 commit = new_crtc_state->commit; in drm_atomic_helper_commit_hw_done()
2498 if (!commit) in drm_atomic_helper_commit_hw_done()
2502 * copy new_crtc_state->commit to old_crtc_state->commit, in drm_atomic_helper_commit_hw_done()
2506 if (old_crtc_state->commit) in drm_atomic_helper_commit_hw_done()
2507 drm_crtc_commit_put(old_crtc_state->commit); in drm_atomic_helper_commit_hw_done()
2509 old_crtc_state->commit = drm_crtc_commit_get(commit); in drm_atomic_helper_commit_hw_done()
2513 complete_all(&commit->hw_done); in drm_atomic_helper_commit_hw_done()
2524 * drm_atomic_helper_commit_cleanup_done - signal completion of commit
2538 struct drm_crtc_commit *commit; in drm_atomic_helper_commit_cleanup_done() local
2542 commit = old_crtc_state->commit; in drm_atomic_helper_commit_cleanup_done()
2543 if (WARN_ON(!commit)) in drm_atomic_helper_commit_cleanup_done()
2546 complete_all(&commit->cleanup_done); in drm_atomic_helper_commit_cleanup_done()
2547 WARN_ON(!try_wait_for_completion(&commit->hw_done)); in drm_atomic_helper_commit_cleanup_done()
2550 list_del(&commit->commit_entry); in drm_atomic_helper_commit_cleanup_done()
2562 * drm_atomic_helper_prepare_planes - prepare plane resources before commit
2660 * when aborting an atomic commit. For cleaning up after a successful commit
2692 * drm_atomic_helper_commit_planes - commit plane state
2823 * a later commit might have already released the plane state. in drm_atomic_helper_commit_planes()
2835 * drm_atomic_helper_commit_planes_on_crtc - commit plane state for a CRTC
2849 * resolve them through ordering of commit calls or through some other means.
2950 * drm_atomic_helper_cleanup_planes - cleanup plane resources after commit
2998 * 4. Actually commit the hardware state.
3023 struct drm_crtc_commit *commit; in drm_atomic_helper_swap_state() local
3038 commit = old_crtc_state->commit; in drm_atomic_helper_swap_state()
3040 if (!commit) in drm_atomic_helper_swap_state()
3043 ret = wait_for_completion_interruptible(&commit->hw_done); in drm_atomic_helper_swap_state()
3049 commit = old_conn_state->commit; in drm_atomic_helper_swap_state()
3051 if (!commit) in drm_atomic_helper_swap_state()
3054 ret = wait_for_completion_interruptible(&commit->hw_done); in drm_atomic_helper_swap_state()
3060 commit = old_plane_state->commit; in drm_atomic_helper_swap_state()
3062 if (!commit) in drm_atomic_helper_swap_state()
3065 ret = wait_for_completion_interruptible(&commit->hw_done); in drm_atomic_helper_swap_state()
3090 if (new_crtc_state->commit) { in drm_atomic_helper_swap_state()
3092 list_add(&new_crtc_state->commit->commit_entry, in drm_atomic_helper_swap_state()
3096 new_crtc_state->commit->event = NULL; in drm_atomic_helper_swap_state()
3534 * drm_atomic_helper_commit_duplicated_state - commit duplicated state
3535 * @state: duplicated atomic state to commit
3536 * @ctx: pointer to acquire_ctx to use for commit.
3540 * be fixed up before commit.