VirtualBox

source: vbox/trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoShgsmi.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: 3.9 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 ___VBoxVideoShgsmi_h___
17#define ___VBoxVideoShgsmi_h___
18
19#include <iprt/cdefs.h>
20#include <VBox/VBoxVideo.h>
21#include "../VBoxVideo.h"
22
23typedef DECLCALLBACK(void) FNVBOXSHGSMICMDCOMPLETION(struct _HGSMIHEAP * pHeap, void *pvCmd, void *pvContext);
24typedef FNVBOXSHGSMICMDCOMPLETION *PFNVBOXSHGSMICMDCOMPLETION;
25
26typedef DECLCALLBACK(void) FNVBOXSHGSMICMDCOMPLETION_IRQ(struct _HGSMIHEAP * pHeap, void *pvCmd, void *pvContext,
27 PFNVBOXSHGSMICMDCOMPLETION *ppfnCompletion, void **ppvCompletion);
28typedef FNVBOXSHGSMICMDCOMPLETION_IRQ *PFNVBOXSHGSMICMDCOMPLETION_IRQ;
29
30typedef struct VBOXSHGSMILIST_ENTRY
31{
32 struct VBOXSHGSMILIST_ENTRY *pNext;
33} VBOXSHGSMILIST_ENTRY, *PVBOXSHGSMILIST_ENTRY;
34
35typedef struct VBOXSHGSMILIST
36{
37 PVBOXSHGSMILIST_ENTRY pFirst;
38 PVBOXSHGSMILIST_ENTRY pLast;
39} VBOXSHGSMILIST, *PVBOXSHGSMILIST;
40
41DECLINLINE(bool) vboxSHGSMIListIsEmpty(PVBOXSHGSMILIST pList)
42{
43 return !pList->pFirst;
44}
45
46DECLINLINE(void) vboxSHGSMIListInit(PVBOXSHGSMILIST pList)
47{
48 pList->pFirst = pList->pLast = NULL;
49}
50
51DECLINLINE(void) vboxSHGSMIListPut(PVBOXSHGSMILIST pList, PVBOXSHGSMILIST_ENTRY pFirst, PVBOXSHGSMILIST_ENTRY pLast)
52{
53 Assert(pFirst);
54 Assert(pLast);
55 pLast->pNext = NULL;
56 if (pList->pLast)
57 {
58 Assert(pList->pFirst);
59 pList->pLast->pNext = pFirst;
60 pList->pLast = pLast;
61 }
62 else
63 {
64 Assert(!pList->pFirst);
65 pList->pFirst = pFirst;
66 pList->pLast = pLast;
67 }
68}
69
70DECLINLINE(void) vboxSHGSMIListCat(PVBOXSHGSMILIST pList1, PVBOXSHGSMILIST pList2)
71{
72 vboxSHGSMIListPut(pList1, pList2->pFirst, pList2->pLast);
73 pList2->pFirst = pList2->pLast = NULL;
74}
75
76DECLINLINE(void) vboxSHGSMICmdListDetach(PVBOXSHGSMILIST pList, PVBOXSHGSMILIST_ENTRY *ppFirst, PVBOXSHGSMILIST_ENTRY *ppLast)
77{
78 *ppFirst = pList->pFirst;
79 if (ppLast)
80 *ppLast = pList->pLast;
81 pList->pFirst = NULL;
82 pList->pLast = NULL;
83}
84
85DECLINLINE(void) vboxSHGSMICmdListDetach2List(PVBOXSHGSMILIST pList, PVBOXSHGSMILIST pDstList)
86{
87 vboxSHGSMICmdListDetach(pList, &pDstList->pFirst, &pDstList->pLast);
88}
89
90void VBoxSHGSMICommandSubmitAsynch (struct _HGSMIHEAP *pHeap, PVOID pvBuff, FNVBOXSHGSMICMDCOMPLETION pfnCompletion, PVOID pvCompletion, uint32_t fFlags);
91void VBoxSHGSMICommandSubmitAsynchIrq (struct _HGSMIHEAP * pHeap, PVOID pvBuff, PFNVBOXSHGSMICMDCOMPLETION_IRQ pfnCompletion, PVOID pvCompletion, uint32_t fFlags);
92void VBoxSHGSMICommandSubmitAsynchEvent (struct _HGSMIHEAP * pHeap, PVOID pvBuff, RTSEMEVENT hEventSem);
93int VBoxSHGSMICommandSubmitSynch (struct _HGSMIHEAP * pHeap, PVOID pCmd);
94int VBoxSHGSMICommandSubmitSynchCompletion (struct _HGSMIHEAP * pHeap, PVOID pCmd);
95void* VBoxSHGSMICommandAlloc (struct _HGSMIHEAP * pHeap, HGSMISIZE cbData, uint8_t u8Channel, uint16_t u16ChannelInfo);
96void VBoxSHGSMICommandFree (struct _HGSMIHEAP * pHeap, void *pvBuffer);
97int VBoxSHGSMICommandProcessCompletion (struct _HGSMIHEAP * pHeap, HGSMIOFFSET offCmd, bool bIrq, PVBOXSHGSMILIST pPostProcessList);
98int VBoxSHGSMICommandPostprocessCompletion (struct _HGSMIHEAP * pHeap, PVBOXSHGSMILIST pPostProcessList);
99
100void vboxSHGSMICbCommandWrite(struct _HGSMIHEAP * pHeap, HGSMIOFFSET data);
101
102#endif /* #ifndef ___VBoxVideoShgsmi_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