The open source OpenXR runtime
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

ipc: Send less information when describing the client

authored by

Jakob Bornecrantz and committed by
Lubosz Sarnecki
1920a9f0 2edf0774

+35 -25
+3 -3
src/xrt/ipc/client/ipc_client_connection.c
··· 289 289 return xret; 290 290 } 291 291 292 - struct ipc_app_state desc = {0}; 292 + struct ipc_client_description desc = {0}; 293 293 desc.info = *i_info; 294 294 desc.pid = getpid(); // Extra info. 295 295 296 - xret = ipc_call_system_set_client_info(ipc_c, &desc); 296 + xret = ipc_call_instance_describe_client(ipc_c, &desc); 297 297 if (xret != XRT_SUCCESS) { 298 - IPC_ERROR(ipc_c, "Failed to set instance info!"); 298 + IPC_ERROR(ipc_c, "Failed to set instance description!"); 299 299 ipc_client_connection_fini(ipc_c); 300 300 301 301
+17 -16
src/xrt/ipc/server/ipc_server_handler.c
··· 164 164 } 165 165 166 166 xrt_result_t 167 + ipc_handle_instance_describe_client(volatile struct ipc_client_state *ics, 168 + const struct ipc_client_description *client_desc) 169 + { 170 + ics->client_state.info = client_desc->info; 171 + ics->client_state.pid = client_desc->pid; 172 + 173 + IPC_INFO(ics->server, 174 + "Client info\n" 175 + "\tapplication_name: '%s'\n" 176 + "\tpid: %i", 177 + client_desc->info.application_name, // 178 + client_desc->pid); // 179 + 180 + return XRT_SUCCESS; 181 + } 182 + 183 + xrt_result_t 167 184 ipc_handle_system_compositor_get_info(volatile struct ipc_client_state *ics, 168 185 struct xrt_system_compositor_info *out_info) 169 186 { ··· 942 959 if (ics->server->global_state.active_client_index == (int)id) { 943 960 out_client_desc->primary_application = true; 944 961 } 945 - 946 - return XRT_SUCCESS; 947 - } 948 - 949 - xrt_result_t 950 - ipc_handle_system_set_client_info(volatile struct ipc_client_state *ics, const struct ipc_app_state *client_desc) 951 - { 952 - ics->client_state.info = client_desc->info; 953 - ics->client_state.pid = client_desc->pid; 954 - 955 - IPC_INFO(ics->server, 956 - "Client info\n" 957 - "\tapplication_name: '%s'\n" 958 - "\tpid: %i", 959 - client_desc->info.application_name, // 960 - client_desc->pid); // 961 962 962 963 return XRT_SUCCESS; 963 964 }
+9
src/xrt/ipc/shared/ipc_protocol.h
··· 274 274 uint64_t startup_timestamp; 275 275 }; 276 276 277 + /*! 278 + * Initial info from a client when it connects. 279 + */ 280 + struct ipc_client_description 281 + { 282 + pid_t pid; 283 + struct xrt_instance_info info; 284 + }; 285 + 277 286 struct ipc_client_list 278 287 { 279 288 int32_t ids[IPC_MAX_CLIENTS];
+6 -6
src/xrt/ipc/shared/proto.json
··· 5 5 "out_handles": {"type": "xrt_shmem_handle_t"} 6 6 }, 7 7 8 - "system_get_client_info": { 8 + "instance_describe_client": { 9 9 "in": [ 10 - {"name": "id", "type": "uint32_t"} 11 - ], 12 - "out": [ 13 - {"name": "desc", "type": "struct ipc_app_state"} 10 + {"name": "desc", "type": "struct ipc_client_description"} 14 11 ] 15 12 }, 16 13 17 - "system_set_client_info": { 14 + "system_get_client_info": { 18 15 "in": [ 16 + {"name": "id", "type": "uint32_t"} 17 + ], 18 + "out": [ 19 19 {"name": "desc", "type": "struct ipc_app_state"} 20 20 ] 21 21 },