From 172ff0f43439b06d24869abce779636198b51914 Mon Sep 17 00:00:00 2001 From: Ryan Pavlik Date: Tue, 9 Jun 2020 17:13:06 -0500 Subject: [PATCH] ipc: Simplify code by just copying a structure. --- src/xrt/ipc/ipc_server_client.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/xrt/ipc/ipc_server_client.c b/src/xrt/ipc/ipc_server_client.c index c2e8e3f90..1bba94407 100644 --- a/src/xrt/ipc/ipc_server_client.c +++ b/src/xrt/ipc/ipc_server_client.c @@ -102,16 +102,8 @@ ipc_handle_compositor_layer_sync(volatile struct ipc_client_state *cs, struct ipc_shared_memory *ism = cs->server->ism; struct ipc_layer_slot *slot = &ism->slots[slot_id]; - //! @todo big copy instead of this sparse copy? - for (uint32_t i = 0; i < slot->num_layers; i++) { - struct ipc_layer_entry *sl = &slot->layers[i]; - volatile struct ipc_layer_entry *rl = - &cs->render_state.layers[i]; - - *rl = *sl; - } - - cs->render_state.num_layers = slot->num_layers; + // Copy current slot data to our state. + cs->render_state = *slot; cs->rendering_state = true; *out_free_slot_id = (slot_id + 1) % IPC_MAX_SLOTS;