VirtualBox

source: vbox/trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/VBoxDispKmt.h@ 53100

Last change on this file since 53100 was 49591, checked in by vboxsync, 11 years ago

wddm: more on new comand mechanism, guest side almost done, some cleanup

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 4.5 KB
Line 
1/* $Id: VBoxDispKmt.h 49591 2013-11-20 17:53:55Z vboxsync $ */
2
3/** @file
4 * VBoxVideo Display D3D User mode dll
5 */
6
7/*
8 * Copyright (C) 2011-2012 Oracle Corporation
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 (GPL) as published by the Free Software
14 * Foundation, in version 2 as it comes in the "COPYING" file of the
15 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
16 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
17 */
18
19#ifndef ___VBoxDispKmt_h__
20#define ___VBoxDispKmt_h__
21
22#include <D3dkmthk.h>
23
24#include "../../common/wddm/VBoxMPIf.h"
25
26/* win8 release preview-specific stuff */
27typedef struct _D3DKMT_ADAPTERINFO
28{
29 D3DKMT_HANDLE hAdapter;
30 LUID AdapterLuid;
31 ULONG NumOfSources;
32 BOOL bPresentMoveRegionsPreferred;
33} D3DKMT_ADAPTERINFO;
34
35#define MAX_ENUM_ADAPTERS 16
36
37typedef struct _D3DKMT_ENUMADAPTERS
38{
39 ULONG NumAdapters;
40 D3DKMT_ADAPTERINFO Adapters[MAX_ENUM_ADAPTERS];
41} D3DKMT_ENUMADAPTERS;
42
43typedef NTSTATUS (APIENTRY *PFND3DKMT_ENUMADAPTERS)(IN OUT D3DKMT_ENUMADAPTERS*);
44
45typedef struct _D3DKMT_OPENADAPTERFROMLUID
46{
47 LUID AdapterLuid;
48 D3DKMT_HANDLE hAdapter;
49} D3DKMT_OPENADAPTERFROMLUID;
50
51typedef NTSTATUS (APIENTRY *PFND3DKMT_OPENADAPTERFROMLUID)(IN OUT D3DKMT_OPENADAPTERFROMLUID*);
52/* END OF win8 release preview-specific stuff */
53
54typedef enum
55{
56 VBOXDISPKMT_CALLBACKS_VERSION_UNDEFINED = 0,
57 VBOXDISPKMT_CALLBACKS_VERSION_VISTA_WIN7,
58 VBOXDISPKMT_CALLBACKS_VERSION_WIN8
59} VBOXDISPKMT_CALLBACKS_VERSION;
60
61typedef struct VBOXDISPKMT_CALLBACKS
62{
63 HMODULE hGdi32;
64 VBOXDISPKMT_CALLBACKS_VERSION enmVersion;
65 /* open adapter */
66 PFND3DKMT_OPENADAPTERFROMHDC pfnD3DKMTOpenAdapterFromHdc;
67 PFND3DKMT_OPENADAPTERFROMGDIDISPLAYNAME pfnD3DKMTOpenAdapterFromGdiDisplayName;
68 /* close adapter */
69 PFND3DKMT_CLOSEADAPTER pfnD3DKMTCloseAdapter;
70 /* escape */
71 PFND3DKMT_ESCAPE pfnD3DKMTEscape;
72
73 PFND3DKMT_QUERYADAPTERINFO pfnD3DKMTQueryAdapterInfo;
74
75 PFND3DKMT_CREATEDEVICE pfnD3DKMTCreateDevice;
76 PFND3DKMT_DESTROYDEVICE pfnD3DKMTDestroyDevice;
77 PFND3DKMT_CREATECONTEXT pfnD3DKMTCreateContext;
78 PFND3DKMT_DESTROYCONTEXT pfnD3DKMTDestroyContext;
79
80 PFND3DKMT_RENDER pfnD3DKMTRender;
81
82 PFND3DKMT_CREATEALLOCATION pfnD3DKMTCreateAllocation;
83 PFND3DKMT_DESTROYALLOCATION pfnD3DKMTDestroyAllocation;
84
85 PFND3DKMT_LOCK pfnD3DKMTLock;
86 PFND3DKMT_UNLOCK pfnD3DKMTUnlock;
87
88 /* auto resize support */
89 PFND3DKMT_INVALIDATEACTIVEVIDPN pfnD3DKMTInvalidateActiveVidPn;
90 PFND3DKMT_POLLDISPLAYCHILDREN pfnD3DKMTPollDisplayChildren;
91
92 /* win8 specifics */
93 PFND3DKMT_ENUMADAPTERS pfnD3DKMTEnumAdapters;
94 PFND3DKMT_OPENADAPTERFROMLUID pfnD3DKMTOpenAdapterFromLuid;
95} VBOXDISPKMT_CALLBACKS, *PVBOXDISPKMT_CALLBACKS;
96
97typedef struct VBOXDISPKMT_ADAPTER
98{
99 D3DKMT_HANDLE hAdapter;
100 HDC hDc;
101 LUID Luid;
102 const VBOXDISPKMT_CALLBACKS *pCallbacks;
103}VBOXDISPKMT_ADAPTER, *PVBOXDISPKMT_ADAPTER;
104
105typedef struct VBOXDISPKMT_DEVICE
106{
107 struct VBOXDISPKMT_ADAPTER *pAdapter;
108 D3DKMT_HANDLE hDevice;
109 VOID *pCommandBuffer;
110 UINT CommandBufferSize;
111 D3DDDI_ALLOCATIONLIST *pAllocationList;
112 UINT AllocationListSize;
113 D3DDDI_PATCHLOCATIONLIST *pPatchLocationList;
114 UINT PatchLocationListSize;
115}VBOXDISPKMT_DEVICE, *PVBOXDISPKMT_DEVICE;
116
117typedef struct VBOXDISPKMT_CONTEXT
118{
119 struct VBOXDISPKMT_DEVICE *pDevice;
120 D3DKMT_HANDLE hContext;
121 VOID *pCommandBuffer;
122 UINT CommandBufferSize;
123 D3DDDI_ALLOCATIONLIST *pAllocationList;
124 UINT AllocationListSize;
125 D3DDDI_PATCHLOCATIONLIST *pPatchLocationList;
126 UINT PatchLocationListSize;
127} VBOXDISPKMT_CONTEXT, *PVBOXDISPKMT_CONTEXT;
128
129HRESULT vboxDispKmtCallbacksInit(PVBOXDISPKMT_CALLBACKS pCallbacks);
130HRESULT vboxDispKmtCallbacksTerm(PVBOXDISPKMT_CALLBACKS pCallbacks);
131
132HRESULT vboxDispKmtOpenAdapter(const VBOXDISPKMT_CALLBACKS *pCallbacks, PVBOXDISPKMT_ADAPTER pAdapter);
133HRESULT vboxDispKmtCloseAdapter(PVBOXDISPKMT_ADAPTER pAdapter);
134HRESULT vboxDispKmtCreateDevice(PVBOXDISPKMT_ADAPTER pAdapter, PVBOXDISPKMT_DEVICE pDevice);
135HRESULT vboxDispKmtDestroyDevice(PVBOXDISPKMT_DEVICE pDevice);
136HRESULT vboxDispKmtCreateContext(PVBOXDISPKMT_DEVICE pDevice, PVBOXDISPKMT_CONTEXT pContext,
137 VBOXWDDM_CONTEXT_TYPE enmType,
138 uint32_t crVersionMajor, uint32_t crVersionMinor,
139 HANDLE hEvent, uint64_t u64UmInfo);
140HRESULT vboxDispKmtDestroyContext(PVBOXDISPKMT_CONTEXT pContext);
141
142
143#endif /* #ifndef ___VBoxDispKmt_h__ */
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette