Lines Matching full:state
58 * @state: atomic state
64 void drm_atomic_state_default_release(struct drm_atomic_state *state) in drm_atomic_state_default_release() argument
66 kfree(state->connectors); in drm_atomic_state_default_release()
67 kfree(state->crtcs); in drm_atomic_state_default_release()
68 kfree(state->planes); in drm_atomic_state_default_release()
69 kfree(state->private_objs); in drm_atomic_state_default_release()
74 * drm_atomic_state_init - init new atomic state
76 * @state: atomic state
78 * Default implementation for filling in a new atomic state.
83 drm_atomic_state_init(struct drm_device *dev, struct drm_atomic_state *state) in drm_atomic_state_init() argument
85 kref_init(&state->ref); in drm_atomic_state_init()
90 state->allow_modeset = true; in drm_atomic_state_init()
92 state->crtcs = kcalloc(dev->mode_config.num_crtc, in drm_atomic_state_init()
93 sizeof(*state->crtcs), GFP_KERNEL); in drm_atomic_state_init()
94 if (!state->crtcs) in drm_atomic_state_init()
96 state->planes = kcalloc(dev->mode_config.num_total_plane, in drm_atomic_state_init()
97 sizeof(*state->planes), GFP_KERNEL); in drm_atomic_state_init()
98 if (!state->planes) in drm_atomic_state_init()
107 state->dev = dev; in drm_atomic_state_init()
109 DRM_DEBUG_ATOMIC("Allocated atomic state %p\n", state); in drm_atomic_state_init()
113 drm_atomic_state_default_release(state); in drm_atomic_state_init()
119 * drm_atomic_state_alloc - allocate atomic state
122 * This allocates an empty atomic state to track updates.
130 struct drm_atomic_state *state; in drm_atomic_state_alloc() local
132 state = kzalloc(sizeof(*state), GFP_KERNEL); in drm_atomic_state_alloc()
133 if (!state) in drm_atomic_state_alloc()
135 if (drm_atomic_state_init(dev, state) < 0) { in drm_atomic_state_alloc()
136 kfree(state); in drm_atomic_state_alloc()
139 return state; in drm_atomic_state_alloc()
147 * drm_atomic_state_default_clear - clear base atomic state
148 * @state: atomic state
150 * Default implementation for clearing atomic state.
154 void drm_atomic_state_default_clear(struct drm_atomic_state *state) in drm_atomic_state_default_clear() argument
156 struct drm_device *dev = state->dev; in drm_atomic_state_default_clear()
160 DRM_DEBUG_ATOMIC("Clearing atomic state %p\n", state); in drm_atomic_state_default_clear()
162 for (i = 0; i < state->num_connector; i++) { in drm_atomic_state_default_clear()
163 struct drm_connector *connector = state->connectors[i].ptr; in drm_atomic_state_default_clear()
169 state->connectors[i].state); in drm_atomic_state_default_clear()
170 state->connectors[i].ptr = NULL; in drm_atomic_state_default_clear()
171 state->connectors[i].state = NULL; in drm_atomic_state_default_clear()
172 state->connectors[i].old_state = NULL; in drm_atomic_state_default_clear()
173 state->connectors[i].new_state = NULL; in drm_atomic_state_default_clear()
178 struct drm_crtc *crtc = state->crtcs[i].ptr; in drm_atomic_state_default_clear()
184 state->crtcs[i].state); in drm_atomic_state_default_clear()
186 state->crtcs[i].ptr = NULL; in drm_atomic_state_default_clear()
187 state->crtcs[i].state = NULL; in drm_atomic_state_default_clear()
188 state->crtcs[i].old_state = NULL; in drm_atomic_state_default_clear()
189 state->crtcs[i].new_state = NULL; in drm_atomic_state_default_clear()
191 if (state->crtcs[i].commit) { in drm_atomic_state_default_clear()
192 drm_crtc_commit_put(state->crtcs[i].commit); in drm_atomic_state_default_clear()
193 state->crtcs[i].commit = NULL; in drm_atomic_state_default_clear()
198 struct drm_plane *plane = state->planes[i].ptr; in drm_atomic_state_default_clear()
204 state->planes[i].state); in drm_atomic_state_default_clear()
205 state->planes[i].ptr = NULL; in drm_atomic_state_default_clear()
206 state->planes[i].state = NULL; in drm_atomic_state_default_clear()
207 state->planes[i].old_state = NULL; in drm_atomic_state_default_clear()
208 state->planes[i].new_state = NULL; in drm_atomic_state_default_clear()
211 for (i = 0; i < state->num_private_objs; i++) { in drm_atomic_state_default_clear()
212 struct drm_private_obj *obj = state->private_objs[i].ptr; in drm_atomic_state_default_clear()
215 state->private_objs[i].state); in drm_atomic_state_default_clear()
216 state->private_objs[i].ptr = NULL; in drm_atomic_state_default_clear()
217 state->private_objs[i].state = NULL; in drm_atomic_state_default_clear()
218 state->private_objs[i].old_state = NULL; in drm_atomic_state_default_clear()
219 state->private_objs[i].new_state = NULL; in drm_atomic_state_default_clear()
221 state->num_private_objs = 0; in drm_atomic_state_default_clear()
223 if (state->fake_commit) { in drm_atomic_state_default_clear()
224 drm_crtc_commit_put(state->fake_commit); in drm_atomic_state_default_clear()
225 state->fake_commit = NULL; in drm_atomic_state_default_clear()
231 * drm_atomic_state_clear - clear state object
232 * @state: atomic state
236 * configuration. Which means that all the state assembled in @state is no
237 * longer an atomic update to the current state, but to some arbitrary earlier
238 * state. Which could break assumptions the driver's
241 * Hence we must clear all cached state and completely start over, using this
244 void drm_atomic_state_clear(struct drm_atomic_state *state) in drm_atomic_state_clear() argument
246 struct drm_device *dev = state->dev; in drm_atomic_state_clear()
250 config->funcs->atomic_state_clear(state); in drm_atomic_state_clear()
252 drm_atomic_state_default_clear(state); in drm_atomic_state_clear()
257 * __drm_atomic_state_free - free all memory for an atomic state
258 * @ref: This atomic state to deallocate
260 * This frees all memory associated with an atomic state, including all the
261 * per-object state for planes, CRTCs and connectors.
265 struct drm_atomic_state *state = container_of(ref, typeof(*state), ref); in __drm_atomic_state_free() local
266 struct drm_device *dev = state->dev; in __drm_atomic_state_free()
269 drm_atomic_state_clear(state); in __drm_atomic_state_free()
271 DRM_DEBUG_ATOMIC("Freeing atomic state %p\n", state); in __drm_atomic_state_free()
274 config->funcs->atomic_state_free(state); in __drm_atomic_state_free()
276 drm_atomic_state_default_release(state); in __drm_atomic_state_free()
277 kfree(state); in __drm_atomic_state_free()
285 * drm_atomic_get_crtc_state - get CRTC state
286 * @state: global atomic state object
287 * @crtc: CRTC to get state object for
289 * This function returns the CRTC state for the given CRTC, allocating it if
290 * needed. It will also grab the relevant CRTC lock to make sure that the state
295 * Either the allocated state or the error code encoded into the pointer. When
300 drm_atomic_get_crtc_state(struct drm_atomic_state *state, in drm_atomic_get_crtc_state() argument
306 WARN_ON(!state->acquire_ctx); in drm_atomic_get_crtc_state()
308 crtc_state = drm_atomic_get_existing_crtc_state(state, crtc); in drm_atomic_get_crtc_state()
312 ret = drm_modeset_lock(&crtc->mutex, state->acquire_ctx); in drm_atomic_get_crtc_state()
320 state->crtcs[index].state = crtc_state; in drm_atomic_get_crtc_state()
321 state->crtcs[index].old_state = crtc->state; in drm_atomic_get_crtc_state()
322 state->crtcs[index].new_state = crtc_state; in drm_atomic_get_crtc_state()
323 state->crtcs[index].ptr = crtc; in drm_atomic_get_crtc_state()
324 crtc_state->state = state; in drm_atomic_get_crtc_state()
326 DRM_DEBUG_ATOMIC("Added [CRTC:%d:%s] %p state to %p\n", in drm_atomic_get_crtc_state()
327 crtc->base.id, crtc->name, crtc_state, state); in drm_atomic_get_crtc_state()
343 * TODO: Add generic modeset state checks once we support those. in drm_atomic_crtc_check()
352 /* The state->enable vs. state->mode_blob checks can be WARN_ON, in drm_atomic_crtc_check()
390 const struct drm_crtc_state *state) in drm_atomic_crtc_print_state() argument
392 struct drm_crtc *crtc = state->crtc; in drm_atomic_crtc_print_state()
395 drm_printf(p, "\tenable=%d\n", state->enable); in drm_atomic_crtc_print_state()
396 drm_printf(p, "\tactive=%d\n", state->active); in drm_atomic_crtc_print_state()
397 drm_printf(p, "\tself_refresh_active=%d\n", state->self_refresh_active); in drm_atomic_crtc_print_state()
398 drm_printf(p, "\tplanes_changed=%d\n", state->planes_changed); in drm_atomic_crtc_print_state()
399 drm_printf(p, "\tmode_changed=%d\n", state->mode_changed); in drm_atomic_crtc_print_state()
400 drm_printf(p, "\tactive_changed=%d\n", state->active_changed); in drm_atomic_crtc_print_state()
401 drm_printf(p, "\tconnectors_changed=%d\n", state->connectors_changed); in drm_atomic_crtc_print_state()
402 drm_printf(p, "\tcolor_mgmt_changed=%d\n", state->color_mgmt_changed); in drm_atomic_crtc_print_state()
403 drm_printf(p, "\tplane_mask=%x\n", state->plane_mask); in drm_atomic_crtc_print_state()
404 drm_printf(p, "\tconnector_mask=%x\n", state->connector_mask); in drm_atomic_crtc_print_state()
405 drm_printf(p, "\tencoder_mask=%x\n", state->encoder_mask); in drm_atomic_crtc_print_state()
406 drm_printf(p, "\tmode: " DRM_MODE_FMT "\n", DRM_MODE_ARG(&state->mode)); in drm_atomic_crtc_print_state()
409 crtc->funcs->atomic_print_state(p, state); in drm_atomic_crtc_print_state()
413 struct drm_connector_state *state) in drm_atomic_connector_check() argument
416 struct drm_writeback_job *writeback_job = state->writeback_job; in drm_atomic_connector_check()
419 state->max_bpc = info->bpc ? info->bpc : 8; in drm_atomic_connector_check()
421 state->max_bpc = min(state->max_bpc, state->max_requested_bpc); in drm_atomic_connector_check()
426 if (writeback_job->fb && !state->crtc) { in drm_atomic_connector_check()
432 if (state->crtc) in drm_atomic_connector_check()
433 crtc_state = drm_atomic_get_existing_crtc_state(state->state, in drm_atomic_connector_check()
434 state->crtc); in drm_atomic_connector_check()
439 state->crtc->base.id); in drm_atomic_connector_check()
451 state->writeback_job = NULL; in drm_atomic_connector_check()
458 * drm_atomic_get_plane_state - get plane state
459 * @state: global atomic state object
460 * @plane: plane to get state object for
462 * This function returns the plane state for the given plane, allocating it if
463 * needed. It will also grab the relevant plane lock to make sure that the state
468 * Either the allocated state or the error code encoded into the pointer. When
473 drm_atomic_get_plane_state(struct drm_atomic_state *state, in drm_atomic_get_plane_state() argument
479 WARN_ON(!state->acquire_ctx); in drm_atomic_get_plane_state()
486 plane_state = drm_atomic_get_existing_plane_state(state, plane); in drm_atomic_get_plane_state()
490 ret = drm_modeset_lock(&plane->mutex, state->acquire_ctx); in drm_atomic_get_plane_state()
498 state->planes[index].state = plane_state; in drm_atomic_get_plane_state()
499 state->planes[index].ptr = plane; in drm_atomic_get_plane_state()
500 state->planes[index].old_state = plane->state; in drm_atomic_get_plane_state()
501 state->planes[index].new_state = plane_state; in drm_atomic_get_plane_state()
502 plane_state->state = state; in drm_atomic_get_plane_state()
504 DRM_DEBUG_ATOMIC("Added [PLANE:%d:%s] %p state to %p\n", in drm_atomic_get_plane_state()
505 plane->base.id, plane->name, plane_state, state); in drm_atomic_get_plane_state()
510 crtc_state = drm_atomic_get_crtc_state(state, in drm_atomic_get_plane_state()
533 * full OFF state. in plane_switching_crtc()
539 * drm_atomic_plane_check - check plane state
540 * @old_plane_state: old plane state to check
541 * @new_plane_state: new plane state to check
543 * Provides core sanity checks for plane state.
570 /* if disabled, we don't care about the rest of the state: */ in drm_atomic_plane_check()
661 const struct drm_plane_state *state) in drm_atomic_plane_print_state() argument
663 struct drm_plane *plane = state->plane; in drm_atomic_plane_print_state()
664 struct drm_rect src = drm_plane_state_src(state); in drm_atomic_plane_print_state()
665 struct drm_rect dest = drm_plane_state_dest(state); in drm_atomic_plane_print_state()
668 drm_printf(p, "\tcrtc=%s\n", state->crtc ? state->crtc->name : "(null)"); in drm_atomic_plane_print_state()
669 drm_printf(p, "\tfb=%u\n", state->fb ? state->fb->base.id : 0); in drm_atomic_plane_print_state()
670 if (state->fb) in drm_atomic_plane_print_state()
671 drm_framebuffer_print_info(p, 2, state->fb); in drm_atomic_plane_print_state()
674 drm_printf(p, "\trotation=%x\n", state->rotation); in drm_atomic_plane_print_state()
675 drm_printf(p, "\tnormalized-zpos=%x\n", state->normalized_zpos); in drm_atomic_plane_print_state()
677 drm_get_color_encoding_name(state->color_encoding)); in drm_atomic_plane_print_state()
679 drm_get_color_range_name(state->color_range)); in drm_atomic_plane_print_state()
682 plane->funcs->atomic_print_state(p, state); in drm_atomic_plane_print_state()
686 * DOC: handling driver private state
693 * objects. Drivers then need to do similar state tracking and commit ordering for
698 * driver private state objects using struct &drm_private_obj, with the
699 * associated state struct &drm_private_state.
701 * Similar to userspace-exposed objects, private state structures can be
704 * directly. Sequence of the actual hardware state commit is not handled,
709 * All private state structures contained in a &drm_atomic_state update can be
712 * Drivers are recommended to wrap these for each type of driver private state
716 * An earlier way to handle driver private state was by subclassing struct
719 * commit instead" of "duplicate state, check, then either commit or release
720 * duplicated state) it is deprecated in favour of using &drm_private_state.
727 * @state: initial private object state
732 * driver private object that needs its own atomic state.
737 struct drm_private_state *state, in drm_atomic_private_obj_init() argument
744 obj->state = state; in drm_atomic_private_obj_init()
760 obj->funcs->atomic_destroy_state(obj, obj->state); in drm_atomic_private_obj_fini()
766 * drm_atomic_get_private_obj_state - get private object state
767 * @state: global atomic state
768 * @obj: private object to get the state for
770 * This function returns the private object state for the given private object,
771 * allocating the state if needed. It will also grab the relevant private
772 * object lock to make sure that the state is consistent.
776 * Either the allocated state or the error code encoded into a pointer.
779 drm_atomic_get_private_obj_state(struct drm_atomic_state *state, in drm_atomic_get_private_obj_state() argument
787 for (i = 0; i < state->num_private_objs; i++) in drm_atomic_get_private_obj_state()
788 if (obj == state->private_objs[i].ptr) in drm_atomic_get_private_obj_state()
789 return state->private_objs[i].state; in drm_atomic_get_private_obj_state()
791 ret = drm_modeset_lock(&obj->lock, state->acquire_ctx); in drm_atomic_get_private_obj_state()
795 num_objs = state->num_private_objs + 1; in drm_atomic_get_private_obj_state()
796 size = sizeof(*state->private_objs) * num_objs; in drm_atomic_get_private_obj_state()
797 arr = krealloc(state->private_objs, size, GFP_KERNEL); in drm_atomic_get_private_obj_state()
801 state->private_objs = arr; in drm_atomic_get_private_obj_state()
802 index = state->num_private_objs; in drm_atomic_get_private_obj_state()
803 memset(&state->private_objs[index], 0, sizeof(*state->private_objs)); in drm_atomic_get_private_obj_state()
809 state->private_objs[index].state = obj_state; in drm_atomic_get_private_obj_state()
810 state->private_objs[index].old_state = obj->state; in drm_atomic_get_private_obj_state()
811 state->private_objs[index].new_state = obj_state; in drm_atomic_get_private_obj_state()
812 state->private_objs[index].ptr = obj; in drm_atomic_get_private_obj_state()
813 obj_state->state = state; in drm_atomic_get_private_obj_state()
815 state->num_private_objs = num_objs; in drm_atomic_get_private_obj_state()
817 DRM_DEBUG_ATOMIC("Added new private object %p state %p to %p\n", in drm_atomic_get_private_obj_state()
818 obj, obj_state, state); in drm_atomic_get_private_obj_state()
826 * @state: global atomic state object
829 * This function returns the old private object state for the given private_obj,
830 * or NULL if the private_obj is not part of the global atomic state.
833 drm_atomic_get_old_private_obj_state(struct drm_atomic_state *state, in drm_atomic_get_old_private_obj_state() argument
838 for (i = 0; i < state->num_private_objs; i++) in drm_atomic_get_old_private_obj_state()
839 if (obj == state->private_objs[i].ptr) in drm_atomic_get_old_private_obj_state()
840 return state->private_objs[i].old_state; in drm_atomic_get_old_private_obj_state()
848 * @state: global atomic state object
851 * This function returns the new private object state for the given private_obj,
852 * or NULL if the private_obj is not part of the global atomic state.
855 drm_atomic_get_new_private_obj_state(struct drm_atomic_state *state, in drm_atomic_get_new_private_obj_state() argument
860 for (i = 0; i < state->num_private_objs; i++) in drm_atomic_get_new_private_obj_state()
861 if (obj == state->private_objs[i].ptr) in drm_atomic_get_new_private_obj_state()
862 return state->private_objs[i].new_state; in drm_atomic_get_new_private_obj_state()
870 * @state: Atomic state
871 * @encoder: The encoder to fetch the connector state for
874 * as specified by the @state.
876 * If there is no connector in @state which previously had @encoder connected to
880 * state). This is especially true in enable hooks because the pipeline has
887 drm_atomic_get_old_connector_for_encoder(struct drm_atomic_state *state, in drm_atomic_get_old_connector_for_encoder() argument
894 for_each_old_connector_in_state(state, connector, conn_state, i) { in drm_atomic_get_old_connector_for_encoder()
905 * @state: Atomic state
906 * @encoder: The encoder to fetch the connector state for
909 * @encoder as specified by the @state.
911 * If there is no connector in @state which will have @encoder connected to it,
914 * attached to @encoder vs ones that do (and to inspect their state). This is
921 drm_atomic_get_new_connector_for_encoder(struct drm_atomic_state *state, in drm_atomic_get_new_connector_for_encoder() argument
928 for_each_new_connector_in_state(state, connector, conn_state, i) { in drm_atomic_get_new_connector_for_encoder()
938 * drm_atomic_get_connector_state - get connector state
939 * @state: global atomic state object
940 * @connector: connector to get state object for
942 * This function returns the connector state for the given connector,
944 * make sure that the state is consistent.
948 * Either the allocated state or the error code encoded into the pointer. When
953 drm_atomic_get_connector_state(struct drm_atomic_state *state, in drm_atomic_get_connector_state() argument
960 WARN_ON(!state->acquire_ctx); in drm_atomic_get_connector_state()
962 ret = drm_modeset_lock(&config->connection_mutex, state->acquire_ctx); in drm_atomic_get_connector_state()
968 if (index >= state->num_connector) { in drm_atomic_get_connector_state()
972 c = krealloc(state->connectors, alloc * sizeof(*state->connectors), GFP_KERNEL); in drm_atomic_get_connector_state()
976 state->connectors = c; in drm_atomic_get_connector_state()
977 memset(&state->connectors[state->num_connector], 0, in drm_atomic_get_connector_state()
978 sizeof(*state->connectors) * (alloc - state->num_connector)); in drm_atomic_get_connector_state()
980 state->num_connector = alloc; in drm_atomic_get_connector_state()
983 if (state->connectors[index].state) in drm_atomic_get_connector_state()
984 return state->connectors[index].state; in drm_atomic_get_connector_state()
991 state->connectors[index].state = connector_state; in drm_atomic_get_connector_state()
992 state->connectors[index].old_state = connector->state; in drm_atomic_get_connector_state()
993 state->connectors[index].new_state = connector_state; in drm_atomic_get_connector_state()
994 state->connectors[index].ptr = connector; in drm_atomic_get_connector_state()
995 connector_state->state = state; in drm_atomic_get_connector_state()
997 DRM_DEBUG_ATOMIC("Added [CONNECTOR:%d:%s] %p state to %p\n", in drm_atomic_get_connector_state()
999 connector_state, state); in drm_atomic_get_connector_state()
1004 crtc_state = drm_atomic_get_crtc_state(state, in drm_atomic_get_connector_state()
1015 const struct drm_connector_state *state) in drm_atomic_connector_print_state() argument
1017 struct drm_connector *connector = state->connector; in drm_atomic_connector_print_state()
1020 drm_printf(p, "\tcrtc=%s\n", state->crtc ? state->crtc->name : "(null)"); in drm_atomic_connector_print_state()
1021 drm_printf(p, "\tself_refresh_aware=%d\n", state->self_refresh_aware); in drm_atomic_connector_print_state()
1024 if (state->writeback_job && state->writeback_job->fb) in drm_atomic_connector_print_state()
1025 drm_printf(p, "\tfb=%d\n", state->writeback_job->fb->base.id); in drm_atomic_connector_print_state()
1028 connector->funcs->atomic_print_state(p, state); in drm_atomic_connector_print_state()
1032 * drm_atomic_get_bridge_state - get bridge state
1033 * @state: global atomic state object
1034 * @bridge: bridge to get state object for
1036 * This function returns the bridge state for the given bridge, allocating it
1038 * state is consistent.
1042 * Either the allocated state or the error code encoded into the pointer. When
1047 drm_atomic_get_bridge_state(struct drm_atomic_state *state, in drm_atomic_get_bridge_state() argument
1052 obj_state = drm_atomic_get_private_obj_state(state, &bridge->base); in drm_atomic_get_bridge_state()
1061 * drm_atomic_get_old_bridge_state - get old bridge state, if it exists
1062 * @state: global atomic state object
1065 * This function returns the old bridge state for the given bridge, or NULL if
1066 * the bridge is not part of the global atomic state.
1069 drm_atomic_get_old_bridge_state(struct drm_atomic_state *state, in drm_atomic_get_old_bridge_state() argument
1074 obj_state = drm_atomic_get_old_private_obj_state(state, &bridge->base); in drm_atomic_get_old_bridge_state()
1083 * drm_atomic_get_new_bridge_state - get new bridge state, if it exists
1084 * @state: global atomic state object
1087 * This function returns the new bridge state for the given bridge, or NULL if
1088 * the bridge is not part of the global atomic state.
1091 drm_atomic_get_new_bridge_state(struct drm_atomic_state *state, in drm_atomic_get_new_bridge_state() argument
1096 obj_state = drm_atomic_get_new_private_obj_state(state, &bridge->base); in drm_atomic_get_new_bridge_state()
1106 * @state: atomic state
1110 * bridge states to @state and make them available when
1121 drm_atomic_add_encoder_bridges(struct drm_atomic_state *state, in drm_atomic_add_encoder_bridges() argument
1131 encoder->base.id, encoder->name, state); in drm_atomic_add_encoder_bridges()
1134 /* Skip bridges that don't implement the atomic state hooks. */ in drm_atomic_add_encoder_bridges()
1138 bridge_state = drm_atomic_get_bridge_state(state, bridge); in drm_atomic_add_encoder_bridges()
1149 * @state: atomic state
1153 * currently using @crtc to the atomic configuration @state. Note that this
1165 drm_atomic_add_affected_connectors(struct drm_atomic_state *state, in drm_atomic_add_affected_connectors() argument
1168 struct drm_mode_config *config = &state->dev->mode_config; in drm_atomic_add_affected_connectors()
1175 crtc_state = drm_atomic_get_crtc_state(state, crtc); in drm_atomic_add_affected_connectors()
1179 ret = drm_modeset_lock(&config->connection_mutex, state->acquire_ctx); in drm_atomic_add_affected_connectors()
1184 crtc->base.id, crtc->name, state); in drm_atomic_add_affected_connectors()
1187 * Changed connectors are already in @state, so only need to look in drm_atomic_add_affected_connectors()
1190 drm_connector_list_iter_begin(state->dev, &conn_iter); in drm_atomic_add_affected_connectors()
1195 conn_state = drm_atomic_get_connector_state(state, connector); in drm_atomic_add_affected_connectors()
1209 * @state: atomic state
1213 * currently used by @crtc to the atomic configuration @state. This is useful
1218 * Since acquiring a plane state will always also acquire the w/w mutex of the
1228 drm_atomic_add_affected_planes(struct drm_atomic_state *state, in drm_atomic_add_affected_planes() argument
1232 drm_atomic_get_old_crtc_state(state, crtc); in drm_atomic_add_affected_planes()
1235 WARN_ON(!drm_atomic_get_new_crtc_state(state, crtc)); in drm_atomic_add_affected_planes()
1238 crtc->base.id, crtc->name, state); in drm_atomic_add_affected_planes()
1240 drm_for_each_plane_mask(plane, state->dev, old_crtc_state->plane_mask) { in drm_atomic_add_affected_planes()
1242 drm_atomic_get_plane_state(state, plane); in drm_atomic_add_affected_planes()
1253 * @state: atomic configuration to check
1262 int drm_atomic_check_only(struct drm_atomic_state *state) in drm_atomic_check_only() argument
1264 struct drm_device *dev = state->dev; in drm_atomic_check_only()
1276 DRM_DEBUG_ATOMIC("checking %p\n", state); in drm_atomic_check_only()
1278 for_each_oldnew_plane_in_state(state, plane, old_plane_state, new_plane_state, i) { in drm_atomic_check_only()
1287 for_each_oldnew_crtc_in_state(state, crtc, old_crtc_state, new_crtc_state, i) { in drm_atomic_check_only()
1296 for_each_new_connector_in_state(state, conn, conn_state, i) { in drm_atomic_check_only()
1306 ret = config->funcs->atomic_check(state->dev, state); in drm_atomic_check_only()
1310 state, ret); in drm_atomic_check_only()
1315 if (!state->allow_modeset) { in drm_atomic_check_only()
1316 for_each_new_crtc_in_state(state, crtc, new_crtc_state, i) { in drm_atomic_check_only()
1331 * @state: atomic configuration to check
1337 * This function will take its own reference on @state.
1343 int drm_atomic_commit(struct drm_atomic_state *state) in drm_atomic_commit() argument
1345 struct drm_mode_config *config = &state->dev->mode_config; in drm_atomic_commit()
1348 ret = drm_atomic_check_only(state); in drm_atomic_commit()
1352 DRM_DEBUG_ATOMIC("committing %p\n", state); in drm_atomic_commit()
1354 return config->funcs->atomic_commit(state->dev, state, false); in drm_atomic_commit()
1360 * @state: atomic configuration to check
1366 * This function will take its own reference on @state.
1372 int drm_atomic_nonblocking_commit(struct drm_atomic_state *state) in drm_atomic_nonblocking_commit() argument
1374 struct drm_mode_config *config = &state->dev->mode_config; in drm_atomic_nonblocking_commit()
1377 ret = drm_atomic_check_only(state); in drm_atomic_nonblocking_commit()
1381 DRM_DEBUG_ATOMIC("committing %p nonblocking\n", state); in drm_atomic_nonblocking_commit()
1383 return config->funcs->atomic_commit(state->dev, state, true); in drm_atomic_nonblocking_commit()
1411 static int update_output_state(struct drm_atomic_state *state, in update_output_state() argument
1422 state->acquire_ctx); in update_output_state()
1427 ret = drm_atomic_add_affected_connectors(state, set->crtc); in update_output_state()
1431 for_each_new_connector_in_state(state, connector, new_conn_state, i) { in update_output_state()
1445 new_conn_state = drm_atomic_get_connector_state(state, in update_output_state()
1456 for_each_new_crtc_in_state(state, crtc, new_crtc_state, i) { in update_output_state()
1481 struct drm_atomic_state *state) in __drm_atomic_helper_set_config() argument
1489 crtc_state = drm_atomic_get_crtc_state(state, crtc); in __drm_atomic_helper_set_config()
1493 primary_state = drm_atomic_get_plane_state(state, crtc->primary); in __drm_atomic_helper_set_config()
1547 ret = update_output_state(state, set); in __drm_atomic_helper_set_config()
1555 void drm_atomic_print_state(const struct drm_atomic_state *state) in drm_atomic_print_state() argument
1557 struct drm_printer p = drm_info_printer(state->dev->dev); in drm_atomic_print_state()
1566 DRM_DEBUG_ATOMIC("checking %p\n", state); in drm_atomic_print_state()
1568 for_each_new_plane_in_state(state, plane, plane_state, i) in drm_atomic_print_state()
1571 for_each_new_crtc_in_state(state, crtc, crtc_state, i) in drm_atomic_print_state()
1574 for_each_new_connector_in_state(state, connector, connector_state, i) in drm_atomic_print_state()
1593 drm_atomic_plane_print_state(p, plane->state); in __drm_state_dump()
1601 drm_atomic_crtc_print_state(p, crtc->state); in __drm_state_dump()
1610 drm_atomic_connector_print_state(p, connector->state); in __drm_state_dump()
1617 * drm_state_dump - dump entire device atomic state
1619 * @p: where to print the state to
1621 * Just for debugging. Drivers might want an option to dump state
1651 {"state", drm_state_info, 0},