VirtualBox

source: vbox/trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoVdma.h@ 32496

Last change on this file since 32496 was 32496, checked in by vboxsync, 14 years ago

wddm/3d: multi-swapchain fixes (for win7 & multi-monitor)

  • 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 Oracle Corporation
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#ifndef ___VBoxVideoVdma_h___
13#define ___VBoxVideoVdma_h___
14
15#include <iprt/cdefs.h>
16#include <VBox/VBoxVideo.h>
17#include "../VBoxVideo.h"
18
19#if 0
20typedef DECLCALLBACK(int) FNVBOXVDMASUBMIT(struct _DEVICE_EXTENSION* pDevExt, struct VBOXVDMAINFO * pInfo, HGSMIOFFSET offDr, PVOID pvContext);
21typedef FNVBOXVDMASUBMIT *PFNVBOXVDMASUBMIT;
22
23typedef struct VBOXVDMASUBMIT
24{
25 PFNVBOXVDMASUBMIT pfnSubmit;
26 PVOID pvContext;
27} VBOXVDMASUBMIT, *PVBOXVDMASUBMIT;
28#endif
29
30/* start */
31typedef enum
32{
33 VBOXVDMAPIPE_STATE_CLOSED = 0,
34 VBOXVDMAPIPE_STATE_CREATED = 1,
35 VBOXVDMAPIPE_STATE_OPENNED = 2,
36 VBOXVDMAPIPE_STATE_CLOSING = 3
37} VBOXVDMAPIPE_STATE;
38
39typedef struct VBOXVDMAPIPE
40{
41 KSPIN_LOCK SinchLock;
42 KEVENT Event;
43 LIST_ENTRY CmdListHead;
44 VBOXVDMAPIPE_STATE enmState;
45 /* true iff the other end needs Event notification */
46 bool bNeedNotify;
47} VBOXVDMAPIPE, *PVBOXVDMAPIPE;
48
49typedef struct VBOXVDMAPIPE_CMD_HDR
50{
51 LIST_ENTRY ListEntry;
52} VBOXVDMAPIPE_CMD_HDR, *PVBOXVDMAPIPE_CMD_HDR;
53
54#define VBOXVDMAPIPE_CMD_HDR_FROM_ENTRY(_pE) ( (PVBOXVDMAPIPE_CMD_HDR)((uint8_t *)(_pE) - RT_OFFSETOF(VBOXVDMAPIPE_CMD_HDR, ListEntry)) )
55
56typedef enum
57{
58 VBOXVDMAPIPE_CMD_TYPE_UNDEFINED = 0,
59 VBOXVDMAPIPE_CMD_TYPE_RECTSINFO = 1,
60 VBOXVDMAPIPE_CMD_TYPE_DMACMD_CLRFILL = 2
61} VBOXVDMAPIPE_CMD_TYPE;
62
63typedef struct VBOXVDMAPIPE_CMD_DR
64{
65 VBOXVDMAPIPE_CMD_HDR PipeHdr;
66 VBOXVDMAPIPE_CMD_TYPE enmType;
67} VBOXVDMAPIPE_CMD_DR, *PVBOXVDMAPIPE_CMD_DR;
68
69#define VBOXVDMAPIPE_CMD_DR_FROM_ENTRY(_pE) ( (PVBOXVDMAPIPE_CMD_DR)VBOXVDMAPIPE_CMD_HDR_FROM_ENTRY(_pE) )
70
71typedef struct VBOXVDMAPIPE_RECTS
72{
73 RECT ContextRect;
74 VBOXWDDM_RECTS_INFO UpdateRects;
75} VBOXVDMAPIPE_RECTS, *PVBOXVDMAPIPE_RECTS;
76
77typedef struct VBOXVDMAPIPE_CMD_RECTSINFO
78{
79 VBOXVDMAPIPE_CMD_DR Hdr;
80 struct VBOXWDDM_CONTEXT *pContext;
81 struct VBOXWDDM_SWAPCHAIN *pSwapchain;
82 VBOXVDMAPIPE_RECTS ContextsRects;
83} VBOXVDMAPIPE_CMD_RECTSINFO, *PVBOXVDMAPIPE_CMD_RECTSINFO;
84
85typedef struct VBOXVDMAPIPE_CMD_DMACMD_CLRFILL
86{
87 VBOXVDMAPIPE_CMD_DR Hdr;
88 struct VBOXWDDM_CONTEXT *pContext;
89 struct VBOXWDDM_ALLOCATION *pAllocation;
90 UINT SubmissionFenceId;
91 D3DDDI_VIDEO_PRESENT_SOURCE_ID VidPnSourceId;
92 UINT Color;
93 VBOXWDDM_RECTS_INFO Rects;
94} VBOXVDMAPIPE_CMD_DMACMD_CLRFILL, *PVBOXVDMAPIPE_CMD_DMACMD_CLRFILL;
95
96typedef struct VBOXVDMAGG
97{
98 VBOXVDMAPIPE CmdPipe;
99 PKTHREAD pThread;
100} VBOXVDMAGG, *PVBOXVDMAGG;
101
102/* DMA commands are currently submitted over HGSMI */
103typedef struct VBOXVDMAINFO
104{
105#ifdef VBOXVDMA
106 HGSMIHEAP CmdHeap;
107#endif
108 UINT uLastCompletedPagingBufferCmdFenceId;
109 BOOL fEnabled;
110#if 0
111 VBOXVDMASUBMIT Submitter;
112#endif
113 /* dma-related commands list processed on the guest w/o host part involvement (guest-guest commands) */
114 VBOXVDMAGG DmaGg;
115} VBOXVDMAINFO, *PVBOXVDMAINFO;
116
117int vboxVdmaCreate (struct _DEVICE_EXTENSION* pDevExt, VBOXVDMAINFO *pInfo
118#ifdef VBOXVDMA
119 , ULONG offBuffer, ULONG cbBuffer
120#endif
121#if 0
122 , PFNVBOXVDMASUBMIT pfnSubmit, PVOID pvContext
123#endif
124 );
125int vboxVdmaDisable (struct _DEVICE_EXTENSION* pDevExt, PVBOXVDMAINFO pInfo);
126int vboxVdmaEnable (struct _DEVICE_EXTENSION* pDevExt, PVBOXVDMAINFO pInfo);
127int vboxVdmaDestroy (struct _DEVICE_EXTENSION* pDevExt, PVBOXVDMAINFO pInfo);
128
129#ifdef VBOXVDMA
130int vboxVdmaFlush (struct _DEVICE_EXTENSION* pDevExt, PVBOXVDMAINFO pInfo);
131int vboxVdmaCBufDrSubmit (struct _DEVICE_EXTENSION* pDevExt, PVBOXVDMAINFO pInfo, PVBOXVDMACBUF_DR pDr);
132struct VBOXVDMACBUF_DR* vboxVdmaCBufDrCreate (PVBOXVDMAINFO pInfo, uint32_t cbTrailingData);
133void vboxVdmaCBufDrFree (PVBOXVDMAINFO pInfo, struct VBOXVDMACBUF_DR* pDr);
134
135#define VBOXVDMACBUF_DR_DATA_OFFSET() (sizeof (VBOXVDMACBUF_DR))
136#define VBOXVDMACBUF_DR_SIZE(_cbData) (VBOXVDMACBUF_DR_DATA_OFFSET() + (_cbData))
137#define VBOXVDMACBUF_DR_DATA(_pDr) ( ((uint8_t*)(_pDr)) + VBOXVDMACBUF_DR_DATA_OFFSET() )
138#endif
139NTSTATUS vboxVdmaGgCmdSubmit(PVBOXVDMAGG pVdma, PVBOXVDMAPIPE_CMD_DR pCmd);
140PVBOXVDMAPIPE_CMD_DR vboxVdmaGgCmdCreate(PVBOXVDMAGG pVdma, VBOXVDMAPIPE_CMD_TYPE enmType, uint32_t cbCmd);
141void vboxVdmaGgCmdDestroy(PVBOXVDMAPIPE_CMD_DR pDr);
142
143#endif /* #ifndef ___VBoxVideoVdma_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