Lines Matching defs:commit
54 * This helper library provides implementations of check and commit functions on
61 * drm_atomic_helper_check() and for the commit callback with
331 * atomic check or commit, this is racy. But that's OK: all we care
1099 * Drivers can use this for building their own atomic commit if they don't have
1237 * drm_atomic_helper_commit_modeset_disables - modeset commit to disable outputs
1245 * drm_atomic_helper_commit_planes(), which is what the default commit function
1283 * drm_atomic_helper_commit_modeset_enables - modeset commit to enable outputs
1291 * drm_atomic_helper_commit_planes(), which is what the default commit function
1323 else if (funcs->commit)
1324 funcs->commit(crtc);
1358 else if (funcs->commit)
1359 funcs->commit(encoder);
1382 * around depending upon whether an atomic commit is blocking or
1383 * non-blocking. For non-blocking commit all waiting needs to happen after
1426 * Helper to, after atomic commit, wait for vblanks on all affected
1432 * Drivers using the nonblocking commit tracking support initialized by calling
1510 * Helper to, after atomic commit, wait for page flips on all affected
1517 * This requires that drivers use the nonblocking commit tracking support
1527 struct drm_crtc_commit *commit = old_state->crtcs[i].commit;
1532 if (!crtc || !commit)
1535 ret = wait_for_completion_timeout(&commit->flip_done, 10 * HZ);
1547 * drm_atomic_helper_commit_tail - commit atomic update to hardware
1553 * enabled to perform a commit. Otherwise, see
1580 * drm_atomic_helper_commit_tail_rpm - commit atomic update to hardware
1586 * commit. Otherwise, one should use the default implementation
1623 * We're measuring the _entire_ commit, so the time will vary depending
1676 * This helper will check if it is possible to commit the state asynchronously.
1680 * It will return 0 if the commit can happen in an asynchronous fashion or error
1682 * fails the commit should be treated like a normal synchronous commit.
1719 * Don't do an async update if there is an outstanding commit modifying
1723 if (old_plane_state->commit &&
1724 !try_wait_for_completion(&old_plane_state->commit->hw_done))
1732 * drm_atomic_helper_async_commit - commit state asynchronously
1780 * drm_atomic_helper_commit - commit validated state object
1832 * when the hw goes bonghits. Which means we can commit the new state on
1855 * NOTE: Commit work has multiple phases, first hardware commit, then
1875 * DOC: implementing nonblocking commit
1880 * asynchronous context used to commit the hardware state.
1889 * 2. Synchronize with any outstanding nonblocking commit worker threads which
1897 * individual commit in parallel - userspace is supposed to do that if it cares.
1908 * (nonblocking) commits, both due to locking and due to commit sequencing
1913 * locks means concurrent callers never see inconsistent state. Note that commit
1920 * commit helpers: a) pre-plane commit b) plane commit c) post-plane commit and
1929 struct drm_crtc_commit *commit, *stall_commit = NULL;
1936 list_for_each_entry(commit, &crtc->commit_list, commit_entry) {
1938 completed = try_wait_for_completion(&commit->flip_done);
1940 * commit with nonblocking ones. */
1946 stall_commit = drm_crtc_commit_get(commit);
1958 * stalling on 2nd previous commit means triple-buffer won't ever stall.
1973 struct drm_crtc_commit *commit = container_of(completion,
1974 typeof(*commit),
1977 drm_crtc_commit_put(commit);
1980 static void init_commit(struct drm_crtc_commit *commit, struct drm_crtc *crtc)
1982 init_completion(&commit->flip_done);
1983 init_completion(&commit->hw_done);
1984 init_completion(&commit->cleanup_done);
1985 INIT_LIST_HEAD(&commit->commit_entry);
1986 kref_init(&commit->ref);
1987 commit->crtc = crtc;
1998 return new_crtc_state->commit;
2013 * drm_atomic_helper_setup_commit - setup possibly nonblocking commit
2018 * nonblocking commits. Drivers using the nonblocking commit infrastructure
2026 * and its stall parameter, for when a driver's commit hooks look at the
2029 * Completion of the hardware commit step must be signalled using
2064 struct drm_crtc_commit *commit;
2068 commit = kzalloc(sizeof(*commit), GFP_KERNEL);
2069 if (!commit)
2072 init_commit(commit, crtc);
2074 new_crtc_state->commit = commit;
2084 complete_all(&commit->flip_done);
2090 complete_all(&commit->flip_done);
2095 commit->event = kzalloc(sizeof(*commit->event),
2097 if (!commit->event)
2100 new_crtc_state->event = commit->event;
2103 new_crtc_state->event->base.completion = &commit->flip_done;
2105 drm_crtc_commit_get(commit);
2107 commit->abort_completion = true;
2109 state->crtcs[i].commit = commit;
2110 drm_crtc_commit_get(commit);
2115 * commit with nonblocking ones. */
2116 if (nonblock && old_conn_state->commit &&
2117 !try_wait_for_completion(&old_conn_state->commit->flip_done))
2121 commit = crtc_or_fake_commit(state, new_conn_state->crtc ?: old_conn_state->crtc);
2122 if (!commit)
2125 new_conn_state->commit = drm_crtc_commit_get(commit);
2130 * commit with nonblocking ones. */
2131 if (nonblock && old_plane_state->commit &&
2132 !try_wait_for_completion(&old_plane_state->commit->flip_done))
2136 commit = crtc_or_fake_commit(state, new_plane_state->crtc ?: old_plane_state->crtc);
2137 if (!commit)
2140 new_plane_state->commit = drm_crtc_commit_get(commit);
2167 struct drm_crtc_commit *commit;
2172 commit = old_crtc_state->commit;
2174 if (!commit)
2177 ret = wait_for_completion_timeout(&commit->hw_done,
2185 ret = wait_for_completion_timeout(&commit->flip_done,
2193 commit = old_conn_state->commit;
2195 if (!commit)
2198 ret = wait_for_completion_timeout(&commit->hw_done,
2206 ret = wait_for_completion_timeout(&commit->flip_done,
2214 commit = old_plane_state->commit;
2216 if (!commit)
2219 ret = wait_for_completion_timeout(&commit->hw_done,
2227 ret = wait_for_completion_timeout(&commit->flip_done,
2276 * drm_atomic_helper_commit_hw_done - setup possible nonblocking commit
2279 * This function is used to signal completion of the hardware commit step. After
2294 struct drm_crtc_commit *commit;
2298 commit = new_crtc_state->commit;
2299 if (!commit)
2303 * copy new_crtc_state->commit to old_crtc_state->commit,
2307 if (old_crtc_state->commit)
2308 drm_crtc_commit_put(old_crtc_state->commit);
2310 old_crtc_state->commit = drm_crtc_commit_get(commit);
2314 complete_all(&commit->hw_done);
2325 * drm_atomic_helper_commit_cleanup_done - signal completion of commit
2339 struct drm_crtc_commit *commit;
2343 commit = old_crtc_state->commit;
2344 if (WARN_ON(!commit))
2347 complete_all(&commit->cleanup_done);
2348 WARN_ON(!try_wait_for_completion(&commit->hw_done));
2351 list_del(&commit->commit_entry);
2363 * drm_atomic_helper_prepare_planes - prepare plane resources before commit
2430 * drm_atomic_helper_commit_planes - commit plane state
2557 commit plane state for a CRTC
2571 * resolve them through ordering of commit calls or through some other means.
2665 * drm_atomic_helper_cleanup_planes - cleanup plane resources after commit
2688 * This might be called before swapping when commit is aborted,
2724 * 4. Actually commit the hardware state.
2749 struct drm_crtc_commit *commit;
2764 commit = old_crtc_state->commit;
2766 if (!commit)
2769 ret = wait_for_completion_interruptible(&commit->hw_done);
2775 commit = old_conn_state->commit;
2777 if (!commit)
2780 ret = wait_for_completion_interruptible(&commit->hw_done);
2786 commit = old_plane_state->commit;
2788 if (!commit)
2791 ret = wait_for_completion_interruptible(&commit->hw_done);
2816 if (new_crtc_state->commit) {
2818 list_add(&new_crtc_state->commit->commit_entry,
2822 new_crtc_state->commit->event = NULL;
3258 * drm_atomic_helper_commit_duplicated_state - commit duplicated state
3259 * @state: duplicated atomic state to commit
3260 * @ctx: pointer to acquire_ctx to use for commit.
3264 * be fixed up before commit.