Lines Matching refs:crtc
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()
172 connector->state->crtc->base.id, in handle_conflicting_encoders()
173 connector->state->crtc->name, 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
221 crtc = conn_state->connector->state->crtc; 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()
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()
366 new_connector_state->crtc->base.id, in update_connector_routing()
367 new_connector_state->crtc->name); 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()
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()
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()
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()
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, new_crtc_state); in drm_atomic_helper_check_planes()
924 crtc->base.id, crtc->name); in drm_atomic_helper_check_planes()
1004 old_state->crtc != new_state->crtc) 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()
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()
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()
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()
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()
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()
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()
1563 crtc->base.id, crtc->name); in drm_atomic_helper_wait_for_flip_done()
1640 struct drm_crtc *crtc; in commit_tail() local
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()
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()
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()
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()
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()
2206 crtc->base.id, crtc->name); 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()
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()
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()
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()
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()
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()
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()
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()
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()
3395 crtc->base.id, crtc->name); in page_flip_common()
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()
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()
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()