1 | /** @file
|
---|
2 | *
|
---|
3 | * VBox frontends: Basic Frontend (BFE):
|
---|
4 | * Declaration of VMDisplay class
|
---|
5 | */
|
---|
6 |
|
---|
7 | /*
|
---|
8 | * Copyright (C) 2006 InnoTek Systemberatung GmbH
|
---|
9 | *
|
---|
10 | * This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
11 | * available from http://www.virtualbox.org. This file is free software;
|
---|
12 | * you can redistribute it and/or modify it under the terms of the GNU
|
---|
13 | * General Public License as published by the Free Software Foundation,
|
---|
14 | * in version 2 as it comes in the "COPYING" file of the VirtualBox OSE
|
---|
15 | * distribution. VirtualBox OSE is distributed in the hope that it will
|
---|
16 | * be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
17 | *
|
---|
18 | * If you received this file as part of a commercial VirtualBox
|
---|
19 | * distribution, then only the terms of your commercial VirtualBox
|
---|
20 | * license agreement apply instead of the previous paragraph.
|
---|
21 | */
|
---|
22 |
|
---|
23 | #ifndef ____H_DISPLAYIMPL
|
---|
24 | #define ____H_DISPLAYIMPL
|
---|
25 |
|
---|
26 | #include <iprt/semaphore.h>
|
---|
27 | #include <VBox/pdm.h>
|
---|
28 |
|
---|
29 | #include "Framebuffer.h"
|
---|
30 |
|
---|
31 | class VMDisplay
|
---|
32 | {
|
---|
33 |
|
---|
34 | public:
|
---|
35 |
|
---|
36 | VMDisplay();
|
---|
37 | ~VMDisplay();
|
---|
38 |
|
---|
39 | // public methods only for internal purposes
|
---|
40 | void handleDisplayResize (int w, int h);
|
---|
41 | void handleDisplayUpdate (int x, int y, int cx, int cy);
|
---|
42 |
|
---|
43 | int VideoAccelEnable (bool fEnable, VBVAMEMORY *pVbvaMemory);
|
---|
44 | void VideoAccelFlush (void);
|
---|
45 | bool VideoAccelAllowed (void);
|
---|
46 |
|
---|
47 | void updatePointerShape(bool fVisible, bool fAlpha, uint32_t xHot, uint32_t yHot, uint32_t width, uint32_t height, void *pShape);
|
---|
48 |
|
---|
49 | static const PDMDRVREG DrvReg;
|
---|
50 |
|
---|
51 | uint32_t getWidth();
|
---|
52 | uint32_t getHeight();
|
---|
53 | uint32_t getColorDepth();
|
---|
54 |
|
---|
55 | STDMETHODIMP RegisterExternalFramebuffer(Framebuffer *Framebuffer);
|
---|
56 | STDMETHODIMP InvalidateAndUpdate();
|
---|
57 | STDMETHODIMP ResizeCompleted();
|
---|
58 |
|
---|
59 | void resetFramebuffer();
|
---|
60 |
|
---|
61 |
|
---|
62 | private:
|
---|
63 |
|
---|
64 | void updateDisplayData();
|
---|
65 |
|
---|
66 | static DECLCALLBACK(void*) drvQueryInterface(PPDMIBASE pInterface, PDMINTERFACE enmInterface);
|
---|
67 | static DECLCALLBACK(int) drvConstruct(PPDMDRVINS pDrvIns, PCFGMNODE pCfgHandle);
|
---|
68 | static DECLCALLBACK(void) displayResizeCallback(PPDMIDISPLAYCONNECTOR pInterface, uint32_t bpp, void *pvVRAM, uint32_t cbLine, uint32_t cx, uint32_t cy);
|
---|
69 | static DECLCALLBACK(void) displayUpdateCallback(PPDMIDISPLAYCONNECTOR pInterface,
|
---|
70 | uint32_t x, uint32_t y, uint32_t cx, uint32_t cy);
|
---|
71 | static DECLCALLBACK(void) displayRefreshCallback(PPDMIDISPLAYCONNECTOR pInterface);
|
---|
72 | static DECLCALLBACK(void) displayResetCallback(PPDMIDISPLAYCONNECTOR pInterface);
|
---|
73 | static DECLCALLBACK(void) displayLFBModeChangeCallback(PPDMIDISPLAYCONNECTOR pInterface, bool fEnabled);
|
---|
74 |
|
---|
75 | static DECLCALLBACK(void) doInvalidateAndUpdate(struct DRVMAINDISPLAY *mpDrv);
|
---|
76 | /** Pointer to the associated display driver. */
|
---|
77 | struct DRVMAINDISPLAY *mpDrv;
|
---|
78 |
|
---|
79 | Framebuffer *mFramebuffer;
|
---|
80 | bool mInternalFramebuffer, mFramebufferOpened;
|
---|
81 |
|
---|
82 | ULONG mSupportedAccelOps;
|
---|
83 | RTSEMEVENTMULTI mResizeSem;
|
---|
84 | RTSEMEVENTMULTI mUpdateSem;
|
---|
85 |
|
---|
86 | VBVAMEMORY *mpVbvaMemory;
|
---|
87 | bool mfVideoAccelEnabled;
|
---|
88 |
|
---|
89 | VBVAMEMORY *mpPendingVbvaMemory;
|
---|
90 | bool mfPendingVideoAccelEnable;
|
---|
91 | bool mfMachineRunning;
|
---|
92 |
|
---|
93 | uint8_t *mpu8VbvaPartial;
|
---|
94 | uint32_t mcbVbvaPartial;
|
---|
95 |
|
---|
96 | bool vbvaFetchCmd (VBVACMDHDR **ppHdr, uint32_t *pcbCmd);
|
---|
97 | void vbvaReleaseCmd (VBVACMDHDR *pHdr, int32_t cbCmd);
|
---|
98 | };
|
---|
99 |
|
---|
100 | extern VMDisplay *gDisplay;
|
---|
101 |
|
---|
102 | #endif // ____H_DISPLAYIMPL
|
---|