Lines Matching defs: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
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)
1487 funcs->commit(crtc);
1521 else if (funcs->commit)
1522 funcs->commit(encoder);
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;
1714 if (!crtc || !commit)
1717 ret = wait_for_completion_timeout(&commit->flip_done, 10 * HZ);
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
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
1920 if (old_plane_state->commit &&
1921 !try_wait_for_completion(&old_plane_state->commit->hw_done)) {
1923 "[PLANE:%d:%s] inflight previous commit preventing async commit\n",
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
2061 * NOTE: Commit work has multiple phases, first hardware commit, then
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;
2142 list_for_each_entry(commit, &crtc->commit_list, commit_entry) {
2144 completed = try_wait_for_completion(&commit->flip_done);
2147 * commit with nonblocking ones.
2152 "[CRTC:%d:%s] busy with a previous commit\n",
2158 stall_commit = drm_crtc_commit_get(commit);
2170 * stalling on 2nd previous commit means triple-buffer won't ever stall.
2185 struct drm_crtc_commit *commit = container_of(completion,
2186 typeof(*commit),
2189 drm_crtc_commit_put(commit);
2192 static void init_commit(struct drm_crtc_commit *commit, struct drm_crtc *crtc)
2194 init_completion(&commit->flip_done);
2195 init_completion(&commit->hw_done);
2196 init_completion(&commit->cleanup_done);
2197 INIT_LIST_HEAD(&commit->commit_entry);
2198 kref_init(&commit->ref);
2199 commit->crtc = crtc;
2210 return new_crtc_state->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;
2286 commit = kzalloc(sizeof(*commit), GFP_KERNEL);
2287 if (!commit)
2290 init_commit(commit, crtc);
2292 new_crtc_state->commit = commit;
2304 complete_all(&commit->flip_done);
2310 complete_all(&commit->flip_done);
2315 commit->event = kzalloc(sizeof(*commit->event),
2317 if (!commit->event)
2320 new_crtc_state->event = commit->event;
2323 new_crtc_state->event->base.completion = &commit->flip_done;
2325 drm_crtc_commit_get(commit);
2327 commit->abort_completion = true;
2329 state->crtcs[i].commit = commit;
2330 drm_crtc_commit_get(commit);
2336 * commit with nonblocking ones.
2338 if (nonblock && old_conn_state->commit &&
2339 !try_wait_for_completion(&old_conn_state->commit->flip_done)) {
2341 "[CONNECTOR:%d:%s] busy with a previous commit\n",
2348 commit = crtc_or_fake_commit(state, new_conn_state->crtc ?: old_conn_state->crtc);
2349 if (!commit)
2352 new_conn_state->commit = drm_crtc_commit_get(commit);
2358 * commit with nonblocking ones.
2360 if (nonblock && old_plane_state->commit &&
2361 !try_wait_for_completion(&old_plane_state->commit->flip_done)) {
2363 "[PLANE:%d:%s] busy with a previous commit\n",
2370 commit = crtc_or_fake_commit(state, new_plane_state->crtc ?: old_plane_state->crtc);
2371 if (!commit)
2374 new_plane_state->commit = drm_crtc_commit_get(commit);
2408 ret = drm_crtc_commit_wait(old_crtc_state->commit);
2411 "[CRTC:%d:%s] commit wait timed out\n",
2416 ret = drm_crtc_commit_wait(old_conn_state->commit);
2419 "[CONNECTOR:%d:%s] commit wait timed out\n",
2424 ret = drm_crtc_commit_wait(old_plane_state->commit);
2427 "[PLANE:%d:%s] commit wait timed out\n",
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;
2497 commit = new_crtc_state->commit;
2498 if (!commit)
2502 * copy new_crtc_state->commit to old_crtc_state->commit,
2506 if (old_crtc_state->commit)
2507 drm_crtc_commit_put(old_crtc_state->commit);
2509 old_crtc_state->commit = drm_crtc_commit_get(commit);
2513 complete_all(&commit->hw_done);
2524 * drm_atomic_helper_commit_cleanup_done - signal completion of commit
2538 struct drm_crtc_commit *commit;
2542 commit = old_crtc_state->commit;
2543 if (WARN_ON(!commit))
2546 complete_all(&commit->cleanup_done);
2547 WARN_ON(!try_wait_for_completion(&commit->hw_done));
2550 list_del(&commit->commit_entry);
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.
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;
3038 commit = old_crtc_state->commit;
3040 if (!commit)
3043 ret = wait_for_completion_interruptible(&commit->hw_done);
3049 commit = old_conn_state->commit;
3051 if (!commit)
3054 ret = wait_for_completion_interruptible(&commit->hw_done);
3060 commit = old_plane_state->commit;
3062 if (!commit)
3065 ret = wait_for_completion_interruptible(&commit->hw_done);
3090 if (new_crtc_state->commit) {
3092 list_add(&new_crtc_state->commit->commit_entry,
3096 new_crtc_state->commit->event = NULL;
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.