Lines Matching full:crtc

54  * top of the CRTC modeset helper callbacks and the plane helper callbacks. It
85 if (old_plane_state->crtc) { in drm_atomic_helper_plane_changed()
87 old_plane_state->crtc); in drm_atomic_helper_plane_changed()
95 if (plane_state->crtc) { in drm_atomic_helper_plane_changed()
96 crtc_state = drm_atomic_get_new_crtc_state(state, plane_state->crtc); in drm_atomic_helper_plane_changed()
124 if (!new_conn_state->crtc) in handle_conflicting_encoders()
159 * If the flag is set conflicting connectors are removed from the CRTC in handle_conflicting_encoders()
160 * and the CRTC is disabled if no encoder is left. This preserves in handle_conflicting_encoders()
176 "[ENCODER:%d:%s] in use on [CRTC:%d:%s] by [CONNECTOR:%d:%s]\n", in handle_conflicting_encoders()
178 connector->state->crtc->base.id, in handle_conflicting_encoders()
179 connector->state->crtc->name, in handle_conflicting_encoders()
192 "[ENCODER:%d:%s] in use on [CRTC:%d:%s], disabling [CONNECTOR:%d:%s]\n", in handle_conflicting_encoders()
194 new_conn_state->crtc->base.id, new_conn_state->crtc->name, in handle_conflicting_encoders()
197 crtc_state = drm_atomic_get_new_crtc_state(state, new_conn_state->crtc); in handle_conflicting_encoders()
224 struct drm_crtc *crtc; in set_best_encoder() local
227 /* Unset the encoder_mask in the old crtc state. */ in set_best_encoder()
228 crtc = conn_state->connector->state->crtc; in set_best_encoder()
230 /* A NULL crtc is an error here because we should have in set_best_encoder()
231 * duplicated a NULL best_encoder when crtc was NULL. in set_best_encoder()
236 WARN_ON(!crtc && encoder != conn_state->best_encoder); in set_best_encoder()
237 if (crtc) { in set_best_encoder()
238 crtc_state = drm_atomic_get_new_crtc_state(state, crtc); in set_best_encoder()
246 crtc = conn_state->crtc; in set_best_encoder()
247 WARN_ON(!crtc); in set_best_encoder()
248 if (crtc) { in set_best_encoder()
249 crtc_state = drm_atomic_get_new_crtc_state(state, crtc); in set_best_encoder()
274 encoder_crtc = old_connector_state->crtc; in steal_encoder()
277 "[ENCODER:%d:%s] in use on [CRTC:%d:%s], stealing it\n", in steal_encoder()
304 if (old_connector_state->crtc != new_connector_state->crtc) { in update_connector_routing()
305 if (old_connector_state->crtc) { in update_connector_routing()
306 crtc_state = drm_atomic_get_new_crtc_state(state, old_connector_state->crtc); in update_connector_routing()
310 if (new_connector_state->crtc) { in update_connector_routing()
311 crtc_state = drm_atomic_get_new_crtc_state(state, new_connector_state->crtc); in update_connector_routing()
316 if (!new_connector_state->crtc) { in update_connector_routing()
326 new_connector_state->crtc); in update_connector_routing()
373 if (!drm_encoder_crtc_ok(new_encoder, new_connector_state->crtc)) { in update_connector_routing()
375 "[ENCODER:%d:%s] incompatible with [CRTC:%d:%s]\n", in update_connector_routing()
378 new_connector_state->crtc->base.id, in update_connector_routing()
379 new_connector_state->crtc->name); in update_connector_routing()
387 "[CONNECTOR:%d:%s] keeps [ENCODER:%d:%s], now on [CRTC:%d:%s]\n", in update_connector_routing()
392 new_connector_state->crtc->base.id, in update_connector_routing()
393 new_connector_state->crtc->name); in update_connector_routing()
405 "[CONNECTOR:%d:%s] using [ENCODER:%d:%s] on [CRTC:%d:%s]\n", in update_connector_routing()
410 new_connector_state->crtc->base.id, in update_connector_routing()
411 new_connector_state->crtc->name); in update_connector_routing()
419 struct drm_crtc *crtc; in mode_fixup() local
426 for_each_new_crtc_in_state(state, crtc, new_crtc_state, i) { in mode_fixup()
439 WARN_ON(!!new_conn_state->best_encoder != !!new_conn_state->crtc); in mode_fixup()
441 if (!new_conn_state->crtc || !new_conn_state->best_encoder) in mode_fixup()
445 drm_atomic_get_new_crtc_state(state, new_conn_state->crtc); in mode_fixup()
484 for_each_new_crtc_in_state(state, crtc, new_crtc_state, i) { in mode_fixup()
494 funcs = crtc->helper_private; in mode_fixup()
498 ret = funcs->mode_fixup(crtc, &new_crtc_state->mode, in mode_fixup()
501 drm_dbg_atomic(crtc->dev, "[CRTC:%d:%s] fixup failed\n", in mode_fixup()
502 crtc->base.id, crtc->name); in mode_fixup()
512 struct drm_crtc *crtc, in mode_valid_path() argument
534 ret = drm_crtc_mode_valid(crtc, mode); in mode_valid_path()
536 drm_dbg_atomic(encoder->dev, "[CRTC:%d:%s] mode_valid() failed\n", in mode_valid_path()
537 crtc->base.id, crtc->name); in mode_valid_path()
553 struct drm_crtc *crtc = conn_state->crtc; in mode_valid() local
558 if (!crtc || !encoder) in mode_valid()
561 crtc_state = drm_atomic_get_new_crtc_state(state, crtc); in mode_valid()
569 mode_status = mode_valid_path(connector, encoder, crtc, mode); in mode_valid()
583 * This does all the CRTC and connector related computations for an atomic
590 * CRTC are added and &drm_connector_helper_funcs.atomic_check is run on them.
595 * This function is only called when the encoder will be part of a configured CRTC,
599 * 7. &drm_crtc_helper_funcs.mode_fixup is called last, to fix up the mode with CRTC constraints.
603 * removed from the CRTC. &drm_crtc_state.active_changed is set when
624 struct drm_crtc *crtc; in drm_atomic_helper_check_modeset() local
634 for_each_oldnew_crtc_in_state(state, crtc, old_crtc_state, new_crtc_state, i) { in drm_atomic_helper_check_modeset()
638 WARN_ON(!drm_modeset_is_locked(&crtc->mutex)); in drm_atomic_helper_check_modeset()
641 drm_dbg_atomic(dev, "[CRTC:%d:%s] mode changed\n", in drm_atomic_helper_check_modeset()
642 crtc->base.id, crtc->name); in drm_atomic_helper_check_modeset()
647 drm_dbg_atomic(dev, "[CRTC:%d:%s] enable changed\n", in drm_atomic_helper_check_modeset()
648 crtc->base.id, crtc->name); in drm_atomic_helper_check_modeset()
663 drm_dbg_atomic(dev, "[CRTC:%d:%s] active changed\n", in drm_atomic_helper_check_modeset()
664 crtc->base.id, crtc->name); in drm_atomic_helper_check_modeset()
669 drm_dbg_atomic(dev, "[CRTC:%d:%s] enabled/connectors mismatch\n", in drm_atomic_helper_check_modeset()
670 crtc->base.id, crtc->name); in drm_atomic_helper_check_modeset()
691 * This only sets crtc->connectors_changed for routing changes, in drm_atomic_helper_check_modeset()
692 * drivers must set crtc->connectors_changed themselves when in drm_atomic_helper_check_modeset()
701 if (old_connector_state->crtc) { in drm_atomic_helper_check_modeset()
703 old_connector_state->crtc); in drm_atomic_helper_check_modeset()
727 * connector which is itself unchanged, but whose CRTC changes its in drm_atomic_helper_check_modeset()
729 * crtc only changed its mode but has the same set of connectors. in drm_atomic_helper_check_modeset()
731 for_each_oldnew_crtc_in_state(state, crtc, old_crtc_state, new_crtc_state, i) { in drm_atomic_helper_check_modeset()
736 "[CRTC:%d:%s] needs all connectors, enable: %c, active: %c\n", in drm_atomic_helper_check_modeset()
737 crtc->base.id, crtc->name, in drm_atomic_helper_check_modeset()
741 ret = drm_atomic_add_affected_connectors(state, crtc); in drm_atomic_helper_check_modeset()
745 ret = drm_atomic_add_affected_planes(state, crtc); in drm_atomic_helper_check_modeset()
842 * @crtc_state: CRTC state to check
846 * doesn't cover the entire CRTC? This will generally
848 * @can_update_disabled: can the plane be updated while the CRTC
874 WARN_ON(plane_state->crtc && plane_state->crtc != crtc_state->crtc); in drm_atomic_helper_check_plane_state()
884 /* crtc should only be NULL when disabling (i.e., !fb) */ in drm_atomic_helper_check_plane_state()
885 if (WARN_ON(!plane_state->crtc)) { in drm_atomic_helper_check_plane_state()
892 "Cannot update plane of a disabled CRTC.\n"); in drm_atomic_helper_check_plane_state()
928 "Plane must cover entire CRTC\n"); in drm_atomic_helper_check_plane_state()
939 * drm_atomic_helper_check_crtc_primary_plane() - Check CRTC state for primary plane
940 * @crtc_state: CRTC state to check
942 * Checks that a CRTC has at least one primary plane attached to it, which is
943 * a requirement on some hardware. Note that this only involves the CRTC side
945 * without the CRTC being enabled, use drm_atomic_helper_check_plane_state() in
949 * 0 if a primary plane is attached to the CRTC, or an error code otherwise
953 struct drm_crtc *crtc = crtc_state->crtc; in drm_atomic_helper_check_crtc_primary_plane() local
954 struct drm_device *dev = crtc->dev; in drm_atomic_helper_check_crtc_primary_plane()
963 drm_dbg_atomic(dev, "[CRTC:%d:%s] primary plane missing\n", crtc->base.id, crtc->name); in drm_atomic_helper_check_crtc_primary_plane()
979 * It also sets &drm_crtc_state.planes_changed to indicate that a CRTC has
989 struct drm_crtc *crtc; in drm_atomic_helper_check_planes() local
1018 for_each_new_crtc_in_state(state, crtc, new_crtc_state, i) { in drm_atomic_helper_check_planes()
1021 funcs = crtc->helper_private; in drm_atomic_helper_check_planes()
1026 ret = funcs->atomic_check(crtc, state); in drm_atomic_helper_check_planes()
1028 drm_dbg_atomic(crtc->dev, in drm_atomic_helper_check_planes()
1029 "[CRTC:%d:%s] atomic driver check failed\n", in drm_atomic_helper_check_planes()
1030 crtc->base.id, crtc->name); in drm_atomic_helper_check_planes()
1098 * No new_state means the CRTC is off, so the only criteria is whether in crtc_needs_disable()
1105 * We need to disable bridge(s) and CRTC if we're transitioning out of in crtc_needs_disable()
1107 * bridge tracks self-refresh status via CRTC state. in crtc_needs_disable()
1110 old_state->crtc != new_state->crtc) in crtc_needs_disable()
1115 * the CRTC is currently on, if it's transitioning to self refresh in crtc_needs_disable()
1129 struct drm_crtc *crtc; in disable_outputs() local
1142 if (!old_conn_state->crtc) in disable_outputs()
1145 old_crtc_state = drm_atomic_get_old_crtc_state(old_state, old_conn_state->crtc); in disable_outputs()
1147 if (new_conn_state->crtc) in disable_outputs()
1150 new_conn_state->crtc); in disable_outputs()
1155 !drm_atomic_crtc_needs_modeset(old_conn_state->crtc->state)) in disable_outputs()
1182 else if (new_conn_state->crtc && funcs->prepare) in disable_outputs()
1193 for_each_oldnew_crtc_in_state(old_state, crtc, old_crtc_state, new_crtc_state, i) { in disable_outputs()
1204 funcs = crtc->helper_private; in disable_outputs()
1206 drm_dbg_atomic(dev, "disabling [CRTC:%d:%s]\n", in disable_outputs()
1207 crtc->base.id, crtc->name); in disable_outputs()
1212 funcs->prepare(crtc); in disable_outputs()
1214 funcs->atomic_disable(crtc, old_state); in disable_outputs()
1216 funcs->disable(crtc); in disable_outputs()
1218 funcs->dpms(crtc, DRM_MODE_DPMS_OFF); in disable_outputs()
1223 ret = drm_crtc_vblank_get(crtc); in disable_outputs()
1235 drm_crtc_vblank_put(crtc); in disable_outputs()
1262 struct drm_crtc *crtc; in drm_atomic_helper_update_legacy_modeset_state() local
1269 WARN_ON(!connector->encoder->crtc); in drm_atomic_helper_update_legacy_modeset_state()
1271 connector->encoder->crtc = NULL; in drm_atomic_helper_update_legacy_modeset_state()
1275 crtc = new_conn_state->crtc; in drm_atomic_helper_update_legacy_modeset_state()
1276 if ((!crtc && old_conn_state->crtc) || in drm_atomic_helper_update_legacy_modeset_state()
1277 (crtc && drm_atomic_crtc_needs_modeset(crtc->state))) { in drm_atomic_helper_update_legacy_modeset_state()
1280 if (crtc && crtc->state->active) in drm_atomic_helper_update_legacy_modeset_state()
1289 if (!new_conn_state->crtc) in drm_atomic_helper_update_legacy_modeset_state()
1296 connector->encoder->crtc = new_conn_state->crtc; in drm_atomic_helper_update_legacy_modeset_state()
1299 /* set legacy state in the crtc structure */ in drm_atomic_helper_update_legacy_modeset_state()
1300 for_each_new_crtc_in_state(old_state, crtc, new_crtc_state, i) { in drm_atomic_helper_update_legacy_modeset_state()
1301 struct drm_plane *primary = crtc->primary; in drm_atomic_helper_update_legacy_modeset_state()
1304 crtc->mode = new_crtc_state->mode; in drm_atomic_helper_update_legacy_modeset_state()
1305 crtc->enabled = new_crtc_state->enable; in drm_atomic_helper_update_legacy_modeset_state()
1310 if (new_plane_state && new_plane_state->crtc == crtc) { in drm_atomic_helper_update_legacy_modeset_state()
1311 crtc->x = new_plane_state->src_x >> 16; in drm_atomic_helper_update_legacy_modeset_state()
1312 crtc->y = new_plane_state->src_y >> 16; in drm_atomic_helper_update_legacy_modeset_state()
1328 struct drm_crtc *crtc; in drm_atomic_helper_calc_timestamping_constants() local
1331 for_each_new_crtc_in_state(state, crtc, new_crtc_state, i) { in drm_atomic_helper_calc_timestamping_constants()
1333 drm_calc_timestamping_constants(crtc, in drm_atomic_helper_calc_timestamping_constants()
1342 struct drm_crtc *crtc; in crtc_set_mode() local
1348 for_each_new_crtc_in_state(old_state, crtc, new_crtc_state, i) { in crtc_set_mode()
1354 funcs = crtc->helper_private; in crtc_set_mode()
1357 drm_dbg_atomic(dev, "modeset on [CRTC:%d:%s]\n", in crtc_set_mode()
1358 crtc->base.id, crtc->name); in crtc_set_mode()
1360 funcs->mode_set_nofb(crtc); in crtc_set_mode()
1375 new_crtc_state = new_conn_state->crtc->state; in crtc_set_mode()
1409 * For compatibility with legacy CRTC helpers this should be called before
1413 * PM since planes updates then only happen when the CRTC is actually enabled.
1456 * For compatibility with legacy CRTC helpers this should be called after
1460 * PM since planes updates then only happen when the CRTC is actually enabled.
1465 struct drm_crtc *crtc; in drm_atomic_helper_commit_modeset_enables() local
1472 for_each_oldnew_crtc_in_state(old_state, crtc, old_crtc_state, new_crtc_state, i) { in drm_atomic_helper_commit_modeset_enables()
1482 funcs = crtc->helper_private; in drm_atomic_helper_commit_modeset_enables()
1485 drm_dbg_atomic(dev, "enabling [CRTC:%d:%s]\n", in drm_atomic_helper_commit_modeset_enables()
1486 crtc->base.id, crtc->name); in drm_atomic_helper_commit_modeset_enables()
1488 funcs->atomic_enable(crtc, old_state); in drm_atomic_helper_commit_modeset_enables()
1490 funcs->commit(crtc); in drm_atomic_helper_commit_modeset_enables()
1502 if (!new_conn_state->crtc->state->active || in drm_atomic_helper_commit_modeset_enables()
1503 !drm_atomic_crtc_needs_modeset(new_conn_state->crtc->state)) in drm_atomic_helper_commit_modeset_enables()
1536 * For atomic updates which touch just a single CRTC, calculate the time of the
1542 struct drm_crtc *crtc; in set_fence_deadline() local
1549 for_each_new_crtc_in_state (state, crtc, new_crtc_state, i) { in set_fence_deadline()
1558 if (drm_crtc_next_vblank_start(crtc, &v)) in set_fence_deadline()
1649 struct drm_crtc *crtc; in drm_atomic_helper_wait_for_vblanks() local
1661 for_each_oldnew_crtc_in_state(old_state, crtc, old_crtc_state, new_crtc_state, i) { in drm_atomic_helper_wait_for_vblanks()
1665 ret = drm_crtc_vblank_get(crtc); in drm_atomic_helper_wait_for_vblanks()
1669 crtc_mask |= drm_crtc_mask(crtc); in drm_atomic_helper_wait_for_vblanks()
1670 old_state->crtcs[i].last_vblank_count = drm_crtc_vblank_count(crtc); in drm_atomic_helper_wait_for_vblanks()
1673 for_each_old_crtc_in_state(old_state, crtc, old_crtc_state, i) { in drm_atomic_helper_wait_for_vblanks()
1674 if (!(crtc_mask & drm_crtc_mask(crtc))) in drm_atomic_helper_wait_for_vblanks()
1679 drm_crtc_vblank_count(crtc), in drm_atomic_helper_wait_for_vblanks()
1682 WARN(!ret, "[CRTC:%d:%s] vblank wait timed out\n", in drm_atomic_helper_wait_for_vblanks()
1683 crtc->base.id, crtc->name); in drm_atomic_helper_wait_for_vblanks()
1685 drm_crtc_vblank_put(crtc); in drm_atomic_helper_wait_for_vblanks()
1708 struct drm_crtc *crtc; in drm_atomic_helper_wait_for_flip_done() local
1715 crtc = old_state->crtcs[i].ptr; in drm_atomic_helper_wait_for_flip_done()
1717 if (!crtc || !commit) in drm_atomic_helper_wait_for_flip_done()
1722 drm_err(dev, "[CRTC:%d:%s] flip_done timed out\n", in drm_atomic_helper_wait_for_flip_done()
1723 crtc->base.id, crtc->name); in drm_atomic_helper_wait_for_flip_done()
1737 * that do not support runtime_pm or do not need the CRTC to be
1770 * that support runtime_pm or need the CRTC to be enabled to perform a
1800 struct drm_crtc *crtc; in commit_tail() local
1825 * drm_atomic_helper_commit_hw_done() so figure out which crtc's have in commit_tail()
1828 for_each_new_crtc_in_state(old_state, crtc, new_crtc_state, i) in commit_tail()
1872 struct drm_crtc *crtc; in drm_atomic_helper_async_check() local
1880 for_each_new_crtc_in_state(state, crtc, crtc_state, i) { in drm_atomic_helper_async_check()
1895 if (!new_plane_state->crtc || in drm_atomic_helper_async_check()
1896 old_plane_state->crtc != new_plane_state->crtc) { in drm_atomic_helper_async_check()
1898 "[PLANE:%d:%s] async update cannot change CRTC\n", in drm_atomic_helper_async_check()
2108 * must be done as one global operation, and enabling or disabling a CRTC can
2136 static int stall_checks(struct drm_crtc *crtc, bool nonblock) in stall_checks() argument
2143 spin_lock(&crtc->commit_lock); in stall_checks()
2145 list_for_each_entry(commit, &crtc->commit_list, commit_entry) { in stall_checks()
2153 spin_unlock(&crtc->commit_lock); in stall_checks()
2154 drm_dbg_atomic(crtc->dev, in stall_checks()
2155 "[CRTC:%d:%s] busy with a previous commit\n", in stall_checks()
2156 crtc->base.id, crtc->name); in stall_checks()
2167 spin_unlock(&crtc->commit_lock); in stall_checks()
2178 drm_err(crtc->dev, "[CRTC:%d:%s] cleanup_done timed out\n", in stall_checks()
2179 crtc->base.id, crtc->name); in stall_checks()
2195 static void init_commit(struct drm_crtc_commit *commit, struct drm_crtc *crtc) in init_commit() argument
2202 commit->crtc = crtc; in init_commit()
2206 crtc_or_fake_commit(struct drm_atomic_state *state, struct drm_crtc *crtc) in crtc_or_fake_commit() argument
2208 if (crtc) { in crtc_or_fake_commit()
2211 new_crtc_state = drm_atomic_get_new_crtc_state(state, crtc); in crtc_or_fake_commit()
2275 struct drm_crtc *crtc; in drm_atomic_helper_setup_commit() local
2287 for_each_oldnew_crtc_in_state(state, crtc, old_crtc_state, new_crtc_state, i) { in drm_atomic_helper_setup_commit()
2292 init_commit(commit, crtc); in drm_atomic_helper_setup_commit()
2296 ret = stall_checks(crtc, nonblock); in drm_atomic_helper_setup_commit()
2302 * new CRTC state is active. Complete right away if everything 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()
2372 commit = crtc_or_fake_commit(state, new_plane_state->crtc ?: old_plane_state->crtc); in drm_atomic_helper_setup_commit()
2390 * This function waits for all preceding commits that touch the same CRTC as
2400 struct drm_crtc *crtc; in drm_atomic_helper_wait_for_dependencies() local
2409 for_each_old_crtc_in_state(old_state, crtc, old_crtc_state, i) { in drm_atomic_helper_wait_for_dependencies()
2412 drm_err(crtc->dev, in drm_atomic_helper_wait_for_dependencies()
2413 "[CRTC:%d:%s] commit wait timed out\n", in drm_atomic_helper_wait_for_dependencies()
2414 crtc->base.id, crtc->name); in drm_atomic_helper_wait_for_dependencies()
2456 struct drm_crtc *crtc; in drm_atomic_helper_fake_vblank() local
2459 for_each_new_crtc_in_state(old_state, crtc, new_crtc_state, i) { in drm_atomic_helper_fake_vblank()
2467 drm_crtc_send_vblank_event(crtc, in drm_atomic_helper_fake_vblank()
2493 struct drm_crtc *crtc; in drm_atomic_helper_commit_hw_done() local
2498 for_each_oldnew_crtc_in_state(old_state, crtc, old_crtc_state, new_crtc_state, i) { in drm_atomic_helper_commit_hw_done()
2538 struct drm_crtc *crtc; in drm_atomic_helper_commit_cleanup_done() local
2543 for_each_old_crtc_in_state(old_state, crtc, old_crtc_state, i) { in drm_atomic_helper_commit_cleanup_done()
2551 spin_lock(&crtc->commit_lock); in drm_atomic_helper_commit_cleanup_done()
2553 spin_unlock(&crtc->commit_lock); in drm_atomic_helper_commit_cleanup_done()
2690 return state->crtc && state->crtc->state->active; in plane_crtc_active()
2711 * Plane parameters can be updated by applications while the associated CRTC is
2713 * which will be available to the driver when the CRTC is turned on. As a result
2715 * disabled CRTC.
2719 * disabled CRTC. This avoids the need to manually ignore plane updates in
2724 * display controllers require to disable a CRTC's planes when the CRTC is
2726 * call for a plane if the CRTC of the old plane state needs a modesetting
2727 * operation. Of course, the drivers need to disable the planes in their CRTC
2738 struct drm_crtc *crtc; in drm_atomic_helper_commit_planes() local
2746 for_each_oldnew_crtc_in_state(old_state, crtc, old_crtc_state, new_crtc_state, i) { in drm_atomic_helper_commit_planes()
2749 funcs = crtc->helper_private; in drm_atomic_helper_commit_planes()
2757 funcs->atomic_begin(crtc, old_state); in drm_atomic_helper_commit_planes()
2775 * is enabled use the state of the current CRTC. If the in drm_atomic_helper_commit_planes()
2777 * CRTC to avoid skipping planes being disabled on an in drm_atomic_helper_commit_planes()
2778 * active CRTC. in drm_atomic_helper_commit_planes()
2792 crtc_state = old_plane_state->crtc->state; in drm_atomic_helper_commit_planes()
2799 } else if (new_plane_state->crtc || disabling) { in drm_atomic_helper_commit_planes()
2809 for_each_oldnew_crtc_in_state(old_state, crtc, old_crtc_state, new_crtc_state, i) { in drm_atomic_helper_commit_planes()
2812 funcs = crtc->helper_private; in drm_atomic_helper_commit_planes()
2820 funcs->atomic_flush(crtc, old_state); in drm_atomic_helper_commit_planes()
2837 * drm_atomic_helper_commit_planes_on_crtc - commit plane state for a CRTC
2838 * @old_crtc_state: atomic state object with the old CRTC state
2841 * functions for planes on the specific CRTC. It assumes that the atomic state
2845 * This function is useful when plane updates should be done CRTC-by-CRTC
2849 * between different CRTCs because this function doesn't handle inter-CRTC
2857 struct drm_crtc *crtc = old_crtc_state->crtc; in drm_atomic_helper_commit_planes_on_crtc() local
2860 drm_atomic_get_new_crtc_state(old_state, crtc); in drm_atomic_helper_commit_planes_on_crtc()
2867 crtc_funcs = crtc->helper_private; in drm_atomic_helper_commit_planes_on_crtc()
2869 crtc_funcs->atomic_begin(crtc, old_state); in drm_atomic_helper_commit_planes_on_crtc()
2871 drm_for_each_plane_mask(plane, crtc->dev, plane_mask) { in drm_atomic_helper_commit_planes_on_crtc()
2884 WARN_ON(new_plane_state->crtc && in drm_atomic_helper_commit_planes_on_crtc()
2885 new_plane_state->crtc != crtc); in drm_atomic_helper_commit_planes_on_crtc()
2891 } else if (new_plane_state->crtc || disabling) { in drm_atomic_helper_commit_planes_on_crtc()
2902 crtc_funcs->atomic_flush(crtc, old_state); in drm_atomic_helper_commit_planes_on_crtc()
2907 * drm_atomic_helper_disable_planes_on_crtc - helper to disable CRTC's planes
2908 * @old_crtc_state: atomic state object with the old CRTC state
2909 * @atomic: if set, synchronize with CRTC's atomic_begin/flush hooks
2911 * Disables all planes associated with the given CRTC. This can be
2912 * used for instance in the CRTC helper atomic_disable callback to disable
2915 * If the atomic-parameter is set the function calls the CRTC's
2926 struct drm_crtc *crtc = old_crtc_state->crtc; in drm_atomic_helper_disable_planes_on_crtc() local
2928 crtc->helper_private; in drm_atomic_helper_disable_planes_on_crtc()
2932 crtc_funcs->atomic_begin(crtc, NULL); in drm_atomic_helper_disable_planes_on_crtc()
2947 crtc_funcs->atomic_flush(crtc, NULL); in drm_atomic_helper_disable_planes_on_crtc()
3021 struct drm_crtc *crtc; in drm_atomic_helper_swap_state() local
3039 for_each_old_crtc_in_state(state, crtc, old_crtc_state, i) { in drm_atomic_helper_swap_state()
3083 for_each_oldnew_crtc_in_state(state, crtc, old_crtc_state, new_crtc_state, i) { in drm_atomic_helper_swap_state()
3084 WARN_ON(crtc->state != old_crtc_state); in drm_atomic_helper_swap_state()
3090 crtc->state = new_crtc_state; in drm_atomic_helper_swap_state()
3093 spin_lock(&crtc->commit_lock); in drm_atomic_helper_swap_state()
3095 &crtc->commit_list); in drm_atomic_helper_swap_state()
3096 spin_unlock(&crtc->commit_lock); in drm_atomic_helper_swap_state()
3131 * @crtc: owning CRTC of owning plane
3133 * @crtc_x: x offset of primary plane on @crtc
3134 * @crtc_y: y offset of primary plane on @crtc
3135 * @crtc_w: width of primary plane rectangle on @crtc
3136 * @crtc_h: height of primary plane rectangle on @crtc
3149 struct drm_crtc *crtc, in drm_atomic_helper_update_plane() argument
3172 ret = drm_atomic_set_crtc_for_plane(plane_state, crtc); in drm_atomic_helper_update_plane()
3185 if (plane == crtc->cursor) in drm_atomic_helper_update_plane()
3223 if (plane_state->crtc && plane_state->crtc->cursor == plane) in drm_atomic_helper_disable_plane()
3242 * Provides a default CRTC set_config handler using the atomic driver interface.
3257 struct drm_crtc *crtc = set->crtc; in drm_atomic_helper_set_config() local
3260 state = drm_atomic_state_alloc(crtc->dev); in drm_atomic_helper_set_config()
3287 * turns them off by setting their DPMS mode to OFF and deactivating the CRTC
3313 struct drm_crtc *crtc; in drm_atomic_helper_disable_all() local
3322 drm_for_each_crtc(crtc, dev) { in drm_atomic_helper_disable_all()
3323 crtc_state = drm_atomic_get_crtc_state(state, crtc); in drm_atomic_helper_disable_all()
3335 ret = drm_atomic_add_affected_planes(state, crtc); in drm_atomic_helper_disable_all()
3339 ret = drm_atomic_add_affected_connectors(state, crtc); in drm_atomic_helper_disable_all()
3366 * drm_atomic_helper_shutdown - shutdown all CRTC
3369 * This shuts down all CRTC, which is useful for driver unloading. Shutdown on
3389 "Disabling all crtc's during unload failed with %i\n", in drm_atomic_helper_shutdown()
3428 struct drm_crtc *crtc; in drm_atomic_helper_duplicate_state() local
3438 drm_for_each_crtc(crtc, dev) { in drm_atomic_helper_duplicate_state()
3441 crtc_state = drm_atomic_get_crtc_state(state, crtc); in drm_atomic_helper_duplicate_state()
3563 struct drm_crtc *crtc; in drm_atomic_helper_commit_duplicated_state() local
3571 for_each_new_crtc_in_state(state, crtc, new_crtc_state, i) in drm_atomic_helper_commit_duplicated_state()
3572 state->crtcs[i].old_state = crtc->state; in drm_atomic_helper_commit_duplicated_state()
3621 struct drm_crtc *crtc, in page_flip_common() argument
3626 struct drm_plane *plane = crtc->primary; in page_flip_common()
3631 crtc_state = drm_atomic_get_crtc_state(state, crtc); in page_flip_common()
3642 ret = drm_atomic_set_crtc_for_plane(plane_state, crtc); in page_flip_common()
3650 drm_dbg_atomic(crtc->dev, in page_flip_common()
3651 "[CRTC:%d:%s] disabled, rejecting legacy flip\n", in page_flip_common()
3652 crtc->base.id, crtc->name); in page_flip_common()
3661 * @crtc: DRM CRTC
3676 int drm_atomic_helper_page_flip(struct drm_crtc *crtc, in drm_atomic_helper_page_flip() argument
3682 struct drm_plane *plane = crtc->primary; in drm_atomic_helper_page_flip()
3692 ret = page_flip_common(state, crtc, fb, event, flags); in drm_atomic_helper_page_flip()
3705 * @crtc: DRM CRTC
3719 int drm_atomic_helper_page_flip_target(struct drm_crtc *crtc, in drm_atomic_helper_page_flip_target() argument
3726 struct drm_plane *plane = crtc->primary; in drm_atomic_helper_page_flip_target()
3737 ret = page_flip_common(state, crtc, fb, event, flags); in drm_atomic_helper_page_flip_target()
3741 crtc_state = drm_atomic_get_new_crtc_state(state, crtc); in drm_atomic_helper_page_flip_target()
3760 * @crtc_state: new CRTC state