Lines Matching refs:crtc

83 	if (old_plane_state->crtc) {  in drm_atomic_helper_plane_changed()
85 old_plane_state->crtc); in drm_atomic_helper_plane_changed()
93 if (plane_state->crtc) { in drm_atomic_helper_plane_changed()
94 crtc_state = drm_atomic_get_new_crtc_state(state, plane_state->crtc); in drm_atomic_helper_plane_changed()
122 if (!new_conn_state->crtc) in handle_conflicting_encoders()
174 connector->state->crtc->base.id, in handle_conflicting_encoders()
175 connector->state->crtc->name, in handle_conflicting_encoders()
189 new_conn_state->crtc->base.id, new_conn_state->crtc->name, in handle_conflicting_encoders()
192 crtc_state = drm_atomic_get_new_crtc_state(state, new_conn_state->crtc); in handle_conflicting_encoders()
219 struct drm_crtc *crtc; in set_best_encoder() local
223 crtc = conn_state->connector->state->crtc; in set_best_encoder()
231 WARN_ON(!crtc && encoder != conn_state->best_encoder); in set_best_encoder()
232 if (crtc) { in set_best_encoder()
233 crtc_state = drm_atomic_get_new_crtc_state(state, crtc); in set_best_encoder()
241 crtc = conn_state->crtc; in set_best_encoder()
242 WARN_ON(!crtc); in set_best_encoder()
243 if (crtc) { in set_best_encoder()
244 crtc_state = drm_atomic_get_new_crtc_state(state, crtc); in set_best_encoder()
269 encoder_crtc = old_connector_state->crtc; in steal_encoder()
298 if (old_connector_state->crtc != new_connector_state->crtc) { in update_connector_routing()
299 if (old_connector_state->crtc) { in update_connector_routing()
300 crtc_state = drm_atomic_get_new_crtc_state(state, old_connector_state->crtc); in update_connector_routing()
304 if (new_connector_state->crtc) { in update_connector_routing()
305 crtc_state = drm_atomic_get_new_crtc_state(state, new_connector_state->crtc); in update_connector_routing()
310 if (!new_connector_state->crtc) { in update_connector_routing()
321 new_connector_state->crtc); in update_connector_routing()
363 if (!drm_encoder_crtc_ok(new_encoder, new_connector_state->crtc)) { in update_connector_routing()
367 new_connector_state->crtc->base.id, in update_connector_routing()
368 new_connector_state->crtc->name); in update_connector_routing()
380 new_connector_state->crtc->base.id, in update_connector_routing()
381 new_connector_state->crtc->name); in update_connector_routing()
397 new_connector_state->crtc->base.id, in update_connector_routing()
398 new_connector_state->crtc->name); in update_connector_routing()
406 struct drm_crtc *crtc; in mode_fixup() local
413 for_each_new_crtc_in_state(state, crtc, new_crtc_state, i) { in mode_fixup()
426 WARN_ON(!!new_conn_state->best_encoder != !!new_conn_state->crtc); in mode_fixup()
428 if (!new_conn_state->crtc || !new_conn_state->best_encoder) in mode_fixup()
432 drm_atomic_get_new_crtc_state(state, new_conn_state->crtc); in mode_fixup()
469 for_each_new_crtc_in_state(state, crtc, new_crtc_state, i) { in mode_fixup()
479 funcs = crtc->helper_private; in mode_fixup()
483 ret = funcs->mode_fixup(crtc, &new_crtc_state->mode, in mode_fixup()
487 crtc->base.id, crtc->name); in mode_fixup()
497 struct drm_crtc *crtc, in mode_valid_path() argument
518 ret = drm_crtc_mode_valid(crtc, mode); in mode_valid_path()
521 crtc->base.id, crtc->name); in mode_valid_path()
537 struct drm_crtc *crtc = conn_state->crtc; in mode_valid() local
542 if (!crtc || !encoder) in mode_valid()
545 crtc_state = drm_atomic_get_new_crtc_state(state, crtc); in mode_valid()
553 mode_status = mode_valid_path(connector, encoder, crtc, mode); in mode_valid()
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()
623 crtc->base.id, crtc->name); in drm_atomic_helper_check_modeset()
629 crtc->base.id, crtc->name); in drm_atomic_helper_check_modeset()
645 crtc->base.id, crtc->name); in drm_atomic_helper_check_modeset()
651 crtc->base.id, crtc->name); 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()
707 for_each_oldnew_crtc_in_state(state, crtc, old_crtc_state, new_crtc_state, i) { 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()
804 WARN_ON(plane_state->crtc && plane_state->crtc != crtc_state->crtc); in drm_atomic_helper_check_plane_state()
815 if (WARN_ON(!plane_state->crtc)) { in drm_atomic_helper_check_plane_state()
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, state); in drm_atomic_helper_check_planes()
924 crtc->base.id, crtc->name); in drm_atomic_helper_check_planes()
1013 struct drm_crtc *crtc; in disable_outputs() local
1026 if (!old_conn_state->crtc) in disable_outputs()
1029 old_crtc_state = drm_atomic_get_old_crtc_state(old_state, old_conn_state->crtc); in disable_outputs()
1031 if (new_conn_state->crtc) in disable_outputs()
1034 new_conn_state->crtc); in disable_outputs()
1039 !drm_atomic_crtc_needs_modeset(old_conn_state->crtc->state)) in disable_outputs()
1066 else if (new_conn_state->crtc && funcs->prepare) in disable_outputs()
1077 for_each_oldnew_crtc_in_state(old_state, crtc, old_crtc_state, new_crtc_state, i) { in disable_outputs()
1088 funcs = crtc->helper_private; in disable_outputs()
1091 crtc->base.id, crtc->name); in disable_outputs()
1096 funcs->prepare(crtc); in disable_outputs()
1098 funcs->atomic_disable(crtc, old_state); in disable_outputs()
1100 funcs->disable(crtc); in disable_outputs()
1102 funcs->dpms(crtc, DRM_MODE_DPMS_OFF); in disable_outputs()
1107 ret = drm_crtc_vblank_get(crtc); in disable_outputs()
1110 drm_crtc_vblank_put(crtc); in disable_outputs()
1137 struct drm_crtc *crtc; in drm_atomic_helper_update_legacy_modeset_state() local
1144 WARN_ON(!connector->encoder->crtc); in drm_atomic_helper_update_legacy_modeset_state()
1146 connector->encoder->crtc = NULL; in drm_atomic_helper_update_legacy_modeset_state()
1150 crtc = new_conn_state->crtc; in drm_atomic_helper_update_legacy_modeset_state()
1151 if ((!crtc && old_conn_state->crtc) || in drm_atomic_helper_update_legacy_modeset_state()
1152 (crtc && drm_atomic_crtc_needs_modeset(crtc->state))) { in drm_atomic_helper_update_legacy_modeset_state()
1155 if (crtc && crtc->state->active) in drm_atomic_helper_update_legacy_modeset_state()
1164 if (!new_conn_state->crtc) in drm_atomic_helper_update_legacy_modeset_state()
1171 connector->encoder->crtc = new_conn_state->crtc; in drm_atomic_helper_update_legacy_modeset_state()
1175 for_each_new_crtc_in_state(old_state, crtc, new_crtc_state, i) { in drm_atomic_helper_update_legacy_modeset_state()
1176 struct drm_plane *primary = crtc->primary; in drm_atomic_helper_update_legacy_modeset_state()
1179 crtc->mode = new_crtc_state->mode; in drm_atomic_helper_update_legacy_modeset_state()
1180 crtc->enabled = new_crtc_state->enable; in drm_atomic_helper_update_legacy_modeset_state()
1185 if (new_plane_state && new_plane_state->crtc == crtc) { in drm_atomic_helper_update_legacy_modeset_state()
1186 crtc->x = new_plane_state->src_x >> 16; in drm_atomic_helper_update_legacy_modeset_state()
1187 crtc->y = new_plane_state->src_y >> 16; in drm_atomic_helper_update_legacy_modeset_state()
1203 struct drm_crtc *crtc; in drm_atomic_helper_calc_timestamping_constants() local
1206 for_each_new_crtc_in_state(state, crtc, new_crtc_state, i) { in drm_atomic_helper_calc_timestamping_constants()
1208 drm_calc_timestamping_constants(crtc, in drm_atomic_helper_calc_timestamping_constants()
1217 struct drm_crtc *crtc; in crtc_set_mode() local
1223 for_each_new_crtc_in_state(old_state, crtc, new_crtc_state, i) { in crtc_set_mode()
1229 funcs = crtc->helper_private; in crtc_set_mode()
1233 crtc->base.id, crtc->name); in crtc_set_mode()
1235 funcs->mode_set_nofb(crtc); in crtc_set_mode()
1250 new_crtc_state = new_conn_state->crtc->state; in crtc_set_mode()
1340 struct drm_crtc *crtc; in drm_atomic_helper_commit_modeset_enables() local
1347 for_each_oldnew_crtc_in_state(old_state, crtc, old_crtc_state, new_crtc_state, i) { in drm_atomic_helper_commit_modeset_enables()
1357 funcs = crtc->helper_private; in drm_atomic_helper_commit_modeset_enables()
1361 crtc->base.id, crtc->name); in drm_atomic_helper_commit_modeset_enables()
1363 funcs->atomic_enable(crtc, old_state); in drm_atomic_helper_commit_modeset_enables()
1365 funcs->commit(crtc); in drm_atomic_helper_commit_modeset_enables()
1377 if (!new_conn_state->crtc->state->active || in drm_atomic_helper_commit_modeset_enables()
1378 !drm_atomic_crtc_needs_modeset(new_conn_state->crtc->state)) in drm_atomic_helper_commit_modeset_enables()
1481 struct drm_crtc *crtc; in drm_atomic_helper_wait_for_vblanks() local
1493 for_each_oldnew_crtc_in_state(old_state, crtc, old_crtc_state, new_crtc_state, i) { in drm_atomic_helper_wait_for_vblanks()
1497 ret = drm_crtc_vblank_get(crtc); in drm_atomic_helper_wait_for_vblanks()
1501 crtc_mask |= drm_crtc_mask(crtc); in drm_atomic_helper_wait_for_vblanks()
1502 old_state->crtcs[i].last_vblank_count = drm_crtc_vblank_count(crtc); in drm_atomic_helper_wait_for_vblanks()
1505 for_each_old_crtc_in_state(old_state, crtc, old_crtc_state, i) { in drm_atomic_helper_wait_for_vblanks()
1506 if (!(crtc_mask & drm_crtc_mask(crtc))) in drm_atomic_helper_wait_for_vblanks()
1511 drm_crtc_vblank_count(crtc), in drm_atomic_helper_wait_for_vblanks()
1515 crtc->base.id, crtc->name); in drm_atomic_helper_wait_for_vblanks()
1517 drm_crtc_vblank_put(crtc); in drm_atomic_helper_wait_for_vblanks()
1540 struct drm_crtc *crtc; in drm_atomic_helper_wait_for_flip_done() local
1547 crtc = old_state->crtcs[i].ptr; in drm_atomic_helper_wait_for_flip_done()
1549 if (!crtc || !commit) in drm_atomic_helper_wait_for_flip_done()
1555 crtc->base.id, crtc->name); in drm_atomic_helper_wait_for_flip_done()
1632 struct drm_crtc *crtc; in commit_tail() local
1660 for_each_new_crtc_in_state(old_state, crtc, new_crtc_state, i) in commit_tail()
1704 struct drm_crtc *crtc; in drm_atomic_helper_async_check() local
1712 for_each_new_crtc_in_state(state, crtc, crtc_state, i) { in drm_atomic_helper_async_check()
1724 if (!new_plane_state->crtc || in drm_atomic_helper_async_check()
1725 old_plane_state->crtc != new_plane_state->crtc) in drm_atomic_helper_async_check()
1947 static int stall_checks(struct drm_crtc *crtc, bool nonblock) in stall_checks() argument
1954 spin_lock(&crtc->commit_lock); in stall_checks()
1956 list_for_each_entry(commit, &crtc->commit_list, commit_entry) { in stall_checks()
1964 spin_unlock(&crtc->commit_lock); in stall_checks()
1966 crtc->base.id, crtc->name); in stall_checks()
1977 spin_unlock(&crtc->commit_lock); 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()
2086 struct drm_crtc *crtc; in drm_atomic_helper_setup_commit() local
2098 for_each_oldnew_crtc_in_state(state, crtc, old_crtc_state, new_crtc_state, i) { in drm_atomic_helper_setup_commit()
2103 init_commit(commit, crtc); in drm_atomic_helper_setup_commit()
2107 ret = stall_checks(crtc, nonblock); in drm_atomic_helper_setup_commit()
2160 commit = crtc_or_fake_commit(state, new_conn_state->crtc ?: old_conn_state->crtc); in drm_atomic_helper_setup_commit()
2181 commit = crtc_or_fake_commit(state, new_plane_state->crtc ?: old_plane_state->crtc); in drm_atomic_helper_setup_commit()
2209 struct drm_crtc *crtc; in drm_atomic_helper_wait_for_dependencies() local
2218 for_each_old_crtc_in_state(old_state, crtc, old_crtc_state, i) { in drm_atomic_helper_wait_for_dependencies()
2222 crtc->base.id, crtc->name); in drm_atomic_helper_wait_for_dependencies()
2262 struct drm_crtc *crtc; in drm_atomic_helper_fake_vblank() local
2265 for_each_new_crtc_in_state(old_state, crtc, new_crtc_state, i) { in drm_atomic_helper_fake_vblank()
2273 drm_crtc_send_vblank_event(crtc, in drm_atomic_helper_fake_vblank()
2299 struct drm_crtc *crtc; in drm_atomic_helper_commit_hw_done() local
2304 for_each_oldnew_crtc_in_state(old_state, crtc, old_crtc_state, new_crtc_state, i) { in drm_atomic_helper_commit_hw_done()
2344 struct drm_crtc *crtc; in drm_atomic_helper_commit_cleanup_done() local
2349 for_each_old_crtc_in_state(old_state, crtc, old_crtc_state, i) { in drm_atomic_helper_commit_cleanup_done()
2357 spin_lock(&crtc->commit_lock); in drm_atomic_helper_commit_cleanup_done()
2359 spin_unlock(&crtc->commit_lock); in drm_atomic_helper_commit_cleanup_done()
2442 return state->crtc && state->crtc->state->active; in plane_crtc_active()
2490 struct drm_crtc *crtc; in drm_atomic_helper_commit_planes() local
2498 for_each_oldnew_crtc_in_state(old_state, crtc, old_crtc_state, new_crtc_state, i) { in drm_atomic_helper_commit_planes()
2501 funcs = crtc->helper_private; in drm_atomic_helper_commit_planes()
2509 funcs->atomic_begin(crtc, old_state); in drm_atomic_helper_commit_planes()
2544 crtc_state = old_plane_state->crtc->state; in drm_atomic_helper_commit_planes()
2551 } else if (new_plane_state->crtc || disabling) { in drm_atomic_helper_commit_planes()
2556 for_each_oldnew_crtc_in_state(old_state, crtc, old_crtc_state, new_crtc_state, i) { in drm_atomic_helper_commit_planes()
2559 funcs = crtc->helper_private; in drm_atomic_helper_commit_planes()
2567 funcs->atomic_flush(crtc, old_state); in drm_atomic_helper_commit_planes()
2593 struct drm_crtc *crtc = old_crtc_state->crtc; in drm_atomic_helper_commit_planes_on_crtc() local
2596 drm_atomic_get_new_crtc_state(old_state, crtc); in drm_atomic_helper_commit_planes_on_crtc()
2603 crtc_funcs = crtc->helper_private; in drm_atomic_helper_commit_planes_on_crtc()
2605 crtc_funcs->atomic_begin(crtc, old_state); in drm_atomic_helper_commit_planes_on_crtc()
2607 drm_for_each_plane_mask(plane, crtc->dev, plane_mask) { in drm_atomic_helper_commit_planes_on_crtc()
2619 WARN_ON(new_plane_state->crtc && in drm_atomic_helper_commit_planes_on_crtc()
2620 new_plane_state->crtc != crtc); in drm_atomic_helper_commit_planes_on_crtc()
2625 else if (new_plane_state->crtc || in drm_atomic_helper_commit_planes_on_crtc()
2631 crtc_funcs->atomic_flush(crtc, old_state); in drm_atomic_helper_commit_planes_on_crtc()
2655 struct drm_crtc *crtc = old_crtc_state->crtc; in drm_atomic_helper_disable_planes_on_crtc() local
2657 crtc->helper_private; in drm_atomic_helper_disable_planes_on_crtc()
2661 crtc_funcs->atomic_begin(crtc, NULL); in drm_atomic_helper_disable_planes_on_crtc()
2676 crtc_funcs->atomic_flush(crtc, NULL); in drm_atomic_helper_disable_planes_on_crtc()
2761 struct drm_crtc *crtc; in drm_atomic_helper_swap_state() local
2779 for_each_old_crtc_in_state(state, crtc, old_crtc_state, i) { in drm_atomic_helper_swap_state()
2823 for_each_oldnew_crtc_in_state(state, crtc, old_crtc_state, new_crtc_state, i) { in drm_atomic_helper_swap_state()
2824 WARN_ON(crtc->state != old_crtc_state); in drm_atomic_helper_swap_state()
2830 crtc->state = new_crtc_state; in drm_atomic_helper_swap_state()
2833 spin_lock(&crtc->commit_lock); in drm_atomic_helper_swap_state()
2835 &crtc->commit_list); in drm_atomic_helper_swap_state()
2836 spin_unlock(&crtc->commit_lock); in drm_atomic_helper_swap_state()
2887 struct drm_crtc *crtc, in drm_atomic_helper_update_plane() argument
2910 ret = drm_atomic_set_crtc_for_plane(plane_state, crtc); in drm_atomic_helper_update_plane()
2923 if (plane == crtc->cursor) in drm_atomic_helper_update_plane()
2961 if (plane_state->crtc && plane_state->crtc->cursor == plane) in drm_atomic_helper_disable_plane()
2995 struct drm_crtc *crtc = set->crtc; in drm_atomic_helper_set_config() local
2998 state = drm_atomic_state_alloc(crtc->dev); in drm_atomic_helper_set_config()
3051 struct drm_crtc *crtc; in drm_atomic_helper_disable_all() local
3060 drm_for_each_crtc(crtc, dev) { in drm_atomic_helper_disable_all()
3061 crtc_state = drm_atomic_get_crtc_state(state, crtc); in drm_atomic_helper_disable_all()
3073 ret = drm_atomic_add_affected_planes(state, crtc); in drm_atomic_helper_disable_all()
3077 ret = drm_atomic_add_affected_connectors(state, crtc); in drm_atomic_helper_disable_all()
3161 struct drm_crtc *crtc; in drm_atomic_helper_duplicate_state() local
3171 drm_for_each_crtc(crtc, dev) { in drm_atomic_helper_duplicate_state()
3174 crtc_state = drm_atomic_get_crtc_state(state, crtc); in drm_atomic_helper_duplicate_state()
3296 struct drm_crtc *crtc; in drm_atomic_helper_commit_duplicated_state() local
3304 for_each_new_crtc_in_state(state, crtc, new_crtc_state, i) in drm_atomic_helper_commit_duplicated_state()
3305 state->crtcs[i].old_state = crtc->state; in drm_atomic_helper_commit_duplicated_state()
3354 struct drm_crtc *crtc, in page_flip_common() argument
3359 struct drm_plane *plane = crtc->primary; in page_flip_common()
3364 crtc_state = drm_atomic_get_crtc_state(state, crtc); in page_flip_common()
3375 ret = drm_atomic_set_crtc_for_plane(plane_state, crtc); in page_flip_common()
3384 crtc->base.id, crtc->name); in page_flip_common()
3408 int drm_atomic_helper_page_flip(struct drm_crtc *crtc, in drm_atomic_helper_page_flip() argument
3414 struct drm_plane *plane = crtc->primary; in drm_atomic_helper_page_flip()
3424 ret = page_flip_common(state, crtc, fb, event, flags); in drm_atomic_helper_page_flip()
3451 int drm_atomic_helper_page_flip_target(struct drm_crtc *crtc, in drm_atomic_helper_page_flip_target() argument
3458 struct drm_plane *plane = crtc->primary; in drm_atomic_helper_page_flip_target()
3469 ret = page_flip_common(state, crtc, fb, event, flags); in drm_atomic_helper_page_flip_target()
3473 crtc_state = drm_atomic_get_new_crtc_state(state, crtc); in drm_atomic_helper_page_flip_target()