Lines Matching full:crtc

51  * top of the CRTC modeset helper callbacks and the plane helper callbacks. It
82 if (old_plane_state->crtc) { in drm_atomic_helper_plane_changed()
84 old_plane_state->crtc); in drm_atomic_helper_plane_changed()
92 if (plane_state->crtc) { in drm_atomic_helper_plane_changed()
93 crtc_state = drm_atomic_get_new_crtc_state(state, plane_state->crtc); in drm_atomic_helper_plane_changed()
121 if (!new_conn_state->crtc) in handle_conflicting_encoders()
154 * If the flag is set conflicting connectors are removed from the CRTC in handle_conflicting_encoders()
155 * and the CRTC is disabled if no encoder is left. This preserves in handle_conflicting_encoders()
170 DRM_DEBUG_ATOMIC("[ENCODER:%d:%s] in use on [CRTC:%d:%s] by [CONNECTOR:%d:%s]\n", in handle_conflicting_encoders()
172 connector->state->crtc->base.id, in handle_conflicting_encoders()
173 connector->state->crtc->name, in handle_conflicting_encoders()
185 DRM_DEBUG_ATOMIC("[ENCODER:%d:%s] in use on [CRTC:%d:%s], disabling [CONNECTOR:%d:%s]\n", in handle_conflicting_encoders()
187 new_conn_state->crtc->base.id, new_conn_state->crtc->name, in handle_conflicting_encoders()
190 crtc_state = drm_atomic_get_new_crtc_state(state, new_conn_state->crtc); in handle_conflicting_encoders()
217 struct drm_crtc *crtc; in set_best_encoder() local
220 /* Unset the encoder_mask in the old crtc state. */ in set_best_encoder()
221 crtc = conn_state->connector->state->crtc; in set_best_encoder()
223 /* A NULL crtc is an error here because we should have in set_best_encoder()
224 * duplicated a NULL best_encoder when crtc was NULL. in set_best_encoder()
229 WARN_ON(!crtc && encoder != conn_state->best_encoder); in set_best_encoder()
230 if (crtc) { in set_best_encoder()
231 crtc_state = drm_atomic_get_new_crtc_state(state, crtc); in set_best_encoder()
239 crtc = conn_state->crtc; in set_best_encoder()
240 WARN_ON(!crtc); in set_best_encoder()
241 if (crtc) { in set_best_encoder()
242 crtc_state = drm_atomic_get_new_crtc_state(state, crtc); in set_best_encoder()
267 encoder_crtc = old_connector_state->crtc; in steal_encoder()
269 DRM_DEBUG_ATOMIC("[ENCODER:%d:%s] in use on [CRTC:%d:%s], stealing it\n", in steal_encoder()
296 if (old_connector_state->crtc != new_connector_state->crtc) { in update_connector_routing()
297 if (old_connector_state->crtc) { in update_connector_routing()
298 crtc_state = drm_atomic_get_new_crtc_state(state, old_connector_state->crtc); in update_connector_routing()
302 if (new_connector_state->crtc) { in update_connector_routing()
303 crtc_state = drm_atomic_get_new_crtc_state(state, new_connector_state->crtc); in update_connector_routing()
308 if (!new_connector_state->crtc) { in update_connector_routing()
319 new_connector_state->crtc); in update_connector_routing()
362 if (!drm_encoder_crtc_ok(new_encoder, new_connector_state->crtc)) { in update_connector_routing()
363 DRM_DEBUG_ATOMIC("[ENCODER:%d:%s] incompatible with [CRTC:%d:%s]\n", in update_connector_routing()
366 new_connector_state->crtc->base.id, in update_connector_routing()
367 new_connector_state->crtc->name); in update_connector_routing()
374 DRM_DEBUG_ATOMIC("[CONNECTOR:%d:%s] keeps [ENCODER:%d:%s], now on [CRTC:%d:%s]\n", in update_connector_routing()
379 new_connector_state->crtc->base.id, in update_connector_routing()
380 new_connector_state->crtc->name); in update_connector_routing()
391 DRM_DEBUG_ATOMIC("[CONNECTOR:%d:%s] using [ENCODER:%d:%s] on [CRTC:%d:%s]\n", in update_connector_routing()
396 new_connector_state->crtc->base.id, in update_connector_routing()
397 new_connector_state->crtc->name); in update_connector_routing()
405 struct drm_crtc *crtc; in mode_fixup() local
412 for_each_new_crtc_in_state(state, crtc, new_crtc_state, i) { in mode_fixup()
425 WARN_ON(!!new_conn_state->best_encoder != !!new_conn_state->crtc); in mode_fixup()
427 if (!new_conn_state->crtc || !new_conn_state->best_encoder) in mode_fixup()
431 drm_atomic_get_new_crtc_state(state, new_conn_state->crtc); in mode_fixup()
468 for_each_new_crtc_in_state(state, crtc, new_crtc_state, i) { in mode_fixup()
478 funcs = crtc->helper_private; in mode_fixup()
482 ret = funcs->mode_fixup(crtc, &new_crtc_state->mode, in mode_fixup()
485 DRM_DEBUG_ATOMIC("[CRTC:%d:%s] fixup failed\n", in mode_fixup()
486 crtc->base.id, crtc->name); in mode_fixup()
496 struct drm_crtc *crtc, in mode_valid_path() argument
517 ret = drm_crtc_mode_valid(crtc, mode); in mode_valid_path()
519 DRM_DEBUG_ATOMIC("[CRTC:%d:%s] mode_valid() failed\n", in mode_valid_path()
520 crtc->base.id, crtc->name); in mode_valid_path()
536 struct drm_crtc *crtc = conn_state->crtc; in mode_valid() local
541 if (!crtc || !encoder) in mode_valid()
544 crtc_state = drm_atomic_get_new_crtc_state(state, crtc); in mode_valid()
552 mode_status = mode_valid_path(connector, encoder, crtc, mode); in mode_valid()
566 * This does all the CRTC and connector related computations for an atomic
573 * CRTC are added and &drm_connector_helper_funcs.atomic_check is run on them.
578 * This function is only called when the encoder will be part of a configured CRTC,
582 * 7. &drm_crtc_helper_funcs.mode_fixup is called last, to fix up the mode with CRTC constraints.
586 * removed from the CRTC. &drm_crtc_state.active_changed is set when
608 struct drm_crtc *crtc; in drm_atomic_helper_check_modeset() local
615 for_each_oldnew_crtc_in_state(state, crtc, old_crtc_state, new_crtc_state, i) { in drm_atomic_helper_check_modeset()
619 WARN_ON(!drm_modeset_is_locked(&crtc->mutex)); in drm_atomic_helper_check_modeset()
622 DRM_DEBUG_ATOMIC("[CRTC:%d:%s] mode changed\n", in drm_atomic_helper_check_modeset()
623 crtc->base.id, crtc->name); in drm_atomic_helper_check_modeset()
628 DRM_DEBUG_ATOMIC("[CRTC:%d:%s] enable changed\n", in drm_atomic_helper_check_modeset()
629 crtc->base.id, crtc->name); in drm_atomic_helper_check_modeset()
644 DRM_DEBUG_ATOMIC("[CRTC:%d:%s] active changed\n", in drm_atomic_helper_check_modeset()
645 crtc->base.id, crtc->name); in drm_atomic_helper_check_modeset()
650 DRM_DEBUG_ATOMIC("[CRTC:%d:%s] enabled/connectors mismatch\n", in drm_atomic_helper_check_modeset()
651 crtc->base.id, crtc->name); in drm_atomic_helper_check_modeset()
672 * This only sets crtc->connectors_changed for routing changes, in drm_atomic_helper_check_modeset()
673 * drivers must set crtc->connectors_changed themselves when in drm_atomic_helper_check_modeset()
681 if (old_connector_state->crtc) { in drm_atomic_helper_check_modeset()
683 old_connector_state->crtc); in drm_atomic_helper_check_modeset()
703 * connector which is itself unchanged, but whose CRTC changes its in drm_atomic_helper_check_modeset()
705 * crtc only changed its mode but has the same set of connectors. in drm_atomic_helper_check_modeset()
707 for_each_oldnew_crtc_in_state(state, crtc, old_crtc_state, new_crtc_state, i) { in drm_atomic_helper_check_modeset()
711 DRM_DEBUG_ATOMIC("[CRTC:%d:%s] needs all connectors, enable: %c, active: %c\n", in drm_atomic_helper_check_modeset()
712 crtc->base.id, crtc->name, in drm_atomic_helper_check_modeset()
716 ret = drm_atomic_add_affected_connectors(state, crtc); in drm_atomic_helper_check_modeset()
720 ret = drm_atomic_add_affected_planes(state, crtc); in drm_atomic_helper_check_modeset()
772 * @crtc_state: CRTC state to check
776 * doesn't cover the entire CRTC? This will generally
778 * @can_update_disabled: can the plane be updated while the CRTC
804 WARN_ON(plane_state->crtc && plane_state->crtc != crtc_state->crtc); in drm_atomic_helper_check_plane_state()
814 /* crtc should only be NULL when disabling (i.e., !fb) */ in drm_atomic_helper_check_plane_state()
815 if (WARN_ON(!plane_state->crtc)) { in drm_atomic_helper_check_plane_state()
821 DRM_DEBUG_KMS("Cannot update plane of a disabled CRTC.\n"); in drm_atomic_helper_check_plane_state()
855 DRM_DEBUG_KMS("Plane must cover entire CRTC\n"); in drm_atomic_helper_check_plane_state()
875 * It also sets &drm_crtc_state.planes_changed to indicate that a CRTC has
885 struct drm_crtc *crtc; in drm_atomic_helper_check_planes() local
913 for_each_new_crtc_in_state(state, crtc, new_crtc_state, i) { in drm_atomic_helper_check_planes()
916 funcs = crtc->helper_private; in drm_atomic_helper_check_planes()
921 ret = funcs->atomic_check(crtc, new_crtc_state); in drm_atomic_helper_check_planes()
923 DRM_DEBUG_ATOMIC("[CRTC:%d:%s] atomic driver check failed\n", in drm_atomic_helper_check_planes()
924 crtc->base.id, crtc->name); in drm_atomic_helper_check_planes()
992 * No new_state means the CRTC is off, so the only criteria is whether in crtc_needs_disable()
999 * We need to disable bridge(s) and CRTC if we're transitioning out of in crtc_needs_disable()
1001 * bridge tracks self-refresh status via CRTC state. in crtc_needs_disable()
1004 old_state->crtc != new_state->crtc) in crtc_needs_disable()
1009 * the CRTC is currently on, if it's transitioning to self refresh in crtc_needs_disable()
1023 struct drm_crtc *crtc; in disable_outputs() local
1034 if (!old_conn_state->crtc) in disable_outputs()
1037 old_crtc_state = drm_atomic_get_old_crtc_state(old_state, old_conn_state->crtc); in disable_outputs()
1039 if (new_conn_state->crtc) in disable_outputs()
1042 new_conn_state->crtc); in disable_outputs()
1047 !drm_atomic_crtc_needs_modeset(old_conn_state->crtc->state)) in disable_outputs()
1074 else if (new_conn_state->crtc && funcs->prepare) in disable_outputs()
1085 for_each_oldnew_crtc_in_state(old_state, crtc, old_crtc_state, new_crtc_state, i) { in disable_outputs()
1096 funcs = crtc->helper_private; in disable_outputs()
1098 DRM_DEBUG_ATOMIC("disabling [CRTC:%d:%s]\n", in disable_outputs()
1099 crtc->base.id, crtc->name); in disable_outputs()
1104 funcs->prepare(crtc); in disable_outputs()
1106 funcs->atomic_disable(crtc, old_crtc_state); in disable_outputs()
1108 funcs->disable(crtc); in disable_outputs()
1110 funcs->dpms(crtc, DRM_MODE_DPMS_OFF); in disable_outputs()
1115 ret = drm_crtc_vblank_get(crtc); in disable_outputs()
1118 drm_crtc_vblank_put(crtc); in disable_outputs()
1145 struct drm_crtc *crtc; in drm_atomic_helper_update_legacy_modeset_state() local
1152 WARN_ON(!connector->encoder->crtc); in drm_atomic_helper_update_legacy_modeset_state()
1154 connector->encoder->crtc = NULL; in drm_atomic_helper_update_legacy_modeset_state()
1158 crtc = new_conn_state->crtc; in drm_atomic_helper_update_legacy_modeset_state()
1159 if ((!crtc && old_conn_state->crtc) || in drm_atomic_helper_update_legacy_modeset_state()
1160 (crtc && drm_atomic_crtc_needs_modeset(crtc->state))) { in drm_atomic_helper_update_legacy_modeset_state()
1163 if (crtc && crtc->state->active) in drm_atomic_helper_update_legacy_modeset_state()
1172 if (!new_conn_state->crtc) in drm_atomic_helper_update_legacy_modeset_state()
1179 connector->encoder->crtc = new_conn_state->crtc; in drm_atomic_helper_update_legacy_modeset_state()
1182 /* set legacy state in the crtc structure */ in drm_atomic_helper_update_legacy_modeset_state()
1183 for_each_new_crtc_in_state(old_state, crtc, new_crtc_state, i) { in drm_atomic_helper_update_legacy_modeset_state()
1184 struct drm_plane *primary = crtc->primary; in drm_atomic_helper_update_legacy_modeset_state()
1187 crtc->mode = new_crtc_state->mode; in drm_atomic_helper_update_legacy_modeset_state()
1188 crtc->enabled = new_crtc_state->enable; in drm_atomic_helper_update_legacy_modeset_state()
1193 if (new_plane_state && new_plane_state->crtc == crtc) { in drm_atomic_helper_update_legacy_modeset_state()
1194 crtc->x = new_plane_state->src_x >> 16; in drm_atomic_helper_update_legacy_modeset_state()
1195 crtc->y = new_plane_state->src_y >> 16; in drm_atomic_helper_update_legacy_modeset_state()
1211 struct drm_crtc *crtc; in drm_atomic_helper_calc_timestamping_constants() local
1214 for_each_new_crtc_in_state(state, crtc, new_crtc_state, i) { in drm_atomic_helper_calc_timestamping_constants()
1216 drm_calc_timestamping_constants(crtc, in drm_atomic_helper_calc_timestamping_constants()
1225 struct drm_crtc *crtc; in crtc_set_mode() local
1231 for_each_new_crtc_in_state(old_state, crtc, new_crtc_state, i) { in crtc_set_mode()
1237 funcs = crtc->helper_private; in crtc_set_mode()
1240 DRM_DEBUG_ATOMIC("modeset on [CRTC:%d:%s]\n", in crtc_set_mode()
1241 crtc->base.id, crtc->name); in crtc_set_mode()
1243 funcs->mode_set_nofb(crtc); in crtc_set_mode()
1258 new_crtc_state = new_conn_state->crtc->state; in crtc_set_mode()
1292 * For compatibility with legacy CRTC helpers this should be called before
1296 * PM since planes updates then only happen when the CRTC is actually enabled.
1339 * For compatibility with legacy CRTC helpers this should be called after
1343 * PM since planes updates then only happen when the CRTC is actually enabled.
1348 struct drm_crtc *crtc; in drm_atomic_helper_commit_modeset_enables() local
1355 for_each_oldnew_crtc_in_state(old_state, crtc, old_crtc_state, new_crtc_state, i) { in drm_atomic_helper_commit_modeset_enables()
1365 funcs = crtc->helper_private; in drm_atomic_helper_commit_modeset_enables()
1368 DRM_DEBUG_ATOMIC("enabling [CRTC:%d:%s]\n", in drm_atomic_helper_commit_modeset_enables()
1369 crtc->base.id, crtc->name); in drm_atomic_helper_commit_modeset_enables()
1371 funcs->atomic_enable(crtc, old_crtc_state); in drm_atomic_helper_commit_modeset_enables()
1373 funcs->commit(crtc); in drm_atomic_helper_commit_modeset_enables()
1385 if (!new_conn_state->crtc->state->active || in drm_atomic_helper_commit_modeset_enables()
1386 !drm_atomic_crtc_needs_modeset(new_conn_state->crtc->state)) in drm_atomic_helper_commit_modeset_enables()
1489 struct drm_crtc *crtc; in drm_atomic_helper_wait_for_vblanks() local
1501 for_each_oldnew_crtc_in_state(old_state, crtc, old_crtc_state, new_crtc_state, i) { in drm_atomic_helper_wait_for_vblanks()
1505 ret = drm_crtc_vblank_get(crtc); in drm_atomic_helper_wait_for_vblanks()
1509 crtc_mask |= drm_crtc_mask(crtc); in drm_atomic_helper_wait_for_vblanks()
1510 old_state->crtcs[i].last_vblank_count = drm_crtc_vblank_count(crtc); in drm_atomic_helper_wait_for_vblanks()
1513 for_each_old_crtc_in_state(old_state, crtc, old_crtc_state, i) { in drm_atomic_helper_wait_for_vblanks()
1514 if (!(crtc_mask & drm_crtc_mask(crtc))) in drm_atomic_helper_wait_for_vblanks()
1519 drm_crtc_vblank_count(crtc), in drm_atomic_helper_wait_for_vblanks()
1522 WARN(!ret, "[CRTC:%d:%s] vblank wait timed out\n", in drm_atomic_helper_wait_for_vblanks()
1523 crtc->base.id, crtc->name); in drm_atomic_helper_wait_for_vblanks()
1525 drm_crtc_vblank_put(crtc); in drm_atomic_helper_wait_for_vblanks()
1548 struct drm_crtc *crtc; in drm_atomic_helper_wait_for_flip_done() local
1555 crtc = old_state->crtcs[i].ptr; in drm_atomic_helper_wait_for_flip_done()
1557 if (!crtc || !commit) in drm_atomic_helper_wait_for_flip_done()
1562 DRM_ERROR("[CRTC:%d:%s] flip_done timed out\n", in drm_atomic_helper_wait_for_flip_done()
1563 crtc->base.id, crtc->name); in drm_atomic_helper_wait_for_flip_done()
1577 * that do not support runtime_pm or do not need the CRTC to be
1610 * that support runtime_pm or need the CRTC to be enabled to perform a
1640 struct drm_crtc *crtc; in commit_tail() local
1665 * drm_atomic_helper_commit_hw_done() so figure out which crtc's have in commit_tail()
1668 for_each_new_crtc_in_state(old_state, crtc, new_crtc_state, i) in commit_tail()
1712 struct drm_crtc *crtc; in drm_atomic_helper_async_check() local
1720 for_each_new_crtc_in_state(state, crtc, crtc_state, i) { in drm_atomic_helper_async_check()
1732 if (!new_plane_state->crtc || in drm_atomic_helper_async_check()
1733 old_plane_state->crtc != new_plane_state->crtc) in drm_atomic_helper_async_check()
1924 * must be done as one global operation, and enabling or disabling a CRTC can
1952 static int stall_checks(struct drm_crtc *crtc, bool nonblock) in stall_checks() argument
1959 spin_lock(&crtc->commit_lock); in stall_checks()
1961 list_for_each_entry(commit, &crtc->commit_list, commit_entry) { in stall_checks()
1967 spin_unlock(&crtc->commit_lock); in stall_checks()
1977 spin_unlock(&crtc->commit_lock); in stall_checks()
1988 DRM_ERROR("[CRTC:%d:%s] cleanup_done timed out\n", in stall_checks()
1989 crtc->base.id, crtc->name); in stall_checks()
2005 static void init_commit(struct drm_crtc_commit *commit, struct drm_crtc *crtc) in init_commit() argument
2012 commit->crtc = crtc; in init_commit()
2016 crtc_or_fake_commit(struct drm_atomic_state *state, struct drm_crtc *crtc) in crtc_or_fake_commit() argument
2018 if (crtc) { in crtc_or_fake_commit()
2021 new_crtc_state = drm_atomic_get_new_crtc_state(state, crtc); in crtc_or_fake_commit()
2083 struct drm_crtc *crtc; in drm_atomic_helper_setup_commit() local
2092 for_each_oldnew_crtc_in_state(state, crtc, old_crtc_state, new_crtc_state, i) { in drm_atomic_helper_setup_commit()
2097 init_commit(commit, crtc); in drm_atomic_helper_setup_commit()
2101 ret = stall_checks(crtc, nonblock); in drm_atomic_helper_setup_commit()
2106 * new CRTC state is active. Complete right away if everything in drm_atomic_helper_setup_commit()
2146 commit = crtc_or_fake_commit(state, new_conn_state->crtc ?: old_conn_state->crtc); in drm_atomic_helper_setup_commit()
2161 commit = crtc_or_fake_commit(state, new_plane_state->crtc ?: old_plane_state->crtc); in drm_atomic_helper_setup_commit()
2176 * This function waits for all preceeding commits that touch the same CRTC as
2186 struct drm_crtc *crtc; in drm_atomic_helper_wait_for_dependencies() local
2196 for_each_old_crtc_in_state(old_state, crtc, old_crtc_state, i) { in drm_atomic_helper_wait_for_dependencies()
2205 DRM_ERROR("[CRTC:%d:%s] hw_done timed out\n", in drm_atomic_helper_wait_for_dependencies()
2206 crtc->base.id, crtc->name); in drm_atomic_helper_wait_for_dependencies()
2213 DRM_ERROR("[CRTC:%d:%s] flip_done timed out\n", in drm_atomic_helper_wait_for_dependencies()
2214 crtc->base.id, crtc->name); in drm_atomic_helper_wait_for_dependencies()
2282 struct drm_crtc *crtc; in drm_atomic_helper_fake_vblank() local
2285 for_each_new_crtc_in_state(old_state, crtc, new_crtc_state, i) { in drm_atomic_helper_fake_vblank()
2293 drm_crtc_send_vblank_event(crtc, in drm_atomic_helper_fake_vblank()
2319 struct drm_crtc *crtc; in drm_atomic_helper_commit_hw_done() local
2324 for_each_oldnew_crtc_in_state(old_state, crtc, old_crtc_state, new_crtc_state, i) { in drm_atomic_helper_commit_hw_done()
2364 struct drm_crtc *crtc; in drm_atomic_helper_commit_cleanup_done() local
2369 for_each_old_crtc_in_state(old_state, crtc, old_crtc_state, i) { in drm_atomic_helper_commit_cleanup_done()
2377 spin_lock(&crtc->commit_lock); in drm_atomic_helper_commit_cleanup_done()
2379 spin_unlock(&crtc->commit_lock); in drm_atomic_helper_commit_cleanup_done()
2453 return state->crtc && state->crtc->state->active; in plane_crtc_active()
2474 * Plane parameters can be updated by applications while the associated CRTC is
2476 * which will be available to the driver when the CRTC is turned on. As a result
2478 * disabled CRTC.
2482 * disabled CRTC. This avoids the need to manually ignore plane updates in
2487 * display controllers require to disable a CRTC's planes when the CRTC is
2489 * call for a plane if the CRTC of the old plane state needs a modesetting
2490 * operation. Of course, the drivers need to disable the planes in their CRTC
2501 struct drm_crtc *crtc; in drm_atomic_helper_commit_planes() local
2509 for_each_oldnew_crtc_in_state(old_state, crtc, old_crtc_state, new_crtc_state, i) { in drm_atomic_helper_commit_planes()
2512 funcs = crtc->helper_private; in drm_atomic_helper_commit_planes()
2520 funcs->atomic_begin(crtc, old_crtc_state); in drm_atomic_helper_commit_planes()
2538 * is enabled use the state of the current CRTC. If the in drm_atomic_helper_commit_planes()
2540 * CRTC to avoid skipping planes being disabled on an in drm_atomic_helper_commit_planes()
2541 * active CRTC. in drm_atomic_helper_commit_planes()
2555 crtc_state = old_plane_state->crtc->state; in drm_atomic_helper_commit_planes()
2562 } else if (new_plane_state->crtc || disabling) { in drm_atomic_helper_commit_planes()
2567 for_each_oldnew_crtc_in_state(old_state, crtc, old_crtc_state, new_crtc_state, i) { in drm_atomic_helper_commit_planes()
2570 funcs = crtc->helper_private; in drm_atomic_helper_commit_planes()
2578 funcs->atomic_flush(crtc, old_crtc_state); in drm_atomic_helper_commit_planes()
2584 * drm_atomic_helper_commit_planes_on_crtc - commit plane state for a CRTC
2585 * @old_crtc_state: atomic state object with the old CRTC state
2588 * functions for planes on the specific CRTC. It assumes that the atomic state
2592 * This function is useful when plane updates should be done CRTC-by-CRTC
2596 * between different CRTCs because this function doesn't handle inter-CRTC
2604 struct drm_crtc *crtc = old_crtc_state->crtc; in drm_atomic_helper_commit_planes_on_crtc() local
2607 drm_atomic_get_new_crtc_state(old_state, crtc); in drm_atomic_helper_commit_planes_on_crtc()
2614 crtc_funcs = crtc->helper_private; in drm_atomic_helper_commit_planes_on_crtc()
2616 crtc_funcs->atomic_begin(crtc, old_crtc_state); in drm_atomic_helper_commit_planes_on_crtc()
2618 drm_for_each_plane_mask(plane, crtc->dev, plane_mask) { in drm_atomic_helper_commit_planes_on_crtc()
2630 WARN_ON(new_plane_state->crtc && in drm_atomic_helper_commit_planes_on_crtc()
2631 new_plane_state->crtc != crtc); in drm_atomic_helper_commit_planes_on_crtc()
2636 else if (new_plane_state->crtc || in drm_atomic_helper_commit_planes_on_crtc()
2642 crtc_funcs->atomic_flush(crtc, old_crtc_state); in drm_atomic_helper_commit_planes_on_crtc()
2647 * drm_atomic_helper_disable_planes_on_crtc - helper to disable CRTC's planes
2648 * @old_crtc_state: atomic state object with the old CRTC state
2649 * @atomic: if set, synchronize with CRTC's atomic_begin/flush hooks
2651 * Disables all planes associated with the given CRTC. This can be
2652 * used for instance in the CRTC helper atomic_disable callback to disable
2655 * If the atomic-parameter is set the function calls the CRTC's
2666 struct drm_crtc *crtc = old_crtc_state->crtc; in drm_atomic_helper_disable_planes_on_crtc() local
2668 crtc->helper_private; in drm_atomic_helper_disable_planes_on_crtc()
2672 crtc_funcs->atomic_begin(crtc, NULL); in drm_atomic_helper_disable_planes_on_crtc()
2687 crtc_funcs->atomic_flush(crtc, NULL); in drm_atomic_helper_disable_planes_on_crtc()
2772 struct drm_crtc *crtc; in drm_atomic_helper_swap_state() local
2790 for_each_old_crtc_in_state(state, crtc, old_crtc_state, i) { in drm_atomic_helper_swap_state()
2834 for_each_oldnew_crtc_in_state(state, crtc, old_crtc_state, new_crtc_state, i) { in drm_atomic_helper_swap_state()
2835 WARN_ON(crtc->state != old_crtc_state); in drm_atomic_helper_swap_state()
2841 crtc->state = new_crtc_state; in drm_atomic_helper_swap_state()
2844 spin_lock(&crtc->commit_lock); in drm_atomic_helper_swap_state()
2846 &crtc->commit_list); in drm_atomic_helper_swap_state()
2847 spin_unlock(&crtc->commit_lock); in drm_atomic_helper_swap_state()
2880 * @crtc: owning CRTC of owning plane
2882 * @crtc_x: x offset of primary plane on @crtc
2883 * @crtc_y: y offset of primary plane on @crtc
2884 * @crtc_w: width of primary plane rectangle on @crtc
2885 * @crtc_h: height of primary plane rectangle on @crtc
2898 struct drm_crtc *crtc, in drm_atomic_helper_update_plane() argument
2921 ret = drm_atomic_set_crtc_for_plane(plane_state, crtc); in drm_atomic_helper_update_plane()
2934 if (plane == crtc->cursor) in drm_atomic_helper_update_plane()
2972 if (plane_state->crtc && plane_state->crtc->cursor == plane) in drm_atomic_helper_disable_plane()
2991 * Provides a default CRTC set_config handler using the atomic driver interface.
3006 struct drm_crtc *crtc = set->crtc; in drm_atomic_helper_set_config() local
3009 state = drm_atomic_state_alloc(crtc->dev); in drm_atomic_helper_set_config()
3036 * turns them off by setting their DPMS mode to OFF and deactivating the CRTC
3062 struct drm_crtc *crtc; in drm_atomic_helper_disable_all() local
3071 drm_for_each_crtc(crtc, dev) { in drm_atomic_helper_disable_all()
3072 crtc_state = drm_atomic_get_crtc_state(state, crtc); in drm_atomic_helper_disable_all()
3084 ret = drm_atomic_add_affected_planes(state, crtc); in drm_atomic_helper_disable_all()
3088 ret = drm_atomic_add_affected_connectors(state, crtc); in drm_atomic_helper_disable_all()
3115 * drm_atomic_helper_shutdown - shutdown all CRTC
3118 * This shuts down all CRTC, which is useful for driver unloading. Shutdown on
3134 DRM_ERROR("Disabling all crtc's during unload failed with %i\n", ret); in drm_atomic_helper_shutdown()
3172 struct drm_crtc *crtc; in drm_atomic_helper_duplicate_state() local
3182 drm_for_each_crtc(crtc, dev) { in drm_atomic_helper_duplicate_state()
3185 crtc_state = drm_atomic_get_crtc_state(state, crtc); in drm_atomic_helper_duplicate_state()
3307 struct drm_crtc *crtc; in drm_atomic_helper_commit_duplicated_state() local
3315 for_each_new_crtc_in_state(state, crtc, new_crtc_state, i) in drm_atomic_helper_commit_duplicated_state()
3316 state->crtcs[i].old_state = crtc->state; in drm_atomic_helper_commit_duplicated_state()
3365 struct drm_crtc *crtc, in page_flip_common() argument
3370 struct drm_plane *plane = crtc->primary; in page_flip_common()
3375 crtc_state = drm_atomic_get_crtc_state(state, crtc); in page_flip_common()
3386 ret = drm_atomic_set_crtc_for_plane(plane_state, crtc); in page_flip_common()
3394 DRM_DEBUG_ATOMIC("[CRTC:%d:%s] disabled, rejecting legacy flip\n", in page_flip_common()
3395 crtc->base.id, crtc->name); in page_flip_common()
3404 * @crtc: DRM CRTC
3419 int drm_atomic_helper_page_flip(struct drm_crtc *crtc, in drm_atomic_helper_page_flip() argument
3425 struct drm_plane *plane = crtc->primary; in drm_atomic_helper_page_flip()
3435 ret = page_flip_common(state, crtc, fb, event, flags); in drm_atomic_helper_page_flip()
3448 * @crtc: DRM CRTC
3462 int drm_atomic_helper_page_flip_target(struct drm_crtc *crtc, in drm_atomic_helper_page_flip_target() argument
3469 struct drm_plane *plane = crtc->primary; in drm_atomic_helper_page_flip_target()
3480 ret = page_flip_common(state, crtc, fb, event, flags); in drm_atomic_helper_page_flip_target()
3484 crtc_state = drm_atomic_get_new_crtc_state(state, crtc); in drm_atomic_helper_page_flip_target()
3500 * @crtc: CRTC object
3512 int drm_atomic_helper_legacy_gamma_set(struct drm_crtc *crtc, in drm_atomic_helper_legacy_gamma_set() argument
3517 struct drm_device *dev = crtc->dev; in drm_atomic_helper_legacy_gamma_set()
3525 state = drm_atomic_state_alloc(crtc->dev); in drm_atomic_helper_legacy_gamma_set()
3547 crtc_state = drm_atomic_get_crtc_state(state, crtc); in drm_atomic_helper_legacy_gamma_set()
3573 * @crtc_state: new CRTC state