1 | /* $Id: VBoxUhgsmi.h 76585 2019-01-01 06:31:29Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * Document me, pretty please.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2010-2019 Oracle Corporation
|
---|
8 | *
|
---|
9 | * This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
10 | * available from http://www.virtualbox.org. This file is free software;
|
---|
11 | * you can redistribute it and/or modify it under the terms of the GNU
|
---|
12 | * General Public License (GPL) as published by the Free Software
|
---|
13 | * Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
14 | * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
15 | * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
16 | *
|
---|
17 | * The contents of this file may alternatively be used under the terms
|
---|
18 | * of the Common Development and Distribution License Version 1.0
|
---|
19 | * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
|
---|
20 | * VirtualBox OSE distribution, in which case the provisions of the
|
---|
21 | * CDDL are applicable instead of those of the GPL.
|
---|
22 | *
|
---|
23 | * You may elect to license modified versions of this file under the
|
---|
24 | * terms and conditions of either the GPL or the CDDL or both.
|
---|
25 | */
|
---|
26 |
|
---|
27 | #ifndef VBOX_INCLUDED_Graphics_VBoxUhgsmi_h
|
---|
28 | #define VBOX_INCLUDED_Graphics_VBoxUhgsmi_h
|
---|
29 | #ifndef RT_WITHOUT_PRAGMA_ONCE
|
---|
30 | # pragma once
|
---|
31 | #endif
|
---|
32 |
|
---|
33 | #include <iprt/cdefs.h>
|
---|
34 | #include <iprt/types.h>
|
---|
35 |
|
---|
36 | typedef struct VBOXUHGSMI *PVBOXUHGSMI;
|
---|
37 |
|
---|
38 | typedef struct VBOXUHGSMI_BUFFER *PVBOXUHGSMI_BUFFER;
|
---|
39 |
|
---|
40 | typedef union VBOXUHGSMI_BUFFER_TYPE_FLAGS
|
---|
41 | {
|
---|
42 | uint32_t Value;
|
---|
43 | struct
|
---|
44 | {
|
---|
45 | uint32_t fCommand : 1;
|
---|
46 | uint32_t Reserved : 31;
|
---|
47 | } s;
|
---|
48 | } VBOXUHGSMI_BUFFER_TYPE_FLAGS;
|
---|
49 |
|
---|
50 | typedef union VBOXUHGSMI_BUFFER_LOCK_FLAGS
|
---|
51 | {
|
---|
52 | uint32_t Value;
|
---|
53 | struct
|
---|
54 | {
|
---|
55 | uint32_t fReadOnly : 1;
|
---|
56 | uint32_t fWriteOnly : 1;
|
---|
57 | uint32_t fDonotWait : 1;
|
---|
58 | uint32_t fDiscard : 1;
|
---|
59 | uint32_t fLockEntire : 1;
|
---|
60 | uint32_t Reserved : 27;
|
---|
61 | } s;
|
---|
62 | } VBOXUHGSMI_BUFFER_LOCK_FLAGS;
|
---|
63 |
|
---|
64 | typedef union VBOXUHGSMI_BUFFER_SUBMIT_FLAGS
|
---|
65 | {
|
---|
66 | uint32_t Value;
|
---|
67 | struct
|
---|
68 | {
|
---|
69 | uint32_t fHostReadOnly : 1;
|
---|
70 | uint32_t fHostWriteOnly : 1;
|
---|
71 | uint32_t fDoNotRetire : 1; /**< the buffer will be used in a subsequent command */
|
---|
72 | uint32_t fEntireBuffer : 1;
|
---|
73 | uint32_t Reserved : 28;
|
---|
74 | } s;
|
---|
75 | } VBOXUHGSMI_BUFFER_SUBMIT_FLAGS, *PVBOXUHGSMI_BUFFER_SUBMIT_FLAGS;
|
---|
76 |
|
---|
77 | /* the caller can specify NULL as a hSynch and specify a valid enmSynchType to make UHGSMI create a proper object itself,
|
---|
78 | * */
|
---|
79 | typedef DECLCALLBACK(int) FNVBOXUHGSMI_BUFFER_CREATE(PVBOXUHGSMI pHgsmi, uint32_t cbBuf, VBOXUHGSMI_BUFFER_TYPE_FLAGS fType, PVBOXUHGSMI_BUFFER* ppBuf);
|
---|
80 | typedef FNVBOXUHGSMI_BUFFER_CREATE *PFNVBOXUHGSMI_BUFFER_CREATE;
|
---|
81 |
|
---|
82 | typedef struct VBOXUHGSMI_BUFFER_SUBMIT
|
---|
83 | {
|
---|
84 | PVBOXUHGSMI_BUFFER pBuf;
|
---|
85 | uint32_t offData;
|
---|
86 | uint32_t cbData;
|
---|
87 | VBOXUHGSMI_BUFFER_SUBMIT_FLAGS fFlags;
|
---|
88 | } VBOXUHGSMI_BUFFER_SUBMIT, *PVBOXUHGSMI_BUFFER_SUBMIT;
|
---|
89 |
|
---|
90 | typedef DECLCALLBACK(int) FNVBOXUHGSMI_BUFFER_SUBMIT(PVBOXUHGSMI pHgsmi, PVBOXUHGSMI_BUFFER_SUBMIT aBuffers, uint32_t cBuffers);
|
---|
91 | typedef FNVBOXUHGSMI_BUFFER_SUBMIT *PFNVBOXUHGSMI_BUFFER_SUBMIT;
|
---|
92 |
|
---|
93 | typedef DECLCALLBACK(int) FNVBOXUHGSMI_BUFFER_DESTROY(PVBOXUHGSMI_BUFFER pBuf);
|
---|
94 | typedef FNVBOXUHGSMI_BUFFER_DESTROY *PFNVBOXUHGSMI_BUFFER_DESTROY;
|
---|
95 |
|
---|
96 | typedef DECLCALLBACK(int) FNVBOXUHGSMI_BUFFER_LOCK(PVBOXUHGSMI_BUFFER pBuf, uint32_t offLock, uint32_t cbLock, VBOXUHGSMI_BUFFER_LOCK_FLAGS fFlags, void**pvLock);
|
---|
97 | typedef FNVBOXUHGSMI_BUFFER_LOCK *PFNVBOXUHGSMI_BUFFER_LOCK;
|
---|
98 |
|
---|
99 | typedef DECLCALLBACK(int) FNVBOXUHGSMI_BUFFER_UNLOCK(PVBOXUHGSMI_BUFFER pBuf);
|
---|
100 | typedef FNVBOXUHGSMI_BUFFER_UNLOCK *PFNVBOXUHGSMI_BUFFER_UNLOCK;
|
---|
101 |
|
---|
102 | typedef struct VBOXUHGSMI
|
---|
103 | {
|
---|
104 | PFNVBOXUHGSMI_BUFFER_CREATE pfnBufferCreate;
|
---|
105 | PFNVBOXUHGSMI_BUFFER_SUBMIT pfnBufferSubmit;
|
---|
106 | /** User custom data. */
|
---|
107 | void *pvUserData;
|
---|
108 | } VBOXUHGSMI;
|
---|
109 |
|
---|
110 | typedef struct VBOXUHGSMI_BUFFER
|
---|
111 | {
|
---|
112 | PFNVBOXUHGSMI_BUFFER_LOCK pfnLock;
|
---|
113 | PFNVBOXUHGSMI_BUFFER_UNLOCK pfnUnlock;
|
---|
114 | PFNVBOXUHGSMI_BUFFER_DESTROY pfnDestroy;
|
---|
115 |
|
---|
116 | /* r/o data added for ease of access and simplicity
|
---|
117 | * modifying it leads to unpredictable behavior */
|
---|
118 | VBOXUHGSMI_BUFFER_TYPE_FLAGS fType;
|
---|
119 | uint32_t cbBuffer;
|
---|
120 | /** User custom data. */
|
---|
121 | void *pvUserData;
|
---|
122 | } VBOXUHGSMI_BUFFER;
|
---|
123 |
|
---|
124 | #define VBoxUhgsmiBufferCreate(_pUhgsmi, _cbBuf, _fType, _ppBuf) ((_pUhgsmi)->pfnBufferCreate(_pUhgsmi, _cbBuf, _fType, _ppBuf))
|
---|
125 | #define VBoxUhgsmiBufferSubmit(_pUhgsmi, _aBuffers, _cBuffers) ((_pUhgsmi)->pfnBufferSubmit(_pUhgsmi, _aBuffers, _cBuffers))
|
---|
126 |
|
---|
127 | #define VBoxUhgsmiBufferLock(_pBuf, _offLock, _cbLock, _fFlags, _pvLock) ((_pBuf)->pfnLock(_pBuf, _offLock, _cbLock, _fFlags, _pvLock))
|
---|
128 | #define VBoxUhgsmiBufferUnlock(_pBuf) ((_pBuf)->pfnUnlock(_pBuf))
|
---|
129 | #define VBoxUhgsmiBufferDestroy(_pBuf) ((_pBuf)->pfnDestroy(_pBuf))
|
---|
130 |
|
---|
131 | #endif /* !VBOX_INCLUDED_Graphics_VBoxUhgsmi_h */
|
---|
132 |
|
---|