DisplayImpl.h revision 936fcb1f7dbf79c2567a06dfa11eeb87443475f0
9888fffcfbe2d41dce14a1249b12cb88cc9b149fvboxsync * VirtualBox COM class implementation
9888fffcfbe2d41dce14a1249b12cb88cc9b149fvboxsync * Copyright (C) 2006-2008 Oracle Corporation
9888fffcfbe2d41dce14a1249b12cb88cc9b149fvboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
9888fffcfbe2d41dce14a1249b12cb88cc9b149fvboxsync * available from http://www.virtualbox.org. This file is free software;
9888fffcfbe2d41dce14a1249b12cb88cc9b149fvboxsync * you can redistribute it and/or modify it under the terms of the GNU
9888fffcfbe2d41dce14a1249b12cb88cc9b149fvboxsync * General Public License (GPL) as published by the Free Software
9888fffcfbe2d41dce14a1249b12cb88cc9b149fvboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
9888fffcfbe2d41dce14a1249b12cb88cc9b149fvboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
9888fffcfbe2d41dce14a1249b12cb88cc9b149fvboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
9888fffcfbe2d41dce14a1249b12cb88cc9b149fvboxsync /* The Framebuffer has default format and must be updates immediately. */
9888fffcfbe2d41dce14a1249b12cb88cc9b149fvboxsync /* The rectangle that includes all dirty rectangles. */
9888fffcfbe2d41dce14a1249b12cb88cc9b149fvboxsync#endif /* VBOX_WITH_HGSMI */
9888fffcfbe2d41dce14a1249b12cb88cc9b149fvboxsync VIRTUALBOXBASE_ADD_ERRORINFO_SUPPORT(Display, IDisplay)
dc45a8f3e936581748c248e00ce572cfe3ea331evboxsync // public initializer/uninitializer for internal purposes only
9888fffcfbe2d41dce14a1249b12cb88cc9b149fvboxsync // public methods only for internal purposes
9888fffcfbe2d41dce14a1249b12cb88cc9b149fvboxsync int handleDisplayResize (unsigned uScreenId, uint32_t bpp, void *pvVRAM, uint32_t cbLine, int w, int h);
9888fffcfbe2d41dce14a1249b12cb88cc9b149fvboxsync void handleDisplayUpdateLegacy (int x, int y, int cx, int cy);
9888fffcfbe2d41dce14a1249b12cb88cc9b149fvboxsync void handleDisplayUpdate (unsigned uScreenId, int x, int y, int w, int h);
9888fffcfbe2d41dce14a1249b12cb88cc9b149fvboxsync void handleVHWACommandProcess(PPDMIDISPLAYCONNECTOR pInterface, PVBOXVHWACMD pCommand);
9888fffcfbe2d41dce14a1249b12cb88cc9b149fvboxsync void handleCrHgsmiCommandProcess(PPDMIDISPLAYCONNECTOR pInterface, PVBOXVDMACMD_CHROMIUM_CMD pCmd);
9888fffcfbe2d41dce14a1249b12cb88cc9b149fvboxsync void handleCrHgsmiControlProcess(PPDMIDISPLAYCONNECTOR pInterface, PVBOXVDMACMD_CHROMIUM_CTL pCtl);
9888fffcfbe2d41dce14a1249b12cb88cc9b149fvboxsync void handleCrHgsmiCommandCompletion(int32_t result, uint32_t u32Function, PVBOXHGCMSVCPARM pParam);
9888fffcfbe2d41dce14a1249b12cb88cc9b149fvboxsync void handleCrHgsmiControlCompletion(int32_t result, uint32_t u32Function, PVBOXHGCMSVCPARM pParam);
9888fffcfbe2d41dce14a1249b12cb88cc9b149fvboxsync return maFramebuffers[VBOX_VIDEO_PRIMARY_SCREEN].pFramebuffer;
9888fffcfbe2d41dce14a1249b12cb88cc9b149fvboxsync int handleSetVisibleRegion(uint32_t cRect, PRTRECT pRect);
87c5113417e917cdf64545d4f8e0a27047cea783vboxsync int handleQueryVisibleRegion(uint32_t *pcRect, PRTRECT pRect);
50671c30431539dd7d6ff6a5f2ceb6c9f9f471b2vboxsync int VideoAccelEnable (bool fEnable, VBVAMEMORY *pVbvaMemory);
9888fffcfbe2d41dce14a1249b12cb88cc9b149fvboxsync // IEventListener methods
9888fffcfbe2d41dce14a1249b12cb88cc9b149fvboxsync // IDisplay methods
9888fffcfbe2d41dce14a1249b12cb88cc9b149fvboxsync STDMETHOD(GetScreenResolution)(ULONG aScreenId, ULONG *aWidth, ULONG *aHeight, ULONG *aBitsPerPixel);
9888fffcfbe2d41dce14a1249b12cb88cc9b149fvboxsync STDMETHOD(SetFramebuffer)(ULONG aScreenId, IFramebuffer *aFramebuffer);
9888fffcfbe2d41dce14a1249b12cb88cc9b149fvboxsync STDMETHOD(GetFramebuffer)(ULONG aScreenId, IFramebuffer **aFramebuffer, LONG *aXOrigin, LONG *aYOrigin);
9888fffcfbe2d41dce14a1249b12cb88cc9b149fvboxsync STDMETHOD(SetVideoModeHint)(ULONG width, ULONG height, ULONG bitsPerPixel, ULONG display);
50671c30431539dd7d6ff6a5f2ceb6c9f9f471b2vboxsync STDMETHOD(TakeScreenShot)(ULONG aScreenId, BYTE *address, ULONG width, ULONG height);
50671c30431539dd7d6ff6a5f2ceb6c9f9f471b2vboxsync STDMETHOD(TakeScreenShotToArray)(ULONG aScreenId, ULONG width, ULONG height, ComSafeArrayOut(BYTE, aScreenData));
50671c30431539dd7d6ff6a5f2ceb6c9f9f471b2vboxsync STDMETHOD(TakeScreenShotPNGToArray)(ULONG aScreenId, ULONG width, ULONG height, ComSafeArrayOut(BYTE, aScreenData));
50671c30431539dd7d6ff6a5f2ceb6c9f9f471b2vboxsync STDMETHOD(DrawToScreen)(ULONG aScreenId, BYTE *address, ULONG x, ULONG y, ULONG width, ULONG height);
50671c30431539dd7d6ff6a5f2ceb6c9f9f471b2vboxsync static DECLCALLBACK(int) changeFramebuffer(Display *that, IFramebuffer *aFB, unsigned uScreenId);
50671c30431539dd7d6ff6a5f2ceb6c9f9f471b2vboxsync static DECLCALLBACK(void*) drvQueryInterface(PPDMIBASE pInterface, const char *pszIID);
50671c30431539dd7d6ff6a5f2ceb6c9f9f471b2vboxsync static DECLCALLBACK(int) drvConstruct(PPDMDRVINS pDrvIns, PCFGMNODE pCfg, uint32_t fFlags);
50671c30431539dd7d6ff6a5f2ceb6c9f9f471b2vboxsync static DECLCALLBACK(void) drvDestruct(PPDMDRVINS pDrvIns);
50671c30431539dd7d6ff6a5f2ceb6c9f9f471b2vboxsync static DECLCALLBACK(int) displayResizeCallback(PPDMIDISPLAYCONNECTOR pInterface, uint32_t bpp, void *pvVRAM, uint32_t cbLine, uint32_t cx, uint32_t cy);
50671c30431539dd7d6ff6a5f2ceb6c9f9f471b2vboxsync static DECLCALLBACK(void) displayUpdateCallback(PPDMIDISPLAYCONNECTOR pInterface,
50671c30431539dd7d6ff6a5f2ceb6c9f9f471b2vboxsync static DECLCALLBACK(void) displayRefreshCallback(PPDMIDISPLAYCONNECTOR pInterface);
50671c30431539dd7d6ff6a5f2ceb6c9f9f471b2vboxsync static DECLCALLBACK(void) displayResetCallback(PPDMIDISPLAYCONNECTOR pInterface);
50671c30431539dd7d6ff6a5f2ceb6c9f9f471b2vboxsync static DECLCALLBACK(void) displayLFBModeChangeCallback(PPDMIDISPLAYCONNECTOR pInterface, bool fEnabled);
50671c30431539dd7d6ff6a5f2ceb6c9f9f471b2vboxsync static DECLCALLBACK(void) displayProcessAdapterDataCallback(PPDMIDISPLAYCONNECTOR pInterface, void *pvVRAM, uint32_t u32VRAMSize);
50671c30431539dd7d6ff6a5f2ceb6c9f9f471b2vboxsync static DECLCALLBACK(void) displayProcessDisplayDataCallback(PPDMIDISPLAYCONNECTOR pInterface, void *pvVRAM, unsigned uScreenId);
50671c30431539dd7d6ff6a5f2ceb6c9f9f471b2vboxsync static DECLCALLBACK(void) displayVHWACommandProcess(PPDMIDISPLAYCONNECTOR pInterface, PVBOXVHWACMD pCommand);
9888fffcfbe2d41dce14a1249b12cb88cc9b149fvboxsync static DECLCALLBACK(void) displayCrHgsmiCommandProcess(PPDMIDISPLAYCONNECTOR pInterface, PVBOXVDMACMD_CHROMIUM_CMD pCmd);
9888fffcfbe2d41dce14a1249b12cb88cc9b149fvboxsync static DECLCALLBACK(void) displayCrHgsmiControlProcess(PPDMIDISPLAYCONNECTOR pInterface, PVBOXVDMACMD_CHROMIUM_CTL pCtl);
9888fffcfbe2d41dce14a1249b12cb88cc9b149fvboxsync static DECLCALLBACK(void) displayCrHgsmiCommandCompletion(int32_t result, uint32_t u32Function, PVBOXHGCMSVCPARM pParam, void *pvContext);
9888fffcfbe2d41dce14a1249b12cb88cc9b149fvboxsync static DECLCALLBACK(void) displayCrHgsmiControlCompletion(int32_t result, uint32_t u32Function, PVBOXHGCMSVCPARM pParam, void *pvContext);
9888fffcfbe2d41dce14a1249b12cb88cc9b149fvboxsync static DECLCALLBACK(int) displayVBVAEnable(PPDMIDISPLAYCONNECTOR pInterface, unsigned uScreenId, PVBVAHOSTFLAGS pHostFlags);
9888fffcfbe2d41dce14a1249b12cb88cc9b149fvboxsync static DECLCALLBACK(void) displayVBVADisable(PPDMIDISPLAYCONNECTOR pInterface, unsigned uScreenId);
9888fffcfbe2d41dce14a1249b12cb88cc9b149fvboxsync static DECLCALLBACK(void) displayVBVAUpdateBegin(PPDMIDISPLAYCONNECTOR pInterface, unsigned uScreenId);
9888fffcfbe2d41dce14a1249b12cb88cc9b149fvboxsync static DECLCALLBACK(void) displayVBVAUpdateProcess(PPDMIDISPLAYCONNECTOR pInterface, unsigned uScreenId, const PVBVACMDHDR pCmd, size_t cbCmd);
9888fffcfbe2d41dce14a1249b12cb88cc9b149fvboxsync static DECLCALLBACK(void) displayVBVAUpdateEnd(PPDMIDISPLAYCONNECTOR pInterface, unsigned uScreenId, int32_t x, int32_t y, uint32_t cx, uint32_t cy);
9888fffcfbe2d41dce14a1249b12cb88cc9b149fvboxsync static DECLCALLBACK(int) displayVBVAResize(PPDMIDISPLAYCONNECTOR pInterface, const PVBVAINFOVIEW pView, const PVBVAINFOSCREEN pScreen, void *pvVRAM);
9888fffcfbe2d41dce14a1249b12cb88cc9b149fvboxsync static DECLCALLBACK(int) displayVBVAMousePointerShape(PPDMIDISPLAYCONNECTOR pInterface, bool fVisible, bool fAlpha, uint32_t xHot, uint32_t yHot, uint32_t cx, uint32_t cy, const void *pvShape);
9888fffcfbe2d41dce14a1249b12cb88cc9b149fvboxsync static DECLCALLBACK(void) displaySSMSaveScreenshot(PSSMHANDLE pSSM, void *pvUser);
9888fffcfbe2d41dce14a1249b12cb88cc9b149fvboxsync static DECLCALLBACK(int) displaySSMLoadScreenshot(PSSMHANDLE pSSM, void *pvUser, uint32_t uVersion, uint32_t uPass);
9888fffcfbe2d41dce14a1249b12cb88cc9b149fvboxsync static DECLCALLBACK(void) displaySSMSave(PSSMHANDLE pSSM, void *pvUser);
9888fffcfbe2d41dce14a1249b12cb88cc9b149fvboxsync static DECLCALLBACK(int) displaySSMLoad(PSSMHANDLE pSSM, void *pvUser, uint32_t uVersion, uint32_t uPass);
9888fffcfbe2d41dce14a1249b12cb88cc9b149fvboxsync /** Pointer to the associated display driver. */
9888fffcfbe2d41dce14a1249b12cb88cc9b149fvboxsync /** Pointer to the device instance for the VMM Device. */
9888fffcfbe2d41dce14a1249b12cb88cc9b149fvboxsync /** Set after the first attempt to find the VMM Device. */
9888fffcfbe2d41dce14a1249b12cb88cc9b149fvboxsync DISPLAYFBINFO maFramebuffers[SchemaDefs::MaxGuestMonitors];
9888fffcfbe2d41dce14a1249b12cb88cc9b149fvboxsync /* arguments of the last handleDisplayResize() call */
9888fffcfbe2d41dce14a1249b12cb88cc9b149fvboxsync /* for fast host hgcm calls */
9888fffcfbe2d41dce14a1249b12cb88cc9b149fvboxsync bool vbvaFetchCmd (VBVACMDHDR **ppHdr, uint32_t *pcbCmd);
9888fffcfbe2d41dce14a1249b12cb88cc9b149fvboxsync void vbvaReleaseCmd (VBVACMDHDR *pHdr, int32_t cbCmd);
9888fffcfbe2d41dce14a1249b12cb88cc9b149fvboxsync static int displayTakeScreenshotEMT(Display *pDisplay, ULONG aScreenId, uint8_t **ppu8Data, size_t *pcbData, uint32_t *pu32Width, uint32_t *pu32Height);
9888fffcfbe2d41dce14a1249b12cb88cc9b149fvboxsync static void InvalidateAndUpdateEMT(Display *pDisplay);
9888fffcfbe2d41dce14a1249b12cb88cc9b149fvboxsync static int drawToScreenEMT(Display *pDisplay, ULONG aScreenId, BYTE *address, ULONG x, ULONG y, ULONG width, ULONG height);
9888fffcfbe2d41dce14a1249b12cb88cc9b149fvboxsync /* Functions run under VBVA lock. */
9888fffcfbe2d41dce14a1249b12cb88cc9b149fvboxsync int videoAccelEnable (bool fEnable, VBVAMEMORY *pVbvaMemory);
9888fffcfbe2d41dce14a1249b12cb88cc9b149fvboxsync#endif /* VBOX_WITH_OLD_VBVA_LOCK */
9888fffcfbe2d41dce14a1249b12cb88cc9b149fvboxsyncvoid gdImageCopyResampled (uint8_t *dst, uint8_t *src,
9888fffcfbe2d41dce14a1249b12cb88cc9b149fvboxsyncint DisplayMakePNG(uint8_t *pu8Data, uint32_t cx, uint32_t cy,
9888fffcfbe2d41dce14a1249b12cb88cc9b149fvboxsync uint8_t **ppu8PNG, uint32_t *pcbPNG, uint32_t *pcxPNG, uint32_t *pcyPNG,
9888fffcfbe2d41dce14a1249b12cb88cc9b149fvboxsync#endif // ____H_DISPLAYIMPL
9888fffcfbe2d41dce14a1249b12cb88cc9b149fvboxsync/* vi: set tabstop=4 shiftwidth=4 expandtab: */