Lines Matching full:state

57  * @state: atomic state
63 void drm_atomic_state_default_release(struct drm_atomic_state *state) in drm_atomic_state_default_release() argument
65 kfree(state->connectors); in drm_atomic_state_default_release()
66 kfree(state->crtcs); in drm_atomic_state_default_release()
67 kfree(state->planes); in drm_atomic_state_default_release()
68 kfree(state->private_objs); in drm_atomic_state_default_release()
73 * drm_atomic_state_init - init new atomic state
75 * @state: atomic state
77 * Default implementation for filling in a new atomic state.
82 drm_atomic_state_init(struct drm_device *dev, struct drm_atomic_state *state) in drm_atomic_state_init() argument
84 kref_init(&state->ref); in drm_atomic_state_init()
89 state->allow_modeset = true; in drm_atomic_state_init()
91 state->crtcs = kcalloc(dev->mode_config.num_crtc, in drm_atomic_state_init()
92 sizeof(*state->crtcs), GFP_KERNEL); in drm_atomic_state_init()
93 if (!state->crtcs) in drm_atomic_state_init()
95 state->planes = kcalloc(dev->mode_config.num_total_plane, in drm_atomic_state_init()
96 sizeof(*state->planes), GFP_KERNEL); in drm_atomic_state_init()
97 if (!state->planes) in drm_atomic_state_init()
100 state->dev = dev; in drm_atomic_state_init()
102 DRM_DEBUG_ATOMIC("Allocated atomic state %p\n", state); in drm_atomic_state_init()
106 drm_atomic_state_default_release(state); in drm_atomic_state_init()
112 * drm_atomic_state_alloc - allocate atomic state
115 * This allocates an empty atomic state to track updates.
123 struct drm_atomic_state *state; in drm_atomic_state_alloc() local
125 state = kzalloc(sizeof(*state), GFP_KERNEL); in drm_atomic_state_alloc()
126 if (!state) in drm_atomic_state_alloc()
128 if (drm_atomic_state_init(dev, state) < 0) { in drm_atomic_state_alloc()
129 kfree(state); in drm_atomic_state_alloc()
132 return state; in drm_atomic_state_alloc()
140 * drm_atomic_state_default_clear - clear base atomic state
141 * @state: atomic state
143 * Default implementation for clearing atomic state.
147 void drm_atomic_state_default_clear(struct drm_atomic_state *state) in drm_atomic_state_default_clear() argument
149 struct drm_device *dev = state->dev; in drm_atomic_state_default_clear()
153 DRM_DEBUG_ATOMIC("Clearing atomic state %p\n", state); in drm_atomic_state_default_clear()
155 for (i = 0; i < state->num_connector; i++) { in drm_atomic_state_default_clear()
156 struct drm_connector *connector = state->connectors[i].ptr; in drm_atomic_state_default_clear()
162 state->connectors[i].state); in drm_atomic_state_default_clear()
163 state->connectors[i].ptr = NULL; in drm_atomic_state_default_clear()
164 state->connectors[i].state = NULL; in drm_atomic_state_default_clear()
165 state->connectors[i].old_state = NULL; in drm_atomic_state_default_clear()
166 state->connectors[i].new_state = NULL; in drm_atomic_state_default_clear()
171 struct drm_crtc *crtc = state->crtcs[i].ptr; in drm_atomic_state_default_clear()
177 state->crtcs[i].state); in drm_atomic_state_default_clear()
179 state->crtcs[i].ptr = NULL; in drm_atomic_state_default_clear()
180 state->crtcs[i].state = NULL; in drm_atomic_state_default_clear()
181 state->crtcs[i].old_state = NULL; in drm_atomic_state_default_clear()
182 state->crtcs[i].new_state = NULL; in drm_atomic_state_default_clear()
184 if (state->crtcs[i].commit) { in drm_atomic_state_default_clear()
185 drm_crtc_commit_put(state->crtcs[i].commit); in drm_atomic_state_default_clear()
186 state->crtcs[i].commit = NULL; in drm_atomic_state_default_clear()
191 struct drm_plane *plane = state->planes[i].ptr; in drm_atomic_state_default_clear()
197 state->planes[i].state); in drm_atomic_state_default_clear()
198 state->planes[i].ptr = NULL; in drm_atomic_state_default_clear()
199 state->planes[i].state = NULL; in drm_atomic_state_default_clear()
200 state->planes[i].old_state = NULL; in drm_atomic_state_default_clear()
201 state->planes[i].new_state = NULL; in drm_atomic_state_default_clear()
204 for (i = 0; i < state->num_private_objs; i++) { in drm_atomic_state_default_clear()
205 struct drm_private_obj *obj = state->private_objs[i].ptr; in drm_atomic_state_default_clear()
208 state->private_objs[i].state); in drm_atomic_state_default_clear()
209 state->private_objs[i].ptr = NULL; in drm_atomic_state_default_clear()
210 state->private_objs[i].state = NULL; in drm_atomic_state_default_clear()
211 state->private_objs[i].old_state = NULL; in drm_atomic_state_default_clear()
212 state->private_objs[i].new_state = NULL; in drm_atomic_state_default_clear()
214 state->num_private_objs = 0; in drm_atomic_state_default_clear()
216 if (state->fake_commit) { in drm_atomic_state_default_clear()
217 drm_crtc_commit_put(state->fake_commit); in drm_atomic_state_default_clear()
218 state->fake_commit = NULL; in drm_atomic_state_default_clear()
224 * drm_atomic_state_clear - clear state object
225 * @state: atomic state
229 * configuration. Which means that all the state assembled in @state is no
230 * longer an atomic update to the current state, but to some arbitrary earlier
231 * state. Which could break assumptions the driver's
234 * Hence we must clear all cached state and completely start over, using this
237 void drm_atomic_state_clear(struct drm_atomic_state *state) in drm_atomic_state_clear() argument
239 struct drm_device *dev = state->dev; in drm_atomic_state_clear()
243 config->funcs->atomic_state_clear(state); in drm_atomic_state_clear()
245 drm_atomic_state_default_clear(state); in drm_atomic_state_clear()
250 * __drm_atomic_state_free - free all memory for an atomic state
251 * @ref: This atomic state to deallocate
253 * This frees all memory associated with an atomic state, including all the
254 * per-object state for planes, crtcs and connectors.
258 struct drm_atomic_state *state = container_of(ref, typeof(*state), ref); in __drm_atomic_state_free() local
259 struct drm_mode_config *config = &state->dev->mode_config; in __drm_atomic_state_free()
261 drm_atomic_state_clear(state); in __drm_atomic_state_free()
263 DRM_DEBUG_ATOMIC("Freeing atomic state %p\n", state); in __drm_atomic_state_free()
266 config->funcs->atomic_state_free(state); in __drm_atomic_state_free()
268 drm_atomic_state_default_release(state); in __drm_atomic_state_free()
269 kfree(state); in __drm_atomic_state_free()
275 * drm_atomic_get_crtc_state - get crtc state
276 * @state: global atomic state object
277 * @crtc: crtc to get state object for
279 * This function returns the crtc state for the given crtc, allocating it if
280 * needed. It will also grab the relevant crtc lock to make sure that the state
285 * Either the allocated state or the error code encoded into the pointer. When
290 drm_atomic_get_crtc_state(struct drm_atomic_state *state, in drm_atomic_get_crtc_state() argument
296 WARN_ON(!state->acquire_ctx); in drm_atomic_get_crtc_state()
298 crtc_state = drm_atomic_get_existing_crtc_state(state, crtc); in drm_atomic_get_crtc_state()
302 ret = drm_modeset_lock(&crtc->mutex, state->acquire_ctx); in drm_atomic_get_crtc_state()
310 state->crtcs[index].state = crtc_state; in drm_atomic_get_crtc_state()
311 state->crtcs[index].old_state = crtc->state; in drm_atomic_get_crtc_state()
312 state->crtcs[index].new_state = crtc_state; in drm_atomic_get_crtc_state()
313 state->crtcs[index].ptr = crtc; in drm_atomic_get_crtc_state()
314 crtc_state->state = state; in drm_atomic_get_crtc_state()
316 DRM_DEBUG_ATOMIC("Added [CRTC:%d:%s] %p state to %p\n", in drm_atomic_get_crtc_state()
317 crtc->base.id, crtc->name, crtc_state, state); in drm_atomic_get_crtc_state()
333 * TODO: Add generic modeset state checks once we support those. in drm_atomic_crtc_check()
342 /* The state->enable vs. state->mode_blob checks can be WARN_ON, in drm_atomic_crtc_check()
380 const struct drm_crtc_state *state) in drm_atomic_crtc_print_state() argument
382 struct drm_crtc *crtc = state->crtc; in drm_atomic_crtc_print_state()
385 drm_printf(p, "\tenable=%d\n", state->enable); in drm_atomic_crtc_print_state()
386 drm_printf(p, "\tactive=%d\n", state->active); in drm_atomic_crtc_print_state()
387 drm_printf(p, "\tself_refresh_active=%d\n", state->self_refresh_active); in drm_atomic_crtc_print_state()
388 drm_printf(p, "\tplanes_changed=%d\n", state->planes_changed); in drm_atomic_crtc_print_state()
389 drm_printf(p, "\tmode_changed=%d\n", state->mode_changed); in drm_atomic_crtc_print_state()
390 drm_printf(p, "\tactive_changed=%d\n", state->active_changed); in drm_atomic_crtc_print_state()
391 drm_printf(p, "\tconnectors_changed=%d\n", state->connectors_changed); in drm_atomic_crtc_print_state()
392 drm_printf(p, "\tcolor_mgmt_changed=%d\n", state->color_mgmt_changed); in drm_atomic_crtc_print_state()
393 drm_printf(p, "\tplane_mask=%x\n", state->plane_mask); in drm_atomic_crtc_print_state()
394 drm_printf(p, "\tconnector_mask=%x\n", state->connector_mask); in drm_atomic_crtc_print_state()
395 drm_printf(p, "\tencoder_mask=%x\n", state->encoder_mask); in drm_atomic_crtc_print_state()
396 drm_printf(p, "\tmode: " DRM_MODE_FMT "\n", DRM_MODE_ARG(&state->mode)); in drm_atomic_crtc_print_state()
399 crtc->funcs->atomic_print_state(p, state); in drm_atomic_crtc_print_state()
403 struct drm_connector_state *state) in drm_atomic_connector_check() argument
406 struct drm_writeback_job *writeback_job = state->writeback_job; in drm_atomic_connector_check()
409 state->max_bpc = info->bpc ? info->bpc : 8; in drm_atomic_connector_check()
411 state->max_bpc = min(state->max_bpc, state->max_requested_bpc); in drm_atomic_connector_check()
416 if (writeback_job->fb && !state->crtc) { in drm_atomic_connector_check()
422 if (state->crtc) in drm_atomic_connector_check()
423 crtc_state = drm_atomic_get_existing_crtc_state(state->state, in drm_atomic_connector_check()
424 state->crtc); in drm_atomic_connector_check()
429 state->crtc->base.id); in drm_atomic_connector_check()
441 state->writeback_job = NULL; in drm_atomic_connector_check()
448 * drm_atomic_get_plane_state - get plane state
449 * @state: global atomic state object
450 * @plane: plane to get state object for
452 * This function returns the plane state for the given plane, allocating it if
453 * needed. It will also grab the relevant plane lock to make sure that the state
458 * Either the allocated state or the error code encoded into the pointer. When
463 drm_atomic_get_plane_state(struct drm_atomic_state *state, in drm_atomic_get_plane_state() argument
469 WARN_ON(!state->acquire_ctx); in drm_atomic_get_plane_state()
476 plane_state = drm_atomic_get_existing_plane_state(state, plane); in drm_atomic_get_plane_state()
480 ret = drm_modeset_lock(&plane->mutex, state->acquire_ctx); in drm_atomic_get_plane_state()
488 state->planes[index].state = plane_state; in drm_atomic_get_plane_state()
489 state->planes[index].ptr = plane; in drm_atomic_get_plane_state()
490 state->planes[index].old_state = plane->state; in drm_atomic_get_plane_state()
491 state->planes[index].new_state = plane_state; in drm_atomic_get_plane_state()
492 plane_state->state = state; in drm_atomic_get_plane_state()
494 DRM_DEBUG_ATOMIC("Added [PLANE:%d:%s] %p state to %p\n", in drm_atomic_get_plane_state()
495 plane->base.id, plane->name, plane_state, state); in drm_atomic_get_plane_state()
500 crtc_state = drm_atomic_get_crtc_state(state, in drm_atomic_get_plane_state()
523 * full OFF state. in plane_switching_crtc()
529 * drm_atomic_plane_check - check plane state
530 * @old_plane_state: old plane state to check
531 * @new_plane_state: new plane state to check
533 * Provides core sanity checks for plane state.
560 /* if disabled, we don't care about the rest of the state: */ in drm_atomic_plane_check()
650 const struct drm_plane_state *state) in drm_atomic_plane_print_state() argument
652 struct drm_plane *plane = state->plane; in drm_atomic_plane_print_state()
653 struct drm_rect src = drm_plane_state_src(state); in drm_atomic_plane_print_state()
654 struct drm_rect dest = drm_plane_state_dest(state); in drm_atomic_plane_print_state()
657 drm_printf(p, "\tcrtc=%s\n", state->crtc ? state->crtc->name : "(null)"); in drm_atomic_plane_print_state()
658 drm_printf(p, "\tfb=%u\n", state->fb ? state->fb->base.id : 0); in drm_atomic_plane_print_state()
659 if (state->fb) in drm_atomic_plane_print_state()
660 drm_framebuffer_print_info(p, 2, state->fb); in drm_atomic_plane_print_state()
663 drm_printf(p, "\trotation=%x\n", state->rotation); in drm_atomic_plane_print_state()
664 drm_printf(p, "\tnormalized-zpos=%x\n", state->normalized_zpos); in drm_atomic_plane_print_state()
666 drm_get_color_encoding_name(state->color_encoding)); in drm_atomic_plane_print_state()
668 drm_get_color_range_name(state->color_range)); in drm_atomic_plane_print_state()
671 plane->funcs->atomic_print_state(p, state); in drm_atomic_plane_print_state()
675 * DOC: handling driver private state
682 * objects. Drivers then need to do similar state tracking and commit ordering for
687 * driver private state objects using struct &drm_private_obj, with the
688 * associated state struct &drm_private_state.
690 * Similar to userspace-exposed objects, private state structures can be
693 * private state object they have with the required call to drm_modeset_lock()
696 * All private state structures contained in a &drm_atomic_state update can be
699 * Drivers are recommended to wrap these for each type of driver private state
703 * An earlier way to handle driver private state was by subclassing struct
706 * commit instead" of "duplicate state, check, then either commit or release
707 * duplicated state) it is deprecated in favour of using &drm_private_state.
714 * @state: initial private object state
719 * driver private object that needs its own atomic state.
724 struct drm_private_state *state, in drm_atomic_private_obj_init() argument
731 obj->state = state; in drm_atomic_private_obj_init()
747 obj->funcs->atomic_destroy_state(obj, obj->state); in drm_atomic_private_obj_fini()
753 * drm_atomic_get_private_obj_state - get private object state
754 * @state: global atomic state
755 * @obj: private object to get the state for
757 * This function returns the private object state for the given private object,
758 * allocating the state if needed. It will also grab the relevant private
759 * object lock to make sure that the state is consistent.
763 * Either the allocated state or the error code encoded into a pointer.
766 drm_atomic_get_private_obj_state(struct drm_atomic_state *state, in drm_atomic_get_private_obj_state() argument
774 for (i = 0; i < state->num_private_objs; i++) in drm_atomic_get_private_obj_state()
775 if (obj == state->private_objs[i].ptr) in drm_atomic_get_private_obj_state()
776 return state->private_objs[i].state; in drm_atomic_get_private_obj_state()
778 ret = drm_modeset_lock(&obj->lock, state->acquire_ctx); in drm_atomic_get_private_obj_state()
782 num_objs = state->num_private_objs + 1; in drm_atomic_get_private_obj_state()
783 size = sizeof(*state->private_objs) * num_objs; in drm_atomic_get_private_obj_state()
784 arr = krealloc(state->private_objs, size, GFP_KERNEL); in drm_atomic_get_private_obj_state()
788 state->private_objs = arr; in drm_atomic_get_private_obj_state()
789 index = state->num_private_objs; in drm_atomic_get_private_obj_state()
790 memset(&state->private_objs[index], 0, sizeof(*state->private_objs)); in drm_atomic_get_private_obj_state()
796 state->private_objs[index].state = obj_state; in drm_atomic_get_private_obj_state()
797 state->private_objs[index].old_state = obj->state; in drm_atomic_get_private_obj_state()
798 state->private_objs[index].new_state = obj_state; in drm_atomic_get_private_obj_state()
799 state->private_objs[index].ptr = obj; in drm_atomic_get_private_obj_state()
800 obj_state->state = state; in drm_atomic_get_private_obj_state()
802 state->num_private_objs = num_objs; in drm_atomic_get_private_obj_state()
804 DRM_DEBUG_ATOMIC("Added new private object %p state %p to %p\n", in drm_atomic_get_private_obj_state()
805 obj, obj_state, state); in drm_atomic_get_private_obj_state()
813 * @state: global atomic state object
816 * This function returns the old private object state for the given private_obj,
817 * or NULL if the private_obj is not part of the global atomic state.
820 drm_atomic_get_old_private_obj_state(struct drm_atomic_state *state, in drm_atomic_get_old_private_obj_state() argument
825 for (i = 0; i < state->num_private_objs; i++) in drm_atomic_get_old_private_obj_state()
826 if (obj == state->private_objs[i].ptr) in drm_atomic_get_old_private_obj_state()
827 return state->private_objs[i].old_state; in drm_atomic_get_old_private_obj_state()
835 * @state: global atomic state object
838 * This function returns the new private object state for the given private_obj,
839 * or NULL if the private_obj is not part of the global atomic state.
842 drm_atomic_get_new_private_obj_state(struct drm_atomic_state *state, in drm_atomic_get_new_private_obj_state() argument
847 for (i = 0; i < state->num_private_objs; i++) in drm_atomic_get_new_private_obj_state()
848 if (obj == state->private_objs[i].ptr) in drm_atomic_get_new_private_obj_state()
849 return state->private_objs[i].new_state; in drm_atomic_get_new_private_obj_state()
857 * @state: Atomic state
858 * @encoder: The encoder to fetch the connector state for
861 * as specified by the @state.
863 * If there is no connector in @state which previously had @encoder connected to
867 * state). This is especially true in enable hooks because the pipeline has
874 drm_atomic_get_old_connector_for_encoder(struct drm_atomic_state *state, in drm_atomic_get_old_connector_for_encoder() argument
881 for_each_old_connector_in_state(state, connector, conn_state, i) { in drm_atomic_get_old_connector_for_encoder()
892 * @state: Atomic state
893 * @encoder: The encoder to fetch the connector state for
896 * @encoder as specified by the @state.
898 * If there is no connector in @state which will have @encoder connected to it,
901 * attached to @encoder vs ones that do (and to inspect their state). This is
908 drm_atomic_get_new_connector_for_encoder(struct drm_atomic_state *state, in drm_atomic_get_new_connector_for_encoder() argument
915 for_each_new_connector_in_state(state, connector, conn_state, i) { in drm_atomic_get_new_connector_for_encoder()
925 * drm_atomic_get_connector_state - get connector state
926 * @state: global atomic state object
927 * @connector: connector to get state object for
929 * This function returns the connector state for the given connector,
931 * make sure that the state is consistent.
935 * Either the allocated state or the error code encoded into the pointer. When
940 drm_atomic_get_connector_state(struct drm_atomic_state *state, in drm_atomic_get_connector_state() argument
947 WARN_ON(!state->acquire_ctx); in drm_atomic_get_connector_state()
949 ret = drm_modeset_lock(&config->connection_mutex, state->acquire_ctx); in drm_atomic_get_connector_state()
955 if (index >= state->num_connector) { in drm_atomic_get_connector_state()
959 c = krealloc(state->connectors, alloc * sizeof(*state->connectors), GFP_KERNEL); in drm_atomic_get_connector_state()
963 state->connectors = c; in drm_atomic_get_connector_state()
964 memset(&state->connectors[state->num_connector], 0, in drm_atomic_get_connector_state()
965 sizeof(*state->connectors) * (alloc - state->num_connector)); in drm_atomic_get_connector_state()
967 state->num_connector = alloc; in drm_atomic_get_connector_state()
970 if (state->connectors[index].state) in drm_atomic_get_connector_state()
971 return state->connectors[index].state; in drm_atomic_get_connector_state()
978 state->connectors[index].state = connector_state; in drm_atomic_get_connector_state()
979 state->connectors[index].old_state = connector->state; in drm_atomic_get_connector_state()
980 state->connectors[index].new_state = connector_state; in drm_atomic_get_connector_state()
981 state->connectors[index].ptr = connector; in drm_atomic_get_connector_state()
982 connector_state->state = state; in drm_atomic_get_connector_state()
984 DRM_DEBUG_ATOMIC("Added [CONNECTOR:%d:%s] %p state to %p\n", in drm_atomic_get_connector_state()
986 connector_state, state); in drm_atomic_get_connector_state()
991 crtc_state = drm_atomic_get_crtc_state(state, in drm_atomic_get_connector_state()
1002 const struct drm_connector_state *state) in drm_atomic_connector_print_state() argument
1004 struct drm_connector *connector = state->connector; in drm_atomic_connector_print_state()
1007 drm_printf(p, "\tcrtc=%s\n", state->crtc ? state->crtc->name : "(null)"); in drm_atomic_connector_print_state()
1008 drm_printf(p, "\tself_refresh_aware=%d\n", state->self_refresh_aware); in drm_atomic_connector_print_state()
1011 if (state->writeback_job && state->writeback_job->fb) in drm_atomic_connector_print_state()
1012 drm_printf(p, "\tfb=%d\n", state->writeback_job->fb->base.id); in drm_atomic_connector_print_state()
1015 connector->funcs->atomic_print_state(p, state); in drm_atomic_connector_print_state()
1020 * @state: atomic state
1024 * currently using @crtc to the atomic configuration @state. Note that this
1036 drm_atomic_add_affected_connectors(struct drm_atomic_state *state, in drm_atomic_add_affected_connectors() argument
1039 struct drm_mode_config *config = &state->dev->mode_config; in drm_atomic_add_affected_connectors()
1046 crtc_state = drm_atomic_get_crtc_state(state, crtc); in drm_atomic_add_affected_connectors()
1050 ret = drm_modeset_lock(&config->connection_mutex, state->acquire_ctx); in drm_atomic_add_affected_connectors()
1055 crtc->base.id, crtc->name, state); in drm_atomic_add_affected_connectors()
1058 * Changed connectors are already in @state, so only need to look in drm_atomic_add_affected_connectors()
1061 drm_connector_list_iter_begin(state->dev, &conn_iter); in drm_atomic_add_affected_connectors()
1066 conn_state = drm_atomic_get_connector_state(state, connector); in drm_atomic_add_affected_connectors()
1080 * @state: atomic state
1084 * currently used by @crtc to the atomic configuration @state. This is useful
1089 * Since acquiring a plane state will always also acquire the w/w mutex of the
1099 drm_atomic_add_affected_planes(struct drm_atomic_state *state, in drm_atomic_add_affected_planes() argument
1103 drm_atomic_get_old_crtc_state(state, crtc); in drm_atomic_add_affected_planes()
1106 WARN_ON(!drm_atomic_get_new_crtc_state(state, crtc)); in drm_atomic_add_affected_planes()
1109 crtc->base.id, crtc->name, state); in drm_atomic_add_affected_planes()
1111 drm_for_each_plane_mask(plane, state->dev, old_crtc_state->plane_mask) { in drm_atomic_add_affected_planes()
1113 drm_atomic_get_plane_state(state, plane); in drm_atomic_add_affected_planes()
1124 * @state: atomic configuration to check
1133 int drm_atomic_check_only(struct drm_atomic_state *state) in drm_atomic_check_only() argument
1135 struct drm_device *dev = state->dev; in drm_atomic_check_only()
1147 DRM_DEBUG_ATOMIC("checking %p\n", state); in drm_atomic_check_only()
1149 for_each_oldnew_plane_in_state(state, plane, old_plane_state, new_plane_state, i) { in drm_atomic_check_only()
1158 for_each_oldnew_crtc_in_state(state, crtc, old_crtc_state, new_crtc_state, i) { in drm_atomic_check_only()
1167 for_each_new_connector_in_state(state, conn, conn_state, i) { in drm_atomic_check_only()
1177 ret = config->funcs->atomic_check(state->dev, state); in drm_atomic_check_only()
1181 state, ret); in drm_atomic_check_only()
1186 if (!state->allow_modeset) { in drm_atomic_check_only()
1187 for_each_new_crtc_in_state(state, crtc, new_crtc_state, i) { in drm_atomic_check_only()
1202 * @state: atomic configuration to check
1208 * This function will take its own reference on @state.
1214 int drm_atomic_commit(struct drm_atomic_state *state) in drm_atomic_commit() argument
1216 struct drm_mode_config *config = &state->dev->mode_config; in drm_atomic_commit()
1219 ret = drm_atomic_check_only(state); in drm_atomic_commit()
1223 DRM_DEBUG_ATOMIC("committing %p\n", state); in drm_atomic_commit()
1225 return config->funcs->atomic_commit(state->dev, state, false); in drm_atomic_commit()
1231 * @state: atomic configuration to check
1237 * This function will take its own reference on @state.
1243 int drm_atomic_nonblocking_commit(struct drm_atomic_state *state) in drm_atomic_nonblocking_commit() argument
1245 struct drm_mode_config *config = &state->dev->mode_config; in drm_atomic_nonblocking_commit()
1248 ret = drm_atomic_check_only(state); in drm_atomic_nonblocking_commit()
1252 DRM_DEBUG_ATOMIC("committing %p nonblocking\n", state); in drm_atomic_nonblocking_commit()
1254 return config->funcs->atomic_commit(state->dev, state, true); in drm_atomic_nonblocking_commit()
1282 static int update_output_state(struct drm_atomic_state *state, in update_output_state() argument
1293 state->acquire_ctx); in update_output_state()
1298 ret = drm_atomic_add_affected_connectors(state, set->crtc); in update_output_state()
1302 for_each_new_connector_in_state(state, connector, new_conn_state, i) { in update_output_state()
1316 new_conn_state = drm_atomic_get_connector_state(state, in update_output_state()
1327 for_each_new_crtc_in_state(state, crtc, new_crtc_state, i) { in update_output_state()
1352 struct drm_atomic_state *state) in __drm_atomic_helper_set_config() argument
1360 crtc_state = drm_atomic_get_crtc_state(state, crtc); in __drm_atomic_helper_set_config()
1364 primary_state = drm_atomic_get_plane_state(state, crtc->primary); in __drm_atomic_helper_set_config()
1418 ret = update_output_state(state, set); in __drm_atomic_helper_set_config()
1426 void drm_atomic_print_state(const struct drm_atomic_state *state) in drm_atomic_print_state() argument
1428 struct drm_printer p = drm_info_printer(state->dev->dev); in drm_atomic_print_state()
1437 DRM_DEBUG_ATOMIC("checking %p\n", state); in drm_atomic_print_state()
1439 for_each_new_plane_in_state(state, plane, plane_state, i) in drm_atomic_print_state()
1442 for_each_new_crtc_in_state(state, crtc, crtc_state, i) in drm_atomic_print_state()
1445 for_each_new_connector_in_state(state, connector, connector_state, i) in drm_atomic_print_state()
1464 drm_atomic_plane_print_state(p, plane->state); in __drm_state_dump()
1472 drm_atomic_crtc_print_state(p, crtc->state); in __drm_state_dump()
1481 drm_atomic_connector_print_state(p, connector->state); in __drm_state_dump()
1488 * drm_state_dump - dump entire device atomic state
1490 * @p: where to print the state to
1492 * Just for debugging. Drivers might want an option to dump state
1522 {"state", drm_state_info, 0},