1 | /** @file
|
---|
2 | *
|
---|
3 | * VBoxVideo Display D3D User mode dll
|
---|
4 | *
|
---|
5 | * Copyright (C) 2010 Oracle Corporation
|
---|
6 | *
|
---|
7 | * This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
8 | * available from http://www.virtualbox.org. This file is free software;
|
---|
9 | * you can redistribute it and/or modify it under the terms of the GNU
|
---|
10 | * General Public License (GPL) as published by the Free Software
|
---|
11 | * Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
12 | * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
13 | * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
14 | */
|
---|
15 | #ifndef ___VBoxDispD3DCmn_h___
|
---|
16 | #define ___VBoxDispD3DCmn_h___
|
---|
17 |
|
---|
18 | #include <windows.h>
|
---|
19 | #include <d3d9types.h>
|
---|
20 | //#include <d3dtypes.h>
|
---|
21 | #include <D3dumddi.h>
|
---|
22 | #include <d3dhal.h>
|
---|
23 |
|
---|
24 | #include <iprt/initterm.h>
|
---|
25 | #include <iprt/log.h>
|
---|
26 | #include <iprt/mem.h>
|
---|
27 |
|
---|
28 | #include <VBox/Log.h>
|
---|
29 |
|
---|
30 | #include <VBox/VBoxGuestLib.h>
|
---|
31 |
|
---|
32 | #include "VBoxDispD3DIf.h"
|
---|
33 | #include "../../Miniport/wddm/VBoxVideoIf.h"
|
---|
34 | #include "VBoxDispCm.h"
|
---|
35 | #include "VBoxDispD3D.h"
|
---|
36 |
|
---|
37 | #ifdef DEBUG
|
---|
38 | # define VBOXWDDMDISP_DEBUG
|
---|
39 | # define VBOXWDDMDISP_DEBUG_FLOW
|
---|
40 | # define VBOXWDDMDISP_DEBUG_DUMPSURFDATA
|
---|
41 | #endif
|
---|
42 |
|
---|
43 | #if 0
|
---|
44 | # ifdef Assert
|
---|
45 | # undef Assert
|
---|
46 | # define Assert(_a) do{}while(0)
|
---|
47 | # endif
|
---|
48 | # ifdef AssertBreakpoint
|
---|
49 | # undef AssertBreakpoint
|
---|
50 | # define AssertBreakpoint() do{}while(0)
|
---|
51 | # endif
|
---|
52 | # ifdef AssertFailed
|
---|
53 | # undef AssertFailed
|
---|
54 | # define AssertFailed() do{}while(0)
|
---|
55 | # endif
|
---|
56 | #endif
|
---|
57 |
|
---|
58 | #ifdef VBOXWDDMDISP_DEBUG
|
---|
59 | extern bool g_VDbgTstDumpEnable;
|
---|
60 | extern bool g_VDbgTstDumpOnSys2VidSameSizeEnable;
|
---|
61 |
|
---|
62 | VOID vboxVDbgDoDumpSurfData(const PVBOXWDDMDISP_DEVICE pDevice, const char * pPrefix, const PVBOXWDDMDISP_RESOURCE pRc, uint32_t iAlloc, const RECT *pRect, IDirect3DSurface9 *pSurf, const char* pSuffix);
|
---|
63 | void vboxVDbgDoMpPrintRect(const PVBOXWDDMDISP_DEVICE pDevice, const char * pPrefix, const RECT *pRect, const char * pSuffix);
|
---|
64 | void vboxVDbgDoMpPrintAlloc(const PVBOXWDDMDISP_DEVICE pDevice, const char * pPrefix, const PVBOXWDDMDISP_RESOURCE pRc, uint32_t iAlloc, const char * pSuffix);
|
---|
65 | VOID vboxVDbgDoPrint(LPCSTR szString, ...);
|
---|
66 | VOID vboxVDbgDoMpPrintF(const PVBOXWDDMDISP_DEVICE pDevice, LPCSTR szString, ...);
|
---|
67 | void vboxVDbgVEHandlerRegister();
|
---|
68 | void vboxVDbgVEHandlerUnregister();
|
---|
69 |
|
---|
70 | #define vboxVDbgBreak() AssertBreakpoint()
|
---|
71 | #define vboxVDbgPrint(_m) \
|
---|
72 | do { \
|
---|
73 | vboxVDbgDoPrint _m ; \
|
---|
74 | } while (0)
|
---|
75 | #define vboxVDbgPrintR vboxVDbgPrint
|
---|
76 | #define vboxVDbgMpPrint(_m) \
|
---|
77 | do { \
|
---|
78 | vboxVDbgDoMpPrintF _m ; \
|
---|
79 | } while (0)
|
---|
80 | #define vboxVDbgMpPrintRect(_m) \
|
---|
81 | do { \
|
---|
82 | vboxVDbgDoMpPrintRect _m ; \
|
---|
83 | } while (0)
|
---|
84 | #define vboxVDbgMpPrintAlloc(_m) \
|
---|
85 | do { \
|
---|
86 | vboxVDbgDoMpPrintAlloc _m ; \
|
---|
87 | } while (0)
|
---|
88 | #ifdef VBOXWDDMDISP_DEBUG_DUMPSURFDATA
|
---|
89 | #define vboxVDbgDumpSurfData(_m) \
|
---|
90 | do { \
|
---|
91 | vboxVDbgDoDumpSurfData _m ; \
|
---|
92 | } while (0)
|
---|
93 | #else
|
---|
94 | #define vboxVDbgDumpSurfData(_m) do {} while (0)
|
---|
95 | #endif
|
---|
96 | #ifdef VBOXWDDMDISP_DEBUG_FLOW
|
---|
97 | # define vboxVDbgPrintF vboxVDbgPrint
|
---|
98 | #else
|
---|
99 | # define vboxVDbgPrintF(_m) do {} while (0)
|
---|
100 | #endif
|
---|
101 | #else
|
---|
102 | #define vboxVDbgMpPrint(_m) do {} while (0)
|
---|
103 | #define vboxVDbgMpPrintRect(_m) do {} while (0)
|
---|
104 | #define vboxVDbgMpPrintAlloc(_m) do {} while (0)
|
---|
105 | #define vboxVDbgDumpSurfData(_m) do {} while (0)
|
---|
106 | #define vboxVDbgBreak() do {} while (0)
|
---|
107 | #define vboxVDbgPrint(_m) do {} while (0)
|
---|
108 | #define vboxVDbgPrintR vboxVDbgPrint
|
---|
109 | #define vboxVDbgPrintF vboxVDbgPrint
|
---|
110 | #endif
|
---|
111 |
|
---|
112 | #endif /* #ifndef ___VBoxDispD3DCmn_h___ */
|
---|