VirtualBox

source: vbox/trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoShgsmi.h@ 30462

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

wddm/3d: basics for visible regions handling

  • 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 ___VBoxVideoShgsmi_h___
13#define ___VBoxVideoShgsmi_h___
14
15#include <iprt/cdefs.h>
16#include <VBox/VBoxVideo.h>
17#include "../VBoxVideo.h"
18
19typedef DECLCALLBACK(void) FNVBOXSHGSMICMDCOMPLETION(struct _HGSMIHEAP * pHeap, void *pvCmd, void *pvContext);
20typedef FNVBOXSHGSMICMDCOMPLETION *PFNVBOXSHGSMICMDCOMPLETION;
21
22typedef DECLCALLBACK(void) FNVBOXSHGSMICMDCOMPLETION_IRQ(struct _HGSMIHEAP * pHeap, void *pvCmd, void *pvContext,
23 PFNVBOXSHGSMICMDCOMPLETION *ppfnCompletion, void **ppvCompletion);
24typedef FNVBOXSHGSMICMDCOMPLETION_IRQ *PFNVBOXSHGSMICMDCOMPLETION_IRQ;
25
26typedef struct VBOXSHGSMILIST_ENTRY
27{
28 struct VBOXSHGSMILIST_ENTRY *pNext;
29} VBOXSHGSMILIST_ENTRY, *PVBOXSHGSMILIST_ENTRY;
30
31typedef struct VBOXSHGSMILIST
32{
33 PVBOXSHGSMILIST_ENTRY pFirst;
34 PVBOXSHGSMILIST_ENTRY pLast;
35} VBOXSHGSMILIST, *PVBOXSHGSMILIST;
36
37DECLINLINE(bool) vboxSHGSMIListIsEmpty(PVBOXSHGSMILIST pList)
38{
39 return !pList->pFirst;
40}
41
42DECLINLINE(void) vboxSHGSMIListInit(PVBOXSHGSMILIST pList)
43{
44 pList->pFirst = pList->pLast = NULL;
45}
46
47DECLINLINE(void) vboxSHGSMIListPut(PVBOXSHGSMILIST pList, PVBOXSHGSMILIST_ENTRY pFirst, PVBOXSHGSMILIST_ENTRY pLast)
48{
49 Assert(pFirst);
50 Assert(pLast);
51 pLast->pNext = NULL;
52 if (pList->pLast)
53 {
54 Assert(pList->pFirst);
55 pList->pLast->pNext = pFirst;
56 pList->pLast = pLast;
57 }
58 else
59 {
60 Assert(!pList->pFirst);
61 pList->pFirst = pFirst;
62 pList->pLast = pLast;
63 }
64}
65
66DECLINLINE(void) vboxSHGSMIListCat(PVBOXSHGSMILIST pList1, PVBOXSHGSMILIST pList2)
67{
68 vboxSHGSMIListPut(pList1, pList2->pFirst, pList2->pLast);
69 pList2->pFirst = pList2->pLast = NULL;
70}
71
72DECLINLINE(void) vboxSHGSMIListDetach(PVBOXSHGSMILIST pList, PVBOXSHGSMILIST_ENTRY *ppFirst, PVBOXSHGSMILIST_ENTRY *ppLast)
73{
74 *ppFirst = pList->pFirst;
75 if (ppLast)
76 *ppLast = pList->pLast;
77 pList->pFirst = NULL;
78 pList->pLast = NULL;
79}
80
81DECLINLINE(void) vboxSHGSMIListDetach2List(PVBOXSHGSMILIST pList, PVBOXSHGSMILIST pDstList)
82{
83 vboxSHGSMIListDetach(pList, &pDstList->pFirst, &pDstList->pLast);
84}
85
86DECLINLINE(void) vboxSHGSMIListDetachEntries(PVBOXSHGSMILIST pList, PVBOXSHGSMILIST_ENTRY pBeforeDetach, PVBOXSHGSMILIST_ENTRY pLast2Detach)
87{
88 if (pBeforeDetach)
89 {
90 pBeforeDetach->pNext = pLast2Detach->pNext;
91 if (!pBeforeDetach->pNext)
92 pList->pLast = pBeforeDetach;
93 }
94 else
95 {
96 pList->pFirst = pLast2Detach->pNext;
97 if (!pList->pFirst)
98 pList->pLast = NULL;
99 }
100 pLast2Detach->pNext = NULL;
101}
102
103
104const VBOXSHGSMIHEADER* VBoxSHGSMICommandPrepAsynchEvent(struct _HGSMIHEAP * pHeap, PVOID pvBuff, RTSEMEVENT hEventSem);
105const VBOXSHGSMIHEADER* VBoxSHGSMICommandPrepSynch(struct _HGSMIHEAP * pHeap, PVOID pCmd);
106const VBOXSHGSMIHEADER* VBoxSHGSMICommandPrepAsynch(struct _HGSMIHEAP * pHeap, PVOID pvBuff, PFNVBOXSHGSMICMDCOMPLETION pfnCompletion, PVOID pvCompletion, uint32_t fFlags);
107const VBOXSHGSMIHEADER* VBoxSHGSMICommandPrepAsynchIrq(struct _HGSMIHEAP * pHeap, PVOID pvBuff, PFNVBOXSHGSMICMDCOMPLETION_IRQ pfnCompletion, PVOID pvCompletion, uint32_t fFlags);
108
109void VBoxSHGSMICommandDoneAsynch(struct _HGSMIHEAP * pHeap, const VBOXSHGSMIHEADER* pHeader);
110int VBoxSHGSMICommandDoneSynch(struct _HGSMIHEAP * pHeap, const VBOXSHGSMIHEADER* pHeader);
111void VBoxSHGSMICommandCancelAsynch(struct _HGSMIHEAP * pHeap, const VBOXSHGSMIHEADER* pHeader);
112void VBoxSHGSMICommandCancelSynch(struct _HGSMIHEAP * pHeap, const VBOXSHGSMIHEADER* pHeader);
113
114DECLINLINE(HGSMIOFFSET) VBoxSHGSMICommandOffset(struct _HGSMIHEAP * pHeap, const VBOXSHGSMIHEADER* pHeader)
115{
116 return HGSMIHeapBufferOffset(pHeap, (void*)pHeader);
117}
118
119void* VBoxSHGSMICommandAlloc(struct _HGSMIHEAP * pHeap, HGSMISIZE cbData, uint8_t u8Channel, uint16_t u16ChannelInfo);
120void VBoxSHGSMICommandFree(struct _HGSMIHEAP * pHeap, void *pvBuffer);
121int VBoxSHGSMICommandProcessCompletion(struct _HGSMIHEAP * pHeap, VBOXSHGSMIHEADER* pCmd, bool bIrq, PVBOXSHGSMILIST pPostProcessList);
122int VBoxSHGSMICommandPostprocessCompletion(struct _HGSMIHEAP * pHeap, PVBOXSHGSMILIST pPostProcessList);
123
124#endif /* #ifndef ___VBoxVideoShgsmi_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