VirtualBox

source: vbox/trunk/include/VBox/Graphics/VBoxVideo.h@ 104429

Last change on this file since 104429 was 98103, checked in by vboxsync, 20 months ago

Copyright year updates by scm.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 48.0 KB
RevLine 
[69015]1/* $Id: VBoxVideo.h 98103 2023-01-17 14:15:46Z vboxsync $ */
[3165]2/** @file
[21217]3 * VirtualBox Video interface.
[3165]4 */
5
6/*
[98103]7 * Copyright (C) 2006-2023 Oracle and/or its affiliates.
[3165]8 *
[69307]9 * Permission is hereby granted, free of charge, to any person
10 * obtaining a copy of this software and associated documentation
11 * files (the "Software"), to deal in the Software without
12 * restriction, including without limitation the rights to use,
13 * copy, modify, merge, publish, distribute, sublicense, and/or sell
14 * copies of the Software, and to permit persons to whom the
15 * Software is furnished to do so, subject to the following
16 * conditions:
[5999]17 *
[69307]18 * The above copyright notice and this permission notice shall be
19 * included in all copies or substantial portions of the Software.
[69179]20 *
[69307]21 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
22 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
23 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
24 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
25 * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
26 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
27 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
[69179]28 * OTHER DEALINGS IN THE SOFTWARE.
[3165]29 */
30
[76558]31#ifndef VBOX_INCLUDED_Graphics_VBoxVideo_h
32#define VBOX_INCLUDED_Graphics_VBoxVideo_h
[76507]33#ifndef RT_WITHOUT_PRAGMA_ONCE
34# pragma once
35#endif
[3165]36
[68657]37#include "VBoxVideoIPRT.h"
[3165]38
[65381]39/* this should be in sync with monitorCount <xsd:maxInclusive value="64"/> in src/VBox/Main/xml/VirtualBox-settings-common.xsd */
40#define VBOX_VIDEO_MAX_SCREENS 64
41
[18135]42/*
[3165]43 * The last 4096 bytes of the guest VRAM contains the generic info for all
44 * DualView chunks: sizes and offsets of chunks. This is filled by miniport.
45 *
46 * Last 4096 bytes of each chunk contain chunk specific data: framebuffer info,
47 * etc. This is used exclusively by the corresponding instance of a display driver.
48 *
[18135]49 * The VRAM layout:
[4027]50 * Last 4096 bytes - Adapter information area.
51 * 4096 bytes aligned miniport heap (value specified in the config rouded up).
52 * Slack - what left after dividing the VRAM.
53 * 4096 bytes aligned framebuffers:
54 * last 4096 bytes of each framebuffer is the display information area.
55 *
[3165]56 * The Virtual Graphics Adapter information in the guest VRAM is stored by the
57 * guest video driver using structures prepended by VBOXVIDEOINFOHDR.
58 *
[4027]59 * When the guest driver writes dword 0 to the VBE_DISPI_INDEX_VBOX_VIDEO
[3165]60 * the host starts to process the info. The first element at the start of
61 * the 4096 bytes region should be normally be a LINK that points to
62 * actual information chain. That way the guest driver can have some
63 * fixed layout of the information memory block and just rewrite
64 * the link to point to relevant memory chain.
65 *
66 * The processing stops at the END element.
67 *
68 * The host can access the memory only when the port IO is processed.
69 * All data that will be needed later must be copied from these 4096 bytes.
70 * But other VRAM can be used by host until the mode is disabled.
71 *
[4027]72 * The guest driver writes dword 0xffffffff to the VBE_DISPI_INDEX_VBOX_VIDEO
[3165]73 * to disable the mode.
74 *
[4027]75 * VBE_DISPI_INDEX_VBOX_VIDEO is used to read the configuration information
76 * from the host and issue commands to the host.
[18135]77 *
[4027]78 * The guest writes the VBE_DISPI_INDEX_VBOX_VIDEO index register, the the
79 * following operations with the VBE data register can be performed:
[18135]80 *
[4027]81 * Operation Result
82 * write 16 bit value NOP
83 * read 16 bit value count of monitors
84 * write 32 bit value sets the vbox command value and the command processed by the host
85 * read 32 bit value result of the last vbox command is returned
[3165]86 */
87
88#define VBOX_VIDEO_PRIMARY_SCREEN 0
89#define VBOX_VIDEO_NO_SCREEN ~0
90
[64185]91/**
92 * VBVA command header.
93 *
94 * @todo Where does this fit in?
95 */
96typedef struct VBVACMDHDR
97{
98 /** Coordinates of affected rectangle. */
99 int16_t x;
100 int16_t y;
101 uint16_t w;
102 uint16_t h;
103} VBVACMDHDR;
104AssertCompileSize(VBVACMDHDR, 8);
105
106/** @name VBVA ring defines.
107 *
108 * The VBVA ring buffer is suitable for transferring large (< 2GB) amount of
109 * data. For example big bitmaps which do not fit to the buffer.
110 *
111 * Guest starts writing to the buffer by initializing a record entry in the
112 * aRecords queue. VBVA_F_RECORD_PARTIAL indicates that the record is being
113 * written. As data is written to the ring buffer, the guest increases off32End
114 * for the record.
115 *
116 * The host reads the aRecords on flushes and processes all completed records.
117 * When host encounters situation when only a partial record presents and
118 * cbRecord & ~VBVA_F_RECORD_PARTIAL >= VBVA_RING_BUFFER_SIZE -
119 * VBVA_RING_BUFFER_THRESHOLD, the host fetched all record data and updates
120 * off32Head. After that on each flush the host continues fetching the data
121 * until the record is completed.
122 *
123 */
124#define VBVA_RING_BUFFER_SIZE (_4M - _1K)
125#define VBVA_RING_BUFFER_THRESHOLD (4 * _1K)
126
127#define VBVA_MAX_RECORDS (64)
128
129#define VBVA_F_MODE_ENABLED UINT32_C(0x00000001)
130#define VBVA_F_MODE_VRDP UINT32_C(0x00000002)
131#define VBVA_F_MODE_VRDP_RESET UINT32_C(0x00000004)
132#define VBVA_F_MODE_VRDP_ORDER_MASK UINT32_C(0x00000008)
133
134#define VBVA_F_STATE_PROCESSING UINT32_C(0x00010000)
135
136#define VBVA_F_RECORD_PARTIAL UINT32_C(0x80000000)
137
138/**
139 * VBVA record.
140 */
141typedef struct VBVARECORD
142{
143 /** The length of the record. Changed by guest. */
144 uint32_t cbRecord;
145} VBVARECORD;
146AssertCompileSize(VBVARECORD, 4);
147
[3165]148/* The size of the information. */
[17676]149/*
150 * The minimum HGSMI heap size is PAGE_SIZE (4096 bytes) and is a restriction of the
151 * runtime heapsimple API. Use minimum 2 pages here, because the info area also may
[18135]152 * contain other data (for example HGSMIHOSTFLAGS structure).
[17676]153 */
[34665]154#ifndef VBOX_XPDM_MINIPORT
[27629]155# define VBVA_ADAPTER_INFORMATION_SIZE (64*_1K)
156#else
[25039]157#define VBVA_ADAPTER_INFORMATION_SIZE (16*_1K)
158#define VBVA_DISPLAY_INFORMATION_SIZE (64*_1K)
[28228]159#endif
[18135]160#define VBVA_MIN_BUFFER_SIZE (64*_1K)
[3165]161
162
163/* The value for port IO to let the adapter to interpret the adapter memory. */
164#define VBOX_VIDEO_DISABLE_ADAPTER_MEMORY 0xFFFFFFFF
165
166/* The value for port IO to let the adapter to interpret the adapter memory. */
167#define VBOX_VIDEO_INTERPRET_ADAPTER_MEMORY 0x00000000
168
169/* The value for port IO to let the adapter to interpret the display memory.
[18135]170 * The display number is encoded in low 16 bits.
[3165]171 */
172#define VBOX_VIDEO_INTERPRET_DISPLAY_MEMORY_BASE 0x00010000
173
[4027]174
[3165]175/* The end of the information. */
176#define VBOX_VIDEO_INFO_TYPE_END 0
177/* Instructs the host to fetch the next VBOXVIDEOINFOHDR at the given offset of VRAM. */
178#define VBOX_VIDEO_INFO_TYPE_LINK 1
179/* Information about a display memory position. */
180#define VBOX_VIDEO_INFO_TYPE_DISPLAY 2
181/* Information about a screen. */
182#define VBOX_VIDEO_INFO_TYPE_SCREEN 3
183/* Information about host notifications for the driver. */
184#define VBOX_VIDEO_INFO_TYPE_HOST_EVENTS 4
[4027]185/* Information about non-volatile guest VRAM heap. */
186#define VBOX_VIDEO_INFO_TYPE_NV_HEAP 5
[4053]187/* VBVA enable/disable. */
188#define VBOX_VIDEO_INFO_TYPE_VBVA_STATUS 6
189/* VBVA flush. */
190#define VBOX_VIDEO_INFO_TYPE_VBVA_FLUSH 7
191/* Query configuration value. */
192#define VBOX_VIDEO_INFO_TYPE_QUERY_CONF32 8
[3165]193
194
195#pragma pack(1)
[34490]196typedef struct VBOXVIDEOINFOHDR
[3165]197{
198 uint8_t u8Type;
199 uint8_t u8Reserved;
200 uint16_t u16Length;
201} VBOXVIDEOINFOHDR;
202
203
[34490]204typedef struct VBOXVIDEOINFOLINK
[3165]205{
206 /* Relative offset in VRAM */
207 int32_t i32Offset;
208} VBOXVIDEOINFOLINK;
209
210
211/* Resides in adapter info memory. Describes a display VRAM chunk. */
[34490]212typedef struct VBOXVIDEOINFODISPLAY
[3165]213{
214 /* Index of the framebuffer assigned by guest. */
215 uint32_t u32Index;
216
217 /* Absolute offset in VRAM of the framebuffer to be displayed on the monitor. */
218 uint32_t u32Offset;
219
220 /* The size of the memory that can be used for the screen. */
221 uint32_t u32FramebufferSize;
222
223 /* The size of the memory that is used for the Display information.
224 * The information is at u32Offset + u32FramebufferSize
225 */
226 uint32_t u32InformationSize;
227
228} VBOXVIDEOINFODISPLAY;
229
230
231/* Resides in display info area, describes the current video mode. */
232#define VBOX_VIDEO_INFO_SCREEN_F_NONE 0x00
233#define VBOX_VIDEO_INFO_SCREEN_F_ACTIVE 0x01
234
[34490]235typedef struct VBOXVIDEOINFOSCREEN
[3165]236{
237 /* Physical X origin relative to the primary screen. */
238 int32_t xOrigin;
239
240 /* Physical Y origin relative to the primary screen. */
241 int32_t yOrigin;
242
243 /* The scan line size in bytes. */
244 uint32_t u32LineSize;
245
246 /* Width of the screen. */
247 uint16_t u16Width;
248
249 /* Height of the screen. */
250 uint16_t u16Height;
251
252 /* Color depth. */
253 uint8_t bitsPerPixel;
254
255 /* VBOX_VIDEO_INFO_SCREEN_F_* */
256 uint8_t u8Flags;
257} VBOXVIDEOINFOSCREEN;
258
259/* The guest initializes the structure to 0. The positions of the structure in the
260 * display info area must not be changed, host will update the structure. Guest checks
261 * the events and modifies the structure as a response to host.
262 */
263#define VBOX_VIDEO_INFO_HOST_EVENTS_F_NONE 0x00000000
264#define VBOX_VIDEO_INFO_HOST_EVENTS_F_VRDP_RESET 0x00000080
265
[34490]266typedef struct VBOXVIDEOINFOHOSTEVENTS
[3165]267{
268 /* Host events. */
269 uint32_t fu32Events;
270} VBOXVIDEOINFOHOSTEVENTS;
[4027]271
272/* Resides in adapter info memory. Describes the non-volatile VRAM heap. */
[34490]273typedef struct VBOXVIDEOINFONVHEAP
[4027]274{
275 /* Absolute offset in VRAM of the start of the heap. */
276 uint32_t u32HeapOffset;
277
278 /* The size of the heap. */
279 uint32_t u32HeapSize;
280
281} VBOXVIDEOINFONVHEAP;
[4053]282
283/* Display information area. */
[34490]284typedef struct VBOXVIDEOINFOVBVASTATUS
[4053]285{
286 /* Absolute offset in VRAM of the start of the VBVA QUEUE. 0 to disable VBVA. */
287 uint32_t u32QueueOffset;
288
289 /* The size of the VBVA QUEUE. 0 to disable VBVA. */
290 uint32_t u32QueueSize;
291
292} VBOXVIDEOINFOVBVASTATUS;
293
[34490]294typedef struct VBOXVIDEOINFOVBVAFLUSH
[4053]295{
296 uint32_t u32DataStart;
297
298 uint32_t u32DataEnd;
299
300} VBOXVIDEOINFOVBVAFLUSH;
301
302#define VBOX_VIDEO_QCI32_MONITOR_COUNT 0
303#define VBOX_VIDEO_QCI32_OFFSCREEN_HEAP_SIZE 1
304
[34490]305typedef struct VBOXVIDEOINFOQUERYCONF32
[4053]306{
307 uint32_t u32Index;
308
309 uint32_t u32Value;
310
311} VBOXVIDEOINFOQUERYCONF32;
[3165]312#pragma pack()
313
[33048]314#ifdef VBOX_WITH_VIDEOHWACCEL
[19844]315#pragma pack(1)
316
[22189]317#define VBOXVHWA_VERSION_MAJ 0
318#define VBOXVHWA_VERSION_MIN 0
[25047]319#define VBOXVHWA_VERSION_BLD 6
[22189]320#define VBOXVHWA_VERSION_RSV 0
321
[19844]322typedef enum
323{
[20478]324 VBOXVHWACMD_TYPE_SURF_CANCREATE = 1,
325 VBOXVHWACMD_TYPE_SURF_CREATE,
[20243]326 VBOXVHWACMD_TYPE_SURF_DESTROY,
327 VBOXVHWACMD_TYPE_SURF_LOCK,
328 VBOXVHWACMD_TYPE_SURF_UNLOCK,
[20478]329 VBOXVHWACMD_TYPE_SURF_BLT,
[20906]330 VBOXVHWACMD_TYPE_SURF_FLIP,
331 VBOXVHWACMD_TYPE_SURF_OVERLAY_UPDATE,
332 VBOXVHWACMD_TYPE_SURF_OVERLAY_SETPOSITION,
[21490]333 VBOXVHWACMD_TYPE_SURF_COLORKEY_SET,
[20478]334 VBOXVHWACMD_TYPE_QUERY_INFO1,
[20653]335 VBOXVHWACMD_TYPE_QUERY_INFO2,
336 VBOXVHWACMD_TYPE_ENABLE,
[22215]337 VBOXVHWACMD_TYPE_DISABLE,
[24162]338 VBOXVHWACMD_TYPE_HH_CONSTRUCT,
[24164]339 VBOXVHWACMD_TYPE_HH_RESET
[32622]340#ifdef VBOX_WITH_WDDM
[29922]341 , VBOXVHWACMD_TYPE_SURF_GETINFO
[32824]342 , VBOXVHWACMD_TYPE_SURF_COLORFILL
[29922]343#endif
[34129]344 , VBOXVHWACMD_TYPE_HH_DISABLE
345 , VBOXVHWACMD_TYPE_HH_ENABLE
[34140]346 , VBOXVHWACMD_TYPE_HH_SAVESTATE_SAVEBEGIN
347 , VBOXVHWACMD_TYPE_HH_SAVESTATE_SAVEEND
348 , VBOXVHWACMD_TYPE_HH_SAVESTATE_SAVEPERFORM
349 , VBOXVHWACMD_TYPE_HH_SAVESTATE_LOADPERFORM
[19844]350} VBOXVHWACMD_TYPE;
351
[71592]352/** The command processing was asynch, set by the host to indicate asynch
353 * command completion. Must not be cleared once set, the command completion is
354 * performed by issuing a host->guest completion command while keeping this
355 * flag unchanged */
356#define VBOXVHWACMD_FLAG_HG_ASYNCH UINT32_C(0x00010000)
357/** asynch completion is performed by issuing the event */
358#define VBOXVHWACMD_FLAG_GH_ASYNCH_EVENT UINT32_C(0x00000001)
359/** issue interrupt on asynch completion */
360#define VBOXVHWACMD_FLAG_GH_ASYNCH_IRQ UINT32_C(0x00000002)
361/** Guest does not do any op on completion of this command, the host may copy
362 * the command and indicate that it does not need the command anymore
[21939]363 * by setting the VBOXVHWACMD_FLAG_HG_ASYNCH_RETURNED flag */
[71592]364#define VBOXVHWACMD_FLAG_GH_ASYNCH_NOCOMPLETION UINT32_C(0x00000004)
365/** the host has copied the VBOXVHWACMD_FLAG_GH_ASYNCH_NOCOMPLETION command and returned it to the guest */
366#define VBOXVHWACMD_FLAG_HG_ASYNCH_RETURNED UINT32_C(0x00020000)
367/** this is the host->host cmd, i.e. a configuration command posted by the host to the framebuffer */
368#define VBOXVHWACMD_FLAG_HH_CMD UINT32_C(0x10000000)
[20478]369
[34490]370typedef struct VBOXVHWACMD
[19844]371{
[71592]372 VBOXVHWACMD_TYPE enmCmd; /**< command type */
373 volatile int32_t rc; /**< command result */
374 int32_t iDisplay; /**< display index */
375 volatile int32_t Flags; /**< ORed VBOXVHWACMD_FLAG_xxx values */
376 uint64_t GuestVBVAReserved1; /**< field internally used by the guest VBVA cmd handling, must NOT be modified by clients */
377 uint64_t GuestVBVAReserved2; /**< field internally used by the guest VBVA cmd handling, must NOT be modified by clients */
[22215]378 volatile uint32_t cRefs;
379 int32_t Reserved;
[20653]380 union
381 {
[34490]382 struct VBOXVHWACMD *pNext;
[71592]383 uint32_t offNext;
384 uint64_t Data; /**< the body is 64-bit aligned */
[20653]385 } u;
[19844]386 char body[1];
387} VBOXVHWACMD;
388
[71592]389#define VBOXVHWACMD_HEADSIZE() (RT_OFFSETOF(VBOXVHWACMD, body))
390#define VBOXVHWACMD_SIZE_FROMBODYSIZE(a_cbBody) (VBOXVHWACMD_HEADSIZE() + (a_cbBody))
391#define VBOXVHWACMD_SIZE(a_tTypeCmd) (VBOXVHWACMD_SIZE_FROMBODYSIZE(sizeof(a_tTypeCmd)))
[19844]392typedef unsigned int VBOXVHWACMD_LENGTH;
393typedef uint64_t VBOXVHWA_SURFHANDLE;
[71592]394#define VBOXVHWA_SURFHANDLE_INVALID UINT64_C(0)
395#define VBOXVHWACMD_BODY(a_pHdr, a_TypeBody) ( (a_TypeBody RT_UNTRUSTED_VOLATILE_HSTGST *)&(a_pHdr)->body[0] )
396#if !defined(IN_GUEST) && defined(IN_RING3)
397# define VBOXVHWACMD_BODY_HOST_HEAP(a_pHdr, a_TypeBody) ( (a_TypeBody *)&(a_pHdr)->body[0] )
398#endif
399#define VBOXVHWACMD_HEAD(a_pBody)\
400 ( (VBOXVHWACMD RT_UNTRUSTED_VOLATILE_HSTGST *)((uint8_t *)(a_pBody) - RT_OFFSETOF(VBOXVHWACMD, body)))
[19844]401
[34490]402typedef struct VBOXVHWA_RECTL
[19844]403{
[21939]404 int32_t left;
405 int32_t top;
406 int32_t right;
407 int32_t bottom;
[19844]408} VBOXVHWA_RECTL;
409
[34490]410typedef struct VBOXVHWA_COLORKEY
[20243]411{
412 uint32_t low;
413 uint32_t high;
414} VBOXVHWA_COLORKEY;
415
[34490]416typedef struct VBOXVHWA_PIXELFORMAT
[20243]417{
418 uint32_t flags;
419 uint32_t fourCC;
420 union
421 {
422 uint32_t rgbBitCount;
423 uint32_t yuvBitCount;
424 } c;
425
426 union
427 {
428 uint32_t rgbRBitMask;
429 uint32_t yuvYBitMask;
430 } m1;
431
432 union
433 {
434 uint32_t rgbGBitMask;
435 uint32_t yuvUBitMask;
436 } m2;
437
438 union
439 {
440 uint32_t rgbBBitMask;
441 uint32_t yuvVBitMask;
442 } m3;
[21939]443
444 union
445 {
446 uint32_t rgbABitMask;
447 } m4;
[25047]448
449 uint32_t Reserved;
[20243]450} VBOXVHWA_PIXELFORMAT;
451
[34490]452typedef struct VBOXVHWA_SURFACEDESC
[19844]453{
[20683]454 uint32_t flags;
[20243]455 uint32_t height;
456 uint32_t width;
[20683]457 uint32_t pitch;
[22028]458 uint32_t sizeX;
459 uint32_t sizeY;
[20683]460 uint32_t cBackBuffers;
[22028]461 uint32_t Reserved;
[20243]462 VBOXVHWA_COLORKEY DstOverlayCK;
463 VBOXVHWA_COLORKEY DstBltCK;
464 VBOXVHWA_COLORKEY SrcOverlayCK;
465 VBOXVHWA_COLORKEY SrcBltCK;
466 VBOXVHWA_PIXELFORMAT PixelFormat;
467 uint32_t surfCaps;
[20683]468 uint32_t Reserved2;
[22247]469 VBOXVHWA_SURFHANDLE hSurf;
470 uint64_t offSurface;
[20683]471} VBOXVHWA_SURFACEDESC;
[19844]472
[34490]473typedef struct VBOXVHWA_BLTFX
[20906]474{
475 uint32_t flags;
476 uint32_t rop;
477 uint32_t rotationOp;
478 uint32_t rotation;
[20985]479 uint32_t fillColor;
480 uint32_t Reserved;
[20906]481 VBOXVHWA_COLORKEY DstCK;
482 VBOXVHWA_COLORKEY SrcCK;
[20985]483} VBOXVHWA_BLTFX;
[20906]484
[34490]485typedef struct VBOXVHWA_OVERLAYFX
[20906]486{
487 uint32_t flags;
488 uint32_t Reserved1;
[21490]489 uint32_t fxFlags;
[20906]490 uint32_t Reserved2;
491 VBOXVHWA_COLORKEY DstCK;
492 VBOXVHWA_COLORKEY SrcCK;
[20985]493} VBOXVHWA_OVERLAYFX;
[20906]494
[24646]495#define VBOXVHWA_CAPS_BLT 0x00000040
496#define VBOXVHWA_CAPS_BLTCOLORFILL 0x04000000
497#define VBOXVHWA_CAPS_BLTFOURCC 0x00000100
498#define VBOXVHWA_CAPS_BLTSTRETCH 0x00000200
499#define VBOXVHWA_CAPS_BLTQUEUE 0x00000080
[20478]500
[24646]501#define VBOXVHWA_CAPS_OVERLAY 0x00000800
502#define VBOXVHWA_CAPS_OVERLAYFOURCC 0x00002000
503#define VBOXVHWA_CAPS_OVERLAYSTRETCH 0x00004000
504#define VBOXVHWA_CAPS_OVERLAYCANTCLIP 0x00001000
[20478]505
[24646]506#define VBOXVHWA_CAPS_COLORKEY 0x00400000
507#define VBOXVHWA_CAPS_COLORKEYHWASSIST 0x01000000
[20478]508
[24646]509#define VBOXVHWA_SCAPS_BACKBUFFER 0x00000004
510#define VBOXVHWA_SCAPS_COMPLEX 0x00000008
511#define VBOXVHWA_SCAPS_FLIP 0x00000010
512#define VBOXVHWA_SCAPS_FRONTBUFFER 0x00000020
513#define VBOXVHWA_SCAPS_OFFSCREENPLAIN 0x00000040
514#define VBOXVHWA_SCAPS_OVERLAY 0x00000080
515#define VBOXVHWA_SCAPS_PRIMARYSURFACE 0x00000200
516#define VBOXVHWA_SCAPS_SYSTEMMEMORY 0x00000800
517#define VBOXVHWA_SCAPS_VIDEOMEMORY 0x00004000
518#define VBOXVHWA_SCAPS_VISIBLE 0x00008000
519#define VBOXVHWA_SCAPS_LOCALVIDMEM 0x10000000
[20985]520
[26667]521#define VBOXVHWA_PF_PALETTEINDEXED8 0x00000020
[24646]522#define VBOXVHWA_PF_RGB 0x00000040
523#define VBOXVHWA_PF_RGBTOYUV 0x00000100
524#define VBOXVHWA_PF_YUV 0x00000200
525#define VBOXVHWA_PF_FOURCC 0x00000004
[20478]526
[24646]527#define VBOXVHWA_LOCK_DISCARDCONTENTS 0x00002000
[20985]528
[20683]529#define VBOXVHWA_CFG_ENABLED 0x00000001
[20478]530
[24646]531#define VBOXVHWA_SD_BACKBUFFERCOUNT 0x00000020
532#define VBOXVHWA_SD_CAPS 0x00000001
533#define VBOXVHWA_SD_CKDESTBLT 0x00004000
534#define VBOXVHWA_SD_CKDESTOVERLAY 0x00002000
535#define VBOXVHWA_SD_CKSRCBLT 0x00010000
536#define VBOXVHWA_SD_CKSRCOVERLAY 0x00008000
537#define VBOXVHWA_SD_HEIGHT 0x00000002
538#define VBOXVHWA_SD_PITCH 0x00000008
539#define VBOXVHWA_SD_PIXELFORMAT 0x00001000
[30788]540/*#define VBOXVHWA_SD_REFRESHRATE 0x00040000*/
[24646]541#define VBOXVHWA_SD_WIDTH 0x00000004
[20683]542
[20985]543#define VBOXVHWA_CKEYCAPS_DESTBLT 0x00000001
544#define VBOXVHWA_CKEYCAPS_DESTBLTCLRSPACE 0x00000002
545#define VBOXVHWA_CKEYCAPS_DESTBLTCLRSPACEYUV 0x00000004
546#define VBOXVHWA_CKEYCAPS_DESTBLTYUV 0x00000008
547#define VBOXVHWA_CKEYCAPS_DESTOVERLAY 0x00000010
548#define VBOXVHWA_CKEYCAPS_DESTOVERLAYCLRSPACE 0x00000020
549#define VBOXVHWA_CKEYCAPS_DESTOVERLAYCLRSPACEYUV 0x00000040
550#define VBOXVHWA_CKEYCAPS_DESTOVERLAYONEACTIVE 0x00000080
551#define VBOXVHWA_CKEYCAPS_DESTOVERLAYYUV 0x00000100
[24646]552#define VBOXVHWA_CKEYCAPS_SRCBLT 0x00000200
553#define VBOXVHWA_CKEYCAPS_SRCBLTCLRSPACE 0x00000400
554#define VBOXVHWA_CKEYCAPS_SRCBLTCLRSPACEYUV 0x00000800
555#define VBOXVHWA_CKEYCAPS_SRCBLTYUV 0x00001000
556#define VBOXVHWA_CKEYCAPS_SRCOVERLAY 0x00002000
557#define VBOXVHWA_CKEYCAPS_SRCOVERLAYCLRSPACE 0x00004000
558#define VBOXVHWA_CKEYCAPS_SRCOVERLAYCLRSPACEYUV 0x00008000
559#define VBOXVHWA_CKEYCAPS_SRCOVERLAYONEACTIVE 0x00010000
560#define VBOXVHWA_CKEYCAPS_SRCOVERLAYYUV 0x00020000
561#define VBOXVHWA_CKEYCAPS_NOCOSTOVERLAY 0x00040000
[20683]562
[20985]563#define VBOXVHWA_BLT_COLORFILL 0x00000400
564#define VBOXVHWA_BLT_DDFX 0x00000800
565#define VBOXVHWA_BLT_EXTENDED_FLAGS 0x40000000
566#define VBOXVHWA_BLT_EXTENDED_LINEAR_CONTENT 0x00000004
567#define VBOXVHWA_BLT_EXTENDED_PRESENTATION_STRETCHFACTOR 0x00000010
568#define VBOXVHWA_BLT_KEYDESTOVERRIDE 0x00004000
569#define VBOXVHWA_BLT_KEYSRCOVERRIDE 0x00010000
570#define VBOXVHWA_BLT_LAST_PRESENTATION 0x20000000
571#define VBOXVHWA_BLT_PRESENTATION 0x10000000
572#define VBOXVHWA_BLT_ROP 0x00020000
573
574
[21490]575#define VBOXVHWA_OVER_DDFX 0x00080000
576#define VBOXVHWA_OVER_HIDE 0x00000200
577#define VBOXVHWA_OVER_KEYDEST 0x00000400
578#define VBOXVHWA_OVER_KEYDESTOVERRIDE 0x00000800
579#define VBOXVHWA_OVER_KEYSRC 0x00001000
580#define VBOXVHWA_OVER_KEYSRCOVERRIDE 0x00002000
581#define VBOXVHWA_OVER_SHOW 0x00004000
[20985]582
[21490]583#define VBOXVHWA_CKEY_COLORSPACE 0x00000001
584#define VBOXVHWA_CKEY_DESTBLT 0x00000002
585#define VBOXVHWA_CKEY_DESTOVERLAY 0x00000004
586#define VBOXVHWA_CKEY_SRCBLT 0x00000008
587#define VBOXVHWA_CKEY_SRCOVERLAY 0x00000010
[20985]588
[21490]589#define VBOXVHWA_BLT_ARITHSTRETCHY 0x00000001
590#define VBOXVHWA_BLT_MIRRORLEFTRIGHT 0x00000002
591#define VBOXVHWA_BLT_MIRRORUPDOWN 0x00000004
592
593#define VBOXVHWA_OVERFX_ARITHSTRETCHY 0x00000001
594#define VBOXVHWA_OVERFX_MIRRORLEFTRIGHT 0x00000002
595#define VBOXVHWA_OVERFX_MIRRORUPDOWN 0x00000004
596
[21553]597#define VBOXVHWA_CAPS2_CANRENDERWINDOWED 0x00080000
598#define VBOXVHWA_CAPS2_WIDESURFACES 0x00001000
599#define VBOXVHWA_CAPS2_COPYFOURCC 0x00008000
[30788]600/*#define VBOXVHWA_CAPS2_FLIPINTERVAL 0x00200000*/
601/*#define VBOXVHWA_CAPS2_FLIPNOVSYNC 0x00400000*/
[21490]602
[21553]603
[22463]604#define VBOXVHWA_OFFSET64_VOID (UINT64_MAX)
[20653]605
[34490]606typedef struct VBOXVHWA_VERSION
[22189]607{
608 uint32_t maj;
609 uint32_t min;
610 uint32_t bld;
611 uint32_t reserved;
612} VBOXVHWA_VERSION;
613
[29488]614#define VBOXVHWA_VERSION_INIT(_pv) do { \
615 (_pv)->maj = VBOXVHWA_VERSION_MAJ; \
616 (_pv)->min = VBOXVHWA_VERSION_MIN; \
617 (_pv)->bld = VBOXVHWA_VERSION_BLD; \
618 (_pv)->reserved = VBOXVHWA_VERSION_RSV; \
619 } while(0)
620
[34490]621typedef struct VBOXVHWACMD_QUERYINFO1
[20478]622{
[22189]623 union
624 {
625 struct
626 {
627 VBOXVHWA_VERSION guestVersion;
628 } in;
[20478]629
[22189]630 struct
631 {
632 uint32_t cfgFlags;
633 uint32_t caps;
634
635 uint32_t caps2;
636 uint32_t colorKeyCaps;
637
638 uint32_t stretchCaps;
639 uint32_t surfaceCaps;
640
641 uint32_t numOverlays;
642 uint32_t curOverlays;
643
644 uint32_t numFourCC;
645 uint32_t reserved;
646 } out;
647 } u;
[20478]648} VBOXVHWACMD_QUERYINFO1;
649
[34490]650typedef struct VBOXVHWACMD_QUERYINFO2
[20478]651{
652 uint32_t numFourCC;
653 uint32_t FourCC[1];
654} VBOXVHWACMD_QUERYINFO2;
655
[73097]656#define VBOXVHWAINFO2_SIZE(_cFourCC) RT_UOFFSETOF_DYN(VBOXVHWACMD_QUERYINFO2, FourCC[_cFourCC])
[20478]657
[34490]658typedef struct VBOXVHWACMD_SURF_CANCREATE
[20478]659{
[21939]660 VBOXVHWA_SURFACEDESC SurfInfo;
[20478]661 union
662 {
663 struct
664 {
[20683]665 uint32_t bIsDifferentPixelFormat;
666 uint32_t Reserved;
[20478]667 } in;
668
669 struct
670 {
[22920]671 int32_t ErrInfo;
[20478]672 } out;
673 } u;
674} VBOXVHWACMD_SURF_CANCREATE;
675
[34490]676typedef struct VBOXVHWACMD_SURF_CREATE
[19844]677{
[21939]678 VBOXVHWA_SURFACEDESC SurfInfo;
[19844]679} VBOXVHWACMD_SURF_CREATE;
680
[32622]681#ifdef VBOX_WITH_WDDM
[34490]682typedef struct VBOXVHWACMD_SURF_GETINFO
[29922]683{
684 VBOXVHWA_SURFACEDESC SurfInfo;
685} VBOXVHWACMD_SURF_GETINFO;
686#endif
687
[34490]688typedef struct VBOXVHWACMD_SURF_DESTROY
[19844]689{
690 union
691 {
692 struct
693 {
694 VBOXVHWA_SURFHANDLE hSurf;
695 } in;
696 } u;
697} VBOXVHWACMD_SURF_DESTROY;
[20243]698
[34490]699typedef struct VBOXVHWACMD_SURF_LOCK
[20243]700{
701 union
702 {
703 struct
704 {
705 VBOXVHWA_SURFHANDLE hSurf;
[20653]706 uint64_t offSurface;
[20243]707 uint32_t flags;
[20653]708 uint32_t rectValid;
[20243]709 VBOXVHWA_RECTL rect;
710 } in;
711 } u;
712} VBOXVHWACMD_SURF_LOCK;
713
[34490]714typedef struct VBOXVHWACMD_SURF_UNLOCK
[20243]715{
716 union
717 {
718 struct
719 {
720 VBOXVHWA_SURFHANDLE hSurf;
[21939]721 uint32_t xUpdatedMemValid;
722 uint32_t reserved;
723 VBOXVHWA_RECTL xUpdatedMemRect;
[20243]724 } in;
725 } u;
726} VBOXVHWACMD_SURF_UNLOCK;
727
[34490]728typedef struct VBOXVHWACMD_SURF_BLT
[20243]729{
[20483]730 uint64_t DstGuestSurfInfo;
731 uint64_t SrcGuestSurfInfo;
[20243]732 union
733 {
734 struct
735 {
736 VBOXVHWA_SURFHANDLE hDstSurf;
[20653]737 uint64_t offDstSurface;
[20243]738 VBOXVHWA_RECTL dstRect;
739 VBOXVHWA_SURFHANDLE hSrcSurf;
[20653]740 uint64_t offSrcSurface;
[20243]741 VBOXVHWA_RECTL srcRect;
742 uint32_t flags;
[21939]743 uint32_t xUpdatedSrcMemValid;
[20985]744 VBOXVHWA_BLTFX desc;
[21939]745 VBOXVHWA_RECTL xUpdatedSrcMemRect;
[20243]746 } in;
747 } u;
748} VBOXVHWACMD_SURF_BLT;
749
[32824]750#ifdef VBOX_WITH_WDDM
[34490]751typedef struct VBOXVHWACMD_SURF_COLORFILL
[32824]752{
753 union
754 {
755 struct
756 {
757 VBOXVHWA_SURFHANDLE hSurf;
758 uint64_t offSurface;
759 uint32_t u32Reserved;
760 uint32_t cRects;
761 VBOXVHWA_RECTL aRects[1];
762 } in;
763 } u;
764} VBOXVHWACMD_SURF_COLORFILL;
765#endif
766
[34490]767typedef struct VBOXVHWACMD_SURF_FLIP
[21253]768{
769 uint64_t TargGuestSurfInfo;
770 uint64_t CurrGuestSurfInfo;
771 union
772 {
773 struct
774 {
775 VBOXVHWA_SURFHANDLE hTargSurf;
776 uint64_t offTargSurface;
777 VBOXVHWA_SURFHANDLE hCurrSurf;
778 uint64_t offCurrSurface;
779 uint32_t flags;
[21939]780 uint32_t xUpdatedTargMemValid;
781 VBOXVHWA_RECTL xUpdatedTargMemRect;
[21253]782 } in;
783 } u;
784} VBOXVHWACMD_SURF_FLIP;
785
[34490]786typedef struct VBOXVHWACMD_SURF_COLORKEY_SET
[21490]787{
788 union
789 {
790 struct
791 {
792 VBOXVHWA_SURFHANDLE hSurf;
793 uint64_t offSurface;
794 VBOXVHWA_COLORKEY CKey;
795 uint32_t flags;
796 uint32_t reserved;
797 } in;
798 } u;
799} VBOXVHWACMD_SURF_COLORKEY_SET;
800
[34129]801#define VBOXVHWACMD_SURF_OVERLAY_UPDATE_F_SRCMEMRECT 0x00000001
802#define VBOXVHWACMD_SURF_OVERLAY_UPDATE_F_DSTMEMRECT 0x00000002
803
[34490]804typedef struct VBOXVHWACMD_SURF_OVERLAY_UPDATE
[20906]805{
806 union
807 {
808 struct
809 {
810 VBOXVHWA_SURFHANDLE hDstSurf;
811 uint64_t offDstSurface;
812 VBOXVHWA_RECTL dstRect;
813 VBOXVHWA_SURFHANDLE hSrcSurf;
814 uint64_t offSrcSurface;
815 VBOXVHWA_RECTL srcRect;
816 uint32_t flags;
[34129]817 uint32_t xFlags;
[20985]818 VBOXVHWA_OVERLAYFX desc;
[21939]819 VBOXVHWA_RECTL xUpdatedSrcMemRect;
[33714]820 VBOXVHWA_RECTL xUpdatedDstMemRect;
[20906]821 } in;
822 } u;
823}VBOXVHWACMD_SURF_OVERLAY_UPDATE;
824
[34490]825typedef struct VBOXVHWACMD_SURF_OVERLAY_SETPOSITION
[20906]826{
827 union
828 {
829 struct
830 {
831 VBOXVHWA_SURFHANDLE hDstSurf;
832 uint64_t offDstSurface;
833 VBOXVHWA_SURFHANDLE hSrcSurf;
834 uint64_t offSrcSurface;
835 uint32_t xPos;
836 uint32_t yPos;
837 uint32_t flags;
838 uint32_t reserved;
839 } in;
840 } u;
841} VBOXVHWACMD_SURF_OVERLAY_SETPOSITION;
842
[34490]843typedef struct VBOXVHWACMD_HH_CONSTRUCT
[22215]844{
[27682]845 void *pVM;
846 /* VRAM info for the backend to be able to properly translate VRAM offsets */
847 void *pvVRAM;
848 uint32_t cbVRAM;
[22215]849} VBOXVHWACMD_HH_CONSTRUCT;
850
[34490]851typedef struct VBOXVHWACMD_HH_SAVESTATE_SAVEPERFORM
[34140]852{
853 struct SSMHANDLE * pSSM;
854} VBOXVHWACMD_HH_SAVESTATE_SAVEPERFORM;
855
[34490]856typedef struct VBOXVHWACMD_HH_SAVESTATE_LOADPERFORM
[34140]857{
858 struct SSMHANDLE * pSSM;
859} VBOXVHWACMD_HH_SAVESTATE_LOADPERFORM;
860
[85121]861typedef DECLCALLBACKTYPE(void, FNVBOXVHWA_HH_CALLBACK,(void *));
[24925]862typedef FNVBOXVHWA_HH_CALLBACK *PFNVBOXVHWA_HH_CALLBACK;
863
864#define VBOXVHWA_HH_CALLBACK_SET(_pCmd, _pfn, _parg) \
865 do { \
[26296]866 (_pCmd)->GuestVBVAReserved1 = (uint64_t)(uintptr_t)(_pfn); \
867 (_pCmd)->GuestVBVAReserved2 = (uint64_t)(uintptr_t)(_parg); \
[24925]868 }while(0)
869
870#define VBOXVHWA_HH_CALLBACK_GET(_pCmd) ((PFNVBOXVHWA_HH_CALLBACK)(_pCmd)->GuestVBVAReserved1)
871#define VBOXVHWA_HH_CALLBACK_GET_ARG(_pCmd) ((void*)(_pCmd)->GuestVBVAReserved2)
872
[19844]873#pragma pack()
[33048]874#endif /* #ifdef VBOX_WITH_VIDEOHWACCEL */
[19844]875
[17624]876/* All structures are without alignment. */
877#pragma pack(1)
878
[25052]879typedef struct VBVAHOSTFLAGS
[17624]880{
881 uint32_t u32HostEvents;
882 uint32_t u32SupportedOrders;
[25052]883} VBVAHOSTFLAGS;
[17624]884
[34490]885typedef struct VBVABUFFER
[25052]886{
887 VBVAHOSTFLAGS hostFlags;
888
[17624]889 /* The offset where the data start in the buffer. */
890 uint32_t off32Data;
891 /* The offset where next data must be placed in the buffer. */
892 uint32_t off32Free;
893
894 /* The queue of record descriptions. */
895 VBVARECORD aRecords[VBVA_MAX_RECORDS];
896 uint32_t indexRecordFirst;
897 uint32_t indexRecordFree;
898
899 /* Space to leave free in the buffer when large partial records are transferred. */
900 uint32_t cbPartialWriteThreshold;
901
902 uint32_t cbData;
903 uint8_t au8Data[1]; /* variable size for the rest of the VBVABUFFER area in VRAM. */
904} VBVABUFFER;
905
[56036]906#define VBVA_MAX_RECORD_SIZE (128*_1M)
907
[19844]908/* guest->host commands */
[17624]909#define VBVA_QUERY_CONF32 1
910#define VBVA_SET_CONF32 2
911#define VBVA_INFO_VIEW 3
912#define VBVA_INFO_HEAP 4
913#define VBVA_FLUSH 5
914#define VBVA_INFO_SCREEN 6
[74622]915/** Enables or disables VBVA. Enabling VBVA without disabling it before
916 * causes a complete screen update. */
[17624]917#define VBVA_ENABLE 7
[19431]918#define VBVA_MOUSE_POINTER_SHAPE 8
[20478]919#ifdef VBOX_WITH_VIDEOHWACCEL
920# define VBVA_VHWA_CMD 9
921#endif /* # ifdef VBOX_WITH_VIDEOHWACCEL */
[32877]922#ifdef VBOX_WITH_VDMA
[26556]923# define VBVA_VDMA_CTL 10 /* setup G<->H DMA channel info */
924# define VBVA_VDMA_CMD 11 /* G->H DMA command */
925#endif
[41636]926#define VBVA_INFO_CAPS 12 /* informs host about HGSMI caps. see VBVACAPS below */
927#define VBVA_SCANLINE_CFG 13 /* configures scanline, see VBVASCANLINECFG below */
928#define VBVA_SCANLINE_INFO 14 /* requests scanline info, see VBVASCANLINEINFO below */
[49365]929#define VBVA_CMDVBVA_SUBMIT 16 /* inform host about VBVA Command submission */
930#define VBVA_CMDVBVA_FLUSH 17 /* inform host about VBVA Command submission */
[50754]931#define VBVA_CMDVBVA_CTL 18 /* G->H DMA command */
[53528]932#define VBVA_QUERY_MODE_HINTS 19 /* Query most recent mode hints sent. */
[53965]933/** Report the guest virtual desktop position and size for mapping host and
934 * guest pointer positions. */
935#define VBVA_REPORT_INPUT_MAPPING 20
936/** Report the guest cursor position and query the host position. */
937#define VBVA_CURSOR_POSITION 21
[17624]938
[19844]939/* host->guest commands */
[33048]940#define VBVAHG_EVENT 1
941#define VBVAHG_DISPLAY_CUSTOM 2
[32877]942#ifdef VBOX_WITH_VDMA
[33048]943#define VBVAHG_SHGSMI_COMPLETION 3
[26556]944#endif
[20478]945
[33048]946#ifdef VBOX_WITH_VIDEOHWACCEL
[20478]947#define VBVAHG_DCUSTOM_VHWA_CMDCOMPLETE 1
948#pragma pack(1)
[34490]949typedef struct VBVAHOSTCMDVHWACMDCOMPLETE
[19464]950{
[19844]951 uint32_t offCmd;
952}VBVAHOSTCMDVHWACMDCOMPLETE;
[20478]953#pragma pack()
[33048]954#endif /* # ifdef VBOX_WITH_VIDEOHWACCEL */
[19464]955
[19844]956#pragma pack(1)
[20478]957typedef enum
958{
959 VBVAHOSTCMD_OP_EVENT = 1,
960 VBVAHOSTCMD_OP_CUSTOM
961}VBVAHOSTCMD_OP_TYPE;
962
[34490]963typedef struct VBVAHOSTCMDEVENT
[20478]964{
965 uint64_t pEvent;
966}VBVAHOSTCMDEVENT;
967
968
[34490]969typedef struct VBVAHOSTCMD
[19464]970{
[19844]971 /* destination ID if >=0 specifies display index, otherwize the command is directed to the miniport */
972 int32_t iDstID;
[20478]973 int32_t customOpCode;
974 union
975 {
[34490]976 struct VBVAHOSTCMD *pNext;
[20653]977 uint32_t offNext;
978 uint64_t Data; /* the body is 64-bit aligned */
[20478]979 } u;
[19464]980 char body[1];
[71592]981} VBVAHOSTCMD;
[19464]982
[71592]983#define VBVAHOSTCMD_SIZE(a_cb) (sizeof(VBVAHOSTCMD) + (a_cb))
984#define VBVAHOSTCMD_BODY(a_pCmd, a_TypeBody) ((a_TypeBody RT_UNTRUSTED_VOLATILE_HSTGST *)&(a_pCmd)->body[0])
985#define VBVAHOSTCMD_HDR(a_pBody) \
986 ( (VBVAHOSTCMD RT_UNTRUSTED_VOLATILE_HSTGST *)( (uint8_t *)(a_pBody) - RT_OFFSETOF(VBVAHOSTCMD, body)) )
987#define VBVAHOSTCMD_HDRSIZE (RT_OFFSETOF(VBVAHOSTCMD, body))
[19464]988
[19844]989#pragma pack()
[19464]990
[17624]991/* VBVACONF32::u32Index */
992#define VBOX_VBVA_CONF32_MONITOR_COUNT 0
993#define VBOX_VBVA_CONF32_HOST_HEAP_SIZE 1
[53846]994/** Returns VINF_SUCCESS if the host can report mode hints via VBVA.
995 * Set value to VERR_NOT_SUPPORTED before calling. */
[53528]996#define VBOX_VBVA_CONF32_MODE_HINT_REPORTING 2
[60109]997/** Returns VINF_SUCCESS if the host can report guest cursor enabled status via
[53965]998 * VBVA. Set value to VERR_NOT_SUPPORTED before calling. */
999#define VBOX_VBVA_CONF32_GUEST_CURSOR_REPORTING 3
1000/** Returns the currently available host cursor capabilities. Available if
1001 * VBVACONF32::VBOX_VBVA_CONF32_GUEST_CURSOR_REPORTING returns success.
1002 * @see VMMDevReqMouseStatus::mouseFeatures. */
1003#define VBOX_VBVA_CONF32_CURSOR_CAPABILITIES 4
[54565]1004/** Returns the supported flags in VBVAINFOSCREEN::u8Flags. */
1005#define VBOX_VBVA_CONF32_SCREEN_FLAGS 5
[56036]1006/** Returns the max size of VBVA record. */
1007#define VBOX_VBVA_CONF32_MAX_RECORD_SIZE 6
[17624]1008
[34490]1009typedef struct VBVACONF32
[17624]1010{
1011 uint32_t u32Index;
1012 uint32_t u32Value;
1013} VBVACONF32;
1014
[64185]1015/** Reserved for historical reasons. */
1016#define VBOX_VBVA_CURSOR_CAPABILITY_RESERVED0 RT_BIT(0)
1017/** Guest cursor capability: can the host show a hardware cursor at the host
1018 * pointer location? */
1019#define VBOX_VBVA_CURSOR_CAPABILITY_HARDWARE RT_BIT(1)
1020/** Reserved for historical reasons. */
1021#define VBOX_VBVA_CURSOR_CAPABILITY_RESERVED2 RT_BIT(2)
1022/** Reserved for historical reasons. Must always be unset. */
1023#define VBOX_VBVA_CURSOR_CAPABILITY_RESERVED3 RT_BIT(3)
1024/** Reserved for historical reasons. */
1025#define VBOX_VBVA_CURSOR_CAPABILITY_RESERVED4 RT_BIT(4)
1026/** Reserved for historical reasons. */
1027#define VBOX_VBVA_CURSOR_CAPABILITY_RESERVED5 RT_BIT(5)
1028
[22412]1029typedef struct VBVAINFOVIEW
[17624]1030{
1031 /* Index of the screen, assigned by the guest. */
1032 uint32_t u32ViewIndex;
1033
1034 /* The screen offset in VRAM, the framebuffer starts here. */
1035 uint32_t u32ViewOffset;
1036
[17705]1037 /* The size of the VRAM memory that can be used for the view. */
[17624]1038 uint32_t u32ViewSize;
1039
[17705]1040 /* The recommended maximum size of the VRAM memory for the screen. */
1041 uint32_t u32MaxScreenSize;
[17624]1042} VBVAINFOVIEW;
1043
[34490]1044typedef struct VBVAINFOHEAP
[17624]1045{
1046 /* Absolute offset in VRAM of the start of the heap. */
1047 uint32_t u32HeapOffset;
1048
1049 /* The size of the heap. */
1050 uint32_t u32HeapSize;
1051
1052} VBVAINFOHEAP;
1053
[34490]1054typedef struct VBVAFLUSH
[17624]1055{
1056 uint32_t u32Reserved;
1057
1058} VBVAFLUSH;
1059
[49365]1060typedef struct VBVACMDVBVASUBMIT
1061{
1062 uint32_t u32Reserved;
1063} VBVACMDVBVASUBMIT;
1064
1065/* flush is requested because due to guest command buffer overflow */
1066#define VBVACMDVBVAFLUSH_F_GUEST_BUFFER_OVERFLOW 1
1067
1068typedef struct VBVACMDVBVAFLUSH
1069{
1070 uint32_t u32Flags;
1071} VBVACMDVBVAFLUSH;
1072
1073
[17624]1074/* VBVAINFOSCREEN::u8Flags */
[35145]1075#define VBVA_SCREEN_F_NONE 0x0000
1076#define VBVA_SCREEN_F_ACTIVE 0x0001
[54565]1077/** The virtual monitor has been disabled by the guest and should be removed
1078 * by the host and ignored for purposes of pointer position calculation. */
[35145]1079#define VBVA_SCREEN_F_DISABLED 0x0002
[54565]1080/** The virtual monitor has been blanked by the guest and should be blacked
[63824]1081 * out by the host using width, height, etc values from the VBVAINFOSCREEN request. */
[54565]1082#define VBVA_SCREEN_F_BLANK 0x0004
[63822]1083/** The virtual monitor has been blanked by the guest and should be blacked
1084 * out by the host using the previous mode values for width. height, etc. */
1085#define VBVA_SCREEN_F_BLANK2 0x0008
[17624]1086
[22412]1087typedef struct VBVAINFOSCREEN
[17624]1088{
[17705]1089 /* Which view contains the screen. */
1090 uint32_t u32ViewIndex;
1091
[17624]1092 /* Physical X origin relative to the primary screen. */
1093 int32_t i32OriginX;
1094
1095 /* Physical Y origin relative to the primary screen. */
1096 int32_t i32OriginY;
1097
[22412]1098 /* Offset of visible framebuffer relative to the framebuffer start. */
1099 uint32_t u32StartOffset;
1100
[17624]1101 /* The scan line size in bytes. */
1102 uint32_t u32LineSize;
1103
1104 /* Width of the screen. */
1105 uint32_t u32Width;
1106
1107 /* Height of the screen. */
1108 uint32_t u32Height;
1109
1110 /* Color depth. */
1111 uint16_t u16BitsPerPixel;
1112
1113 /* VBVA_SCREEN_F_* */
1114 uint16_t u16Flags;
1115} VBVAINFOSCREEN;
1116
1117
1118/* VBVAENABLE::u32Flags */
1119#define VBVA_F_NONE 0x00000000
1120#define VBVA_F_ENABLE 0x00000001
1121#define VBVA_F_DISABLE 0x00000002
[28228]1122/* extended VBVA to be used with WDDM */
1123#define VBVA_F_EXTENDED 0x00000004
[29798]1124/* vbva offset is absolute VRAM offset */
1125#define VBVA_F_ABSOFFSET 0x00000008
[17624]1126
[34490]1127typedef struct VBVAENABLE
[17624]1128{
1129 uint32_t u32Flags;
[17676]1130 uint32_t u32Offset;
[22592]1131 int32_t i32Result;
[17624]1132} VBVAENABLE;
1133
[34490]1134typedef struct VBVAENABLE_EX
[28228]1135{
1136 VBVAENABLE Base;
1137 uint32_t u32ScreenId;
1138} VBVAENABLE_EX;
1139
1140
[34490]1141typedef struct VBVAMOUSEPOINTERSHAPE
[19431]1142{
1143 /* The host result. */
[22536]1144 int32_t i32Result;
[19464]1145
[19431]1146 /* VBOX_MOUSE_POINTER_* bit flags. */
1147 uint32_t fu32Flags;
1148
1149 /* X coordinate of the hot spot. */
1150 uint32_t u32HotX;
1151
1152 /* Y coordinate of the hot spot. */
1153 uint32_t u32HotY;
1154
1155 /* Width of the pointer in pixels. */
1156 uint32_t u32Width;
1157
1158 /* Height of the pointer in scanlines. */
1159 uint32_t u32Height;
1160
1161 /* Pointer data.
1162 *
1163 ****
1164 * The data consists of 1 bpp AND mask followed by 32 bpp XOR (color) mask.
1165 *
1166 * For pointers without alpha channel the XOR mask pixels are 32 bit values: (lsb)BGR0(msb).
1167 * For pointers with alpha channel the XOR mask consists of (lsb)BGRA(msb) 32 bit values.
1168 *
1169 * Guest driver must create the AND mask for pointers with alpha channel, so if host does not
1170 * support alpha, the pointer could be displayed as a normal color pointer. The AND mask can
1171 * be constructed from alpha values. For example alpha value >= 0xf0 means bit 0 in the AND mask.
1172 *
1173 * The AND mask is 1 bpp bitmap with byte aligned scanlines. Size of AND mask,
1174 * therefore, is cbAnd = (width + 7) / 8 * height. The padding bits at the
1175 * end of any scanline are undefined.
1176 *
1177 * The XOR mask follows the AND mask on the next 4 bytes aligned offset:
1178 * uint8_t *pXor = pAnd + (cbAnd + 3) & ~3
1179 * Bytes in the gap between the AND and the XOR mask are undefined.
1180 * XOR mask scanlines have no gap between them and size of XOR mask is:
1181 * cXor = width * 4 * height.
1182 ****
1183 *
1184 * Preallocate 4 bytes for accessing actual data as p->au8Data.
1185 */
1186 uint8_t au8Data[4];
1187
1188} VBVAMOUSEPOINTERSHAPE;
1189
[64185]1190/** @name VBVAMOUSEPOINTERSHAPE::fu32Flags
1191 * @note The VBOX_MOUSE_POINTER_* flags are used in the guest video driver,
1192 * values must be <= 0x8000 and must not be changed. (try make more sense
1193 * of this, please).
1194 * @{
1195 */
1196/** pointer is visible */
1197#define VBOX_MOUSE_POINTER_VISIBLE (0x0001)
1198/** pointer has alpha channel */
1199#define VBOX_MOUSE_POINTER_ALPHA (0x0002)
1200/** pointerData contains new pointer shape */
1201#define VBOX_MOUSE_POINTER_SHAPE (0x0004)
1202/** @} */
1203
[29742]1204/* the guest driver can handle asynch guest cmd completion by reading the command offset from io port */
1205#define VBVACAPS_COMPLETEGCMD_BY_IOREAD 0x00000001
1206/* the guest driver can handle video adapter IRQs */
1207#define VBVACAPS_IRQ 0x00000002
[53528]1208/** The guest can read video mode hints sent via VBVA. */
1209#define VBVACAPS_VIDEO_MODE_HINTS 0x00000004
[53965]1210/** The guest can switch to a software cursor on demand. */
1211#define VBVACAPS_DISABLE_CURSOR_INTEGRATION 0x00000008
[60177]1212/** The guest does not depend on host handling the VBE registers. */
1213#define VBVACAPS_USE_VBVA_ONLY 0x00000010
[34490]1214typedef struct VBVACAPS
[29742]1215{
1216 int32_t rc;
1217 uint32_t fCaps;
1218} VBVACAPS;
1219
[41636]1220/* makes graphics device generate IRQ on VSYNC */
1221#define VBVASCANLINECFG_ENABLE_VSYNC_IRQ 0x00000001
1222/* guest driver may request the current scanline */
1223#define VBVASCANLINECFG_ENABLE_SCANLINE_INFO 0x00000002
1224/* request the current refresh period, returned in u32RefreshPeriodMs */
1225#define VBVASCANLINECFG_QUERY_REFRESH_PERIOD 0x00000004
1226/* set new refresh period specified in u32RefreshPeriodMs.
1227 * if used with VBVASCANLINECFG_QUERY_REFRESH_PERIOD,
1228 * u32RefreshPeriodMs is set to the previous refresh period on return */
1229#define VBVASCANLINECFG_SET_REFRESH_PERIOD 0x00000008
1230
1231typedef struct VBVASCANLINECFG
1232{
1233 int32_t rc;
1234 uint32_t fFlags;
1235 uint32_t u32RefreshPeriodMs;
1236 uint32_t u32Reserved;
1237} VBVASCANLINECFG;
1238
1239typedef struct VBVASCANLINEINFO
1240{
1241 int32_t rc;
1242 uint32_t u32ScreenId;
1243 uint32_t u32InVBlank;
1244 uint32_t u32ScanLine;
1245} VBVASCANLINEINFO;
1246
[53528]1247/** Query the most recent mode hints received from the host. */
1248typedef struct VBVAQUERYMODEHINTS
1249{
1250 /** The maximum number of screens to return hints for. */
1251 uint16_t cHintsQueried;
1252 /** The size of the mode hint structures directly following this one. */
1253 uint16_t cbHintStructureGuest;
1254 /** The return code for the operation. Initialise to VERR_NOT_SUPPORTED. */
1255 int32_t rc;
1256} VBVAQUERYMODEHINTS;
1257
1258/** Structure in which a mode hint is returned. The guest allocates an array
1259 * of these immediately after the VBVAQUERYMODEHINTS structure. To accomodate
1260 * future extensions, the VBVAQUERYMODEHINTS structure specifies the size of
1261 * the VBVAMODEHINT structures allocated by the guest, and the host only fills
1262 * out structure elements which fit into that size. The host should fill any
1263 * unused members (e.g. dx, dy) or structure space on the end with ~0. The
1264 * whole structure can legally be set to ~0 to skip a screen. */
1265typedef struct VBVAMODEHINT
1266{
1267 uint32_t magic;
1268 uint32_t cx;
1269 uint32_t cy;
1270 uint32_t cBPP; /* Which has never been used... */
1271 uint32_t cDisplay;
1272 uint32_t dx; /**< X offset into the virtual frame-buffer. */
1273 uint32_t dy; /**< Y offset into the virtual frame-buffer. */
1274 uint32_t fEnabled; /* Not fFlags. Add new members for new flags. */
1275} VBVAMODEHINT;
1276
1277#define VBVAMODEHINT_MAGIC UINT32_C(0x0801add9)
1278
[53965]1279/** Report the rectangle relative to which absolute pointer events should be
1280 * expressed. This information remains valid until the next VBVA resize event
1281 * for any screen, at which time it is reset to the bounding rectangle of all
[56323]1282 * virtual screens and must be re-set.
[53965]1283 * @see VBVA_REPORT_INPUT_MAPPING. */
1284typedef struct VBVAREPORTINPUTMAPPING
1285{
1286 int32_t x; /**< Upper left X co-ordinate relative to the first screen. */
1287 int32_t y; /**< Upper left Y co-ordinate relative to the first screen. */
1288 uint32_t cx; /**< Rectangle width. */
1289 uint32_t cy; /**< Rectangle height. */
1290} VBVAREPORTINPUTMAPPING;
1291
1292/** Report the guest cursor position and query the host one. The host may wish
[70075]1293 * to use the guest information to re-position its own cursor, particularly
1294 * when the cursor is captured and the guest does not support switching to a
1295 * software cursor. After every mode switch the guest must signal that it
1296 * supports sending position information by sending an event with
1297 * @a fReportPosition set to false.
[53965]1298 * @see VBVA_CURSOR_POSITION */
1299typedef struct VBVACURSORPOSITION
1300{
1301 uint32_t fReportPosition; /**< Are we reporting a position? */
1302 uint32_t x; /**< Guest cursor X position */
1303 uint32_t y; /**< Guest cursor Y position */
1304} VBVACURSORPOSITION;
1305
[17624]1306#pragma pack()
1307
[33146]1308typedef uint64_t VBOXVIDEOOFFSET;
1309
1310#define VBOXVIDEOOFFSET_VOID ((VBOXVIDEOOFFSET)~0)
1311
[36882]1312#pragma pack(1)
[26556]1313
1314/*
1315 * VBOXSHGSMI made on top HGSMI and allows receiving notifications
1316 * about G->H command completion
1317 */
1318/* SHGSMI command header */
1319typedef struct VBOXSHGSMIHEADER
1320{
1321 uint64_t pvNext; /*<- completion processing queue */
1322 uint32_t fFlags; /*<- see VBOXSHGSMI_FLAG_XXX Flags */
1323 uint32_t cRefs; /*<- command referece count */
1324 uint64_t u64Info1; /*<- contents depends on the fFlags value */
1325 uint64_t u64Info2; /*<- contents depends on the fFlags value */
1326} VBOXSHGSMIHEADER, *PVBOXSHGSMIHEADER;
1327
[36882]1328typedef enum
1329{
1330 VBOXVDMACMD_TYPE_UNDEFINED = 0,
1331 VBOXVDMACMD_TYPE_DMA_PRESENT_BLT = 1,
1332 VBOXVDMACMD_TYPE_DMA_BPB_TRANSFER,
1333 VBOXVDMACMD_TYPE_DMA_BPB_FILL,
1334 VBOXVDMACMD_TYPE_DMA_PRESENT_SHADOW2PRIMARY,
1335 VBOXVDMACMD_TYPE_DMA_PRESENT_CLRFILL,
1336 VBOXVDMACMD_TYPE_DMA_PRESENT_FLIP,
1337 VBOXVDMACMD_TYPE_DMA_NOP,
[37490]1338 VBOXVDMACMD_TYPE_CHROMIUM_CMD, /* chromium cmd */
1339 VBOXVDMACMD_TYPE_DMA_BPB_TRANSFER_VRAMSYS,
1340 VBOXVDMACMD_TYPE_CHILD_STATUS_IRQ /* make the device notify child (monitor) state change IRQ */
[36882]1341} VBOXVDMACMD_TYPE;
1342
1343#pragma pack()
1344
[26556]1345/* the command processing was asynch, set by the host to indicate asynch command completion
1346 * must not be cleared once set, the command completion is performed by issuing a host->guest completion command
1347 * while keeping this flag unchanged */
1348#define VBOXSHGSMI_FLAG_HG_ASYNCH 0x00010000
[30788]1349#if 0
1350/* if set - asynch completion is performed by issuing the event,
1351 * if cleared - asynch completion is performed by calling a callback */
1352#define VBOXSHGSMI_FLAG_GH_ASYNCH_EVENT 0x00000001
1353#endif
[26556]1354/* issue interrupt on asynch completion, used for critical G->H commands,
1355 * i.e. for completion of which guest is waiting. */
1356#define VBOXSHGSMI_FLAG_GH_ASYNCH_IRQ 0x00000002
1357/* guest does not do any op on completion of this command,
1358 * the host may copy the command and indicate that it does not need the command anymore
1359 * by not setting VBOXSHGSMI_FLAG_HG_ASYNCH */
1360#define VBOXSHGSMI_FLAG_GH_ASYNCH_NOCOMPLETION 0x00000004
1361/* guest requires the command to be processed asynchronously,
1362 * not setting VBOXSHGSMI_FLAG_HG_ASYNCH by the host in this case is treated as command failure */
1363#define VBOXSHGSMI_FLAG_GH_ASYNCH_FORCE 0x00000008
1364/* force IRQ on cmd completion */
1365#define VBOXSHGSMI_FLAG_GH_ASYNCH_IRQ_FORCE 0x00000010
1366/* an IRQ-level callback is associated with the command */
1367#define VBOXSHGSMI_FLAG_GH_ASYNCH_CALLBACK_IRQ 0x00000020
1368/* guest expects this command to be completed synchronously */
1369#define VBOXSHGSMI_FLAG_GH_SYNCH 0x00000040
1370
[36882]1371
[71590]1372DECLINLINE(uint8_t RT_UNTRUSTED_VOLATILE_GUEST *)
1373VBoxSHGSMIBufferData(const VBOXSHGSMIHEADER RT_UNTRUSTED_VOLATILE_GUEST *pHeader)
[26969]1374{
[71590]1375 return (uint8_t RT_UNTRUSTED_VOLATILE_GUEST *)pHeader + sizeof(VBOXSHGSMIHEADER);
[26969]1376}
1377
[71590]1378#define VBoxSHGSMIBufferHeaderSize() (sizeof(VBOXSHGSMIHEADER))
[39603]1379
[71590]1380DECLINLINE(VBOXSHGSMIHEADER RT_UNTRUSTED_VOLATILE_GUEST *) VBoxSHGSMIBufferHeader(const void RT_UNTRUSTED_VOLATILE_GUEST *pvData)
[26969]1381{
[71590]1382 return (VBOXSHGSMIHEADER RT_UNTRUSTED_VOLATILE_GUEST *)((uintptr_t)pvData - sizeof(VBOXSHGSMIHEADER));
[26969]1383}
1384
[32877]1385#ifdef VBOX_WITH_VDMA
[32241]1386# pragma pack(1)
1387
[26556]1388/* VDMA - Video DMA */
1389
1390/* VDMA Control API */
1391/* VBOXVDMA_CTL::u32Flags */
[26969]1392typedef enum
1393{
1394 VBOXVDMA_CTL_TYPE_NONE = 0,
1395 VBOXVDMA_CTL_TYPE_ENABLE,
1396 VBOXVDMA_CTL_TYPE_DISABLE,
[41636]1397 VBOXVDMA_CTL_TYPE_FLUSH,
[71602]1398 VBOXVDMA_CTL_TYPE_WATCHDOG,
1399 VBOXVDMA_CTL_TYPE_END
[26969]1400} VBOXVDMA_CTL_TYPE;
[26556]1401
1402typedef struct VBOXVDMA_CTL
1403{
[26969]1404 VBOXVDMA_CTL_TYPE enmCtl;
[26556]1405 uint32_t u32Offset;
1406 int32_t i32Result;
[71590]1407} VBOXVDMA_CTL;
[26556]1408
1409/* VBOXVDMACBUF_DR::phBuf specifies offset in VRAM */
1410#define VBOXVDMACBUF_FLAG_BUF_VRAM_OFFSET 0x00000001
1411/* command buffer follows the VBOXVDMACBUF_DR in VRAM, VBOXVDMACBUF_DR::phBuf is ignored */
1412#define VBOXVDMACBUF_FLAG_BUF_FOLLOWS_DR 0x00000002
1413
[71595]1414/**
[26556]1415 * We can not submit the DMA command via VRAM since we do not have control over
1416 * DMA command buffer [de]allocation, i.e. we only control the buffer contents.
1417 * In other words the system may call one of our callbacks to fill a command buffer
1418 * with the necessary commands and then discard the buffer w/o any notification.
1419 *
1420 * We have only DMA command buffer physical address at submission time.
1421 *
1422 * so the only way is to */
1423typedef struct VBOXVDMACBUF_DR
1424{
[32889]1425 uint16_t fFlags;
1426 uint16_t cbBuf;
[26556]1427 /* RT_SUCCESS() - on success
1428 * VERR_INTERRUPTED - on preemption
1429 * VERR_xxx - on error */
1430 int32_t rc;
[26661]1431 union
1432 {
1433 uint64_t phBuf;
1434 VBOXVIDEOOFFSET offVramBuf;
1435 } Location;
[32889]1436 uint64_t aGuestData[7];
[26556]1437} VBOXVDMACBUF_DR, *PVBOXVDMACBUF_DR;
1438
[71595]1439#define VBOXVDMACBUF_DR_TAIL(a_pCmd, a_TailType) \
1440 ( (a_TailType RT_UNTRUSTED_VOLATILE_HSTGST *)( ((uint8_t*)(a_pCmd)) + sizeof(VBOXVDMACBUF_DR)) )
1441#define VBOXVDMACBUF_DR_FROM_TAIL(a_pCmd) \
1442 ( (VBOXVDMACBUF_DR RT_UNTRUSTED_VOLATILE_HSTGST *)( ((uint8_t*)(a_pCmd)) - sizeof(VBOXVDMACBUF_DR)) )
[26556]1443
1444typedef struct VBOXVDMACMD
1445{
1446 VBOXVDMACMD_TYPE enmType;
[26630]1447 uint32_t u32CmdSpecific;
[71595]1448} VBOXVDMACMD;
[26556]1449
[71595]1450#define VBOXVDMACMD_HEADER_SIZE() sizeof(VBOXVDMACMD)
[73103]1451#define VBOXVDMACMD_SIZE_FROMBODYSIZE(_s) ((uint32_t)(VBOXVDMACMD_HEADER_SIZE() + (_s)))
1452#define VBOXVDMACMD_SIZE(_t) (VBOXVDMACMD_SIZE_FROMBODYSIZE(sizeof(_t)))
[71596]1453#define VBOXVDMACMD_BODY(a_pCmd, a_TypeBody) \
1454 ( (a_TypeBody RT_UNTRUSTED_VOLATILE_HSTGST *)( ((uint8_t *)(a_pCmd)) + VBOXVDMACMD_HEADER_SIZE()) )
[71595]1455#define VBOXVDMACMD_BODY_SIZE(_s) ( (_s) - VBOXVDMACMD_HEADER_SIZE() )
[71596]1456#define VBOXVDMACMD_FROM_BODY(a_pBody) \
1457 ( (VBOXVDMACMD RT_UNTRUSTED_VOLATILE_HSTGST *)( ((uint8_t *)(a_pBody)) - VBOXVDMACMD_HEADER_SIZE()) )
[73103]1458#define VBOXVDMACMD_BODY_FIELD_OFFSET(_ot, _t, _f) ( (_ot)(uintptr_t)( VBOXVDMACMD_BODY(0, uint8_t) + RT_UOFFSETOF_DYN(_t, _f) ) )
[26556]1459
[80876]1460# pragma pack()
1461#endif /* #ifdef VBOX_WITH_VDMA */
[26630]1462
[28322]1463
[37490]1464#define VBOXVDMA_CHILD_STATUS_F_CONNECTED 0x01
1465#define VBOXVDMA_CHILD_STATUS_F_DISCONNECTED 0x02
1466#define VBOXVDMA_CHILD_STATUS_F_ROTATED 0x04
1467
1468typedef struct VBOXVDMA_CHILD_STATUS
1469{
1470 uint32_t iChild;
1471 uint8_t fFlags;
1472 uint8_t u8RotationAngle;
1473 uint16_t u16Reserved;
1474} VBOXVDMA_CHILD_STATUS, *PVBOXVDMA_CHILD_STATUS;
1475
1476/* apply the aInfos are applied to all targets, the iTarget is ignored */
1477#define VBOXVDMACMD_CHILD_STATUS_IRQ_F_APPLY_TO_ALL 0x00000001
1478
1479typedef struct VBOXVDMACMD_CHILD_STATUS_IRQ
1480{
1481 uint32_t cInfos;
1482 uint32_t fFlags;
1483 VBOXVDMA_CHILD_STATUS aInfos[1];
1484} VBOXVDMACMD_CHILD_STATUS_IRQ, *PVBOXVDMACMD_CHILD_STATUS_IRQ;
1485
[51260]1486#define VBOXCMDVBVA_SCREENMAP_SIZE(_elType) ((VBOX_VIDEO_MAX_SCREENS + sizeof (_elType) - 1) / sizeof (_elType))
1487#define VBOXCMDVBVA_SCREENMAP_DECL(_elType, _name) _elType _name[VBOXCMDVBVA_SCREENMAP_SIZE(_elType)]
[51121]1488
[76585]1489#endif /* !VBOX_INCLUDED_Graphics_VBoxVideo_h */
[68657]1490
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette