The open source OpenXR runtime
0
fork

Configure Feed

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

ipc: Initialize hmd data from static role

Make sure the xdev used to read the hmd part is the one from head static
role. This fixes issues in case more than one hmd is available.

Part-of: <https://gitlab.freedesktop.org/monado/monado/-/merge_requests/2427>

authored by

Patrick Nicolas and committed by
Marge Bot
4e22c990 ecf26e0f

+16 -17
+16 -17
src/xrt/ipc/server/ipc_server_process.c
··· 357 357 isdev->stage_supported = xdev->stage_supported; 358 358 isdev->battery_status_supported = xdev->battery_status_supported; 359 359 360 - // Is this a HMD? 361 - if (xdev->hmd != NULL) { 362 - // set view count 363 - ism->hmd.view_count = xdev->hmd->view_count; 364 - for (uint32_t view = 0; view < xdev->hmd->view_count; ++view) { 365 - ism->hmd.views[view].display.w_pixels = xdev->hmd->views[view].display.w_pixels; 366 - ism->hmd.views[view].display.h_pixels = xdev->hmd->views[view].display.h_pixels; 367 - } 368 - 369 - for (size_t i = 0; i < xdev->hmd->blend_mode_count; i++) { 370 - // Not super necessary, we also do this assert in oxr_system.c 371 - assert(u_verify_blend_mode_valid(xdev->hmd->blend_modes[i])); 372 - ism->hmd.blend_modes[i] = xdev->hmd->blend_modes[i]; 373 - } 374 - ism->hmd.blend_mode_count = xdev->hmd->blend_mode_count; 375 - } 376 - 377 360 // Setup the tracking origin. 378 361 isdev->tracking_origin_index = (uint32_t)-1; 379 362 for (uint32_t k = 0; k < XRT_SYSTEM_MAX_DEVICES; k++) { ··· 427 410 isdev->first_output_index = output_start; 428 411 } 429 412 } 413 + 414 + // Setup the HMD 415 + // set view count 416 + assert(s->xsysd->static_roles.head->hmd); 417 + ism->hmd.view_count = s->xsysd->static_roles.head->hmd->view_count; 418 + for (uint32_t view = 0; view < s->xsysd->static_roles.head->hmd->view_count; ++view) { 419 + ism->hmd.views[view].display.w_pixels = s->xsysd->static_roles.head->hmd->views[view].display.w_pixels; 420 + ism->hmd.views[view].display.h_pixels = s->xsysd->static_roles.head->hmd->views[view].display.h_pixels; 421 + } 422 + 423 + for (size_t i = 0; i < s->xsysd->static_roles.head->hmd->blend_mode_count; i++) { 424 + // Not super necessary, we also do this assert in oxr_system.c 425 + assert(u_verify_blend_mode_valid(s->xsysd->static_roles.head->hmd->blend_modes[i])); 426 + ism->hmd.blend_modes[i] = s->xsysd->static_roles.head->hmd->blend_modes[i]; 427 + } 428 + ism->hmd.blend_mode_count = s->xsysd->static_roles.head->hmd->blend_mode_count; 430 429 431 430 // Finally tell the client how many devices we have. 432 431 s->ism->isdev_count = count;