const struct dc_stream_status *stream_status;
enum surface_update_type update_type;
struct dc_state *context;
+ struct dc_context *dc_ctx = dc->ctx;
int i;
stream_status = dc_stream_get_status(stream);
update_surface_trace(dc, srf_updates, surface_count);
- if (update_type >= UPDATE_TYPE_FULL)
+ if (update_type >= UPDATE_TYPE_FULL) {
+
+ /* initialize scratch memory for building context */
+ context = dc_create_state();
+ if (context == NULL) {
+ DC_ERROR("Failed to allocate new validate context!\n");
+ return;
+ }
+
dc_resource_state_copy_construct(state, context);
+ }
for (i = 0; i < surface_count; i++) {
dc_post_update_surfaces_to_stream(dc);
+ if (dc->current_state != context) {
+
+ struct dc_state *old = dc->current_state;
+
+ dc->current_state = context;
+ dc_release_state(old);
+
+ }
+
return;
}