VirtualBox

source: vbox/trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoWddm.h@ 27606

Last change on this file since 27606 was 27606, checked in by vboxsync, 15 years ago

wddm: mouse pointer integration support (not tested)

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 4.6 KB
Line 
1/*
2 * Copyright (C) 2010 Sun Microsystems, Inc.
3 *
4 * This file is part of VirtualBox Open Source Edition (OSE), as
5 * available from http://www.virtualbox.org. This file is free software;
6 * you can redistribute it and/or modify it under the terms of the GNU
7 * General Public License (GPL) as published by the Free Software
8 * Foundation, in version 2 as it comes in the "COPYING" file of the
9 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
10 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
11 *
12 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
13 * Clara, CA 95054 USA or visit http://www.sun.com if you need
14 * additional information or have any questions.
15 */
16#ifndef ___VBoxVideoWddm_h___
17#define ___VBoxVideoWddm_h___
18
19/* one page size */
20#define VBOXWDDM_C_DMA_BUFFER_SIZE 0x1000
21#define VBOXWDDM_C_ALLOC_LIST_SIZE 0xc00
22#define VBOXWDDM_C_PATH_LOCATION_LIST_SIZE 0xc00
23
24#define VBOXWDDM_C_POINTER_MAX_WIDTH 64
25#define VBOXWDDM_C_POINTER_MAX_HEIGHT 64
26
27#define VBOXWDDM_ROUNDBOUND(_v, _b) (((_v) + ((_b) - 1)) & ~((_b) - 1))
28
29typedef enum
30{
31 VBOXWDDM_ALLOC_TYPE_UNEFINED = 0,
32 VBOXWDDM_ALLOC_TYPE_STD_SHAREDPRIMARYSURFACE,
33 VBOXWDDM_ALLOC_TYPE_STD_SHADOWSURFACE,
34 VBOXWDDM_ALLOC_TYPE_STD_STAGINGSURFACE,
35 /* this one is win 7-specific and hence unused for now */
36 VBOXWDDM_ALLOC_TYPE_STD_GDISURFACE
37 /* custom allocation types requested from user-mode d3d module will go here */
38} VBOXWDDM_ALLOC_TYPE;
39
40typedef struct VBOXWDDM_SURFACE_DESC
41{
42 UINT width;
43 UINT height;
44 D3DDDIFORMAT format;
45 UINT bpp;
46 UINT pitch;
47} VBOXWDDM_SURFACE_DESC, *PVBOXWDDM_SURFACE_DESC;
48
49typedef struct VBOXWDDM_ALLOCINFO
50{
51 VBOXWDDM_ALLOC_TYPE enmType;
52 union
53 {
54 VBOXWDDM_SURFACE_DESC SurfInfo;
55 } u;
56} VBOXWDDM_ALLOCINFO, *PVBOXWDDM_ALLOCINFO;
57
58#define VBOXWDDM_ALLOCINFO_HEADSIZE() (sizeof (VBOXWDDM_ALLOCINFO))
59#define VBOXWDDM_ALLOCINFO_SIZE_FROMBODYSIZE(_s) (VBOXWDDM_ALLOCINFO_HEADSIZE() + (_s))
60#define VBOXWDDM_ALLOCINFO_SIZE(_tCmd) (VBOXWDDM_ALLOCINFO_SIZE_FROMBODYSIZE(sizeof(_tCmd)))
61#define VBOXWDDM_ALLOCINFO_BODY(_p, _t) ( (_t*)(((uint8_t*)(_p)) + VBOXWDDM_ALLOCINFO_HEADSIZE()) )
62#define VBOXWDDM_ALLOCINFO_HEAD(_pb) ((VBOXWDDM_ALLOCINFO*)((uint8_t *)(_pb) - VBOXWDDM_ALLOCATION_HEADSIZE()))
63
64
65typedef struct VBOXWDDM_ALLOCINFO_SHAREDPRIMARYSURFACE
66{
67 D3DDDI_RATIONAL RefreshRate;
68 D3DDDI_VIDEO_PRESENT_SOURCE_ID VidPnSourceId;
69} VBOXWDDM_ALLOCINFO_SHAREDPRIMARYSURFACE, *PVBOXWDDM_ALLOCINFO_SHAREDPRIMARYSURFACE;
70
71/* allocation */
72typedef struct VBOXWDDM_ALLOCATION
73{
74 VBOXWDDM_ALLOC_TYPE enmType;
75 VBOXVIDEOOFFSET offVram;
76 UINT SegmentId;
77 union
78 {
79 VBOXWDDM_SURFACE_DESC SurfInfo;
80 } u;
81} VBOXWDDM_ALLOCATION, *PVBOXWDDM_ALLOCATION;
82
83#define VBOXWDDM_ALLOCATION_HEADSIZE() (sizeof (VBOXWDDM_ALLOCATION))
84#define VBOXWDDM_ALLOCATION_SIZE_FROMBODYSIZE(_s) (VBOXWDDM_ALLOCATION_HEADSIZE() + (_s))
85#define VBOXWDDM_ALLOCATION_SIZE(_tCmd) (VBOXWDDM_ALLOCATION_SIZE_FROMBODYSIZE(sizeof(_tCmd)))
86#define VBOXWDDM_ALLOCATION_BODY(_p, _t) ( (_t*)(((uint8_t*)(_p)) + VBOXWDDM_ALLOCATION_HEADSIZE()) )
87#define VBOXWDDM_ALLOCATION_HEAD(_pb) ((VBOXWDDM_ALLOCATION*)((uint8_t *)(_pb) - VBOXWDDM_ALLOCATION_HEADSIZE()))
88
89
90
91
92
93typedef struct VBOXWDDM_ALLOCATION_SHAREDPRIMARYSURFACE
94{
95 D3DDDI_RATIONAL RefreshRate;
96 D3DDDI_VIDEO_PRESENT_SOURCE_ID VidPnSourceId;
97// VBOXVIDEOOFFSET offAddress;
98 BOOLEAN bVisible;
99 BOOLEAN bAssigned;
100} VBOXWDDM_ALLOCATION_SHAREDPRIMARYSURFACE, *PVBOXWDDM_ALLOCATION_SHAREDPRIMARYSURFACE;
101
102typedef enum
103{
104 VBOXWDDM_DEVICE_TYPE_UNDEFINED = 0,
105 VBOXWDDM_DEVICE_TYPE_SYSTEM
106} VBOXWDDM_DEVICE_TYPE;
107
108typedef struct VBOXWDDM_DEVICE
109{
110 struct _DEVICE_EXTENSION * pAdapter; /* Adapder info */
111 HANDLE hDevice; /* handle passed to CreateDevice */
112 VBOXWDDM_DEVICE_TYPE enmType; /* device creation flags passed to DxgkDdiCreateDevice, not sure we need it */
113} VBOXWDDM_DEVICE, *PVBOXWDDM_DEVICE;
114
115typedef enum
116{
117 VBOXWDDM_CONTEXT_TYPE_UNDEFINED = 0,
118 VBOXWDDM_CONTEXT_TYPE_SYSTEM
119} VBOXWDDM_CONTEXT_TYPE;
120
121typedef struct VBOXWDDM_CONTEXT
122{
123 struct VBOXWDDM_DEVICE * pDevice;
124 HANDLE hContext;
125 VBOXWDDM_CONTEXT_TYPE enmType;
126 UINT NodeOrdinal;
127 UINT EngineAffinity;
128 UINT uLastCompletedCmdFenceId;
129} VBOXWDDM_CONTEXT, *PVBOXWDDM_CONTEXT;
130
131typedef struct VBOXWDDM_DMA_PRIVATE_DATA
132{
133 PVBOXWDDM_CONTEXT pContext;
134 uint8_t Reserved[8];
135}VBOXWDDM_DMA_PRIVATE_DATA, *PVBOXWDDM_DMA_PRIVATE_DATA;
136
137typedef struct VBOXWDDM_OPENALLOCATION
138{
139 D3DKMT_HANDLE hAllocation;
140} VBOXWDDM_OPENALLOCATION, *PVBOXWDDM_OPENALLOCATION;
141
142#endif /* #ifndef ___VBoxVideoWddm_h___ */
Note: See TracBrowser for help on using the repository browser.

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