VirtualBox

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

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

wddm: more correct visible VRAM size reporting + some cleaning

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 4.8 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#include "../VBoxVideo.h"
20
21/* one page size */
22#define VBOXWDDM_C_DMA_BUFFER_SIZE 0x1000
23#define VBOXWDDM_C_ALLOC_LIST_SIZE 0xc00
24#define VBOXWDDM_C_PATH_LOCATION_LIST_SIZE 0xc00
25
26#define VBOXWDDM_C_POINTER_MAX_WIDTH 64
27#define VBOXWDDM_C_POINTER_MAX_HEIGHT 64
28
29#define VBOXWDDM_C_VDMA_BUFFER_SIZE (64*_1K)
30
31//#define VBOXWDDM_WITH_FAKE_SEGMENT
32
33#define VBOXWDDM_ROUNDBOUND(_v, _b) (((_v) + ((_b) - 1)) & ~((_b) - 1))
34
35PVOID vboxWddmMemAlloc(IN SIZE_T cbSize);
36PVOID vboxWddmMemAllocZero(IN SIZE_T cbSize);
37VOID vboxWddmMemFree(PVOID pvMem);
38
39typedef enum
40{
41 VBOXWDDM_ALLOC_TYPE_UNEFINED = 0,
42 VBOXWDDM_ALLOC_TYPE_STD_SHAREDPRIMARYSURFACE,
43 VBOXWDDM_ALLOC_TYPE_STD_SHADOWSURFACE,
44 VBOXWDDM_ALLOC_TYPE_STD_STAGINGSURFACE,
45 /* this one is win 7-specific and hence unused for now */
46 VBOXWDDM_ALLOC_TYPE_STD_GDISURFACE
47 /* custom allocation types requested from user-mode d3d module will go here */
48} VBOXWDDM_ALLOC_TYPE;
49
50typedef struct VBOXWDDM_SURFACE_DESC
51{
52 UINT width;
53 UINT height;
54 D3DDDIFORMAT format;
55 UINT bpp;
56 UINT pitch;
57} VBOXWDDM_SURFACE_DESC, *PVBOXWDDM_SURFACE_DESC;
58
59typedef struct VBOXWDDM_ALLOCINFO
60{
61 VBOXWDDM_ALLOC_TYPE enmType;
62 union
63 {
64 VBOXWDDM_SURFACE_DESC SurfInfo;
65 } u;
66} VBOXWDDM_ALLOCINFO, *PVBOXWDDM_ALLOCINFO;
67
68#define VBOXWDDM_ALLOCINFO_HEADSIZE() (sizeof (VBOXWDDM_ALLOCINFO))
69#define VBOXWDDM_ALLOCINFO_SIZE_FROMBODYSIZE(_s) (VBOXWDDM_ALLOCINFO_HEADSIZE() + (_s))
70#define VBOXWDDM_ALLOCINFO_SIZE(_tCmd) (VBOXWDDM_ALLOCINFO_SIZE_FROMBODYSIZE(sizeof(_tCmd)))
71#define VBOXWDDM_ALLOCINFO_BODY(_p, _t) ( (_t*)(((uint8_t*)(_p)) + VBOXWDDM_ALLOCINFO_HEADSIZE()) )
72#define VBOXWDDM_ALLOCINFO_HEAD(_pb) ((VBOXWDDM_ALLOCINFO*)((uint8_t *)(_pb) - VBOXWDDM_ALLOCATION_HEADSIZE()))
73
74
75typedef struct VBOXWDDM_ALLOCINFO_SHAREDPRIMARYSURFACE
76{
77 D3DDDI_RATIONAL RefreshRate;
78 D3DDDI_VIDEO_PRESENT_SOURCE_ID VidPnSourceId;
79} VBOXWDDM_ALLOCINFO_SHAREDPRIMARYSURFACE, *PVBOXWDDM_ALLOCINFO_SHAREDPRIMARYSURFACE;
80
81/* allocation */
82typedef struct VBOXWDDM_ALLOCATION
83{
84 VBOXWDDM_ALLOC_TYPE enmType;
85 VBOXVIDEOOFFSET offVram;
86 UINT SegmentId;
87 union
88 {
89 VBOXWDDM_SURFACE_DESC SurfInfo;
90 } u;
91} VBOXWDDM_ALLOCATION, *PVBOXWDDM_ALLOCATION;
92
93#define VBOXWDDM_ALLOCATION_HEADSIZE() (sizeof (VBOXWDDM_ALLOCATION))
94#define VBOXWDDM_ALLOCATION_SIZE_FROMBODYSIZE(_s) (VBOXWDDM_ALLOCATION_HEADSIZE() + (_s))
95#define VBOXWDDM_ALLOCATION_SIZE(_tCmd) (VBOXWDDM_ALLOCATION_SIZE_FROMBODYSIZE(sizeof(_tCmd)))
96#define VBOXWDDM_ALLOCATION_BODY(_p, _t) ( (_t*)(((uint8_t*)(_p)) + VBOXWDDM_ALLOCATION_HEADSIZE()) )
97#define VBOXWDDM_ALLOCATION_HEAD(_pb) ((VBOXWDDM_ALLOCATION*)((uint8_t *)(_pb) - VBOXWDDM_ALLOCATION_HEADSIZE()))
98
99
100
101
102
103typedef struct VBOXWDDM_ALLOCATION_SHAREDPRIMARYSURFACE
104{
105 D3DDDI_RATIONAL RefreshRate;
106 D3DDDI_VIDEO_PRESENT_SOURCE_ID VidPnSourceId;
107// VBOXVIDEOOFFSET offAddress;
108 BOOLEAN bVisible;
109 BOOLEAN bAssigned;
110} VBOXWDDM_ALLOCATION_SHAREDPRIMARYSURFACE, *PVBOXWDDM_ALLOCATION_SHAREDPRIMARYSURFACE;
111
112typedef enum
113{
114 VBOXWDDM_DEVICE_TYPE_UNDEFINED = 0,
115 VBOXWDDM_DEVICE_TYPE_SYSTEM
116} VBOXWDDM_DEVICE_TYPE;
117
118typedef struct VBOXWDDM_DEVICE
119{
120 struct _DEVICE_EXTENSION * pAdapter; /* Adapder info */
121 HANDLE hDevice; /* handle passed to CreateDevice */
122 VBOXWDDM_DEVICE_TYPE enmType; /* device creation flags passed to DxgkDdiCreateDevice, not sure we need it */
123} VBOXWDDM_DEVICE, *PVBOXWDDM_DEVICE;
124
125typedef enum
126{
127 VBOXWDDM_CONTEXT_TYPE_UNDEFINED = 0,
128 VBOXWDDM_CONTEXT_TYPE_SYSTEM
129} VBOXWDDM_CONTEXT_TYPE;
130
131typedef struct VBOXWDDM_CONTEXT
132{
133 struct VBOXWDDM_DEVICE * pDevice;
134 HANDLE hContext;
135 VBOXWDDM_CONTEXT_TYPE enmType;
136 UINT NodeOrdinal;
137 UINT EngineAffinity;
138 UINT uLastCompletedCmdFenceId;
139} VBOXWDDM_CONTEXT, *PVBOXWDDM_CONTEXT;
140
141typedef struct VBOXWDDM_DMA_PRIVATE_DATA
142{
143 PVBOXWDDM_CONTEXT pContext;
144 uint8_t Reserved[8];
145}VBOXWDDM_DMA_PRIVATE_DATA, *PVBOXWDDM_DMA_PRIVATE_DATA;
146
147typedef struct VBOXWDDM_OPENALLOCATION
148{
149 D3DKMT_HANDLE hAllocation;
150} VBOXWDDM_OPENALLOCATION, *PVBOXWDDM_OPENALLOCATION;
151
152#endif /* #ifndef ___VBoxVideoWddm_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