VBoxVideo.h revision dee9595a04fb1bd1908a48bd602fa1ed0b6967f9
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync * VirtualBox Video interface.
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync * Copyright (C) 2006 Oracle Corporation
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync * available from http://www.virtualbox.org. This file is free software;
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync * you can redistribute it and/or modify it under the terms of the GNU
88c504b1c053e580e42d5fc90ef2ccedc50c65bdvboxsync * General Public License (GPL) as published by the Free Software
2369dc897927db3f9d3c044b8f35348680d4b831vboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
28140a038e3e4b8a04d8f246a55fe206b130c204vboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
49ad08ab15f3b96d2d5ba5134a0506dd7b27fdf1vboxsync * The contents of this file may alternatively be used under the terms
49ad08ab15f3b96d2d5ba5134a0506dd7b27fdf1vboxsync * of the Common Development and Distribution License Version 1.0
49ad08ab15f3b96d2d5ba5134a0506dd7b27fdf1vboxsync * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
49ad08ab15f3b96d2d5ba5134a0506dd7b27fdf1vboxsync * VirtualBox OSE distribution, in which case the provisions of the
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync * CDDL are applicable instead of those of the GPL.
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync * You may elect to license modified versions of this file under the
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync * terms and conditions of either the GPL or the CDDL or both.
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync * The last 4096 bytes of the guest VRAM contains the generic info for all
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync * DualView chunks: sizes and offsets of chunks. This is filled by miniport.
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync * Last 4096 bytes of each chunk contain chunk specific data: framebuffer info,
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync * etc. This is used exclusively by the corresponding instance of a display driver.
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync * The VRAM layout:
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync * Last 4096 bytes - Adapter information area.
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync * 4096 bytes aligned miniport heap (value specified in the config rouded up).
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync * Slack - what left after dividing the VRAM.
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync * 4096 bytes aligned framebuffers:
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync * last 4096 bytes of each framebuffer is the display information area.
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync * The Virtual Graphics Adapter information in the guest VRAM is stored by the
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync * guest video driver using structures prepended by VBOXVIDEOINFOHDR.
70f0bd50f20879a58549999c7871cf0ddefc35e0vboxsync * When the guest driver writes dword 0 to the VBE_DISPI_INDEX_VBOX_VIDEO
70f0bd50f20879a58549999c7871cf0ddefc35e0vboxsync * the host starts to process the info. The first element at the start of
70f0bd50f20879a58549999c7871cf0ddefc35e0vboxsync * the 4096 bytes region should be normally be a LINK that points to
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync * actual information chain. That way the guest driver can have some
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync * fixed layout of the information memory block and just rewrite
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync * the link to point to relevant memory chain.
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync * The processing stops at the END element.
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync * The host can access the memory only when the port IO is processed.
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync * All data that will be needed later must be copied from these 4096 bytes.
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync * But other VRAM can be used by host until the mode is disabled.
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync * The guest driver writes dword 0xffffffff to the VBE_DISPI_INDEX_VBOX_VIDEO
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync * to disable the mode.
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync * VBE_DISPI_INDEX_VBOX_VIDEO is used to read the configuration information
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync * from the host and issue commands to the host.
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync * The guest writes the VBE_DISPI_INDEX_VBOX_VIDEO index register, the the
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync * following operations with the VBE data register can be performed:
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync * Operation Result
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync * write 16 bit value NOP
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync * read 16 bit value count of monitors
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync * write 32 bit value sets the vbox command value and the command processed by the host
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync * read 32 bit value result of the last vbox command is returned
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync/* The size of the information. */
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync * The minimum HGSMI heap size is PAGE_SIZE (4096 bytes) and is a restriction of the
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync * runtime heapsimple API. Use minimum 2 pages here, because the info area also may
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync * contain other data (for example HGSMIHOSTFLAGS structure).
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync/* The value for port IO to let the adapter to interpret the adapter memory. */
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync#define VBOX_VIDEO_DISABLE_ADAPTER_MEMORY 0xFFFFFFFF
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync/* The value for port IO to let the adapter to interpret the adapter memory. */
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync#define VBOX_VIDEO_INTERPRET_ADAPTER_MEMORY 0x00000000
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync/* The value for port IO to let the adapter to interpret the display memory.
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync * The display number is encoded in low 16 bits.
70f0bd50f20879a58549999c7871cf0ddefc35e0vboxsync#define VBOX_VIDEO_INTERPRET_DISPLAY_MEMORY_BASE 0x00010000
70f0bd50f20879a58549999c7871cf0ddefc35e0vboxsync/* The end of the information. */
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync/* Instructs the host to fetch the next VBOXVIDEOINFOHDR at the given offset of VRAM. */
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync/* Information about a display memory position. */
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync/* Information about a screen. */
c94dfdedd3c28b8db5d23f1947e56e21bf5711c8vboxsync/* Information about host notifications for the driver. */
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync/* Information about non-volatile guest VRAM heap. */
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync/* VBVA flush. */
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync/* Query configuration value. */
49ad08ab15f3b96d2d5ba5134a0506dd7b27fdf1vboxsync /* Relative offset in VRAM */
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync/* Resides in adapter info memory. Describes a display VRAM chunk. */
49ad08ab15f3b96d2d5ba5134a0506dd7b27fdf1vboxsync /* Index of the framebuffer assigned by guest. */
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync /* Absolute offset in VRAM of the framebuffer to be displayed on the monitor. */
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync /* The size of the memory that can be used for the screen. */
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync /* The size of the memory that is used for the Display information.
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync * The information is at u32Offset + u32FramebufferSize
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync/* Resides in display info area, describes the current video mode. */
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync /* Physical X origin relative to the primary screen. */
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync /* Physical Y origin relative to the primary screen. */
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync /* The scan line size in bytes. */
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync /* Width of the screen. */
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync /* Height of the screen. */
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync /* Color depth. */
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync /* VBOX_VIDEO_INFO_SCREEN_F_* */
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync/* The guest initializes the structure to 0. The positions of the structure in the
49ad08ab15f3b96d2d5ba5134a0506dd7b27fdf1vboxsync * display info area must not be changed, host will update the structure. Guest checks
49ad08ab15f3b96d2d5ba5134a0506dd7b27fdf1vboxsync * the events and modifies the structure as a response to host.
49ad08ab15f3b96d2d5ba5134a0506dd7b27fdf1vboxsync#define VBOX_VIDEO_INFO_HOST_EVENTS_F_NONE 0x00000000
49ad08ab15f3b96d2d5ba5134a0506dd7b27fdf1vboxsync#define VBOX_VIDEO_INFO_HOST_EVENTS_F_VRDP_RESET 0x00000080
49ad08ab15f3b96d2d5ba5134a0506dd7b27fdf1vboxsync /* Host events. */
49ad08ab15f3b96d2d5ba5134a0506dd7b27fdf1vboxsync/* Resides in adapter info memory. Describes the non-volatile VRAM heap. */
49ad08ab15f3b96d2d5ba5134a0506dd7b27fdf1vboxsync /* Absolute offset in VRAM of the start of the heap. */
49ad08ab15f3b96d2d5ba5134a0506dd7b27fdf1vboxsync /* The size of the heap. */
49ad08ab15f3b96d2d5ba5134a0506dd7b27fdf1vboxsync/* Display information area. */
49ad08ab15f3b96d2d5ba5134a0506dd7b27fdf1vboxsync /* Absolute offset in VRAM of the start of the VBVA QUEUE. 0 to disable VBVA. */
49ad08ab15f3b96d2d5ba5134a0506dd7b27fdf1vboxsync /* The size of the VBVA QUEUE. 0 to disable VBVA. */
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsynctypedef enum
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync/* the command processing was asynch, set by the host to indicate asynch command completion
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync * must not be cleared once set, the command completion is performed by issuing a host->guest completion command
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync * while keeping this flag unchanged */
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync/* asynch completion is performed by issuing the event */
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync/* issue interrupt on asynch completion */
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync/* 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
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync * by setting the VBOXVHWACMD_FLAG_HG_ASYNCH_RETURNED flag */
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync#define VBOXVHWACMD_FLAG_GH_ASYNCH_NOCOMPLETION 0x00000004
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync/* the host has copied the VBOXVHWACMD_FLAG_GH_ASYNCH_NOCOMPLETION command and returned it to the guest */
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync#define VBOXVHWACMD_FLAG_HG_ASYNCH_RETURNED 0x00020000
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync/* this is the host->host cmd, i.e. a configuration command posted by the host to the framebuffer */
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsynctypedef struct VBOXVHWACMD
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync volatile int32_t Flags; /* ored VBOXVHWACMD_FLAG_xxx values */
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync uint64_t GuestVBVAReserved1; /* field internally used by the guest VBVA cmd handling, must NOT be modified by clients */
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync uint64_t GuestVBVAReserved2; /* field internally used by the guest VBVA cmd handling, must NOT be modified by clients */
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync#define VBOXVHWACMD_HEADSIZE() (RT_OFFSETOF(VBOXVHWACMD, body))
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync#define VBOXVHWACMD_SIZE_FROMBODYSIZE(_s) (VBOXVHWACMD_HEADSIZE() + (_s))
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync#define VBOXVHWACMD_SIZE(_tCmd) (VBOXVHWACMD_SIZE_FROMBODYSIZE(sizeof(_tCmd)))
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsynctypedef unsigned int VBOXVHWACMD_LENGTH;
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync#define VBOXVHWACMD_HEAD(_pb) ((VBOXVHWACMD*)((uint8_t *)(_pb) - RT_OFFSETOF(VBOXVHWACMD, body)))
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync/*#define VBOXVHWA_SD_REFRESHRATE 0x00040000*/
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync#define VBOXVHWA_CKEYCAPS_DESTBLTCLRSPACE 0x00000002
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync#define VBOXVHWA_CKEYCAPS_DESTBLTCLRSPACEYUV 0x00000004
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync#define VBOXVHWA_CKEYCAPS_DESTOVERLAYCLRSPACE 0x00000020
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync#define VBOXVHWA_CKEYCAPS_DESTOVERLAYCLRSPACEYUV 0x00000040
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync#define VBOXVHWA_CKEYCAPS_DESTOVERLAYONEACTIVE 0x00000080
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync#define VBOXVHWA_CKEYCAPS_SRCBLTCLRSPACEYUV 0x00000800
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync#define VBOXVHWA_CKEYCAPS_SRCOVERLAYCLRSPACE 0x00004000
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync#define VBOXVHWA_CKEYCAPS_SRCOVERLAYCLRSPACEYUV 0x00008000
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync#define VBOXVHWA_CKEYCAPS_SRCOVERLAYONEACTIVE 0x00010000
49ad08ab15f3b96d2d5ba5134a0506dd7b27fdf1vboxsync#define VBOXVHWA_BLT_EXTENDED_LINEAR_CONTENT 0x00000004
49ad08ab15f3b96d2d5ba5134a0506dd7b27fdf1vboxsync#define VBOXVHWA_BLT_EXTENDED_PRESENTATION_STRETCHFACTOR 0x00000010
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync/*#define VBOXVHWA_CAPS2_FLIPINTERVAL 0x00200000*/
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync/*#define VBOXVHWA_CAPS2_FLIPNOVSYNC 0x00400000*/
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync#define VBOXVHWAINFO2_SIZE(_cFourCC) RT_OFFSETOF(VBOXVHWACMD_QUERYINFO2, FourCC[_cFourCC])
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync#define VBOXVHWACMD_SURF_OVERLAY_UPDATE_F_SRCMEMRECT 0x00000001
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync#define VBOXVHWACMD_SURF_OVERLAY_UPDATE_F_DSTMEMRECT 0x00000002
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync /* VRAM info for the backend to be able to properly translate VRAM offsets */
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsynctypedef DECLCALLBACK(void) FNVBOXVHWA_HH_CALLBACK(void*);
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsynctypedef FNVBOXVHWA_HH_CALLBACK *PFNVBOXVHWA_HH_CALLBACK;
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync#define VBOXVHWA_HH_CALLBACK_SET(_pCmd, _pfn, _parg) \
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync (_pCmd)->GuestVBVAReserved1 = (uint64_t)(uintptr_t)(_pfn); \
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync (_pCmd)->GuestVBVAReserved2 = (uint64_t)(uintptr_t)(_parg); \
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync#define VBOXVHWA_HH_CALLBACK_GET(_pCmd) ((PFNVBOXVHWA_HH_CALLBACK)(_pCmd)->GuestVBVAReserved1)
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync#define VBOXVHWA_HH_CALLBACK_GET_ARG(_pCmd) ((void*)(_pCmd)->GuestVBVAReserved2)
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync#endif /* #ifdef VBOX_WITH_VIDEOHWACCEL */
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync/* All structures are without alignment. */
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsynctypedef struct VBVABUFFER
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync /* The offset where the data start in the buffer. */
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync /* The offset where next data must be placed in the buffer. */
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync /* The queue of record descriptions. */
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync /* Space to leave free in the buffer when large partial records are transferred. */
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync uint8_t au8Data[1]; /* variable size for the rest of the VBVABUFFER area in VRAM. */
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync/* guest->host commands */
49ad08ab15f3b96d2d5ba5134a0506dd7b27fdf1vboxsync#endif /* # ifdef VBOX_WITH_VIDEOHWACCEL */
49ad08ab15f3b96d2d5ba5134a0506dd7b27fdf1vboxsync# define VBVA_VDMA_CTL 10 /* setup G<->H DMA channel info */
49ad08ab15f3b96d2d5ba5134a0506dd7b27fdf1vboxsync#define VBVA_INFO_CAPS 12 /* informs host about HGSMI caps. see _VBVACAPS below */
49ad08ab15f3b96d2d5ba5134a0506dd7b27fdf1vboxsync/* host->guest commands */
49ad08ab15f3b96d2d5ba5134a0506dd7b27fdf1vboxsync#endif /* # ifdef VBOX_WITH_VIDEOHWACCEL */
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsynctypedef enum
49ad08ab15f3b96d2d5ba5134a0506dd7b27fdf1vboxsynctypedef struct VBVAHOSTCMD
49ad08ab15f3b96d2d5ba5134a0506dd7b27fdf1vboxsync /* destination ID if >=0 specifies display index, otherwize the command is directed to the miniport */
49ad08ab15f3b96d2d5ba5134a0506dd7b27fdf1vboxsync#define VBVAHOSTCMD_SIZE(_size) (sizeof(VBVAHOSTCMD) + (_size))
49ad08ab15f3b96d2d5ba5134a0506dd7b27fdf1vboxsync#define VBVAHOSTCMD_BODY(_pCmd, _tBody) ((_tBody*)(_pCmd)->body)
49ad08ab15f3b96d2d5ba5134a0506dd7b27fdf1vboxsync#define VBVAHOSTCMD_HDR(_pBody) ((VBVAHOSTCMD*)(((uint8_t*)_pBody) - RT_OFFSETOF(VBVAHOSTCMD, body)))
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync#define VBVAHOSTCMD_HDRSIZE (RT_OFFSETOF(VBVAHOSTCMD, body))
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync/* VBVACONF32::u32Index */
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsynctypedef struct VBVACONF32
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsynctypedef struct VBVAINFOVIEW
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync /* Index of the screen, assigned by the guest. */
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync /* The screen offset in VRAM, the framebuffer starts here. */
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync /* The size of the VRAM memory that can be used for the view. */
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync /* The recommended maximum size of the VRAM memory for the screen. */
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsynctypedef struct VBVAINFOHEAP
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync /* Absolute offset in VRAM of the start of the heap. */
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync /* The size of the heap. */
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsynctypedef struct VBVAFLUSH
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync/* VBVAINFOSCREEN::u8Flags */
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync/** The virtual monitor has been disabled by the guest and should be blacked
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync * out by the host and ignored for purposes of pointer position calculation. */
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync /* Which view contains the screen. */
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync /* Physical X origin relative to the primary screen. */
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync /* Physical Y origin relative to the primary screen. */
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync /* Offset of visible framebuffer relative to the framebuffer start. */
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync /* The scan line size in bytes. */
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync /* Width of the screen. */
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync /* Height of the screen. */
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync /* Color depth. */
49ad08ab15f3b96d2d5ba5134a0506dd7b27fdf1vboxsync /* VBVA_SCREEN_F_* */
49ad08ab15f3b96d2d5ba5134a0506dd7b27fdf1vboxsync/* VBVAENABLE::u32Flags */
49ad08ab15f3b96d2d5ba5134a0506dd7b27fdf1vboxsync/* extended VBVA to be used with WDDM */
49ad08ab15f3b96d2d5ba5134a0506dd7b27fdf1vboxsync/* vbva offset is absolute VRAM offset */
49ad08ab15f3b96d2d5ba5134a0506dd7b27fdf1vboxsynctypedef struct VBVAENABLE
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync /* The host result. */
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync /* VBOX_MOUSE_POINTER_* bit flags. */
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync /* X coordinate of the hot spot. */
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync /* Y coordinate of the hot spot. */
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync /* Width of the pointer in pixels. */
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync /* Height of the pointer in scanlines. */
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync /* Pointer data.
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync * The data consists of 1 bpp AND mask followed by 32 bpp XOR (color) mask.
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync * For pointers without alpha channel the XOR mask pixels are 32 bit values: (lsb)BGR0(msb).
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync * For pointers with alpha channel the XOR mask consists of (lsb)BGRA(msb) 32 bit values.
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync * Guest driver must create the AND mask for pointers with alpha channel, so if host does not
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync * support alpha, the pointer could be displayed as a normal color pointer. The AND mask can
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync * be constructed from alpha values. For example alpha value >= 0xf0 means bit 0 in the AND mask.
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync * The AND mask is 1 bpp bitmap with byte aligned scanlines. Size of AND mask,
49ad08ab15f3b96d2d5ba5134a0506dd7b27fdf1vboxsync * therefore, is cbAnd = (width + 7) / 8 * height. The padding bits at the
49ad08ab15f3b96d2d5ba5134a0506dd7b27fdf1vboxsync * end of any scanline are undefined.
49ad08ab15f3b96d2d5ba5134a0506dd7b27fdf1vboxsync * The XOR mask follows the AND mask on the next 4 bytes aligned offset:
49ad08ab15f3b96d2d5ba5134a0506dd7b27fdf1vboxsync * uint8_t *pXor = pAnd + (cbAnd + 3) & ~3
49ad08ab15f3b96d2d5ba5134a0506dd7b27fdf1vboxsync * Bytes in the gap between the AND and the XOR mask are undefined.
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync * XOR mask scanlines have no gap between them and size of XOR mask is:
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync * cXor = width * 4 * height.
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync * Preallocate 4 bytes for accessing actual data as p->au8Data.
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync/* the guest driver can handle asynch guest cmd completion by reading the command offset from io port */
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync/* the guest driver can handle video adapter IRQs */
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsynctypedef struct VBVACAPS
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync * VBOXSHGSMI made on top HGSMI and allows receiving notifications
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync * about G->H command completion
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync/* SHGSMI command header */
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync uint64_t pvNext; /*<- completion processing queue */
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync uint32_t fFlags; /*<- see VBOXSHGSMI_FLAG_XXX Flags */
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync uint64_t u64Info1; /*<- contents depends on the fFlags value */
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync uint64_t u64Info2; /*<- contents depends on the fFlags value */
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsynctypedef enum
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync VBOXVDMACMD_TYPE_CHILD_STATUS_IRQ /* make the device notify child (monitor) state change IRQ */
49ad08ab15f3b96d2d5ba5134a0506dd7b27fdf1vboxsync/* the command processing was asynch, set by the host to indicate asynch command completion
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync * must not be cleared once set, the command completion is performed by issuing a host->guest completion command
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync * while keeping this flag unchanged */
49ad08ab15f3b96d2d5ba5134a0506dd7b27fdf1vboxsync/* if set - asynch completion is performed by issuing the event,
49ad08ab15f3b96d2d5ba5134a0506dd7b27fdf1vboxsync * if cleared - asynch completion is performed by calling a callback */
49ad08ab15f3b96d2d5ba5134a0506dd7b27fdf1vboxsync/* issue interrupt on asynch completion, used for critical G->H commands,
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync * i.e. for completion of which guest is waiting. */
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync/* guest does not do any op on completion of this command,
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync * the host may copy the command and indicate that it does not need the command anymore
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync * by not setting VBOXSHGSMI_FLAG_HG_ASYNCH */
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync#define VBOXSHGSMI_FLAG_GH_ASYNCH_NOCOMPLETION 0x00000004
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync/* guest requires the command to be processed asynchronously,
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync * not setting VBOXSHGSMI_FLAG_HG_ASYNCH by the host in this case is treated as command failure */
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync/* force IRQ on cmd completion */
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync#define VBOXSHGSMI_FLAG_GH_ASYNCH_IRQ_FORCE 0x00000010
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync/* an IRQ-level callback is associated with the command */
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync#define VBOXSHGSMI_FLAG_GH_ASYNCH_CALLBACK_IRQ 0x00000020
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync/* guest expects this command to be completed synchronously */
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsyncDECLINLINE(uint8_t *) VBoxSHGSMIBufferData (const VBOXSHGSMIHEADER* pHeader)
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync return (uint8_t *)pHeader + sizeof (VBOXSHGSMIHEADER);
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync#define VBoxSHGSMIBufferHeaderSize() (sizeof (VBOXSHGSMIHEADER))
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsyncDECLINLINE(PVBOXSHGSMIHEADER) VBoxSHGSMIBufferHeader (const void *pvData)
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync return (PVBOXSHGSMIHEADER)((uint8_t *)pvData - sizeof (VBOXSHGSMIHEADER));
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync/* VDMA - Video DMA */
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync/* VDMA Control API */
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync/* VBOXVDMA_CTL::u32Flags */
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsynctypedef enum
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsynctypedef struct VBOXVDMA_CTL
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsynctypedef enum
49ad08ab15f3b96d2d5ba5134a0506dd7b27fdf1vboxsync/*typedef uint64_t VBOXVDMAPHADDRESS;*/
49ad08ab15f3b96d2d5ba5134a0506dd7b27fdf1vboxsync/* region specified as a rectangle, otherwize it is a size of memory pointed to by phys address */
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync/* Surface handle is valid */
49ad08ab15f3b96d2d5ba5134a0506dd7b27fdf1vboxsync/* address is offset in VRAM */
49ad08ab15f3b96d2d5ba5134a0506dd7b27fdf1vboxsync/* VBOXVDMACBUF_DR::phBuf specifies offset in VRAM */
49ad08ab15f3b96d2d5ba5134a0506dd7b27fdf1vboxsync#define VBOXVDMACBUF_FLAG_BUF_VRAM_OFFSET 0x00000001
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync/* command buffer follows the VBOXVDMACBUF_DR in VRAM, VBOXVDMACBUF_DR::phBuf is ignored */
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync * We can not submit the DMA command via VRAM since we do not have control over
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync * DMA command buffer [de]allocation, i.e. we only control the buffer contents.
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync * In other words the system may call one of our callbacks to fill a command buffer
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync * with the necessary commands and then discard the buffer w/o any notification.
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync * We have only DMA command buffer physical address at submission time.
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync * so the only way is to */
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync /* RT_SUCCESS() - on success
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync * VERR_INTERRUPTED - on preemption
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync * VERR_xxx - on error */
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync#define VBOXVDMACBUF_DR_TAIL(_pCmd, _t) ( (_t*)(((uint8_t*)(_pCmd)) + sizeof (VBOXVDMACBUF_DR)) )
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync#define VBOXVDMACBUF_DR_FROM_TAIL(_pCmd) ( (VBOXVDMACBUF_DR*)(((uint8_t*)(_pCmd)) - sizeof (VBOXVDMACBUF_DR)) )
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsynctypedef struct VBOXVDMACMD
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync#define VBOXVDMACMD_HEADER_SIZE() sizeof (VBOXVDMACMD)
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync#define VBOXVDMACMD_SIZE_FROMBODYSIZE(_s) (VBOXVDMACMD_HEADER_SIZE() + (_s))
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync#define VBOXVDMACMD_SIZE(_t) (VBOXVDMACMD_SIZE_FROMBODYSIZE(sizeof (_t)))
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync#define VBOXVDMACMD_BODY(_pCmd, _t) ( (_t*)(((uint8_t*)(_pCmd)) + VBOXVDMACMD_HEADER_SIZE()) )
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync#define VBOXVDMACMD_BODY_SIZE(_s) ( (_s) - VBOXVDMACMD_HEADER_SIZE() )
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync#define VBOXVDMACMD_FROM_BODY(_pCmd) ( (VBOXVDMACMD*)(((uint8_t*)(_pCmd)) - VBOXVDMACMD_HEADER_SIZE()) )
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync#define VBOXVDMACMD_BODY_FIELD_OFFSET(_ot, _t, _f) ( (_ot)(uintptr_t)( VBOXVDMACMD_BODY(0, uint8_t) + RT_OFFSETOF(_t, _f) ) )
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync} VBOXVDMACMD_DMA_PRESENT_BLT, *PVBOXVDMACMD_DMA_PRESENT_BLT;
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsynctypedef struct VBOXVDMACMD_DMA_PRESENT_SHADOW2PRIMARY
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync} VBOXVDMACMD_DMA_PRESENT_SHADOW2PRIMARY, *PVBOXVDMACMD_DMA_PRESENT_SHADOW2PRIMARY;
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync#define VBOXVDMACMD_DMA_BPB_TRANSFER_F_SRC_VRAMOFFSET 0x00000001
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync#define VBOXVDMACMD_DMA_BPB_TRANSFER_F_DST_VRAMOFFSET 0x00000002
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync} VBOXVDMACMD_DMA_BPB_TRANSFER, *PVBOXVDMACMD_DMA_BPB_TRANSFER;
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync#define VBOXVDMACMD_SYSMEMEL_NEXT(_pEl) (((_pEl)->fFlags & VBOXVDMACMD_SYSMEMEL_F_PAGELIST) ? \
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync ((PVBOXVDMACMD_SYSMEMEL)(((uint8_t*)(_pEl))+RT_OFFSETOF(VBOXVDMACMD_SYSMEMEL, phBuf[(_pEl)->cPages]))) \
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync#define VBOXVDMACMD_DMA_BPB_TRANSFER_VRAMSYS_SYS2VRAM 0x00000001
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync} VBOXVDMACMD_DMA_BPB_TRANSFER_VRAMSYS, *PVBOXVDMACMD_DMA_BPB_TRANSFER_VRAMSYS;
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync} VBOXVDMACMD_DMA_BPB_FILL, *PVBOXVDMACMD_DMA_BPB_FILL;
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync/* apply the aInfos are applied to all targets, the iTarget is ignored */
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync#define VBOXVDMACMD_CHILD_STATUS_IRQ_F_APPLY_TO_ALL 0x00000001
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync} VBOXVDMACMD_CHILD_STATUS_IRQ, *PVBOXVDMACMD_CHILD_STATUS_IRQ;
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync#endif /* #ifdef VBOX_WITH_VDMA */
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync} VBOXVDMACMD_CHROMIUM_BUFFER, *PVBOXVDMACMD_CHROMIUM_BUFFER;
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync} VBOXVDMACMD_CHROMIUM_CMD, *PVBOXVDMACMD_CHROMIUM_CMD;
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsynctypedef enum
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync VBOXVDMACMD_CHROMIUM_CTL_TYPE_CRHGSMI_SETUP_COMPLETION,
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync VBOXVDMACMD_CHROMIUM_CTL_TYPE_SIZEHACK = 0xfffffffe
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync} VBOXVDMACMD_CHROMIUM_CTL, *PVBOXVDMACMD_CHROMIUM_CTL;
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsynctypedef struct VBOXVDMACMD_CHROMIUM_CTL_CRHGSMI_SETUP
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync} VBOXVDMACMD_CHROMIUM_CTL_CRHGSMI_SETUP, *PVBOXVDMACMD_CHROMIUM_CTL_CRHGSMI_SETUP;
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsynctypedef struct PDMIDISPLAYVBVACALLBACKS *HCRHGSMICMDCOMPLETION;
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsynctypedef DECLCALLBACK(int) FNCRHGSMICMDCOMPLETION(HCRHGSMICMDCOMPLETION hCompletion, PVBOXVDMACMD_CHROMIUM_CMD pCmd, int rc);
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsynctypedef FNCRHGSMICMDCOMPLETION *PFNCRHGSMICMDCOMPLETION;
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsynctypedef struct VBOXVDMACMD_CHROMIUM_CTL_CRHGSMI_SETUP_COMPLETION