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 ___VBoxUhgsmiKmt_h__
|
---|
16 | #define ___VBoxUhgsmiKmt_h__
|
---|
17 |
|
---|
18 | #include "VBoxUhgsmiBase.h"
|
---|
19 | #include "VBoxDispD3DCmn.h"
|
---|
20 |
|
---|
21 | #include <D3dkmthk.h>
|
---|
22 |
|
---|
23 | typedef struct VBOXDISPKMT_CALLBACKS
|
---|
24 | {
|
---|
25 | HMODULE hGdi32;
|
---|
26 | /* open adapter */
|
---|
27 | PFND3DKMT_OPENADAPTERFROMHDC pfnD3DKMTOpenAdapterFromHdc;
|
---|
28 | PFND3DKMT_OPENADAPTERFROMGDIDISPLAYNAME pfnD3DKMTOpenAdapterFromGdiDisplayName;
|
---|
29 | /* close adapter */
|
---|
30 | PFND3DKMT_CLOSEADAPTER pfnD3DKMTCloseAdapter;
|
---|
31 | /* escape */
|
---|
32 | PFND3DKMT_ESCAPE pfnD3DKMTEscape;
|
---|
33 |
|
---|
34 | PFND3DKMT_CREATEDEVICE pfnD3DKMTCreateDevice;
|
---|
35 | PFND3DKMT_DESTROYDEVICE pfnD3DKMTDestroyDevice;
|
---|
36 | PFND3DKMT_CREATECONTEXT pfnD3DKMTCreateContext;
|
---|
37 | PFND3DKMT_DESTROYCONTEXT pfnD3DKMTDestroyContext;
|
---|
38 |
|
---|
39 | PFND3DKMT_RENDER pfnD3DKMTRender;
|
---|
40 |
|
---|
41 | PFND3DKMT_CREATEALLOCATION pfnD3DKMTCreateAllocation;
|
---|
42 | PFND3DKMT_DESTROYALLOCATION pfnD3DKMTDestroyAllocation;
|
---|
43 |
|
---|
44 | PFND3DKMT_LOCK pfnD3DKMTLock;
|
---|
45 | PFND3DKMT_UNLOCK pfnD3DKMTUnlock;
|
---|
46 | } VBOXDISPKMT_CALLBACKS, *PVBOXDISPKMT_CALLBACKS;
|
---|
47 |
|
---|
48 | HRESULT vboxDispKmtCallbacksInit(PVBOXDISPKMT_CALLBACKS pCallbacks);
|
---|
49 | HRESULT vboxDispKmtCallbacksTerm(PVBOXDISPKMT_CALLBACKS pCallbacks);
|
---|
50 |
|
---|
51 | typedef struct VBOXDISPKMT_ADAPTER
|
---|
52 | {
|
---|
53 | D3DKMT_HANDLE hAdapter;
|
---|
54 | HDC hDc;
|
---|
55 | PVBOXDISPKMT_CALLBACKS pCallbacks;
|
---|
56 | }VBOXDISPKMT_ADAPTER, *PVBOXDISPKMT_ADAPTER;
|
---|
57 |
|
---|
58 | typedef struct VBOXDISPKMT_DEVICE
|
---|
59 | {
|
---|
60 | struct VBOXDISPKMT_ADAPTER *pAdapter;
|
---|
61 | D3DKMT_HANDLE hDevice;
|
---|
62 | VOID *pCommandBuffer;
|
---|
63 | UINT CommandBufferSize;
|
---|
64 | D3DDDI_ALLOCATIONLIST *pAllocationList;
|
---|
65 | UINT AllocationListSize;
|
---|
66 | D3DDDI_PATCHLOCATIONLIST *pPatchLocationList;
|
---|
67 | UINT PatchLocationListSize;
|
---|
68 | }VBOXDISPKMT_DEVICE, *PVBOXDISPKMT_DEVICE;
|
---|
69 |
|
---|
70 | typedef struct VBOXDISPKMT_CONTEXT
|
---|
71 | {
|
---|
72 | struct VBOXDISPKMT_DEVICE *pDevice;
|
---|
73 | D3DKMT_HANDLE hContext;
|
---|
74 | VOID *pCommandBuffer;
|
---|
75 | UINT CommandBufferSize;
|
---|
76 | D3DDDI_ALLOCATIONLIST *pAllocationList;
|
---|
77 | UINT AllocationListSize;
|
---|
78 | D3DDDI_PATCHLOCATIONLIST *pPatchLocationList;
|
---|
79 | UINT PatchLocationListSize;
|
---|
80 | } VBOXDISPKMT_CONTEXT, *PVBOXDISPKMT_CONTEXT;
|
---|
81 |
|
---|
82 | typedef struct VBOXUHGSMI_PRIVATE_KMT
|
---|
83 | {
|
---|
84 | VBOXUHGSMI_PRIVATE_BASE BasePrivate;
|
---|
85 | VBOXDISPKMT_CALLBACKS Callbacks;
|
---|
86 | VBOXDISPKMT_ADAPTER Adapter;
|
---|
87 | VBOXDISPKMT_DEVICE Device;
|
---|
88 | VBOXDISPKMT_CONTEXT Context;
|
---|
89 | } VBOXUHGSMI_PRIVATE_KMT, *PVBOXUHGSMI_PRIVATE_KMT;
|
---|
90 |
|
---|
91 | #define VBOXUHGSMIKMT_GET_PRIVATE(_p, _t) ((_t*)(((uint8_t*)_p) - RT_OFFSETOF(_t, BasePrivate.Base)))
|
---|
92 | #define VBOXUHGSMIKMT_GET(_p) VBOXUHGSMIKMT_GET_PRIVATE(_p, VBOXUHGSMI_PRIVATE_KMT)
|
---|
93 |
|
---|
94 | HRESULT vboxDispKmtOpenAdapter(PVBOXDISPKMT_CALLBACKS pCallbacks, PVBOXDISPKMT_ADAPTER pAdapter);
|
---|
95 | HRESULT vboxDispKmtCloseAdapter(PVBOXDISPKMT_ADAPTER pAdapter);
|
---|
96 | HRESULT vboxDispKmtCreateDevice(PVBOXDISPKMT_ADAPTER pAdapter, PVBOXDISPKMT_DEVICE pDevice);
|
---|
97 | HRESULT vboxDispKmtDestroyDevice(PVBOXDISPKMT_DEVICE pDevice);
|
---|
98 | HRESULT vboxDispKmtCreateContext(PVBOXDISPKMT_DEVICE pDevice, PVBOXDISPKMT_CONTEXT pContext,
|
---|
99 | VBOXWDDM_CONTEXT_TYPE enmType, HANDLE hEvent, uint64_t u64UmInfo);
|
---|
100 | HRESULT vboxDispKmtDestroyContext(PVBOXDISPKMT_CONTEXT pContext);
|
---|
101 |
|
---|
102 | HRESULT vboxUhgsmiKmtCreate(PVBOXUHGSMI_PRIVATE_KMT pHgsmi, BOOL bD3D);
|
---|
103 | HRESULT vboxUhgsmiKmtDestroy(PVBOXUHGSMI_PRIVATE_KMT pHgsmi);
|
---|
104 |
|
---|
105 | HRESULT vboxUhgsmiKmtEscCreate(PVBOXUHGSMI_PRIVATE_KMT pHgsmi, BOOL bD3D);
|
---|
106 |
|
---|
107 |
|
---|
108 | #endif /* #ifndef ___VBoxUhgsmiKmt_h__ */
|
---|