1 | /* $Id: VBoxMPShgsmi.h 55421 2015-04-24 12:00:21Z vboxsync $ */
|
---|
2 |
|
---|
3 | /** @file
|
---|
4 | * VBox WDDM Miniport driver
|
---|
5 | */
|
---|
6 |
|
---|
7 | /*
|
---|
8 | * Copyright (C) 2011-2012 Oracle Corporation
|
---|
9 | *
|
---|
10 | * This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
11 | * available from http://www.virtualbox.org. This file is free software;
|
---|
12 | * you can redistribute it and/or modify it under the terms of the GNU
|
---|
13 | * General Public License (GPL) as published by the Free Software
|
---|
14 | * Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
15 | * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
16 | * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
17 | */
|
---|
18 |
|
---|
19 | #ifndef ___VBoxMPShgsmi_h___
|
---|
20 | #define ___VBoxMPShgsmi_h___
|
---|
21 |
|
---|
22 | #include <iprt/cdefs.h>
|
---|
23 | #include <VBox/VBoxVideo.h>
|
---|
24 |
|
---|
25 | #include "common/VBoxMPUtils.h"
|
---|
26 |
|
---|
27 | typedef struct VBOXSHGSMI
|
---|
28 | {
|
---|
29 | KSPIN_LOCK HeapLock;
|
---|
30 | HGSMIHEAP Heap;
|
---|
31 | } VBOXSHGSMI, *PVBOXSHGSMI;
|
---|
32 |
|
---|
33 | typedef DECLCALLBACK(void) FNVBOXSHGSMICMDCOMPLETION(PVBOXSHGSMI pHeap, void *pvCmd, void *pvContext);
|
---|
34 | typedef FNVBOXSHGSMICMDCOMPLETION *PFNVBOXSHGSMICMDCOMPLETION;
|
---|
35 |
|
---|
36 | typedef DECLCALLBACK(PFNVBOXSHGSMICMDCOMPLETION) FNVBOXSHGSMICMDCOMPLETION_IRQ(PVBOXSHGSMI pHeap, void *pvCmd, void *pvContext, void **ppvCompletion);
|
---|
37 | typedef FNVBOXSHGSMICMDCOMPLETION_IRQ *PFNVBOXSHGSMICMDCOMPLETION_IRQ;
|
---|
38 |
|
---|
39 |
|
---|
40 | const VBOXSHGSMIHEADER* VBoxSHGSMICommandPrepAsynchEvent(PVBOXSHGSMI pHeap, PVOID pvBuff, RTSEMEVENT hEventSem);
|
---|
41 | const VBOXSHGSMIHEADER* VBoxSHGSMICommandPrepSynch(PVBOXSHGSMI pHeap, PVOID pCmd);
|
---|
42 | const VBOXSHGSMIHEADER* VBoxSHGSMICommandPrepAsynch(PVBOXSHGSMI pHeap, PVOID pvBuff, PFNVBOXSHGSMICMDCOMPLETION pfnCompletion, PVOID pvCompletion, uint32_t fFlags);
|
---|
43 | const VBOXSHGSMIHEADER* VBoxSHGSMICommandPrepAsynchIrq(PVBOXSHGSMI pHeap, PVOID pvBuff, PFNVBOXSHGSMICMDCOMPLETION_IRQ pfnCompletion, PVOID pvCompletion, uint32_t fFlags);
|
---|
44 |
|
---|
45 | void VBoxSHGSMICommandDoneAsynch(PVBOXSHGSMI pHeap, const VBOXSHGSMIHEADER* pHeader);
|
---|
46 | int VBoxSHGSMICommandDoneSynch(PVBOXSHGSMI pHeap, const VBOXSHGSMIHEADER* pHeader);
|
---|
47 | void VBoxSHGSMICommandCancelAsynch(PVBOXSHGSMI pHeap, const VBOXSHGSMIHEADER* pHeader);
|
---|
48 | void VBoxSHGSMICommandCancelSynch(PVBOXSHGSMI pHeap, const VBOXSHGSMIHEADER* pHeader);
|
---|
49 |
|
---|
50 | DECLINLINE(HGSMIOFFSET) VBoxSHGSMICommandOffset(const PVBOXSHGSMI pHeap, const VBOXSHGSMIHEADER* pHeader)
|
---|
51 | {
|
---|
52 | return HGSMIHeapBufferOffset(&pHeap->Heap, (void*)pHeader);
|
---|
53 | }
|
---|
54 |
|
---|
55 | /* allows getting VRAM offset of arbitrary pointer within the SHGSMI command
|
---|
56 | * if invalid pointer is passed in, behavior is undefined */
|
---|
57 | DECLINLINE(HGSMIOFFSET) VBoxSHGSMICommandPtrOffset(const PVBOXSHGSMI pHeap, const void * pvPtr)
|
---|
58 | {
|
---|
59 | return HGSMIPointerToOffset (&pHeap->Heap.area, (const HGSMIBUFFERHEADER *)pvPtr);
|
---|
60 | }
|
---|
61 |
|
---|
62 | int VBoxSHGSMIInit(PVBOXSHGSMI pHeap, void *pvBase, HGSMISIZE cbArea, HGSMIOFFSET offBase, const HGSMIENV *pEnv);
|
---|
63 | void VBoxSHGSMITerm(PVBOXSHGSMI pHeap);
|
---|
64 | void* VBoxSHGSMIHeapAlloc(PVBOXSHGSMI pHeap, HGSMISIZE cbData, uint8_t u8Channel, uint16_t u16ChannelInfo);
|
---|
65 | void VBoxSHGSMIHeapFree(PVBOXSHGSMI pHeap, void *pvBuffer);
|
---|
66 | void* VBoxSHGSMIHeapBufferAlloc(PVBOXSHGSMI pHeap, HGSMISIZE cbData);
|
---|
67 | void VBoxSHGSMIHeapBufferFree(PVBOXSHGSMI pHeap, void *pvBuffer);
|
---|
68 | void* VBoxSHGSMICommandAlloc(PVBOXSHGSMI pHeap, HGSMISIZE cbData, uint8_t u8Channel, uint16_t u16ChannelInfo);
|
---|
69 | void VBoxSHGSMICommandFree(PVBOXSHGSMI pHeap, void *pvBuffer);
|
---|
70 | int VBoxSHGSMICommandProcessCompletion(PVBOXSHGSMI pHeap, VBOXSHGSMIHEADER* pCmd, bool bIrq, struct VBOXVTLIST * pPostProcessList);
|
---|
71 | int VBoxSHGSMICommandPostprocessCompletion(PVBOXSHGSMI pHeap, struct VBOXVTLIST * pPostProcessList);
|
---|
72 |
|
---|
73 | #endif /* #ifndef ___VBoxMPShgsmi_h___ */
|
---|