/** @file
* VirtualBox Video interface.
*/
/*
* Copyright (C) 2006-2012 Oracle Corporation
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
* General Public License (GPL) as published by the Free Software
* Foundation, in version 2 as it comes in the "COPYING" file of the
* VirtualBox OSE distribution. VirtualBox OSE is distributed in the
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*
* The contents of this file may alternatively be used under the terms
* of the Common Development and Distribution License Version 1.0
* (CDDL) only, as it comes in the "COPYING.CDDL" file of the
* VirtualBox OSE distribution, in which case the provisions of the
* CDDL are applicable instead of those of the GPL.
*
* You may elect to license modified versions of this file under the
* terms and conditions of either the GPL or the CDDL or both.
*/
#ifndef ___VBox_VBoxVideo_h
#define ___VBox_VBoxVideo_h
/*
* The last 4096 bytes of the guest VRAM contains the generic info for all
* DualView chunks: sizes and offsets of chunks. This is filled by miniport.
*
* Last 4096 bytes of each chunk contain chunk specific data: framebuffer info,
* etc. This is used exclusively by the corresponding instance of a display driver.
*
* The VRAM layout:
* Last 4096 bytes - Adapter information area.
* 4096 bytes aligned miniport heap (value specified in the config rouded up).
* Slack - what left after dividing the VRAM.
* 4096 bytes aligned framebuffers:
* last 4096 bytes of each framebuffer is the display information area.
*
* The Virtual Graphics Adapter information in the guest VRAM is stored by the
* guest video driver using structures prepended by VBOXVIDEOINFOHDR.
*
* When the guest driver writes dword 0 to the VBE_DISPI_INDEX_VBOX_VIDEO
* the host starts to process the info. The first element at the start of
* the 4096 bytes region should be normally be a LINK that points to
* actual information chain. That way the guest driver can have some
* fixed layout of the information memory block and just rewrite
* the link to point to relevant memory chain.
*
* The processing stops at the END element.
*
* The host can access the memory only when the port IO is processed.
* All data that will be needed later must be copied from these 4096 bytes.
* But other VRAM can be used by host until the mode is disabled.
*
* The guest driver writes dword 0xffffffff to the VBE_DISPI_INDEX_VBOX_VIDEO
* to disable the mode.
*
* VBE_DISPI_INDEX_VBOX_VIDEO is used to read the configuration information
* from the host and issue commands to the host.
*
* The guest writes the VBE_DISPI_INDEX_VBOX_VIDEO index register, the the
* following operations with the VBE data register can be performed:
*
* Operation Result
* write 16 bit value NOP
* read 16 bit value count of monitors
* write 32 bit value sets the vbox command value and the command processed by the host
* read 32 bit value result of the last vbox command is returned
*/
#define VBOX_VIDEO_PRIMARY_SCREEN 0
#define VBOX_VIDEO_NO_SCREEN ~0
/* The size of the information. */
/*
* The minimum HGSMI heap size is PAGE_SIZE (4096 bytes) and is a restriction of the
* runtime heapsimple API. Use minimum 2 pages here, because the info area also may
* contain other data (for example HGSMIHOSTFLAGS structure).
*/
#ifndef VBOX_XPDM_MINIPORT
#else
#endif
/* The value for port IO to let the adapter to interpret the adapter memory. */
/* The value for port IO to let the adapter to interpret the adapter memory. */
/* The value for port IO to let the adapter to interpret the display memory.
* The display number is encoded in low 16 bits.
*/
/* The end of the information. */
#define VBOX_VIDEO_INFO_TYPE_END 0
/* Instructs the host to fetch the next VBOXVIDEOINFOHDR at the given offset of VRAM. */
/* Information about a display memory position. */
/* Information about a screen. */
/* Information about host notifications for the driver. */
/* Information about non-volatile guest VRAM heap. */
/* VBVA flush. */
/* Query configuration value. */
#pragma pack(1)
typedef struct VBOXVIDEOINFOHDR
{
typedef struct VBOXVIDEOINFOLINK
{
/* Relative offset in VRAM */
/* Resides in adapter info memory. Describes a display VRAM chunk. */
typedef struct VBOXVIDEOINFODISPLAY
{
/* Index of the framebuffer assigned by guest. */
/* Absolute offset in VRAM of the framebuffer to be displayed on the monitor. */
/* The size of the memory that can be used for the screen. */
/* The size of the memory that is used for the Display information.
* The information is at u32Offset + u32FramebufferSize
*/
/* Resides in display info area, describes the current video mode. */
typedef struct VBOXVIDEOINFOSCREEN
{
/* Physical X origin relative to the primary screen. */
/* Physical Y origin relative to the primary screen. */
/* The scan line size in bytes. */
/* Width of the screen. */
/* Height of the screen. */
/* Color depth. */
/* VBOX_VIDEO_INFO_SCREEN_F_* */
/* The guest initializes the structure to 0. The positions of the structure in the
* display info area must not be changed, host will update the structure. Guest checks
* the events and modifies the structure as a response to host.
*/
typedef struct VBOXVIDEOINFOHOSTEVENTS
{
/* Host events. */
/* Resides in adapter info memory. Describes the non-volatile VRAM heap. */
typedef struct VBOXVIDEOINFONVHEAP
{
/* Absolute offset in VRAM of the start of the heap. */
/* The size of the heap. */
/* Display information area. */
typedef struct VBOXVIDEOINFOVBVASTATUS
{
/* Absolute offset in VRAM of the start of the VBVA QUEUE. 0 to disable VBVA. */
/* The size of the VBVA QUEUE. 0 to disable VBVA. */
typedef struct VBOXVIDEOINFOVBVAFLUSH
{
#define VBOX_VIDEO_QCI32_MONITOR_COUNT 0
typedef struct VBOXVIDEOINFOQUERYCONF32
{
#pragma pack()
#ifdef VBOX_WITH_VIDEOHWACCEL
#pragma pack(1)
#define VBOXVHWA_VERSION_MAJ 0
#define VBOXVHWA_VERSION_MIN 0
#define VBOXVHWA_VERSION_RSV 0
typedef enum
{
#ifdef VBOX_WITH_WDDM
#endif
/* the command processing was asynch, set by the host to indicate asynch command completion
* must not be cleared once set, the command completion is performed by issuing a host->guest completion command
* while keeping this flag unchanged */
/* asynch completion is performed by issuing the event */
/* issue interrupt on asynch completion */
/* guest does not do any op on completion of this command, the host may copy the command and indicate that it does not need the command anymore
* by setting the VBOXVHWACMD_FLAG_HG_ASYNCH_RETURNED flag */
/* the host has copied the VBOXVHWACMD_FLAG_GH_ASYNCH_NOCOMPLETION command and returned it to the guest */
/* this is the host->host cmd, i.e. a configuration command posted by the host to the framebuffer */
typedef struct VBOXVHWACMD
{
uint64_t GuestVBVAReserved1; /* field internally used by the guest VBVA cmd handling, must NOT be modified by clients */
uint64_t GuestVBVAReserved2; /* field internally used by the guest VBVA cmd handling, must NOT be modified by clients */
union
{
} u;
} VBOXVHWACMD;
typedef unsigned int VBOXVHWACMD_LENGTH;
typedef struct VBOXVHWA_RECTL
{
typedef struct VBOXVHWA_COLORKEY
{
typedef struct VBOXVHWA_PIXELFORMAT
{
union
{
} c;
union
{
} m1;
union
{
} m2;
union
{
} m3;
union
{
} m4;
typedef struct VBOXVHWA_SURFACEDESC
{
typedef struct VBOXVHWA_BLTFX
{
typedef struct VBOXVHWA_OVERLAYFX
{
/*#define VBOXVHWA_SD_REFRESHRATE 0x00040000*/
/*#define VBOXVHWA_CAPS2_FLIPINTERVAL 0x00200000*/
/*#define VBOXVHWA_CAPS2_FLIPNOVSYNC 0x00400000*/
typedef struct VBOXVHWA_VERSION
{
} while(0)
typedef struct VBOXVHWACMD_QUERYINFO1
{
union
{
struct
{
} in;
struct
{
} out;
} u;
typedef struct VBOXVHWACMD_QUERYINFO2
{
typedef struct VBOXVHWACMD_SURF_CANCREATE
{
union
{
struct
{
} in;
struct
{
} out;
} u;
typedef struct VBOXVHWACMD_SURF_CREATE
{
#ifdef VBOX_WITH_WDDM
typedef struct VBOXVHWACMD_SURF_GETINFO
{
#endif
typedef struct VBOXVHWACMD_SURF_DESTROY
{
union
{
struct
{
} in;
} u;
typedef struct VBOXVHWACMD_SURF_LOCK
{
union
{
struct
{
} in;
} u;
typedef struct VBOXVHWACMD_SURF_UNLOCK
{
union
{
struct
{
} in;
} u;
typedef struct VBOXVHWACMD_SURF_BLT
{
union
{
struct
{
} in;
} u;
#ifdef VBOX_WITH_WDDM
typedef struct VBOXVHWACMD_SURF_COLORFILL
{
union
{
struct
{
} in;
} u;
#endif
typedef struct VBOXVHWACMD_SURF_FLIP
{
union
{
struct
{
} in;
} u;
typedef struct VBOXVHWACMD_SURF_COLORKEY_SET
{
union
{
struct
{
} in;
} u;
typedef struct VBOXVHWACMD_SURF_OVERLAY_UPDATE
{
union
{
struct
{
} in;
} u;
typedef struct VBOXVHWACMD_SURF_OVERLAY_SETPOSITION
{
union
{
struct
{
} in;
} u;
typedef struct VBOXVHWACMD_HH_CONSTRUCT
{
void *pVM;
/* VRAM info for the backend to be able to properly translate VRAM offsets */
void *pvVRAM;
typedef struct VBOXVHWACMD_HH_SAVESTATE_SAVEPERFORM
{
typedef struct VBOXVHWACMD_HH_SAVESTATE_LOADPERFORM
{
do { \
}while(0)
#pragma pack()
#endif /* #ifdef VBOX_WITH_VIDEOHWACCEL */
/* All structures are without alignment. */
#pragma pack(1)
typedef struct VBVAHOSTFLAGS
{
typedef struct VBVABUFFER
{
/* The offset where the data start in the buffer. */
/* The offset where next data must be placed in the buffer. */
/* The queue of record descriptions. */
/* Space to leave free in the buffer when large partial records are transferred. */
} VBVABUFFER;
/* guest->host commands */
#ifdef VBOX_WITH_VIDEOHWACCEL
#endif /* # ifdef VBOX_WITH_VIDEOHWACCEL */
#ifdef VBOX_WITH_VDMA
#endif
/** Report the guest virtual desktop position and size for mapping host and
* guest pointer positions. */
/** Report the guest cursor position and query the host position. */
/* host->guest commands */
#ifdef VBOX_WITH_VDMA
#endif
#ifdef VBOX_WITH_VIDEOHWACCEL
#pragma pack(1)
typedef struct VBVAHOSTCMDVHWACMDCOMPLETE
{
#pragma pack()
#endif /* # ifdef VBOX_WITH_VIDEOHWACCEL */
#pragma pack(1)
typedef enum
{
typedef struct VBVAHOSTCMDEVENT
{
typedef struct VBVAHOSTCMD
{
/* destination ID if >=0 specifies display index, otherwize the command is directed to the miniport */
union
{
} u;
#define VBVAHOSTCMD_HDR(_pBody) ((VBVAHOSTCMD*)(((uint8_t*)_pBody) - RT_OFFSETOF(VBVAHOSTCMD, body)))
#pragma pack()
/* VBVACONF32::u32Index */
#define VBOX_VBVA_CONF32_MONITOR_COUNT 0
/** Returns VINF_SUCCESS if the host can report mode hints via VBVA.
* Set value to VERR_NOT_SUPPORTED before calling. */
/** Returns VINF_SUCCESS if the host can receive guest cursor information via
* VBVA. Set value to VERR_NOT_SUPPORTED before calling. */
/** Returns the currently available host cursor capabilities. Available if
* VBVACONF32::VBOX_VBVA_CONF32_GUEST_CURSOR_REPORTING returns success.
* @see VMMDevReqMouseStatus::mouseFeatures. */
/** Returns the supported flags in VBVAINFOSCREEN::u8Flags. */
typedef struct VBVACONF32
{
} VBVACONF32;
typedef struct VBVAINFOVIEW
{
/* Index of the screen, assigned by the guest. */
/* The screen offset in VRAM, the framebuffer starts here. */
/* The size of the VRAM memory that can be used for the view. */
/* The recommended maximum size of the VRAM memory for the screen. */
} VBVAINFOVIEW;
typedef struct VBVAINFOHEAP
{
/* Absolute offset in VRAM of the start of the heap. */
/* The size of the heap. */
} VBVAINFOHEAP;
typedef struct VBVAFLUSH
{
} VBVAFLUSH;
typedef struct VBVACMDVBVASUBMIT
{
/* flush is requested because due to guest command buffer overflow */
typedef struct VBVACMDVBVAFLUSH
{
/* VBVAINFOSCREEN::u8Flags */
/** The virtual monitor has been disabled by the guest and should be removed
* by the host and ignored for purposes of pointer position calculation. */
/** The virtual monitor has been blanked by the guest and should be blacked
* out by the host. */
typedef struct VBVAINFOSCREEN
{
/* Which view contains the screen. */
/* Physical X origin relative to the primary screen. */
/* Physical Y origin relative to the primary screen. */
/* Offset of visible framebuffer relative to the framebuffer start. */
/* The scan line size in bytes. */
/* Width of the screen. */
/* Height of the screen. */
/* Color depth. */
/* VBVA_SCREEN_F_* */
/* VBVAENABLE::u32Flags */
/* extended VBVA to be used with WDDM */
/* vbva offset is absolute VRAM offset */
typedef struct VBVAENABLE
{
} VBVAENABLE;
typedef struct VBVAENABLE_EX
{
typedef struct VBVAMOUSEPOINTERSHAPE
{
/* The host result. */
/* VBOX_MOUSE_POINTER_* bit flags. */
/* X coordinate of the hot spot. */
/* Y coordinate of the hot spot. */
/* Width of the pointer in pixels. */
/* Height of the pointer in scanlines. */
/* Pointer data.
*
****
* The data consists of 1 bpp AND mask followed by 32 bpp XOR (color) mask.
*
* For pointers without alpha channel the XOR mask pixels are 32 bit values: (lsb)BGR0(msb).
* For pointers with alpha channel the XOR mask consists of (lsb)BGRA(msb) 32 bit values.
*
* Guest driver must create the AND mask for pointers with alpha channel, so if host does not
* support alpha, the pointer could be displayed as a normal color pointer. The AND mask can
* be constructed from alpha values. For example alpha value >= 0xf0 means bit 0 in the AND mask.
*
* The AND mask is 1 bpp bitmap with byte aligned scanlines. Size of AND mask,
* therefore, is cbAnd = (width + 7) / 8 * height. The padding bits at the
* end of any scanline are undefined.
*
* The XOR mask follows the AND mask on the next 4 bytes aligned offset:
* uint8_t *pXor = pAnd + (cbAnd + 3) & ~3
* Bytes in the gap between the AND and the XOR mask are undefined.
* XOR mask scanlines have no gap between them and size of XOR mask is:
* cXor = width * 4 * height.
****
*
* Preallocate 4 bytes for accessing actual data as p->au8Data.
*/
/* the guest driver can handle asynch guest cmd completion by reading the command offset from io port */
/* the guest driver can handle video adapter IRQs */
/** The guest can read video mode hints sent via VBVA. */
/** The guest can switch to a software cursor on demand. */
typedef struct VBVACAPS
{
} VBVACAPS;
/* makes graphics device generate IRQ on VSYNC */
/* guest driver may request the current scanline */
/* request the current refresh period, returned in u32RefreshPeriodMs */
/* set new refresh period specified in u32RefreshPeriodMs.
* if used with VBVASCANLINECFG_QUERY_REFRESH_PERIOD,
* u32RefreshPeriodMs is set to the previous refresh period on return */
typedef struct VBVASCANLINECFG
{
typedef struct VBVASCANLINEINFO
{
/** Query the most recent mode hints received from the host. */
typedef struct VBVAQUERYMODEHINTS
{
/** The maximum number of screens to return hints for. */
/** The size of the mode hint structures directly following this one. */
/** The return code for the operation. Initialise to VERR_NOT_SUPPORTED. */
/** Structure in which a mode hint is returned. The guest allocates an array
* of these immediately after the VBVAQUERYMODEHINTS structure. To accomodate
* future extensions, the VBVAQUERYMODEHINTS structure specifies the size of
* the VBVAMODEHINT structures allocated by the guest, and the host only fills
* out structure elements which fit into that size. The host should fill any
* unused members (e.g. dx, dy) or structure space on the end with ~0. The
* whole structure can legally be set to ~0 to skip a screen. */
typedef struct VBVAMODEHINT
{
} VBVAMODEHINT;
/** Report the rectangle relative to which absolute pointer events should be
* expressed. This information remains valid until the next VBVA resize event
* for any screen, at which time it is reset to the bounding rectangle of all
* virtual screens and must be re-set.
* @see VBVA_REPORT_INPUT_MAPPING. */
typedef struct VBVAREPORTINPUTMAPPING
{
int32_t x; /**< Upper left X co-ordinate relative to the first screen. */
int32_t y; /**< Upper left Y co-ordinate relative to the first screen. */
/** Report the guest cursor position and query the host one. The host may wish
* to use the guest information to re-position its own cursor (though this is
* currently unlikely).
* @see VBVA_CURSOR_POSITION */
typedef struct VBVACURSORPOSITION
{
uint32_t x; /**< Guest cursor X position */
uint32_t y; /**< Guest cursor Y position */
#pragma pack()
#pragma pack(1)
/*
* VBOXSHGSMI made on top HGSMI and allows receiving notifications
* about G->H command completion
*/
/* SHGSMI command header */
typedef struct VBOXSHGSMIHEADER
{
typedef enum
{
#pragma pack()
/* the command processing was asynch, set by the host to indicate asynch command completion
* must not be cleared once set, the command completion is performed by issuing a host->guest completion command
* while keeping this flag unchanged */
#if 0
/* if set - asynch completion is performed by issuing the event,
* if cleared - asynch completion is performed by calling a callback */
#define VBOXSHGSMI_FLAG_GH_ASYNCH_EVENT 0x00000001
#endif
/* issue interrupt on asynch completion, used for critical G->H commands,
* i.e. for completion of which guest is waiting. */
/* guest does not do any op on completion of this command,
* the host may copy the command and indicate that it does not need the command anymore
* by not setting VBOXSHGSMI_FLAG_HG_ASYNCH */
/* guest requires the command to be processed asynchronously,
* not setting VBOXSHGSMI_FLAG_HG_ASYNCH by the host in this case is treated as command failure */
/* force IRQ on cmd completion */
/* an IRQ-level callback is associated with the command */
/* guest expects this command to be completed synchronously */
{
}
{
}
#ifdef VBOX_WITH_VDMA
# pragma pack(1)
/* VDMA - Video DMA */
/* VDMA Control API */
/* VBOXVDMA_CTL::u32Flags */
typedef enum
{
typedef struct VBOXVDMA_CTL
{
typedef struct VBOXVDMA_RECTL
{
typedef enum
{
typedef struct VBOXVDMA_SURF_DESC
{
/*typedef uint64_t VBOXVDMAPHADDRESS;*/
/* region specified as a rectangle, otherwize it is a size of memory pointed to by phys address */
/* Surface handle is valid */
/* address is offset in VRAM */
/* VBOXVDMACBUF_DR::phBuf specifies offset in VRAM */
/* command buffer follows the VBOXVDMACBUF_DR in VRAM, VBOXVDMACBUF_DR::phBuf is ignored */
/*
* We can not submit the DMA command via VRAM since we do not have control over
* DMA command buffer [de]allocation, i.e. we only control the buffer contents.
* In other words the system may call one of our callbacks to fill a command buffer
* with the necessary commands and then discard the buffer w/o any notification.
*
* We have only DMA command buffer physical address at submission time.
*
* so the only way is to */
typedef struct VBOXVDMACBUF_DR
{
/* RT_SUCCESS() - on success
* VERR_INTERRUPTED - on preemption
* VERR_xxx - on error */
union
{
} Location;
#define VBOXVDMACBUF_DR_FROM_TAIL(_pCmd) ( (VBOXVDMACBUF_DR*)(((uint8_t*)(_pCmd)) - sizeof (VBOXVDMACBUF_DR)) )
typedef struct VBOXVDMACMD
{
#define VBOXVDMACMD_FROM_BODY(_pCmd) ( (VBOXVDMACMD*)(((uint8_t*)(_pCmd)) - VBOXVDMACMD_HEADER_SIZE()) )
#define VBOXVDMACMD_BODY_FIELD_OFFSET(_ot, _t, _f) ( (_ot)(uintptr_t)( VBOXVDMACMD_BODY(0, uint8_t) + RT_OFFSETOF(_t, _f) ) )
typedef struct VBOXVDMACMD_DMA_PRESENT_BLT
{
typedef struct VBOXVDMACMD_DMA_PRESENT_SHADOW2PRIMARY
{
typedef struct VBOXVDMACMD_DMA_BPB_TRANSFER
{
union
{
} Src;
union
{
} Dst;
typedef struct VBOXVDMACMD_SYSMEMEL
{
((PVBOXVDMACMD_SYSMEMEL)(((uint8_t*)(_pEl))+RT_OFFSETOF(VBOXVDMACMD_SYSMEMEL, phBuf[(_pEl)->cPages]))) \
: \
((_pEl)+1)
typedef struct VBOXVDMACMD_DMA_BPB_TRANSFER_VRAMSYS
{
typedef struct VBOXVDMACMD_DMA_BPB_FILL
{
typedef struct VBOXVDMA_CHILD_STATUS
{
/* apply the aInfos are applied to all targets, the iTarget is ignored */
typedef struct VBOXVDMACMD_CHILD_STATUS_IRQ
{
# pragma pack()
#endif /* #ifdef VBOX_WITH_VDMA */
#pragma pack(1)
typedef struct VBOXVDMACMD_CHROMIUM_BUFFER
{
typedef struct VBOXVDMACMD_CHROMIUM_CMD
{
typedef enum
{
typedef struct VBOXVDMACMD_CHROMIUM_CTL
{
typedef DECLCALLBACK(int) FNCRHGSMICMDCOMPLETION(HCRHGSMICMDCOMPLETION hCompletion, PVBOXVDMACMD_CHROMIUM_CMD pCmd, int rc);
/* tells whether 3D backend has some 3D overlay data displayed */
/* same as PFNCROGLHASDATA, but for specific screen */
/* callbacks chrogl gives to main */
typedef struct CR_MAIN_INTERFACE
{
typedef struct VBOXVDMACMD_CHROMIUM_CTL_CRHGSMI_SETUP_MAINCB
{
/*in*/
/*out*/
/* server callbacks */
/* submit chromium cmd */
typedef DECLCALLBACK(int) FNVBOXCRCON_SVR_CRCMD(HVBOXCRCON_SERVER hServer, PVBOXVDMACMD_CHROMIUM_CMD pCmd, uint32_t cbCmd);
/* submit chromium control cmd */
typedef DECLCALLBACK(int) FNVBOXCRCON_SVR_CRCTL(HVBOXCRCON_SERVER hServer, PVBOXVDMACMD_CHROMIUM_CTL pCtl, uint32_t cbCmd);
/* request 3D data.
* The protocol is the following:
* 1. if there is no 3D data displayed on screen, returns VINF_EOF immediately w/o calling any PFNVBOXCRCON_3DRGN_XXX callbacks
* 2. otherwise calls PFNVBOXCRCON_3DRGN_ONSUBMIT, submits the "regions get" request to the CrOpenGL server to process it asynchronously and returns VINF_SUCCESS
* 2.a on "regions get" request processing calls PFNVBOXCRCON_3DRGN_BEGIN,
* 2.b then PFNVBOXCRCON_3DRGN_REPORT zero or more times for each 3D region,
* 2.c and then PFNVBOXCRCON_3DRGN_END
* 3. returns VERR_XXX code on failure
* */
typedef DECLCALLBACK(int) FNVBOXCRCON_SVR_3DRGN_GET(HVBOXCRCON_SERVER hServer, HVBOXCRCON_3DRGN_CLIENT hRgnClient, uint32_t idScreen);
/* 3D Regions Client callbacks */
/* called from the PFNVBOXCRCON_SVR_3DRGN_GET callback in case server has 3D data and is going to process the request asynchronously,
* see comments for PFNVBOXCRCON_SVR_3DRGN_GET above */
typedef DECLCALLBACK(int) FNVBOXCRCON_3DRGN_ONSUBMIT(HVBOXCRCON_3DRGN_CLIENT hRgnClient, uint32_t idScreen, HVBOXCRCON_3DRGN_ASYNCCLIENT *phRgnAsyncClient);
/* called from the "regions get" command processing thread, to indicate that the "regions get" is started.
* see comments for PFNVBOXCRCON_SVR_3DRGN_GET above */
typedef DECLCALLBACK(int) FNVBOXCRCON_3DRGN_BEGIN(HVBOXCRCON_3DRGN_ASYNCCLIENT hRgnAsyncClient, uint32_t idScreen);
/* called from the "regions get" command processing thread, to report a 3D region.
* see comments for PFNVBOXCRCON_SVR_3DRGN_GET above */
typedef DECLCALLBACK(int) FNVBOXCRCON_3DRGN_REPORT(HVBOXCRCON_3DRGN_ASYNCCLIENT hRgnAsyncClient, uint32_t idScreen, void *pvData, uint32_t cbStride, const RTRECT *pRect);
/* called from the "regions get" command processing thread, to indicate that the "regions get" is completed.
* see comments for PFNVBOXCRCON_SVR_3DRGN_GET above */
typedef DECLCALLBACK(int) FNVBOXCRCON_3DRGN_END(HVBOXCRCON_3DRGN_ASYNCCLIENT hRgnAsyncClient, uint32_t idScreen);
/* client callbacks */
/* complete chromium cmd */
typedef DECLCALLBACK(int) FNVBOXCRCON_CLT_CRCTL_COMPLETE(HVBOXCRCON_CLIENT hClient, PVBOXVDMACMD_CHROMIUM_CTL pCtl, int rc);
/* complete chromium control cmd */
typedef DECLCALLBACK(int) FNVBOXCRCON_CLT_CRCMD_COMPLETE(HVBOXCRCON_CLIENT hClient, PVBOXVDMACMD_CHROMIUM_CMD pCmd, int rc);
typedef struct VBOXCRCON_SERVER_CALLBACKS
{
typedef struct VBOXCRCON_CLIENT_CALLBACKS
{
/* issued by Main to establish connection between Main and CrOpenGL service */
typedef struct VBOXVDMACMD_CHROMIUM_CTL_CRCONNECT
{
/*input (filled by Client) :*/
/*output (filled by Server) :*/
/* ring command buffer dr */
/* the "completed" state is signalled via the ring buffer values */
/* CrHgsmi command */
/* blit command that does blitting of allocations identified by VRAM offset or host id
* for VRAM-offset ones the size and format are same as primary */
/* flip */
/* ColorFill */
/* allocation paging transfer request */
/* allocation paging fill request */
/* same as VBOXCMDVBVA_OPTYPE_NOP, but contains VBOXCMDVBVA_HDR data */
/* actual command is stored in guest system memory */
/* complex command - i.e. can contain multiple commands
* i.e. the VBOXCMDVBVA_OPTYPE_COMPLEXCMD VBOXCMDVBVA_HDR is followed
* by one or more VBOXCMDVBVA_HDR commands.
* Each command's size is specified in it's VBOXCMDVBVA_HDR's u32FenceID field */
/* nop - is a one-bit command. The buffer size to skip is determined by VBVA buffer size */
/* u8Flags flags */
/* transfer from RAM to Allocation */
/* blit direction is from first operand to second */
/* operand 1 contains host id */
/* operand 2 contains host id */
/* primary hint id is src */
/* trying to make the header as small as possible,
* we'd have pretty few op codes actually, so 8bit is quite enough,
* we will be able to extend it in any way. */
typedef struct VBOXCMDVBVA_HDR
{
/* one VBOXCMDVBVA_OPTYPE_XXX, except NOP, see comments above */
/* command-specific
* VBOXCMDVBVA_OPTYPE_CRCMD - must be null
* VBOXCMDVBVA_OPTYPE_BLT - OR-ed VBOXCMDVBVA_OPF_ALLOC_XXX flags
* VBOXCMDVBVA_OPTYPE_PAGING_TRANSFER - must be null
* VBOXCMDVBVA_OPTYPE_PAGING_FILL - must be null
* VBOXCMDVBVA_OPTYPE_NOPCMD - must be null
* VBOXCMDVBVA_OPTYPE_NOP - not applicable (as the entire VBOXCMDVBVA_HDR is not valid) */
/* one of VBOXCMDVBVA_STATE_XXX*/
union
{
/* result, 0 on success, otherwise contains the failure code TBD */
} u;
union
{
/* complex command (VBOXCMDVBVA_OPTYPE_COMPLEXCMD) element data */
struct
{
/* command length */
/* guest-specific data, host expects it to be NULL */
} complexCmdEl;
/* DXGK DDI fence ID */
} u2;
typedef struct VBOXCMDVBVA_CRCMD_BUFFER
{
typedef struct VBOXCMDVBVA_CRCMD_CMD
{
typedef struct VBOXCMDVBVA_CRCMD
{
typedef struct VBOXCMDVBVA_ALLOCINFO
{
union
{
} u;
typedef struct VBOXCMDVBVA_ALLOCDESC
{
typedef struct VBOXCMDVBVA_RECT
{
/** Coordinates of affected rectangle. */
typedef struct VBOXCMDVBVA_POINT
{
int16_t x;
int16_t y;
typedef struct VBOXCMDVBVA_BLT_HDR
{
typedef struct VBOXCMDVBVA_BLT_PRIMARY
{
/* the rects count is determined from the command size */
typedef struct VBOXCMDVBVA_BLT_PRIMARY_GENERIC_A8R8G8B8
{
/* the rects count is determined from the command size */
typedef struct VBOXCMDVBVA_BLT_OFFPRIMSZFMT_OR_ID
{
/* the rects count is determined from the command size */
typedef struct VBOXCMDVBVA_BLT_SAMEDIM_A8R8G8B8
{
/* the rects count is determined from the command size */
typedef struct VBOXCMDVBVA_BLT_GENERIC_A8R8G8B8
{
/* the rects count is determined from the command size */
typedef struct VBOXCMDVBVA_FLIP
{
typedef struct VBOXCMDVBVA_CLRFILL_HDR
{
typedef struct VBOXCMDVBVA_CLRFILL_PRIMARY
{
typedef struct VBOXCMDVBVA_CLRFILL_GENERIC_A8R8G8B8
{
#if 0
#define VBOXCMDVBVA_SYSMEMEL_CPAGES_MAX 0x1000
typedef struct VBOXCMDVBVA_SYSMEMEL
{
#endif
typedef struct VBOXCMDVBVA_PAGING_TRANSFER_DATA
{
/* for now can only contain offVRAM.
* paging transfer can NOT be initiated for allocations having host 3D object (hostID) associated */
typedef struct VBOXCMDVBVA_PAGING_TRANSFER
{
typedef struct VBOXCMDVBVA_PAGING_FILL
{
/* paging transfer can NOT be initiated for allocations having host 3D object (hostID) associated */
typedef struct VBOXCMDVBVA_SYSMEMCMD
{
typedef struct VBOXCMDVBVA_CTL
{
typedef struct VBOXCMDVBVA_CTL_ENABLE
{
#define VBOXCMDVBVA_SCREENMAP_SIZE(_elType) ((VBOX_VIDEO_MAX_SCREENS + sizeof (_elType) - 1) / sizeof (_elType))
#define VBOXCMDVBVA_SCREENMAP_DECL(_elType, _name) _elType _name[VBOXCMDVBVA_SCREENMAP_SIZE(_elType)]
typedef struct VBOXCMDVBVA_RESIZE_ENTRY
{
typedef struct VBOXCMDVBVA_RESIZE
{
typedef struct VBOXCMDVBVA_CTL_RESIZE
{
typedef struct VBOXCMDVBVA_3DCTL
{
typedef struct VBOXCMDVBVA_3DCTL_CONNECT
{
typedef struct VBOXCMDVBVA_3DCTL_CMD
{
typedef struct VBOXCMDVBVA_CTL_3DCTL_CMD
{
typedef struct VBOXCMDVBVA_CTL_3DCTL_CONNECT
{
typedef struct VBOXCMDVBVA_CTL_3DCTL
{
#pragma pack()
#ifdef VBOXVDMA_WITH_VBVA
# pragma pack(1)
typedef struct VBOXVDMAVBVACMD
{
#pragma pack()
#endif
#endif