Lines Matching defs: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
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)
1490 funcs->commit(crtc);
1524 else if (funcs->commit)
1525 funcs->commit(encoder);
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;
1717 if (!crtc || !commit)
1720 ret = wait_for_completion_timeout(&commit->flip_done, 10 * HZ);
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
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
1923 if (old_plane_state->commit &&
1924 !try_wait_for_completion(&old_plane_state->commit->hw_done)) {
1926 "[PLANE:%d:%s] inflight previous commit preventing async commit\n",
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
2064 * NOTE: Commit work has multiple phases, first hardware commit, then
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;
2145 list_for_each_entry(commit, &crtc->commit_list, commit_entry) {
2147 completed = try_wait_for_completion(&commit->flip_done);
2150 * commit with nonblocking ones.
2155 "[CRTC:%d:%s] busy with a previous commit\n",
2161 stall_commit = drm_crtc_commit_get(commit);
2173 * stalling on 2nd previous commit means triple-buffer won't ever stall.
2188 struct drm_crtc_commit *commit = container_of(completion,
2189 typeof(*commit),
2192 drm_crtc_commit_put(commit);
2195 static void init_commit(struct drm_crtc_commit *commit, struct drm_crtc *crtc)
2197 init_completion(&commit->flip_done);
2198 init_completion(&commit->hw_done);
2199 init_completion(&commit->cleanup_done);
2200 INIT_LIST_HEAD(&commit->commit_entry);
2201 kref_init(&commit->ref);
2202 commit->crtc = crtc;
2213 return new_crtc_state->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
2282 struct drm_crtc_commit *commit;
2289 commit = kzalloc(sizeof(*commit), GFP_KERNEL);
2290 if (!commit)
2293 init_commit(commit, crtc);
2295 new_crtc_state->commit = commit;
2307 complete_all(&commit->flip_done);
2313 complete_all(&commit->flip_done);
2318 commit->event = kzalloc(sizeof(*commit->event),
2320 if (!commit->event)
2323 new_crtc_state->event = commit->event;
2326 new_crtc_state->event->base.completion = &commit->flip_done;
2328 drm_crtc_commit_get(commit);
2330 commit->abort_completion = true;
2332 state->crtcs[i].commit = commit;
2333 drm_crtc_commit_get(commit);
2339 * commit with nonblocking ones.
2341 if (nonblock && old_conn_state->commit &&
2342 !try_wait_for_completion(&old_conn_state->commit->flip_done)) {
2344 "[CONNECTOR:%d:%s] busy with a previous commit\n",
2351 commit = crtc_or_fake_commit(state, new_conn_state->crtc ?: old_conn_state->crtc);
2352 if (!commit)
2355 new_conn_state->commit = drm_crtc_commit_get(commit);
2361 * commit with nonblocking ones.
2363 if (nonblock && old_plane_state->commit &&
2364 !try_wait_for_completion(&old_plane_state->commit->flip_done)) {
2366 "[PLANE:%d:%s] busy with a previous commit\n",
2373 commit = crtc_or_fake_commit(state, new_plane_state->crtc ?: old_plane_state->crtc);
2374 if (!commit)
2377 new_plane_state->commit = drm_crtc_commit_get(commit);
2411 ret = drm_crtc_commit_wait(old_crtc_state->commit);
2414 "[CRTC:%d:%s] commit wait timed out\n",
2419 ret = drm_crtc_commit_wait(old_conn_state->commit);
2422 "[CONNECTOR:%d:%s] commit wait timed out\n",
2427 ret = drm_crtc_commit_wait(old_plane_state->commit);
2430 "[PLANE:%d:%s] commit wait timed out\n",
2478 * drm_atomic_helper_commit_hw_done - setup possible nonblocking commit
2481 * This function is used to signal completion of the hardware commit step. After
2496 struct drm_crtc_commit *commit;
2500 commit = new_crtc_state->commit;
2501 if (!commit)
2505 * copy new_crtc_state->commit to old_crtc_state->commit,
2509 if (old_crtc_state->commit)
2510 drm_crtc_commit_put(old_crtc_state->commit);
2512 old_crtc_state->commit = drm_crtc_commit_get(commit);
2516 complete_all(&commit->hw_done);
2527 * drm_atomic_helper_commit_cleanup_done - signal completion of commit
2541 struct drm_crtc_commit *commit;
2545 commit = old_crtc_state->commit;
2546 if (WARN_ON(!commit))
2549 complete_all(&commit->cleanup_done);
2550 WARN_ON(!try_wait_for_completion(&commit->hw_done));
2553 list_del(&commit->commit_entry);
2565 * drm_atomic_helper_prepare_planes - prepare plane resources before commit
2663 * when aborting an atomic commit. For cleaning up after a successful commit
2695 * drm_atomic_helper_commit_planes - commit plane state
2826 * a later commit might have already released the plane state.
2838 * drm_atomic_helper_commit_planes_on_crtc - commit plane state for a CRTC
2852 * resolve them through ordering of commit calls or through some other means.
2953 * drm_atomic_helper_cleanup_planes - cleanup plane resources after commit
3001 * 4. Actually commit the hardware state.
3027 struct drm_crtc_commit *commit;
3042 commit = old_crtc_state->commit;
3044 if (!commit)
3047 ret = wait_for_completion_interruptible(&commit->hw_done);
3053 commit = old_conn_state->commit;
3055 if (!commit)
3058 ret = wait_for_completion_interruptible(&commit->hw_done);
3064 commit = old_plane_state->commit;
3066 if (!commit)
3069 ret = wait_for_completion_interruptible(&commit->hw_done);
3094 if (new_crtc_state->commit) {
3096 list_add(&new_crtc_state->commit->commit_entry,
3100 new_crtc_state->commit->event = NULL;
3543 * drm_atomic_helper_commit_duplicated_state - commit duplicated state
3544 * @state: duplicated atomic state to commit
3545 * @ctx: pointer to acquire_ctx to use for commit.
3549 * be fixed up before commit.