XenevaOS
Loading...
Searching...
No Matches
gpusrv.h
Go to the documentation of this file.
1/* GPUSRV=1: asynchronous virtio-gpu presentation over /dev/gpusrv.
2 *
3 * /dev/graph maps a kernel-owned, tightly packed desktop framebuffer. It is
4 * stable across server restarts and mirrored to GOP on each damage update.
5 * ACQUIRE requires the caller's hwdev capability for 1af4:1050. The ABI never
6 * returns a physical framebuffer address owned by the kernel: the server
7 * supplies DMA backing pages allocated through its own /dev/hwdev capability.
8 * TAKE copies pending damage from the stable kernel framebuffer into that
9 * backing, then freezes the frame until ACK.
10 * Only one frame may be in flight. New damage coalesces while it is busy.
11 * The server must reset the device before ACQUIRE and close its hwdev handle
12 * after any failed/timed-out command. It must never ACK unfinished device I/O.
13 * The kernel never waits for the server and never frees either framebuffer.
14 */
15#ifndef __GPUSRV_ABI_H__
16#define __GPUSRV_ABI_H__
17#include <stdint.h>
18
19#define GPUSRV_VERSION 1
20#define GPUSRV_VENDOR 0x1AF4
21#define GPUSRV_DEVICE 0x1050
22#define GPUSRV_RESOURCE 1
23#define GPUSRV_MAX_DIM 4096
24#define GPUSRV_MAX_BACKING 16
25#define GPUSRV_MAX_BACKING_BYTES (1024 * 1024)
26
27#define GPUSRV_IOC_ACQUIRE 0x5801
28#define GPUSRV_IOC_TAKE 0x5802
29#define GPUSRV_IOC_ACK 0x5803
30#define GPUSRV_IOC_STATUS 0x5804
31/* Damage is deliberately kept at the old compositor value: the node is
32 * different (/dev/gpusrv rather than /dev/virtiogpu), so existing private
33 * ioctl callers can migrate without another number translation. */
34#define GPUSRV_IOC_DAMAGE 0x202
35#define GPUSRV_IOC_FLUSH 0x203
36#define GPUSRV_IOC_RESOURCE 0x204
37
38#define GPUSRV_OK 0
39#define GPUSRV_E_PERM -1
40#define GPUSRV_E_INVAL -2
41#define GPUSRV_E_BUSY -3
42#define GPUSRV_E_EMPTY -4
43#define GPUSRV_E_UNAVAILABLE -5
44
45typedef struct {
46 uint32_t x, y, width, height;
48
54
63
64typedef struct {
66 uint32_t x, y, width, height;
68
69typedef struct {
71} GpuSrvAck;
72
73typedef struct {
76 uint64_t submitted, completed, generation;
78#endif
int int32_t
Definition acefiex.h:160
unsigned int uint32_t
Definition acefiex.h:163
COMPILER_DEPENDENT_UINT64 uint64_t
Definition acefiex.h:165
float pitch
Definition compose3d.cpp:145
bool ready
Definition compose3d.cpp:134
GameVersion_t version
Definition d_main.c:943
#define GPUSRV_MAX_BACKING
Definition gpusrv.h:24
int y
Definition layout.c:118
int x
Definition layout.c:118
Definition gpusrv.h:69
uint64_t sequence
Definition gpusrv.h:70
Definition gpusrv.h:55
uint32_t height
Definition gpusrv.h:58
uint32_t version
Definition gpusrv.h:56
uint64_t backing_bytes
Definition gpusrv.h:59
int32_t hw_handle
Definition gpusrv.h:57
uint32_t backing_count
Definition gpusrv.h:60
Definition gpusrv.h:49
uint64_t phys
Definition gpusrv.h:50
uint32_t length
Definition gpusrv.h:51
uint32_t reserved
Definition gpusrv.h:52
Definition gpusrv.h:45
uint32_t height
Definition gpusrv.h:46
Definition gpusrv.h:64
uint64_t sequence
Definition gpusrv.h:65
uint32_t height
Definition gpusrv.h:66
Definition gpusrv.h:73
uint32_t attached
Definition gpusrv.h:74
uint32_t height
Definition gpusrv.h:75
uint64_t completed
Definition gpusrv.h:76
Definition ioport.h:44