Lines Matching refs:crtc
63 if (plane->state->crtc) { in drm_atomic_helper_plane_changed()
64 crtc_state = state->crtc_states[drm_crtc_index(plane->state->crtc)]; in drm_atomic_helper_plane_changed()
72 if (plane_state->crtc) { in drm_atomic_helper_plane_changed()
74 state->crtc_states[drm_crtc_index(plane_state->crtc)]; in drm_atomic_helper_plane_changed()
96 return connector->state->crtc; in get_current_crtc_for_encoder()
172 if (connector->state->crtc != connector_state->crtc) { in update_connector_routing()
173 if (connector->state->crtc) { in update_connector_routing()
174 idx = drm_crtc_index(connector->state->crtc); in update_connector_routing()
180 if (connector_state->crtc) { in update_connector_routing()
181 idx = drm_crtc_index(connector_state->crtc); in update_connector_routing()
188 if (!connector_state->crtc) { in update_connector_routing()
214 connector_state->crtc->base.id); in update_connector_routing()
233 idx = drm_crtc_index(connector_state->crtc); in update_connector_routing()
243 connector_state->crtc->base.id); in update_connector_routing()
251 struct drm_crtc *crtc; in mode_fixup() local
258 for_each_crtc_in_state(state, crtc, crtc_state, i) { in mode_fixup()
269 WARN_ON(!!conn_state->best_encoder != !!conn_state->crtc); in mode_fixup()
271 if (!conn_state->crtc || !conn_state->best_encoder) in mode_fixup()
275 state->crtc_states[drm_crtc_index(conn_state->crtc)]; in mode_fixup()
313 for_each_crtc_in_state(state, crtc, crtc_state, i) { in mode_fixup()
319 funcs = crtc->helper_private; in mode_fixup()
320 ret = funcs->mode_fixup(crtc, &crtc_state->mode, in mode_fixup()
324 crtc->base.id); in mode_fixup()
364 struct drm_crtc *crtc; in drm_atomic_helper_check_modeset() local
370 for_each_crtc_in_state(state, crtc, crtc_state, i) { in drm_atomic_helper_check_modeset()
371 if (!drm_mode_equal(&crtc->state->mode, &crtc_state->mode)) { in drm_atomic_helper_check_modeset()
373 crtc->base.id); in drm_atomic_helper_check_modeset()
377 if (crtc->state->enable != crtc_state->enable) { in drm_atomic_helper_check_modeset()
379 crtc->base.id); in drm_atomic_helper_check_modeset()
401 for_each_crtc_in_state(state, crtc, crtc_state, i) { in drm_atomic_helper_check_modeset()
409 if (crtc->state->active != crtc_state->active) { in drm_atomic_helper_check_modeset()
411 crtc->base.id); in drm_atomic_helper_check_modeset()
419 crtc->base.id, in drm_atomic_helper_check_modeset()
423 ret = drm_atomic_add_affected_connectors(state, crtc); in drm_atomic_helper_check_modeset()
428 crtc); in drm_atomic_helper_check_modeset()
432 crtc->base.id); in drm_atomic_helper_check_modeset()
458 struct drm_crtc *crtc; in drm_atomic_helper_check_planes() local
482 for_each_crtc_in_state(state, crtc, crtc_state, i) { in drm_atomic_helper_check_planes()
485 funcs = crtc->helper_private; in drm_atomic_helper_check_planes()
490 ret = funcs->atomic_check(crtc, state->crtc_states[i]); in drm_atomic_helper_check_planes()
493 crtc->base.id); in drm_atomic_helper_check_planes()
544 struct drm_crtc *crtc; in disable_outputs() local
555 if (!old_conn_state->crtc) in disable_outputs()
558 old_crtc_state = old_state->crtc_states[drm_crtc_index(old_conn_state->crtc)]; in disable_outputs()
561 !needs_modeset(old_conn_state->crtc->state)) in disable_outputs()
585 if (connector->state->crtc && funcs->prepare) in disable_outputs()
596 for_each_crtc_in_state(old_state, crtc, old_crtc_state, i) { in disable_outputs()
600 if (!needs_modeset(crtc->state)) in disable_outputs()
606 funcs = crtc->helper_private; in disable_outputs()
609 crtc->base.id); in disable_outputs()
613 if (crtc->state->enable && funcs->prepare) in disable_outputs()
614 funcs->prepare(crtc); in disable_outputs()
616 funcs->disable(crtc); in disable_outputs()
618 funcs->dpms(crtc, DRM_MODE_DPMS_OFF); in disable_outputs()
627 struct drm_crtc *crtc; in set_routing_links() local
636 WARN_ON(!connector->encoder->crtc); in set_routing_links()
638 connector->encoder->crtc = NULL; in set_routing_links()
644 if (!connector->state->crtc) in set_routing_links()
651 connector->encoder->crtc = connector->state->crtc; in set_routing_links()
655 for_each_crtc_in_state(old_state, crtc, old_crtc_state, i) { in set_routing_links()
656 crtc->mode = crtc->state->mode; in set_routing_links()
657 crtc->enabled = crtc->state->enable; in set_routing_links()
658 crtc->x = crtc->primary->state->src_x >> 16; in set_routing_links()
659 crtc->y = crtc->primary->state->src_y >> 16; in set_routing_links()
666 struct drm_crtc *crtc; in crtc_set_mode() local
672 for_each_crtc_in_state(old_state, crtc, old_crtc_state, i) { in crtc_set_mode()
675 if (!crtc->state->mode_changed) in crtc_set_mode()
678 funcs = crtc->helper_private; in crtc_set_mode()
680 if (crtc->state->enable && funcs->mode_set_nofb) { in crtc_set_mode()
682 crtc->base.id); in crtc_set_mode()
684 funcs->mode_set_nofb(crtc); in crtc_set_mode()
699 new_crtc_state = connector->state->crtc->state; in crtc_set_mode()
762 struct drm_crtc *crtc; in drm_atomic_helper_commit_modeset_enables() local
768 for_each_crtc_in_state(old_state, crtc, old_crtc_state, i) { in drm_atomic_helper_commit_modeset_enables()
772 if (!needs_modeset(crtc->state)) in drm_atomic_helper_commit_modeset_enables()
775 if (!crtc->state->active) in drm_atomic_helper_commit_modeset_enables()
778 funcs = crtc->helper_private; in drm_atomic_helper_commit_modeset_enables()
780 if (crtc->state->enable) { in drm_atomic_helper_commit_modeset_enables()
782 crtc->base.id); in drm_atomic_helper_commit_modeset_enables()
785 funcs->enable(crtc); in drm_atomic_helper_commit_modeset_enables()
787 funcs->commit(crtc); in drm_atomic_helper_commit_modeset_enables()
798 if (!connector->state->crtc->state->active || in drm_atomic_helper_commit_modeset_enables()
799 !needs_modeset(connector->state->crtc->state)) in drm_atomic_helper_commit_modeset_enables()
847 struct drm_crtc *crtc) in framebuffer_changed() argument
854 if (plane->state->crtc != crtc && in framebuffer_changed()
855 old_plane_state->crtc != crtc) in framebuffer_changed()
880 struct drm_crtc *crtc; in drm_atomic_helper_wait_for_vblanks() local
884 for_each_crtc_in_state(old_state, crtc, old_crtc_state, i) { in drm_atomic_helper_wait_for_vblanks()
890 if (!crtc->state->enable) in drm_atomic_helper_wait_for_vblanks()
898 if (!framebuffer_changed(dev, old_state, crtc)) in drm_atomic_helper_wait_for_vblanks()
901 ret = drm_crtc_vblank_get(crtc); in drm_atomic_helper_wait_for_vblanks()
909 for_each_crtc_in_state(old_state, crtc, old_crtc_state, i) { in drm_atomic_helper_wait_for_vblanks()
918 drm_crtc_vblank_put(crtc); in drm_atomic_helper_wait_for_vblanks()
1108 struct drm_crtc *crtc; in drm_atomic_helper_commit_planes() local
1114 for_each_crtc_in_state(old_state, crtc, old_crtc_state, i) { in drm_atomic_helper_commit_planes()
1117 funcs = crtc->helper_private; in drm_atomic_helper_commit_planes()
1122 funcs->atomic_begin(crtc); in drm_atomic_helper_commit_planes()
1145 for_each_crtc_in_state(old_state, crtc, old_crtc_state, i) { in drm_atomic_helper_commit_planes()
1148 funcs = crtc->helper_private; in drm_atomic_helper_commit_planes()
1153 funcs->atomic_flush(crtc); in drm_atomic_helper_commit_planes()
1233 struct drm_crtc *crtc = state->crtcs[i]; in drm_atomic_helper_swap_state() local
1235 if (!crtc) in drm_atomic_helper_swap_state()
1238 crtc->state->state = state; in drm_atomic_helper_swap_state()
1239 swap(state->crtc_states[i], crtc->state); in drm_atomic_helper_swap_state()
1240 crtc->state->state = NULL; in drm_atomic_helper_swap_state()
1276 struct drm_crtc *crtc, in drm_atomic_helper_update_plane() argument
1291 state->acquire_ctx = drm_modeset_legacy_acquire_ctx(crtc); in drm_atomic_helper_update_plane()
1299 ret = drm_atomic_set_crtc_for_plane(plane_state, crtc); in drm_atomic_helper_update_plane()
1316 if (plane == crtc->cursor) in drm_atomic_helper_update_plane()
1366 if (!plane->crtc) in drm_atomic_helper_disable_plane()
1373 state->acquire_ctx = drm_modeset_legacy_acquire_ctx(plane->crtc); in drm_atomic_helper_disable_plane()
1394 if (plane == plane->crtc->cursor) in drm_atomic_helper_disable_plane()
1428 struct drm_device *dev = set->crtc->dev; in update_output_state()
1429 struct drm_crtc *crtc; in update_output_state() local
1448 for_each_crtc_in_state(state, crtc, crtc_state, i) { in update_output_state()
1449 ret = drm_atomic_add_affected_connectors(state, crtc); in update_output_state()
1456 if (conn_state->crtc == set->crtc) { in update_output_state()
1466 set->crtc); in update_output_state()
1474 for_each_crtc_in_state(state, crtc, crtc_state, i) { in update_output_state()
1479 if (crtc == set->crtc) in update_output_state()
1483 drm_atomic_connectors_for_crtc(state, crtc); in update_output_state()
1501 struct drm_crtc *crtc = set->crtc; in drm_atomic_helper_set_config() local
1506 state = drm_atomic_state_alloc(crtc->dev); in drm_atomic_helper_set_config()
1510 state->acquire_ctx = drm_modeset_legacy_acquire_ctx(crtc); in drm_atomic_helper_set_config()
1512 crtc_state = drm_atomic_get_crtc_state(state, crtc); in drm_atomic_helper_set_config()
1518 primary_state = drm_atomic_get_plane_state(state, crtc->primary); in drm_atomic_helper_set_config()
1547 ret = drm_atomic_set_crtc_for_plane(primary_state, crtc); in drm_atomic_helper_set_config()
1587 crtc->primary->old_fb = crtc->primary->fb; in drm_atomic_helper_set_config()
1606 drm_atomic_helper_crtc_set_property(struct drm_crtc *crtc, in drm_atomic_helper_crtc_set_property() argument
1614 state = drm_atomic_state_alloc(crtc->dev); in drm_atomic_helper_crtc_set_property()
1619 state->acquire_ctx = crtc->dev->mode_config.acquire_ctx; in drm_atomic_helper_crtc_set_property()
1621 crtc_state = drm_atomic_get_crtc_state(state, crtc); in drm_atomic_helper_crtc_set_property()
1627 ret = drm_atomic_crtc_set_property(crtc, crtc_state, in drm_atomic_helper_crtc_set_property()
1789 int drm_atomic_helper_page_flip(struct drm_crtc *crtc, in drm_atomic_helper_page_flip() argument
1794 struct drm_plane *plane = crtc->primary; in drm_atomic_helper_page_flip()
1807 state->acquire_ctx = drm_modeset_legacy_acquire_ctx(crtc); in drm_atomic_helper_page_flip()
1809 crtc_state = drm_atomic_get_crtc_state(state, crtc); in drm_atomic_helper_page_flip()
1822 ret = drm_atomic_set_crtc_for_plane(plane_state, crtc); in drm_atomic_helper_page_flip()
1875 struct drm_crtc *crtc; in drm_atomic_helper_connector_dpms() local
1884 crtc = connector->state->crtc; in drm_atomic_helper_connector_dpms()
1886 if (!crtc) in drm_atomic_helper_connector_dpms()
1894 state->acquire_ctx = drm_modeset_legacy_acquire_ctx(crtc); in drm_atomic_helper_connector_dpms()
1896 crtc_state = drm_atomic_get_crtc_state(state, crtc); in drm_atomic_helper_connector_dpms()
1903 if (tmp_connector->state->crtc != crtc) in drm_atomic_helper_connector_dpms()
1958 void drm_atomic_helper_crtc_reset(struct drm_crtc *crtc) in drm_atomic_helper_crtc_reset() argument
1960 kfree(crtc->state); in drm_atomic_helper_crtc_reset()
1961 crtc->state = kzalloc(sizeof(*crtc->state), GFP_KERNEL); in drm_atomic_helper_crtc_reset()
1963 if (crtc->state) in drm_atomic_helper_crtc_reset()
1964 crtc->state->crtc = crtc; in drm_atomic_helper_crtc_reset()
1976 void __drm_atomic_helper_crtc_duplicate_state(struct drm_crtc *crtc, in __drm_atomic_helper_crtc_duplicate_state() argument
1979 memcpy(state, crtc->state, sizeof(*state)); in __drm_atomic_helper_crtc_duplicate_state()
1996 drm_atomic_helper_crtc_duplicate_state(struct drm_crtc *crtc) in drm_atomic_helper_crtc_duplicate_state() argument
2000 if (WARN_ON(!crtc->state)) in drm_atomic_helper_crtc_duplicate_state()
2005 __drm_atomic_helper_crtc_duplicate_state(crtc, state); in drm_atomic_helper_crtc_duplicate_state()
2020 void __drm_atomic_helper_crtc_destroy_state(struct drm_crtc *crtc, in __drm_atomic_helper_crtc_destroy_state() argument
2039 void drm_atomic_helper_crtc_destroy_state(struct drm_crtc *crtc, in drm_atomic_helper_crtc_destroy_state() argument
2042 __drm_atomic_helper_crtc_destroy_state(crtc, state); in drm_atomic_helper_crtc_destroy_state()