The open source OpenXR runtime
0
fork

Configure Feed

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

d/ohmd: Add quirk to rotate WVR2 display left

OpenHMD can't easily tell us the WVR SKU because it has to read it
from the config after opening the device, while the product string
is set at device list time.

As a workaround, recognize the WVR2 by its resolution.

+26
+26
src/xrt/drivers/ohmd/oh_device.c
··· 224 224 struct 225 225 { 226 226 bool rotate_lenses_right; 227 + bool rotate_lenses_left; 227 228 bool rotate_lenses_inwards; 228 229 bool video_see_through; 229 230 bool video_distortion_none; ··· 291 292 292 293 if (strcmp(prod, "Rift (CV1)") == 0) { 293 294 info.quirks.delay_after_initialization = true; 295 + } 296 + 297 + /* Only the WVR2 display is rotated. OpenHMD can't easily tell us 298 + * the WVR SKU, so just recognize it by resolution */ 299 + if (strcmp(prod, "VR-Tek WVR") == 0 && 300 + info.display.w_pixels == 2560 && 301 + info.display.h_pixels == 1440) { 302 + info.quirks.rotate_lenses_left = true; 294 303 } 295 304 296 305 ··· 540 549 ohd->base.hmd->views[1].viewport.w_pixels = w; 541 550 ohd->base.hmd->views[1].viewport.h_pixels = h / 2; 542 551 ohd->base.hmd->views[1].rot = u_device_rotation_right; 552 + } 553 + 554 + if (info.quirks.rotate_lenses_left) { 555 + int w = info.display.w_pixels; 556 + int h = info.display.h_pixels; 557 + 558 + ohd->base.hmd->views[0].viewport.x_pixels = 0; 559 + ohd->base.hmd->views[0].viewport.y_pixels = 0; 560 + ohd->base.hmd->views[0].viewport.w_pixels = w; 561 + ohd->base.hmd->views[0].viewport.h_pixels = h / 2; 562 + ohd->base.hmd->views[0].rot = u_device_rotation_left; 563 + 564 + ohd->base.hmd->views[1].viewport.x_pixels = 0; 565 + ohd->base.hmd->views[1].viewport.y_pixels = h / 2; 566 + ohd->base.hmd->views[1].viewport.w_pixels = w; 567 + ohd->base.hmd->views[1].viewport.h_pixels = h / 2; 568 + ohd->base.hmd->views[1].rot = u_device_rotation_left; 543 569 } 544 570 545 571 if (info.quirks.rotate_lenses_inwards) {