Lines Matching full:state
37 struct intel_global_state *state, in intel_atomic_global_obj_init() argument
42 state->obj = obj; in intel_atomic_global_obj_init()
44 kref_init(&state->ref); in intel_atomic_global_obj_init()
46 obj->state = state; in intel_atomic_global_obj_init()
58 drm_WARN_ON(&dev_priv->drm, kref_read(&obj->state->ref) != 1); in intel_atomic_global_obj_cleanup()
59 intel_atomic_global_state_put(obj->state); in intel_atomic_global_obj_cleanup()
84 static void assert_global_state_read_locked(struct intel_atomic_state *state) in assert_global_state_read_locked() argument
86 struct drm_modeset_acquire_ctx *ctx = state->base.acquire_ctx; in assert_global_state_read_locked()
87 struct drm_i915_private *dev_priv = to_i915(state->base.dev); in assert_global_state_read_locked()
95 drm_WARN(&dev_priv->drm, 1, "Global state not read locked\n"); in assert_global_state_read_locked()
99 intel_atomic_get_global_obj_state(struct intel_atomic_state *state, in intel_atomic_get_global_obj_state() argument
102 struct drm_i915_private *i915 = to_i915(state->base.dev); in intel_atomic_get_global_obj_state()
108 for (i = 0; i < state->num_global_objs; i++) in intel_atomic_get_global_obj_state()
109 if (obj == state->global_objs[i].ptr) in intel_atomic_get_global_obj_state()
110 return state->global_objs[i].state; in intel_atomic_get_global_obj_state()
112 assert_global_state_read_locked(state); in intel_atomic_get_global_obj_state()
114 num_objs = state->num_global_objs + 1; in intel_atomic_get_global_obj_state()
115 size = sizeof(*state->global_objs) * num_objs; in intel_atomic_get_global_obj_state()
116 arr = krealloc(state->global_objs, size, GFP_KERNEL); in intel_atomic_get_global_obj_state()
120 state->global_objs = arr; in intel_atomic_get_global_obj_state()
121 index = state->num_global_objs; in intel_atomic_get_global_obj_state()
122 memset(&state->global_objs[index], 0, sizeof(*state->global_objs)); in intel_atomic_get_global_obj_state()
133 state->global_objs[index].state = obj_state; in intel_atomic_get_global_obj_state()
134 state->global_objs[index].old_state = in intel_atomic_get_global_obj_state()
135 intel_atomic_global_state_get(obj->state); in intel_atomic_get_global_obj_state()
136 state->global_objs[index].new_state = obj_state; in intel_atomic_get_global_obj_state()
137 state->global_objs[index].ptr = obj; in intel_atomic_get_global_obj_state()
138 obj_state->state = state; in intel_atomic_get_global_obj_state()
140 state->num_global_objs = num_objs; in intel_atomic_get_global_obj_state()
142 drm_dbg_atomic(&i915->drm, "Added new global object %p state %p to %p\n", in intel_atomic_get_global_obj_state()
143 obj, obj_state, state); in intel_atomic_get_global_obj_state()
149 intel_atomic_get_old_global_obj_state(struct intel_atomic_state *state, in intel_atomic_get_old_global_obj_state() argument
154 for (i = 0; i < state->num_global_objs; i++) in intel_atomic_get_old_global_obj_state()
155 if (obj == state->global_objs[i].ptr) in intel_atomic_get_old_global_obj_state()
156 return state->global_objs[i].old_state; in intel_atomic_get_old_global_obj_state()
162 intel_atomic_get_new_global_obj_state(struct intel_atomic_state *state, in intel_atomic_get_new_global_obj_state() argument
167 for (i = 0; i < state->num_global_objs; i++) in intel_atomic_get_new_global_obj_state()
168 if (obj == state->global_objs[i].ptr) in intel_atomic_get_new_global_obj_state()
169 return state->global_objs[i].new_state; in intel_atomic_get_new_global_obj_state()
174 void intel_atomic_swap_global_state(struct intel_atomic_state *state) in intel_atomic_swap_global_state() argument
176 struct drm_i915_private *dev_priv = to_i915(state->base.dev); in intel_atomic_swap_global_state()
181 for_each_oldnew_global_obj_in_state(state, obj, old_obj_state, in intel_atomic_swap_global_state()
183 drm_WARN_ON(&dev_priv->drm, obj->state != old_obj_state); in intel_atomic_swap_global_state()
186 * If the new state wasn't modified (and properly in intel_atomic_swap_global_state()
194 old_obj_state->state = state; in intel_atomic_swap_global_state()
195 new_obj_state->state = NULL; in intel_atomic_swap_global_state()
197 state->global_objs[i].state = old_obj_state; in intel_atomic_swap_global_state()
199 intel_atomic_global_state_put(obj->state); in intel_atomic_swap_global_state()
200 obj->state = intel_atomic_global_state_get(new_obj_state); in intel_atomic_swap_global_state()
204 void intel_atomic_clear_global_state(struct intel_atomic_state *state) in intel_atomic_clear_global_state() argument
208 for (i = 0; i < state->num_global_objs; i++) { in intel_atomic_clear_global_state()
209 intel_atomic_global_state_put(state->global_objs[i].old_state); in intel_atomic_clear_global_state()
210 intel_atomic_global_state_put(state->global_objs[i].new_state); in intel_atomic_clear_global_state()
212 state->global_objs[i].ptr = NULL; in intel_atomic_clear_global_state()
213 state->global_objs[i].state = NULL; in intel_atomic_clear_global_state()
214 state->global_objs[i].old_state = NULL; in intel_atomic_clear_global_state()
215 state->global_objs[i].new_state = NULL; in intel_atomic_clear_global_state()
217 state->num_global_objs = 0; in intel_atomic_clear_global_state()
222 struct intel_atomic_state *state = obj_state->state; in intel_atomic_lock_global_state() local
223 struct drm_i915_private *dev_priv = to_i915(state->base.dev); in intel_atomic_lock_global_state()
230 state->base.acquire_ctx); in intel_atomic_lock_global_state()
242 struct intel_atomic_state *state = obj_state->state; in intel_atomic_serialize_global_state() local
243 struct drm_i915_private *dev_priv = to_i915(state->base.dev); in intel_atomic_serialize_global_state()
249 crtc_state = intel_atomic_get_crtc_state(&state->base, crtc); in intel_atomic_serialize_global_state()
260 intel_atomic_global_state_is_serialized(struct intel_atomic_state *state) in intel_atomic_global_state_is_serialized() argument
262 struct drm_i915_private *i915 = to_i915(state->base.dev); in intel_atomic_global_state_is_serialized()
266 if (!intel_atomic_get_new_crtc_state(state, crtc)) in intel_atomic_global_state_is_serialized()