Files
DroidDeck/tools/tests/sysv_otime_harness.c
T
Kurt Himebauch 3820445561 feat: Cardboard VR mode with ARM64 SteamVR (#704)
* feat: add Cardboard mode with side-by-side lens-distorted eyes and 3DoF head tracking

* fix: derive the Cardboard field of view from the panel and recentre fully when far from upright

* feat: share the Cardboard head pose with the guest and add a SteamVR driver for it

* feat: run SteamVR's compositor on Turnip/KGSL with a display-extension layer and a driver-direct HMD

* feat: show SteamVR frames in Cardboard mode through a driver-side presenter and a fake direct-mode display

* feat: install and start SteamVR for Cardboard mode from the session drawer

* docs: describe Cardboard mode and the SteamVR path

* feat: drive SteamVR hands from the game pad and keep the Cardboard headset out of standby

* docs: record where the SteamVR dashboard stops

* fix: map Cardboard head tracking to the screen's axes and keep turns about the real vertical as yaw

* fix: give Cardboard its previous picture back when SteamVR stops

* fix: report sem_otime from emulated SysV semaphores so SteamVR's web helper can start

* fix: bridge SteamVR's shared semaphores across processes and keep Steam alive while SteamVR runs

* feat: present SteamVR straight to DroidDeck's compositor at panel resolution

* docs: update Cardboard VR notes for the dashboard, semaphore bridge and direct presenter

* fix: keep Wine and FEX signal handlers in the VR layer; add semaphore tracing

* fix: clear a stale SteamVR active marker on status

* fix: clear only an old SteamVR active marker

* fix: unblock SteamVR clients on Turnip and keep Steam's web helper alive across SteamVR runs

* fix: judge shared waits before a submit's own signals and on Vulkan 1.0 devices

* docs: record VR games, SteamVR Home and OpenXR results on the Thor

* docs: add Cardboard VR learnings from the Thor bring-up

* docs: add Cardboard VR screenshots from the Thor

* fix: keep the VR layer's display stand-in to SteamVR runs and clear a leftover marker at session start

* fix: report SteamVR start and stop failures from the helper's exit code
2026-10-13 14:36:56 +00:00

29 lines
1.1 KiB
C

/* Host test for sysv.c: IPC_STAT's sem_otime turns non-zero with the first semop, which the usual
* race-free init (and SteamVR's web helper) waits for. Linked with sysv.c, whose semget/semop/semctl
* replace libc's. */
#define _GNU_SOURCE
#include <stdio.h>
#include <sys/ipc.h>
#include <sys/sem.h>
int main(void) {
int creator = semget(0x5eed0001, 1, IPC_CREAT | IPC_EXCL | 0600);
if (creator < 0) { perror("semget"); return 1; }
struct semid_ds ds;
if (semctl(creator, 0, IPC_STAT, &ds) != 0 || ds.sem_otime != 0 || ds.sem_ctime == 0) {
printf("FAIL: a new set has otime %ld ctime %ld\n", (long)ds.sem_otime, (long)ds.sem_ctime);
return 1;
}
struct sembuf up = {0, 1, 0};
if (semop(creator, &up, 1) != 0) { perror("semop"); return 1; }
int other = semget(0x5eed0001, 1, 0600);
if (other < 0 || semctl(other, 0, IPC_STAT, &ds) != 0 || ds.sem_otime == 0) {
printf("FAIL: otime still 0 after semop\n");
return 1;
}
if (semctl(other, 0, GETVAL) != 1) { printf("FAIL: value\n"); return 1; }
semctl(creator, 0, IPC_RMID);
printf("PASS: sysv otime\n");
return 0;
}