Lines Matching refs:crtc
80 if (old_plane_state->crtc) { in drm_atomic_helper_plane_changed()
82 old_plane_state->crtc); in drm_atomic_helper_plane_changed()
90 if (plane_state->crtc) { in drm_atomic_helper_plane_changed()
91 crtc_state = drm_atomic_get_new_crtc_state(state, plane_state->crtc); in drm_atomic_helper_plane_changed()
130 if (!new_conn_state->crtc) in handle_conflicting_encoders()
181 connector->state->crtc->base.id, in handle_conflicting_encoders()
182 connector->state->crtc->name, in handle_conflicting_encoders()
196 new_conn_state->crtc->base.id, new_conn_state->crtc->name, in handle_conflicting_encoders()
199 crtc_state = drm_atomic_get_new_crtc_state(state, new_conn_state->crtc); in handle_conflicting_encoders()
226 struct drm_crtc *crtc; in set_best_encoder() local
230 crtc = conn_state->connector->state->crtc; in set_best_encoder()
238 WARN_ON(!crtc && encoder != conn_state->best_encoder); in set_best_encoder()
239 if (crtc) { in set_best_encoder()
240 crtc_state = drm_atomic_get_new_crtc_state(state, crtc); in set_best_encoder()
248 crtc = conn_state->crtc; in set_best_encoder()
249 WARN_ON(!crtc); in set_best_encoder()
250 if (crtc) { in set_best_encoder()
251 crtc_state = drm_atomic_get_new_crtc_state(state, crtc); in set_best_encoder()
276 encoder_crtc = old_connector_state->crtc; in steal_encoder()
305 if (old_connector_state->crtc != new_connector_state->crtc) { in update_connector_routing()
306 if (old_connector_state->crtc) { in update_connector_routing()
307 crtc_state = drm_atomic_get_new_crtc_state(state, old_connector_state->crtc); in update_connector_routing()
311 if (new_connector_state->crtc) { in update_connector_routing()
312 crtc_state = drm_atomic_get_new_crtc_state(state, new_connector_state->crtc); in update_connector_routing()
317 if (!new_connector_state->crtc) { in update_connector_routing()
328 new_connector_state->crtc); in update_connector_routing()
371 if (!drm_encoder_crtc_ok(new_encoder, new_connector_state->crtc)) { in update_connector_routing()
375 new_connector_state->crtc->base.id, in update_connector_routing()
376 new_connector_state->crtc->name); in update_connector_routing()
388 new_connector_state->crtc->base.id, in update_connector_routing()
389 new_connector_state->crtc->name); in update_connector_routing()
405 new_connector_state->crtc->base.id, in update_connector_routing()
406 new_connector_state->crtc->name); in update_connector_routing()
414 struct drm_crtc *crtc; in mode_fixup() local
421 for_each_new_crtc_in_state(state, crtc, new_crtc_state, i) { in mode_fixup()
433 WARN_ON(!!new_conn_state->best_encoder != !!new_conn_state->crtc); in mode_fixup()
435 if (!new_conn_state->crtc || !new_conn_state->best_encoder) in mode_fixup()
439 drm_atomic_get_new_crtc_state(state, new_conn_state->crtc); in mode_fixup()
474 for_each_new_crtc_in_state(state, crtc, new_crtc_state, i) { in mode_fixup()
484 funcs = crtc->helper_private; in mode_fixup()
488 ret = funcs->mode_fixup(crtc, &new_crtc_state->mode, in mode_fixup()
492 crtc->base.id, crtc->name); in mode_fixup()
502 struct drm_crtc *crtc, in mode_valid_path() argument
520 ret = drm_crtc_mode_valid(crtc, mode); in mode_valid_path()
523 crtc->base.id, crtc->name); in mode_valid_path()
539 struct drm_crtc *crtc = conn_state->crtc; in mode_valid() local
544 if (!crtc || !encoder) in mode_valid()
547 crtc_state = drm_atomic_get_new_crtc_state(state, crtc); in mode_valid()
555 mode_status = mode_valid_path(connector, encoder, crtc, mode); in mode_valid()
610 struct drm_crtc *crtc; in drm_atomic_helper_check_modeset() local
617 for_each_oldnew_crtc_in_state(state, crtc, old_crtc_state, new_crtc_state, i) { in drm_atomic_helper_check_modeset()
621 WARN_ON(!drm_modeset_is_locked(&crtc->mutex)); in drm_atomic_helper_check_modeset()
625 crtc->base.id, crtc->name); in drm_atomic_helper_check_modeset()
631 crtc->base.id, crtc->name); in drm_atomic_helper_check_modeset()
647 crtc->base.id, crtc->name); in drm_atomic_helper_check_modeset()
653 crtc->base.id, crtc->name); in drm_atomic_helper_check_modeset()
678 if (old_connector_state->crtc) { in drm_atomic_helper_check_modeset()
680 old_connector_state->crtc); in drm_atomic_helper_check_modeset()
704 for_each_oldnew_crtc_in_state(state, crtc, old_crtc_state, new_crtc_state, i) { in drm_atomic_helper_check_modeset()
709 crtc->base.id, crtc->name, in drm_atomic_helper_check_modeset()
713 ret = drm_atomic_add_affected_connectors(state, crtc); in drm_atomic_helper_check_modeset()
717 ret = drm_atomic_add_affected_planes(state, crtc); in drm_atomic_helper_check_modeset()
781 WARN_ON(plane_state->crtc && plane_state->crtc != crtc_state->crtc); in drm_atomic_helper_check_plane_state()
792 if (WARN_ON(!plane_state->crtc)) { in drm_atomic_helper_check_plane_state()
862 struct drm_crtc *crtc; in drm_atomic_helper_check_planes() local
890 for_each_new_crtc_in_state(state, crtc, new_crtc_state, i) { in drm_atomic_helper_check_planes()
893 funcs = crtc->helper_private; in drm_atomic_helper_check_planes()
898 ret = funcs->atomic_check(crtc, new_crtc_state); in drm_atomic_helper_check_planes()
901 crtc->base.id, crtc->name); in drm_atomic_helper_check_planes()
990 struct drm_crtc *crtc; in disable_outputs() local
1000 if (!old_conn_state->crtc) in disable_outputs()
1003 old_crtc_state = drm_atomic_get_old_crtc_state(old_state, old_conn_state->crtc); in disable_outputs()
1005 if (new_conn_state->crtc) in disable_outputs()
1008 new_conn_state->crtc); in disable_outputs()
1013 !drm_atomic_crtc_needs_modeset(old_conn_state->crtc->state)) in disable_outputs()
1039 else if (new_conn_state->crtc && funcs->prepare) in disable_outputs()
1050 for_each_oldnew_crtc_in_state(old_state, crtc, old_crtc_state, new_crtc_state, i) { in disable_outputs()
1061 funcs = crtc->helper_private; in disable_outputs()
1064 crtc->base.id, crtc->name); in disable_outputs()
1069 funcs->prepare(crtc); in disable_outputs()
1071 funcs->atomic_disable(crtc, old_crtc_state); in disable_outputs()
1073 funcs->disable(crtc); in disable_outputs()
1075 funcs->dpms(crtc, DRM_MODE_DPMS_OFF); in disable_outputs()
1080 ret = drm_crtc_vblank_get(crtc); in disable_outputs()
1083 drm_crtc_vblank_put(crtc); in disable_outputs()
1112 struct drm_crtc *crtc; in drm_atomic_helper_update_legacy_modeset_state() local
1119 WARN_ON(!connector->encoder->crtc); in drm_atomic_helper_update_legacy_modeset_state()
1121 connector->encoder->crtc = NULL; in drm_atomic_helper_update_legacy_modeset_state()
1125 crtc = new_conn_state->crtc; in drm_atomic_helper_update_legacy_modeset_state()
1126 if ((!crtc && old_conn_state->crtc) || in drm_atomic_helper_update_legacy_modeset_state()
1127 (crtc && drm_atomic_crtc_needs_modeset(crtc->state))) { in drm_atomic_helper_update_legacy_modeset_state()
1130 if (crtc && crtc->state->active) in drm_atomic_helper_update_legacy_modeset_state()
1139 if (!new_conn_state->crtc) in drm_atomic_helper_update_legacy_modeset_state()
1146 connector->encoder->crtc = new_conn_state->crtc; in drm_atomic_helper_update_legacy_modeset_state()
1150 for_each_new_crtc_in_state(old_state, crtc, new_crtc_state, i) { in drm_atomic_helper_update_legacy_modeset_state()
1151 struct drm_plane *primary = crtc->primary; in drm_atomic_helper_update_legacy_modeset_state()
1154 crtc->mode = new_crtc_state->mode; in drm_atomic_helper_update_legacy_modeset_state()
1155 crtc->enabled = new_crtc_state->enable; in drm_atomic_helper_update_legacy_modeset_state()
1160 if (new_plane_state && new_plane_state->crtc == crtc) { in drm_atomic_helper_update_legacy_modeset_state()
1161 crtc->x = new_plane_state->src_x >> 16; in drm_atomic_helper_update_legacy_modeset_state()
1162 crtc->y = new_plane_state->src_y >> 16; in drm_atomic_helper_update_legacy_modeset_state()
1166 drm_calc_timestamping_constants(crtc, in drm_atomic_helper_update_legacy_modeset_state()
1175 struct drm_crtc *crtc; in crtc_set_mode() local
1181 for_each_new_crtc_in_state(old_state, crtc, new_crtc_state, i) { in crtc_set_mode()
1187 funcs = crtc->helper_private; in crtc_set_mode()
1191 crtc->base.id, crtc->name); in crtc_set_mode()
1193 funcs->mode_set_nofb(crtc); in crtc_set_mode()
1207 new_crtc_state = new_conn_state->crtc->state; in crtc_set_mode()
1295 struct drm_crtc *crtc; in drm_atomic_helper_commit_modeset_enables() local
1302 for_each_oldnew_crtc_in_state(old_state, crtc, old_crtc_state, new_crtc_state, i) { in drm_atomic_helper_commit_modeset_enables()
1312 funcs = crtc->helper_private; in drm_atomic_helper_commit_modeset_enables()
1316 crtc->base.id, crtc->name); in drm_atomic_helper_commit_modeset_enables()
1318 funcs->atomic_enable(crtc, old_crtc_state); in drm_atomic_helper_commit_modeset_enables()
1320 funcs->commit(crtc); in drm_atomic_helper_commit_modeset_enables()
1331 if (!new_conn_state->crtc->state->active || in drm_atomic_helper_commit_modeset_enables()
1332 !drm_atomic_crtc_needs_modeset(new_conn_state->crtc->state)) in drm_atomic_helper_commit_modeset_enables()
1434 struct drm_crtc *crtc; in drm_atomic_helper_wait_for_vblanks() local
1446 for_each_oldnew_crtc_in_state(old_state, crtc, old_crtc_state, new_crtc_state, i) { in drm_atomic_helper_wait_for_vblanks()
1450 ret = drm_crtc_vblank_get(crtc); in drm_atomic_helper_wait_for_vblanks()
1454 crtc_mask |= drm_crtc_mask(crtc); in drm_atomic_helper_wait_for_vblanks()
1455 old_state->crtcs[i].last_vblank_count = drm_crtc_vblank_count(crtc); in drm_atomic_helper_wait_for_vblanks()
1458 for_each_old_crtc_in_state(old_state, crtc, old_crtc_state, i) { in drm_atomic_helper_wait_for_vblanks()
1459 if (!(crtc_mask & drm_crtc_mask(crtc))) in drm_atomic_helper_wait_for_vblanks()
1464 drm_crtc_vblank_count(crtc), in drm_atomic_helper_wait_for_vblanks()
1468 crtc->base.id, crtc->name); in drm_atomic_helper_wait_for_vblanks()
1470 drm_crtc_vblank_put(crtc); in drm_atomic_helper_wait_for_vblanks()
1493 struct drm_crtc *crtc; in drm_atomic_helper_wait_for_flip_done() local
1500 crtc = old_state->crtcs[i].ptr; in drm_atomic_helper_wait_for_flip_done()
1502 if (!crtc || !commit) in drm_atomic_helper_wait_for_flip_done()
1508 crtc->base.id, crtc->name); in drm_atomic_helper_wait_for_flip_done()
1585 struct drm_crtc *crtc; in commit_tail() local
1613 for_each_new_crtc_in_state(old_state, crtc, new_crtc_state, i) in commit_tail()
1657 struct drm_crtc *crtc; in drm_atomic_helper_async_check() local
1665 for_each_new_crtc_in_state(state, crtc, crtc_state, i) { in drm_atomic_helper_async_check()
1677 if (!new_plane_state->crtc || in drm_atomic_helper_async_check()
1678 old_plane_state->crtc != new_plane_state->crtc) in drm_atomic_helper_async_check()
1885 static int stall_checks(struct drm_crtc *crtc, bool nonblock) in stall_checks() argument
1892 spin_lock(&crtc->commit_lock); in stall_checks()
1894 list_for_each_entry(commit, &crtc->commit_list, commit_entry) { in stall_checks()
1900 spin_unlock(&crtc->commit_lock); in stall_checks()
1910 spin_unlock(&crtc->commit_lock); in stall_checks()
1922 crtc->base.id, crtc->name); in stall_checks()
1938 static void init_commit(struct drm_crtc_commit *commit, struct drm_crtc *crtc) in init_commit() argument
1945 commit->crtc = crtc; in init_commit()
1949 crtc_or_fake_commit(struct drm_atomic_state *state, struct drm_crtc *crtc) in crtc_or_fake_commit() argument
1951 if (crtc) { in crtc_or_fake_commit()
1954 new_crtc_state = drm_atomic_get_new_crtc_state(state, crtc); in crtc_or_fake_commit()
2016 struct drm_crtc *crtc; in drm_atomic_helper_setup_commit() local
2025 for_each_oldnew_crtc_in_state(state, crtc, old_crtc_state, new_crtc_state, i) { in drm_atomic_helper_setup_commit()
2030 init_commit(commit, crtc); in drm_atomic_helper_setup_commit()
2034 ret = stall_checks(crtc, nonblock); in drm_atomic_helper_setup_commit()
2079 commit = crtc_or_fake_commit(state, new_conn_state->crtc ?: old_conn_state->crtc); in drm_atomic_helper_setup_commit()
2094 commit = crtc_or_fake_commit(state, new_plane_state->crtc ?: old_plane_state->crtc); in drm_atomic_helper_setup_commit()
2119 struct drm_crtc *crtc; in drm_atomic_helper_wait_for_dependencies() local
2129 for_each_old_crtc_in_state(old_state, crtc, old_crtc_state, i) { in drm_atomic_helper_wait_for_dependencies()
2139 crtc->base.id, crtc->name); in drm_atomic_helper_wait_for_dependencies()
2147 crtc->base.id, crtc->name); in drm_atomic_helper_wait_for_dependencies()
2213 struct drm_crtc *crtc; in drm_atomic_helper_fake_vblank() local
2216 for_each_new_crtc_in_state(old_state, crtc, new_crtc_state, i) { in drm_atomic_helper_fake_vblank()
2224 drm_crtc_send_vblank_event(crtc, in drm_atomic_helper_fake_vblank()
2250 struct drm_crtc *crtc; in drm_atomic_helper_commit_hw_done() local
2255 for_each_oldnew_crtc_in_state(old_state, crtc, old_crtc_state, new_crtc_state, i) { in drm_atomic_helper_commit_hw_done()
2295 struct drm_crtc *crtc; in drm_atomic_helper_commit_cleanup_done() local
2300 for_each_old_crtc_in_state(old_state, crtc, old_crtc_state, i) { in drm_atomic_helper_commit_cleanup_done()
2308 spin_lock(&crtc->commit_lock); in drm_atomic_helper_commit_cleanup_done()
2310 spin_unlock(&crtc->commit_lock); in drm_atomic_helper_commit_cleanup_done()
2384 return state->crtc && state->crtc->state->active; in plane_crtc_active()
2432 struct drm_crtc *crtc; in drm_atomic_helper_commit_planes() local
2440 for_each_oldnew_crtc_in_state(old_state, crtc, old_crtc_state, new_crtc_state, i) { in drm_atomic_helper_commit_planes()
2443 funcs = crtc->helper_private; in drm_atomic_helper_commit_planes()
2451 funcs->atomic_begin(crtc, old_crtc_state); in drm_atomic_helper_commit_planes()
2486 crtc_state = old_plane_state->crtc->state; in drm_atomic_helper_commit_planes()
2493 } else if (new_plane_state->crtc || disabling) { in drm_atomic_helper_commit_planes()
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_flush(crtc, old_crtc_state); in drm_atomic_helper_commit_planes()
2535 struct drm_crtc *crtc = old_crtc_state->crtc; in drm_atomic_helper_commit_planes_on_crtc() local
2538 drm_atomic_get_new_crtc_state(old_state, crtc); in drm_atomic_helper_commit_planes_on_crtc()
2545 crtc_funcs = crtc->helper_private; in drm_atomic_helper_commit_planes_on_crtc()
2547 crtc_funcs->atomic_begin(crtc, old_crtc_state); in drm_atomic_helper_commit_planes_on_crtc()
2549 drm_for_each_plane_mask(plane, crtc->dev, plane_mask) { in drm_atomic_helper_commit_planes_on_crtc()
2561 WARN_ON(new_plane_state->crtc && in drm_atomic_helper_commit_planes_on_crtc()
2562 new_plane_state->crtc != crtc); in drm_atomic_helper_commit_planes_on_crtc()
2567 else if (new_plane_state->crtc || in drm_atomic_helper_commit_planes_on_crtc()
2573 crtc_funcs->atomic_flush(crtc, old_crtc_state); in drm_atomic_helper_commit_planes_on_crtc()
2597 struct drm_crtc *crtc = old_crtc_state->crtc; in drm_atomic_helper_disable_planes_on_crtc() local
2599 crtc->helper_private; in drm_atomic_helper_disable_planes_on_crtc()
2603 crtc_funcs->atomic_begin(crtc, NULL); in drm_atomic_helper_disable_planes_on_crtc()
2618 crtc_funcs->atomic_flush(crtc, NULL); in drm_atomic_helper_disable_planes_on_crtc()
2703 struct drm_crtc *crtc; in drm_atomic_helper_swap_state() local
2721 for_each_old_crtc_in_state(state, crtc, old_crtc_state, i) { in drm_atomic_helper_swap_state()
2765 for_each_oldnew_crtc_in_state(state, crtc, old_crtc_state, new_crtc_state, i) { in drm_atomic_helper_swap_state()
2766 WARN_ON(crtc->state != old_crtc_state); in drm_atomic_helper_swap_state()
2772 crtc->state = new_crtc_state; in drm_atomic_helper_swap_state()
2775 spin_lock(&crtc->commit_lock); in drm_atomic_helper_swap_state()
2777 &crtc->commit_list); in drm_atomic_helper_swap_state()
2778 spin_unlock(&crtc->commit_lock); in drm_atomic_helper_swap_state()
2829 struct drm_crtc *crtc, in drm_atomic_helper_update_plane() argument
2852 ret = drm_atomic_set_crtc_for_plane(plane_state, crtc); in drm_atomic_helper_update_plane()
2865 if (plane == crtc->cursor) in drm_atomic_helper_update_plane()
2903 if (plane_state->crtc && plane_state->crtc->cursor == plane) in drm_atomic_helper_disable_plane()
2937 struct drm_crtc *crtc = set->crtc; in drm_atomic_helper_set_config() local
2940 state = drm_atomic_state_alloc(crtc->dev); in drm_atomic_helper_set_config()
2993 struct drm_crtc *crtc; in drm_atomic_helper_disable_all() local
3002 drm_for_each_crtc(crtc, dev) { in drm_atomic_helper_disable_all()
3003 crtc_state = drm_atomic_get_crtc_state(state, crtc); in drm_atomic_helper_disable_all()
3015 ret = drm_atomic_add_affected_planes(state, crtc); in drm_atomic_helper_disable_all()
3019 ret = drm_atomic_add_affected_connectors(state, crtc); in drm_atomic_helper_disable_all()
3103 struct drm_crtc *crtc; in drm_atomic_helper_duplicate_state() local
3113 drm_for_each_crtc(crtc, dev) { in drm_atomic_helper_duplicate_state()
3116 crtc_state = drm_atomic_get_crtc_state(state, crtc); in drm_atomic_helper_duplicate_state()
3238 struct drm_crtc *crtc; in drm_atomic_helper_commit_duplicated_state() local
3246 for_each_new_crtc_in_state(state, crtc, new_crtc_state, i) in drm_atomic_helper_commit_duplicated_state()
3247 state->crtcs[i].old_state = crtc->state; in drm_atomic_helper_commit_duplicated_state()
3296 struct drm_crtc *crtc, in page_flip_common() argument
3301 struct drm_plane *plane = crtc->primary; in page_flip_common()
3306 crtc_state = drm_atomic_get_crtc_state(state, crtc); in page_flip_common()
3317 ret = drm_atomic_set_crtc_for_plane(plane_state, crtc); in page_flip_common()
3326 crtc->base.id, crtc->name); in page_flip_common()
3350 int drm_atomic_helper_page_flip(struct drm_crtc *crtc, in drm_atomic_helper_page_flip() argument
3356 struct drm_plane *plane = crtc->primary; in drm_atomic_helper_page_flip()
3366 ret = page_flip_common(state, crtc, fb, event, flags); in drm_atomic_helper_page_flip()
3393 int drm_atomic_helper_page_flip_target(struct drm_crtc *crtc, in drm_atomic_helper_page_flip_target() argument
3400 struct drm_plane *plane = crtc->primary; in drm_atomic_helper_page_flip_target()
3411 ret = page_flip_common(state, crtc, fb, event, flags); in drm_atomic_helper_page_flip_target()
3415 crtc_state = drm_atomic_get_new_crtc_state(state, crtc); in drm_atomic_helper_page_flip_target()
3443 int drm_atomic_helper_legacy_gamma_set(struct drm_crtc *crtc, in drm_atomic_helper_legacy_gamma_set() argument
3448 struct drm_device *dev = crtc->dev; in drm_atomic_helper_legacy_gamma_set()
3456 state = drm_atomic_state_alloc(crtc->dev); in drm_atomic_helper_legacy_gamma_set()
3478 crtc_state = drm_atomic_get_crtc_state(state, crtc); in drm_atomic_helper_legacy_gamma_set()