VBoxVideoHost3D.h revision f102b1e193666a8b1009b39a65eb9d84f9c0e793
81f46059436c6145937a4cc2c7424023a289fcd8vboxsync/** @file
81f46059436c6145937a4cc2c7424023a289fcd8vboxsync *
81f46059436c6145937a4cc2c7424023a289fcd8vboxsync * VirtualBox 3D host inter-components interfaces
81f46059436c6145937a4cc2c7424023a289fcd8vboxsync */
81f46059436c6145937a4cc2c7424023a289fcd8vboxsync
81f46059436c6145937a4cc2c7424023a289fcd8vboxsync/*
81f46059436c6145937a4cc2c7424023a289fcd8vboxsync * Copyright (C) 2011-2012 Oracle Corporation
81f46059436c6145937a4cc2c7424023a289fcd8vboxsync *
81f46059436c6145937a4cc2c7424023a289fcd8vboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
81f46059436c6145937a4cc2c7424023a289fcd8vboxsync * available from http://www.virtualbox.org. This file is free software;
81f46059436c6145937a4cc2c7424023a289fcd8vboxsync * you can redistribute it and/or modify it under the terms of the GNU
81f46059436c6145937a4cc2c7424023a289fcd8vboxsync * General Public License (GPL) as published by the Free Software
81f46059436c6145937a4cc2c7424023a289fcd8vboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
81f46059436c6145937a4cc2c7424023a289fcd8vboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
81f46059436c6145937a4cc2c7424023a289fcd8vboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
81f46059436c6145937a4cc2c7424023a289fcd8vboxsync *
81f46059436c6145937a4cc2c7424023a289fcd8vboxsync * The contents of this file may alternatively be used under the terms
81f46059436c6145937a4cc2c7424023a289fcd8vboxsync * of the Common Development and Distribution License Version 1.0
81f46059436c6145937a4cc2c7424023a289fcd8vboxsync * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
81f46059436c6145937a4cc2c7424023a289fcd8vboxsync * VirtualBox OSE distribution, in which case the provisions of the
81f46059436c6145937a4cc2c7424023a289fcd8vboxsync * CDDL are applicable instead of those of the GPL.
81f46059436c6145937a4cc2c7424023a289fcd8vboxsync *
81f46059436c6145937a4cc2c7424023a289fcd8vboxsync * You may elect to license modified versions of this file under the
81f46059436c6145937a4cc2c7424023a289fcd8vboxsync * terms and conditions of either the GPL or the CDDL or both.
81f46059436c6145937a4cc2c7424023a289fcd8vboxsync */
81f46059436c6145937a4cc2c7424023a289fcd8vboxsync#ifndef ___VBox_VBoxVideoHost3D_h
81f46059436c6145937a4cc2c7424023a289fcd8vboxsync#define ___VBox_VBoxVideoHost3D_h
81f46059436c6145937a4cc2c7424023a289fcd8vboxsync#include <iprt/cdefs.h>
81f46059436c6145937a4cc2c7424023a289fcd8vboxsync#include <VBox/VBoxVideo.h>
81f46059436c6145937a4cc2c7424023a289fcd8vboxsync#include <VBox/hgcmsvc.h>
81f46059436c6145937a4cc2c7424023a289fcd8vboxsync#include <VBox/vmm/pdmifs.h>
81f46059436c6145937a4cc2c7424023a289fcd8vboxsync
81f46059436c6145937a4cc2c7424023a289fcd8vboxsync/* screen update instance */
81f46059436c6145937a4cc2c7424023a289fcd8vboxsynctypedef struct PDMIDISPLAYCONNECTOR *HVBOXCRCMDCLTSCR;
81f46059436c6145937a4cc2c7424023a289fcd8vboxsyncstruct VBVACMDHDR;
81f46059436c6145937a4cc2c7424023a289fcd8vboxsync
81f46059436c6145937a4cc2c7424023a289fcd8vboxsynctypedef struct VBOXCMDVBVA_HDR *PVBOXCMDVBVA_HDR;
81f46059436c6145937a4cc2c7424023a289fcd8vboxsync
81f46059436c6145937a4cc2c7424023a289fcd8vboxsynctypedef DECLCALLBACKPTR(void, PFNVBOXCRCMD_CLTSCR_UPDATE_BEGIN)(HVBOXCRCMDCLTSCR hClt, unsigned u32Screen);
81f46059436c6145937a4cc2c7424023a289fcd8vboxsynctypedef DECLCALLBACKPTR(void, PFNVBOXCRCMD_CLTSCR_UPDATE_END)(HVBOXCRCMDCLTSCR hClt, unsigned uScreenId, int32_t x, int32_t y, uint32_t cx, uint32_t cy);
81f46059436c6145937a4cc2c7424023a289fcd8vboxsynctypedef DECLCALLBACKPTR(void, PFNVBOXCRCMD_CLTSCR_UPDATE_PROCESS)(HVBOXCRCMDCLTSCR hClt, unsigned u32Screen, struct VBVACMDHDR *pCmd, size_t cbCmd);
81f46059436c6145937a4cc2c7424023a289fcd8vboxsync
81f46059436c6145937a4cc2c7424023a289fcd8vboxsync/*client callbacks to be used by the server
81f46059436c6145937a4cc2c7424023a289fcd8vboxsync * when working in the CrCmd mode */
81f46059436c6145937a4cc2c7424023a289fcd8vboxsynctypedef struct VBOXCRCMD_SVRENABLE_INFO
81f46059436c6145937a4cc2c7424023a289fcd8vboxsync{
81f46059436c6145937a4cc2c7424023a289fcd8vboxsync HVBOXCRCMDCLTSCR hCltScr;
81f46059436c6145937a4cc2c7424023a289fcd8vboxsync PFNVBOXCRCMD_CLTSCR_UPDATE_BEGIN pfnCltScrUpdateBegin;
81f46059436c6145937a4cc2c7424023a289fcd8vboxsync PFNVBOXCRCMD_CLTSCR_UPDATE_PROCESS pfnCltScrUpdateProcess;
81f46059436c6145937a4cc2c7424023a289fcd8vboxsync PFNVBOXCRCMD_CLTSCR_UPDATE_END pfnCltScrUpdateEnd;
81f46059436c6145937a4cc2c7424023a289fcd8vboxsync} VBOXCRCMD_SVRENABLE_INFO;
81f46059436c6145937a4cc2c7424023a289fcd8vboxsync
81f46059436c6145937a4cc2c7424023a289fcd8vboxsynctypedef void * HVBOXCRCMDSVR;
81f46059436c6145937a4cc2c7424023a289fcd8vboxsync
81f46059436c6145937a4cc2c7424023a289fcd8vboxsync/* enables the CrCmd interface, thus the hgcm interface gets disabled.
81f46059436c6145937a4cc2c7424023a289fcd8vboxsync * all subsequent calls will be done in the thread Enable was done,
81f46059436c6145937a4cc2c7424023a289fcd8vboxsync * until the Disable is called */
81f46059436c6145937a4cc2c7424023a289fcd8vboxsynctypedef DECLCALLBACKPTR(int, PFNVBOXCRCMD_SVR_ENABLE)(HVBOXCRCMDSVR hSvr, VBOXCRCMD_SVRENABLE_INFO *pInfo);
81f46059436c6145937a4cc2c7424023a289fcd8vboxsync/* Opposite to Enable (see above) */
81f46059436c6145937a4cc2c7424023a289fcd8vboxsynctypedef DECLCALLBACKPTR(int, PFNVBOXCRCMD_SVR_DISABLE)(HVBOXCRCMDSVR hSvr);
81f46059436c6145937a4cc2c7424023a289fcd8vboxsync/* process command */
81f46059436c6145937a4cc2c7424023a289fcd8vboxsynctypedef DECLCALLBACKPTR(int8_t, PFNVBOXCRCMD_SVR_CMD)(HVBOXCRCMDSVR hSvr, const VBOXCMDVBVA_HDR *pCmd, uint32_t cbCmd);
81f46059436c6145937a4cc2c7424023a289fcd8vboxsync/* process host control */
81f46059436c6145937a4cc2c7424023a289fcd8vboxsynctypedef DECLCALLBACKPTR(int, PFNVBOXCRCMD_SVR_HOSTCTL)(HVBOXCRCMDSVR hSvr, uint8_t* pCtl, uint32_t cbCmd);
81f46059436c6145937a4cc2c7424023a289fcd8vboxsync/* process guest control */
81f46059436c6145937a4cc2c7424023a289fcd8vboxsynctypedef DECLCALLBACKPTR(int, PFNVBOXCRCMD_SVR_GUESTCTL)(HVBOXCRCMDSVR hSvr, uint8_t* pCtl, uint32_t cbCmd);
81f46059436c6145937a4cc2c7424023a289fcd8vboxsync/* screen resize */
81f46059436c6145937a4cc2c7424023a289fcd8vboxsynctypedef DECLCALLBACKPTR(int, PFNVBOXCRCMD_SVR_RESIZE)(HVBOXCRCMDSVR hSvr, const struct VBVAINFOSCREEN *pScreen, void *pvVRAM);
81f46059436c6145937a4cc2c7424023a289fcd8vboxsync/* process SaveState */
81f46059436c6145937a4cc2c7424023a289fcd8vboxsynctypedef DECLCALLBACKPTR(int, PFNVBOXCRCMD_SVR_SAVESTATE)(HVBOXCRCMDSVR hSvr, PSSMHANDLE pSSM);
81f46059436c6145937a4cc2c7424023a289fcd8vboxsync/* process LoadState */
81f46059436c6145937a4cc2c7424023a289fcd8vboxsynctypedef DECLCALLBACKPTR(int, PFNVBOXCRCMD_SVR_LOADSTATE)(HVBOXCRCMDSVR hSvr, PSSMHANDLE pSSM, uint32_t u32Version);
81f46059436c6145937a4cc2c7424023a289fcd8vboxsync
81f46059436c6145937a4cc2c7424023a289fcd8vboxsync
81f46059436c6145937a4cc2c7424023a289fcd8vboxsynctypedef struct VBOXCRCMD_SVRINFO
81f46059436c6145937a4cc2c7424023a289fcd8vboxsync{
81f46059436c6145937a4cc2c7424023a289fcd8vboxsync HVBOXCRCMDSVR hSvr;
81f46059436c6145937a4cc2c7424023a289fcd8vboxsync PFNVBOXCRCMD_SVR_ENABLE pfnEnable;
81f46059436c6145937a4cc2c7424023a289fcd8vboxsync PFNVBOXCRCMD_SVR_DISABLE pfnDisable;
81f46059436c6145937a4cc2c7424023a289fcd8vboxsync PFNVBOXCRCMD_SVR_CMD pfnCmd;
81f46059436c6145937a4cc2c7424023a289fcd8vboxsync PFNVBOXCRCMD_SVR_HOSTCTL pfnHostCtl;
81f46059436c6145937a4cc2c7424023a289fcd8vboxsync PFNVBOXCRCMD_SVR_GUESTCTL pfnGuestCtl;
81f46059436c6145937a4cc2c7424023a289fcd8vboxsync PFNVBOXCRCMD_SVR_RESIZE pfnResize;
81f46059436c6145937a4cc2c7424023a289fcd8vboxsync PFNVBOXCRCMD_SVR_SAVESTATE pfnSaveState;
81f46059436c6145937a4cc2c7424023a289fcd8vboxsync PFNVBOXCRCMD_SVR_LOADSTATE pfnLoadState;
81f46059436c6145937a4cc2c7424023a289fcd8vboxsync} VBOXCRCMD_SVRINFO;
81f46059436c6145937a4cc2c7424023a289fcd8vboxsync
81f46059436c6145937a4cc2c7424023a289fcd8vboxsync
81f46059436c6145937a4cc2c7424023a289fcd8vboxsynctypedef struct VBOXVDMACMD_CHROMIUM_CTL_CRHGSMI_SETUP
81f46059436c6145937a4cc2c7424023a289fcd8vboxsync{
81f46059436c6145937a4cc2c7424023a289fcd8vboxsync VBOXVDMACMD_CHROMIUM_CTL Hdr;
81f46059436c6145937a4cc2c7424023a289fcd8vboxsync union
81f46059436c6145937a4cc2c7424023a289fcd8vboxsync {
81f46059436c6145937a4cc2c7424023a289fcd8vboxsync void *pvVRamBase;
81f46059436c6145937a4cc2c7424023a289fcd8vboxsync uint64_t uAlignment;
81f46059436c6145937a4cc2c7424023a289fcd8vboxsync };
81f46059436c6145937a4cc2c7424023a289fcd8vboxsync uint64_t cbVRam;
81f46059436c6145937a4cc2c7424023a289fcd8vboxsync PPDMLED pLed;
81f46059436c6145937a4cc2c7424023a289fcd8vboxsync /* out */
81f46059436c6145937a4cc2c7424023a289fcd8vboxsync struct VBOXCRCMD_SVRINFO CrCmdServerInfo;
81f46059436c6145937a4cc2c7424023a289fcd8vboxsync} VBOXVDMACMD_CHROMIUM_CTL_CRHGSMI_SETUP, *PVBOXVDMACMD_CHROMIUM_CTL_CRHGSMI_SETUP;
81f46059436c6145937a4cc2c7424023a289fcd8vboxsync
81f46059436c6145937a4cc2c7424023a289fcd8vboxsynctypedef enum
81f46059436c6145937a4cc2c7424023a289fcd8vboxsync{
81f46059436c6145937a4cc2c7424023a289fcd8vboxsync VBOXCRCMDCTL_TYPE_HGCM = 1,
81f46059436c6145937a4cc2c7424023a289fcd8vboxsync VBOXCRCMDCTL_TYPE_DISABLE,
81f46059436c6145937a4cc2c7424023a289fcd8vboxsync VBOXCRCMDCTL_TYPE_ENABLE,
81f46059436c6145937a4cc2c7424023a289fcd8vboxsync VBOXCRCMDCTL_TYPE_32bit = 0x7fffffff
81f46059436c6145937a4cc2c7424023a289fcd8vboxsync} VBOXCRCMDCTL_TYPE;
81f46059436c6145937a4cc2c7424023a289fcd8vboxsync
81f46059436c6145937a4cc2c7424023a289fcd8vboxsynctypedef struct VBOXCRCMDCTL
81f46059436c6145937a4cc2c7424023a289fcd8vboxsync{
81f46059436c6145937a4cc2c7424023a289fcd8vboxsync VBOXCRCMDCTL_TYPE enmType;
81f46059436c6145937a4cc2c7424023a289fcd8vboxsync uint32_t u32Function;
81f46059436c6145937a4cc2c7424023a289fcd8vboxsync /* not to be used by clients */
81f46059436c6145937a4cc2c7424023a289fcd8vboxsync union
81f46059436c6145937a4cc2c7424023a289fcd8vboxsync {
81f46059436c6145937a4cc2c7424023a289fcd8vboxsync void(*pfnInternal)();
81f46059436c6145937a4cc2c7424023a289fcd8vboxsync void* pvInternal;
81f46059436c6145937a4cc2c7424023a289fcd8vboxsync } u;
81f46059436c6145937a4cc2c7424023a289fcd8vboxsync} VBOXCRCMDCTL;
81f46059436c6145937a4cc2c7424023a289fcd8vboxsync
81f46059436c6145937a4cc2c7424023a289fcd8vboxsynctypedef struct VBOXCRCMDCTL_HGCM
81f46059436c6145937a4cc2c7424023a289fcd8vboxsync{
81f46059436c6145937a4cc2c7424023a289fcd8vboxsync VBOXCRCMDCTL Hdr;
81f46059436c6145937a4cc2c7424023a289fcd8vboxsync VBOXHGCMSVCPARM aParms[1];
81f46059436c6145937a4cc2c7424023a289fcd8vboxsync} VBOXCRCMDCTL_HGCM;
81f46059436c6145937a4cc2c7424023a289fcd8vboxsync
81f46059436c6145937a4cc2c7424023a289fcd8vboxsynctypedef struct VBOXVDMAHOST * HVBOXCRCMDCTL_REMAINING_HOST_COMMAND;
81f46059436c6145937a4cc2c7424023a289fcd8vboxsync
81f46059436c6145937a4cc2c7424023a289fcd8vboxsynctypedef DECLCALLBACKPTR(uint8_t*, PFNVBOXCRCMDCTL_REMAINING_HOST_COMMAND)(HVBOXCRCMDCTL_REMAINING_HOST_COMMAND hClient, uint32_t *pcbCtl, int prevCmdRc);
81f46059436c6145937a4cc2c7424023a289fcd8vboxsync
81f46059436c6145937a4cc2c7424023a289fcd8vboxsynctypedef struct VBOXCRCMDCTL_HGCMENABLE_DATA
81f46059436c6145937a4cc2c7424023a289fcd8vboxsync{
81f46059436c6145937a4cc2c7424023a289fcd8vboxsync HVBOXCRCMDCTL_REMAINING_HOST_COMMAND hRHCmd;
81f46059436c6145937a4cc2c7424023a289fcd8vboxsync PFNVBOXCRCMDCTL_REMAINING_HOST_COMMAND pfnRHCmd;
81f46059436c6145937a4cc2c7424023a289fcd8vboxsync} VBOXCRCMDCTL_HGCMENABLE_DATA;
81f46059436c6145937a4cc2c7424023a289fcd8vboxsync
81f46059436c6145937a4cc2c7424023a289fcd8vboxsynctypedef struct VBOXVDMAHOST * HVBOXCRCMDCTL_NOTIFY_TERMINATING;
81f46059436c6145937a4cc2c7424023a289fcd8vboxsync
81f46059436c6145937a4cc2c7424023a289fcd8vboxsynctypedef DECLCALLBACKPTR(int, PFNVBOXCRCMDCTL_NOTIFY_TERMINATING)(HVBOXCRCMDCTL_NOTIFY_TERMINATING hClient, VBOXCRCMDCTL_HGCMENABLE_DATA *pHgcmEnableData);
81f46059436c6145937a4cc2c7424023a289fcd8vboxsync
81f46059436c6145937a4cc2c7424023a289fcd8vboxsynctypedef DECLCALLBACKPTR(void, PFNVBOXCRCMDCTL_NOTIFY_TERMINATING_DONE)(HVBOXCRCMDCTL_NOTIFY_TERMINATING hClient);
81f46059436c6145937a4cc2c7424023a289fcd8vboxsync
81f46059436c6145937a4cc2c7424023a289fcd8vboxsynctypedef struct VBOXCRCMDCTL_HGCMDISABLE_DATA
81f46059436c6145937a4cc2c7424023a289fcd8vboxsync{
81f46059436c6145937a4cc2c7424023a289fcd8vboxsync HVBOXCRCMDCTL_NOTIFY_TERMINATING hNotifyTerm;
81f46059436c6145937a4cc2c7424023a289fcd8vboxsync PFNVBOXCRCMDCTL_NOTIFY_TERMINATING pfnNotifyTerm;
81f46059436c6145937a4cc2c7424023a289fcd8vboxsync PFNVBOXCRCMDCTL_NOTIFY_TERMINATING_DONE pfnNotifyTermDone;
81f46059436c6145937a4cc2c7424023a289fcd8vboxsync} VBOXCRCMDCTL_HGCMDISABLE_DATA;
81f46059436c6145937a4cc2c7424023a289fcd8vboxsync
81f46059436c6145937a4cc2c7424023a289fcd8vboxsynctypedef struct VBOXCRCMDCTL_ENABLE
81f46059436c6145937a4cc2c7424023a289fcd8vboxsync{
81f46059436c6145937a4cc2c7424023a289fcd8vboxsync VBOXCRCMDCTL Hdr;
81f46059436c6145937a4cc2c7424023a289fcd8vboxsync VBOXCRCMDCTL_HGCMENABLE_DATA Data;
81f46059436c6145937a4cc2c7424023a289fcd8vboxsync} VBOXCRCMDCTL_ENABLE;
81f46059436c6145937a4cc2c7424023a289fcd8vboxsync
81f46059436c6145937a4cc2c7424023a289fcd8vboxsynctypedef struct VBOXCRCMDCTL_DISABLE
81f46059436c6145937a4cc2c7424023a289fcd8vboxsync{
81f46059436c6145937a4cc2c7424023a289fcd8vboxsync VBOXCRCMDCTL Hdr;
81f46059436c6145937a4cc2c7424023a289fcd8vboxsync VBOXCRCMDCTL_HGCMDISABLE_DATA Data;
81f46059436c6145937a4cc2c7424023a289fcd8vboxsync} VBOXCRCMDCTL_DISABLE;
81f46059436c6145937a4cc2c7424023a289fcd8vboxsync
81f46059436c6145937a4cc2c7424023a289fcd8vboxsync#endif /*#ifndef ___VBox_VBoxVideoHost3D_h*/
81f46059436c6145937a4cc2c7424023a289fcd8vboxsync