vtest

package module
v0.0.0-...-af31ec6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 4, 2026 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Overview

Package vtest implements a pure-Go (CGO=0) client for the virglrenderer "vtest" wire protocol — the same protocol Mesa's virgl driver speaks to a running `virgl_test_server` over a Unix-domain socket WITHOUT a virtual machine. Mesa CI uses this path with llvmpipe (software GL, no GPU) to validate the virgl command stream headlessly; go-virtio uses it to feed the command buffers produced by go-virtio/gpu (buildClearVirglBuffer / buildDrawVirglBuffer) to a real renderer and read back the rendered pixels.

All wire constants and layouts below are quoted from virglrenderer's vtest/vtest_protocol.h and the read/write sites in vtest/vtest_renderer.c and vtest/vtest_server.c (utmapp/virglrenderer mirror of gitlab.freedesktop.org/virgl/virglrenderer).

Wire conventions (from vtest_server.c:vtest_client_dispatch_commands and vtest_renderer.c:vtest_block_write):

  • Every value on the wire is a 32-bit unsigned integer in the host byte order of the server. vtest is a local-socket, same-machine protocol, so this is little-endian on all platforms go-virtio targets (x86-64, aarch64). We encode little-endian.

  • Each command is framed by a 2-dword header: dword[0] = length (VTEST_CMD_LEN, # of payload dwords OR bytes, command-specific — see notes per command) dword[1] = cmd id (VTEST_CMD_ID) (vtest_protocol.h: VTEST_HDR_SIZE 2, VTEST_CMD_LEN 0, VTEST_CMD_ID 1.)

Index

Constants

View Source
const (
	VcmdGetCaps             = 1
	VcmdResourceCreate      = 2
	VcmdResourceUnref       = 3
	VcmdTransferGet         = 4
	VcmdTransferPut         = 5
	VcmdSubmitCmd           = 6
	VcmdResourceBusyWait    = 7
	VcmdCreateRenderer      = 8
	VcmdGetCaps2            = 9
	VcmdPingProtocolVersion = 10
	VcmdProtocolVersion     = 11
	VcmdResourceCreate2     = 12
	VcmdTransferGet2        = 13
	VcmdTransferPut2        = 14
)

Command ids — vtest_protocol.h "vtest cmds".

View Source
const (
	VcmdGetParam           = 15
	VcmdGetCapset          = 16
	VcmdContextInit        = 17
	VcmdResourceCreateBlob = 18
	VcmdSyncCreate         = 19
	VcmdSyncUnref          = 20
	VcmdSyncRead           = 21
	VcmdSyncWrite          = 22
	VcmdSyncWait           = 23
	VcmdSubmitCmd2         = 24
)

v3 command ids — vtest_protocol.h (VIRGL_RENDERER_UNSTABLE_APIS block).

View Source
const (
	BlobTypeGuest       = 1
	BlobTypeHost3D      = 2
	BlobTypeHost3DGuest = 3
)

Blob types — vtest_protocol.h enum vcmd_blob_type.

View Source
const (
	BlobFlagMappable    = 1 << 0
	BlobFlagShareable   = 1 << 1
	BlobFlagCrossDevice = 1 << 2
)

Blob flags — vtest_protocol.h enum vcmd_blob_flag.

View Source
const CapsetVenus = 4

CapsetVenus is VIRTGPU_DRM_CAPSET_VENUS (drm-uapi/virtgpu_drm.h: #define VIRTGPU_DRM_CAPSET_VENUS 4), the capset id vtest_init_capset sends.

View Source
const CmdGenerateReplyBit = 0x1

CmdGenerateReplyBit is VK_COMMAND_GENERATE_REPLY_BIT_EXT (vn_protocol_driver_defines.h: `VK_COMMAND_GENERATE_REPLY_BIT_EXT = 0x00000001`). Setting it in a command's cmd_flags makes the host renderer emit a reply into the reply command stream (see EncodeVkSetReplyCommandStreamMESACS and the venusclear driver's reply-shmem path).

View Source
const DefaultSocketName = "/tmp/.virgl_test"

DefaultSocketName — vtest_protocol.h:

#define VTEST_DEFAULT_SOCKET_NAME "/tmp/.virgl_test"
View Source
const SubmitCmd2FlagRingIdx = 1 << 0

SUBMIT_CMD2 batch flags — vtest_protocol.h enum vcmd_submit_cmd2_flag.

View Source
const VcmdParamMaxTimelineCount = 1

VCMD_PARAM_MAX_TIMELINE_COUNT — vtest_protocol.h enum vcmd_param.

View Source
const VtestProtocolVersion = 2

VtestProtocolVersion is the version this client negotiates. vtest_protocol.h: #define VTEST_PROTOCOL_VERSION 2.

View Source
const VtestProtocolVersionVenus = 3

VtestProtocolVersionVenus is the minimum protocol version Venus needs. vn_renderer_vtest.c:vtest_init_protocol_version: min_protocol_version = 3; the v3 opcodes (GET_PARAM/GET_CAPSET/CONTEXT_INIT/RESOURCE_CREATE_BLOB/ SUBMIT_CMD2) are compiled only under VIRGL_RENDERER_UNSTABLE_APIS.

Variables

This section is empty.

Functions

func EncodeMinimalVkCreateInstanceCS

func EncodeMinimalVkCreateInstanceCS(cmdFlags uint32, appName, engineName string, apiVersion uint64, instanceHandle uint64) []byte

EncodeMinimalVkCreateInstanceCS produces the command stream for a minimal vkCreateInstance with an application info (no layers, no extensions) and a returned-handle slot. This is the command we write INTO the ring to force the host consumer to advance head. Field order from vn_encode_vkCreateInstance + vn_encode_VkInstanceCreateInfo(_self) + vn_encode_VkApplicationInfo(_self):

vkCreateInstance:
  i32 cmd_type=0
  u32 cmd_flags
  u64 simple_pointer(pCreateInfo)=1
    VkInstanceCreateInfo:
      i32 sType=INSTANCE_CREATE_INFO
      u64 simple_pointer(pNext)=0
      u32 flags=0
      u64 simple_pointer(pApplicationInfo)=1
        VkApplicationInfo:
          i32 sType=APPLICATION_INFO
          u64 simple_pointer(pNext)=0
          str pApplicationName    (array_size(0) when "")
          u32 applicationVersion
          str pEngineName         (array_size(0) when "")
          u32 engineVersion
          u32 apiVersion
      u32 enabledLayerCount=0
      (pp layer names) array_size(0)
      u32 enabledExtensionCount=0
      (pp ext names) array_size(0)
  u64 simple_pointer(pAllocator)=0
  u64 simple_pointer(pInstance)=1
    u64 handle id (0 placeholder; the renderer fills the reply)

cmdFlags carries the vn_cs cmd flags; Mesa's vn_submit_vkCreateInstance uses VK_COMMAND_GENERATE_REPLY_BIT_EXT (= 1) to request a reply, but for the bare "did the host consume the ring" proof a reply is not required, so the caller chooses (0 = fire-and-forget, 1 = ask for a reply).

func EncodeVkCreateRingMESACS

func EncodeVkCreateRingMESACS(ring uint64, info RingCreateInfoMESA) []byte

EncodeVkCreateRingMESACS produces the raw command stream for vkCreateRingMESA(ring, &VkRingCreateInfoMESA{...}), the cs Mesa passes to vn_renderer_submit_simple in vn_ring_create. pNext is encoded as NULL (the optional VkRingMonitorInfoMESA is omitted; vn_encode_VkRingCreateInfoMESA_pnext accepts a NULL chain as simple_pointer(0)).

Field order, from vn_encode_vkCreateRingMESA + vn_encode_VkRingCreateInfoMESA + _self:

i32 cmd_type=188
u32 cmd_flags=0
u64 ring (handle)
u64 simple_pointer(pCreateInfo)=1
  i32 sType=RING_CREATE_INFO_MESA
  u64 simple_pointer(pNext)=0          (no monitor info)
  u32 flags
  u32 resourceId
  u64 offset u64 size u64 idleTimeout
  u64 headOffset u64 tailOffset u64 statusOffset
  u64 bufferOffset u64 bufferSize u64 extraOffset u64 extraSize

func EncodeVkSetReplyCommandStreamMESACS

func EncodeVkSetReplyCommandStreamMESACS(resourceID uint32, offset, size uint64) []byte

EncodeVkSetReplyCommandStreamMESACS produces the command stream for vkSetReplyCommandStreamMESA(&VkCommandStreamDescriptionMESA{resourceId, offset, size}), the command Mesa submits into the ring BEFORE a reply-bearing command to tell the host renderer where to write that reply (vn_ring.c:vn_ring_set_reply_shmem_locked). The reply lands in a SEPARATE reply shmem resource (resourceId), not in the ring's extra region.

Field order, from vn_encode_vkSetReplyCommandStreamMESA + vn_encode_VkCommandStreamDescriptionMESA (vn_protocol_driver_transport.h:558 / :27):

i32 cmd_type=178
u32 cmd_flags=0
u64 simple_pointer(pStream)=1
  u32 resourceId
  u64 offset   (size_t -> u64; vn_encode_size_t)
  u64 size     (size_t -> u64)

func RingShmemSize

func RingShmemSize(bufferSize, extraSize int) int

RingShmemSize returns the total ring shared-memory size for a command buffer of bufferSize bytes plus an extra (reply) region of extraSize bytes: extra_offset = buffer_offset + buffer_size; shmem_size = extra_offset + extra_size (vn_ring.c).

Types

type ClearImageResult

type ClearImageResult struct {
	NegotiatedVersion uint32
	MaxTimelineCount  uint32
	CapsetLen         int
	RingBlobResID     uint32
	ReplyBlobResID    uint32

	// Decoded handles / indices from each reply.
	Instance       uint64
	PhysDevCount   uint32
	PhysDev        uint64
	MemTypeCount   uint32
	MemTypeIndex   uint32 // chosen HOST_VISIBLE|COHERENT type
	MemTypeFlags   uint32
	QueueFamCount  uint32
	QueueFamilyIdx uint32
	Device         uint64
	Queue          uint64
	Image          uint64
	MemReqSize     uint64
	MemReqAlign    uint64
	MemReqBits     uint32
	Memory         uint64
	CmdPool        uint64
	CmdBuf         uint64
	Fence          uint64

	// VkResult of each result-bearing reply (0 == VK_SUCCESS).
	ResCreateInstance int32
	ResCreateDevice   int32
	ResCreateImage    int32
	ResAllocMemory    int32
	ResBindImage      int32
	ResCreatePool     int32
	ResAllocCmdBuf    int32
	ResBeginCmdBuf    int32
	ResEndCmdBuf      int32
	ResCreateFence    int32
	ResQueueSubmit    int32
	ResWaitForFences  int32

	// Step-by-step trace lines (each command's seqno + head-after + decode).
	Trace []string

	// ClearColor is the colour we asked CmdClearColorImage to write.
	ClearColor [4]float32

	// ---- guest-visible readback (the last Venus frontier) ----
	// MemBlobResID is the res_id of the HOST3D|MAPPABLE blob whose blob_id ties
	// to the VkDeviceMemory (vn_device_memory_bo_init: blob_id = mem->base.id);
	// the host backs the device memory with this blob, so its mmap IS the
	// cleared image's storage. Zero until the readback path runs.
	MemBlobResID uint32
	// ReadbackDone is true once the mapped device-memory blob was read.
	ReadbackDone bool
	// FirstTexel is the RGBA bytes of pixel (0,0) read from the mapped blob.
	FirstTexel [4]byte
	// ExpectTexel is the expected clear texel (the float clear encoded to the
	// image format, R8G8B8A8_UNORM here).
	ExpectTexel [4]byte
	// TexelsChecked / TexelsRed: how many texels of the first row(s) were read
	// back and how many matched the clear colour.
	TexelsChecked int
	TexelsRed     int
	// ReadbackPass is true iff every checked texel equalled the clear colour.
	ReadbackPass bool
}

ClearImageResult records every host-observable value of the clear-image walk so the caller can report exact acceptance per command.

func VenusClearImage

func VenusClearImage(socketPath string, bufferSize, width, height int, clear [4]float32, timeout time.Duration) (*ClearImageResult, error)

VenusClearImage runs the full clear-image walk against a live virgl_test_server --venus and returns the observed result. width/height are the LINEAR image dimensions; clear is the RGBA colour (0..1 floats).

bufferSize must be a power of two and large enough to hold every command stream written across the whole sequence without wrapping (the validator picks a large default). On any host rejection the returned error quotes the failing command; the caller should additionally capture the server stderr (the next wall).

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client is a vtest protocol client speaking to a virgl_test_server over a connected stream (a *net.UnixConn in production; any io.ReadWriter in tests).

The encoders are split out as package-level functions (encode*) so they can be unit-tested offline against hand-derived expected byte streams without a live server, mirroring the go-virtio/venus "proof" tests.

func Dial

func Dial(socketPath string) (*Client, net.Conn, error)

Dial connects to a virgl_test_server listening on the given Unix socket path (use DefaultSocketName for the server's default).

func New

func New(rw io.ReadWriter) *Client

New wraps an already-connected stream.

func (*Client) ContextInit

func (c *Client) ContextInit(capsetID uint32) error

ContextInit sends VCMD_CONTEXT_INIT(capset_id). No reply body.

func (*Client) CreateResource

func (c *Client) CreateResource(a ResourceCreateArgs) error

CreateResource sends VCMD_RESOURCE_CREATE. No reply body.

func (*Client) GetCapset

func (c *Client) GetCapset(id, version uint32) (capset []byte, valid bool, err error)

GetCapset sends VCMD_GET_CAPSET(id, version). It returns the raw capset blob (struct virgl_renderer_capset_venus on the wire) and whether the server reported it valid. Layout per vtest_vcmd_get_capset: reply header length counts {valid}+capset in dwords, so capset is (length-1)*4 bytes.

func (*Client) GetParam

func (c *Client) GetParam(param uint32) (uint32, error)

GetParam sends VCMD_GET_PARAM and returns the value (0 when the server reports the param invalid, mirroring vtest_vcmd_get_param's `resp[0] ? resp[1] : 0`).

func (*Client) Handshake

func (c *Client) Handshake(name string, version uint32) (negotiated uint32, err error)

Handshake performs the full vtest startup handshake against a live server:

  1. VCMD_PING_PROTOCOL_VERSION -> server replies header [0,10]
  2. VCMD_PROTOCOL_VERSION(v) -> server replies header [1,11] + [negotiated]
  3. VCMD_CREATE_RENDERER(name) -> no reply

It returns the protocol version the server negotiated. Per vtest_server.c:vtest_client_dispatch_commands, CREATE_RENDERER must be the FIRST command that creates the context — but PING/PROTOCOL_VERSION are dispatched against the current context, so Mesa sends CREATE_RENDERER first in practice. We follow Mesa's util/virgl_vtest_socket ordering: ping, negotiate, then create.

NOTE on ordering: vtest_server requires the very first header to be CREATE_RENDERER before a context exists. Real Mesa sends CREATE_RENDERER first, THEN ping/negotiate. We therefore send create first here.

func (*Client) HandshakeVenus

func (c *Client) HandshakeVenus(name string) (negotiated uint32, err error)

HandshakeVenus performs the vtest startup handshake negotiating protocol version >= 3 (required for Venus). Same ordering as Handshake but asks for v3. It returns the version the server negotiated; the caller MUST verify it is >= 3 (an older virglrenderer built WITHOUT VIRGL_RENDERER_UNSTABLE_APIS caps the negotiation at 2 and every Venus opcode below is unreachable — that is the first wall to map).

func (*Client) SubmitCmd

func (c *Client) SubmitCmd(cmdBuf []byte) error

SubmitCmd sends VCMD_SUBMIT_CMD carrying a virgl command buffer. No reply.

func (*Client) SubmitCmd2

func (c *Client) SubmitCmd2(batch SubmitCmd2Batch) error

SubmitCmd2 sends a single-batch VCMD_SUBMIT_CMD2. No reply body (vtest_submit_cmd2 dispatches into virgl_renderer_submit_cmd and returns).

func (*Client) TransferGet

func (c *Client) TransferGet(a TransferGetArgs) ([]byte, error)

TransferGet sends VCMD_TRANSFER_GET and reads back exactly args.DataSize bytes of pixel data (the server writes the read-back IOV with no response header, per vtest_transfer_get_internal).

func (*Client) TransferPut

func (c *Client) TransferPut(a TransferGetArgs, data []byte) error

TransferPut sends VCMD_TRANSFER_PUT uploading data into a resource. No reply.

type MappedRing

type MappedRing struct {
	ResID uint32
	// contains filtered or unexported fields
}

MappedRing is an mmap'd ring shared-memory region plus its res_id.

func (*MappedRing) Extra

func (m *MappedRing) Extra() []byte

Extra returns the ring's extra (reply) region as a sub-slice of the mapping. Unused by the dedicated-reply-blob path (replies land in a separate blob), but exposed for completeness/inspection.

func (*MappedRing) Head

func (m *MappedRing) Head() uint32

Head/Tail/Status read the consumer/producer/status control words from the mmap (vn_ring.c offsets). Head and Status are written by the HOST renderer.

func (*MappedRing) Status

func (m *MappedRing) Status() uint32

func (*MappedRing) Submit

func (m *MappedRing) Submit(cmd []byte) uint32

Submit writes a whole command stream into the ring buffer at the current monotonic cursor, advances the cursor, and release-stores the new tail. It returns the new tail value, which is the command's seqno (vn_ring_submit_internal: `submit->seqno = ring->cur`). The caller waits for the host head to reach this seqno via WaitHead. cmd MUST be a whole number of dwords (vn_cs pads every command to 4). Commands must collectively fit in the buffer for this simple non-wrapping driver (we size the buffer large).

func (*MappedRing) Tail

func (m *MappedRing) Tail() uint32

func (*MappedRing) Unmap

func (m *MappedRing) Unmap() error

Unmap releases the mapping.

func (*MappedRing) WaitHead

func (m *MappedRing) WaitHead(seqno uint32, timeout time.Duration) (head uint32, reached bool)

WaitHead busy-polls the HOST-owned head word until head >= seqno (the host consumer has consumed through this command) or the deadline elapses. It mirrors vn_ring.c:vn_ring_wait_seqno (vn_ring_get_seqno_status: head >= seqno). It returns the final head and whether the seqno was reached. Our command sizes keep the monotonic cursor well below 2^31, so the wrapping- aware comparison in Mesa reduces to a plain unsigned >= here.

type RawConn

type RawConn struct {
	// contains filtered or unexported fields
}

RawConn is a raw-fd vtest transport: a connected AF_UNIX/SOCK_STREAM socket we read/write with plain syscalls so we can recvmsg the blob fd.

func DialRaw

func DialRaw(socketPath string) (*RawConn, error)

DialRaw connects to the vtest server at socketPath on a bare socket fd.

func (*RawConn) Close

func (r *RawConn) Close() error

Close closes the socket.

func (*RawConn) Read

func (r *RawConn) Read(p []byte) (int, error)

Read reads up to len(p) bytes (single recv; callers loop for full reads via readFull). It satisfies io.Reader so RawConn can back a Client for the plain (non-fd) commands.

func (*RawConn) ResourceCreateBlob

func (r *RawConn) ResourceCreateBlob(blobType, flags uint32, size, blobID uint64) (resID uint32, fd int, err error)

ResourceCreateBlob sends VCMD_RESOURCE_CREATE_BLOB, reads the [len=1,id=18] + res_id reply, then recvmsg's the exported blob fd over SCM_RIGHTS. Mirrors vn_renderer_vtest.c:vtest_vcmd_resource_create_blob.

func (*RawConn) Write

func (r *RawConn) Write(p []byte) (int, error)

Write writes the whole buffer (handles short writes), matching vn_renderer_vtest.c:vtest_write.

type ResourceCreateArgs

type ResourceCreateArgs struct {
	Handle    uint32 // [0] RES_HANDLE — client-chosen resource id
	Target    uint32 // [1] TARGET     — pipe_texture_target (2 = 2D)
	Format    uint32 // [2] FORMAT     — virgl_formats
	Bind      uint32 // [3] BIND       — VIRGL_BIND_* (RENDER_TARGET etc.)
	Width     uint32 // [4] WIDTH
	Height    uint32 // [5] HEIGHT
	Depth     uint32 // [6] DEPTH
	ArraySize uint32 // [7] ARRAY_SIZE
	LastLevel uint32 // [8] LAST_LEVEL
	NrSamples uint32 // [9] NR_SAMPLES
}

ResourceCreateArgs mirrors the 10-dword VCMD_RESOURCE_CREATE payload read by vtest_renderer.c:vtest_create_resource_decode_args, field order from vtest_protocol.h (VCMD_RES_CREATE_* indices).

type RingCreateInfoMESA

type RingCreateInfoMESA struct {
	Flags        uint32
	ResourceID   uint32
	Offset       uint64
	Size         uint64
	IdleTimeout  uint64
	HeadOffset   uint64
	TailOffset   uint64
	StatusOffset uint64
	BufferOffset uint64
	BufferSize   uint64
	ExtraOffset  uint64
	ExtraSize    uint64
}

RingCreateInfoMESA mirrors the fields of VkRingCreateInfoMESA that vn_encode_VkRingCreateInfoMESA_self serialises (sType/pNext skipped). It is the same shape as go-virtio/venus/ring.CreateInfo; we keep a local copy so this package does not need the venus module just to name the fields.

type RoundTripResult

type RoundTripResult struct {
	NegotiatedVersion uint32
	MaxTimelineCount  uint32
	CapsetLen         int
	BlobResID         uint32
	RingTailAfter     uint32
	HeadStart         uint32
	HeadAfter         uint32
	StatusAfter       uint32
	HeadAdvanced      bool
}

RoundTripResult captures the observed host response of a Venus ring attempt.

func VenusRingRoundTrip

func VenusRingRoundTrip(socketPath string, bufferSize, extraSize int, timeout time.Duration) (*RoundTripResult, error)

VenusRingRoundTrip performs the full Venus bring-up over the vtest socket and attempts the genuine round-trip: it creates the ring's backing HOST3D blob, mmaps it, registers the ring (vkCreateRingMESA via SUBMIT_CMD2 ring_idx 0), writes a vkCreateInstance command stream into the ring buffer, stores the new tail, then busy-polls the HOST-owned head word for up to timeout. A head advance past 0 is the host actually consuming our ring bytes — the real "host responded" proof.

bufferSize must be a power of two. The returned result records every host-observable value (negotiated version, timeline count, capset length, blob res_id, and the head/status the host wrote) so the caller can report the exact outcome or the precise wall.

type SubmitCmd2Batch

type SubmitCmd2Batch struct {
	Flags   uint32
	RingIdx uint32
	Syncs   []SubmitCmd2Sync
	CmdData []byte // the raw command stream (must be a whole number of dwords)
}

SubmitCmd2Batch mirrors struct vcmd_submit_cmd2_batch (vtest_protocol.h), which is EIGHT dwords on the wire:

{flags, cmd_offset, cmd_size, sync_offset, sync_count, ring_idx,
 num_in_syncobj, num_out_syncobj}

where the offsets/sizes are in DWORDS relative to the start of the submit payload (after the batch_count + the batch headers). The two trailing syncobj-count dwords are only *read* by the server at protocol_version >= 4 (vtest_renderer.c:vtest_submit_cmd2), but Mesa always writes the whole sizeof(struct vcmd_submit_cmd2_batch) = 32 bytes = 8 dwords (vn_renderer_vtest.c:vtest_vcmd_submit_cmd2 `vtest_write(vtest, &dst, sizeof(dst))`), so the batch stride is 8 dwords regardless of version. We zero num_in/num_out_syncobj.

type SubmitCmd2Sync

type SubmitCmd2Sync struct {
	ID    uint32
	Value uint64
}

SubmitCmd2Sync is one (sync_id, value) pair appended after the command streams (vtest_vcmd_submit_cmd2 writes {id, val_lo, val_hi}).

type TransferGetArgs

type TransferGetArgs struct {
	Handle      uint32 // [0]  RES_HANDLE
	Level       uint32 // [1]  LEVEL
	Stride      uint32 // [2]  STRIDE
	LayerStride uint32 // [3]  LAYER_STRIDE
	X           uint32 // [4]  X
	Y           uint32 // [5]  Y
	Z           uint32 // [6]  Z
	Width       uint32 // [7]  WIDTH
	Height      uint32 // [8]  HEIGHT
	Depth       uint32 // [9]  DEPTH
	DataSize    uint32 // [10] DATA_SIZE — bytes the server writes back
}

TransferGetArgs mirrors the 11-dword VCMD_TRANSFER_GET payload read by vtest_renderer.c:vtest_transfer_decode_args (VCMD_TRANSFER_* indices). The box (x,y,z,w,h,d) is a virgl_box; DataSize is how many bytes the server will write back (vtest_transfer_get_internal mallocs DataSize and block_writes it after the read-back, with no response header).

Directories

Path Synopsis
cmd
validator command
Command validator feeds a go-virtio/gpu virgl command buffer (dumped to a file on the host) to a real virgl_test_server and reads back the rendered pixels, asserting the expected colour.
Command validator feeds a go-virtio/gpu virgl command buffer (dumped to a file on the host) to a real virgl_test_server and reads back the rendered pixels, asserting the expected colour.
venusclear command
Command venusclear drives the FULL Venus clear-image command sequence against a live `virgl_test_server --venus` (backed by lavapipe) over the vtest socket, then reports the host's acceptance of every command.
Command venusclear drives the FULL Venus clear-image command sequence against a live `virgl_test_server --venus` (backed by lavapipe) over the vtest socket, then reports the host's acceptance of every command.
venusvalidator command
Command venusvalidator drives a real `virgl_test_server --venus` over the vtest socket and attempts the genuine Venus round-trip: bring up a Venus context, create + mmap the ring's backing HOST3D blob, register the ring with vkCreateRingMESA, write a vkCreateInstance command stream into the ring, and busy-poll the HOST-owned head word.
Command venusvalidator drives a real `virgl_test_server --venus` over the vtest socket and attempts the genuine Venus round-trip: bring up a Venus context, create + mmap the ring's backing HOST3D blob, register the ring with vkCreateRingMESA, write a vkCreateInstance command stream into the ring, and busy-poll the HOST-owned head word.
Package refrender is a tiny software REFERENCE rasteriser used to turn the go-virtio/gpu virgl draw/tex command buffers into an EXACT expected 16x16 BGRA framebuffer, so the live-virglrenderer readback can be checked against an analytic ground truth (coverage + per-channel colour) rather than the weak "non-uniform / >=2 colours" heuristic.
Package refrender is a tiny software REFERENCE rasteriser used to turn the go-virtio/gpu virgl draw/tex command buffers into an EXACT expected 16x16 BGRA framebuffer, so the live-virglrenderer readback can be checked against an analytic ground truth (coverage + per-channel colour) rather than the weak "non-uniform / >=2 colours" heuristic.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL