Changeset 67066 in vbox for trunk/include/VBox/Graphics
- Timestamp:
- May 24, 2017 1:37:42 PM (8 years ago)
- svn:sync-xref-src-repo-rev:
- 115725
- Location:
- trunk/include/VBox/Graphics
- Files:
-
- 1 edited
- 2 copied
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/Graphics/HGSMIBase.h
r67065 r67066 25 25 26 26 27 #ifndef ___VBox_Graphics_HGSMIB uffers_h___28 #define ___VBox_Graphics_HGSMIB uffers_h___27 #ifndef ___VBox_Graphics_HGSMIBase_h___ 28 #define ___VBox_Graphics_HGSMIBase_h___ 29 29 30 30 #include <HGSMI.h> 31 #include <HGSMIC hSetup.h>31 #include <HGSMIContext.h> 32 32 #include <VBoxVideoIPRT.h> 33 33 34 #ifdef VBOX_WDDM_MINIPORT35 # include "wddm/VBoxMPShgsmi.h"36 typedef VBOXSHGSMI HGSMIGUESTCMDHEAP;37 # define HGSMIGUESTCMDHEAP_GET(_p) (&(_p)->Heap)38 #else39 typedef HGSMIHEAP HGSMIGUESTCMDHEAP;40 # define HGSMIGUESTCMDHEAP_GET(_p) (_p)41 #endif42 43 34 RT_C_DECLS_BEGIN 44 45 /**46 * Structure grouping the context needed for submitting commands to the host47 * via HGSMI48 */49 typedef struct HGSMIGUESTCOMMANDCONTEXT50 {51 /** Information about the memory heap located in VRAM from which data52 * structures to be sent to the host are allocated. */53 HGSMIGUESTCMDHEAP heapCtx;54 /** The I/O port used for submitting commands to the host by writing their55 * offsets into the heap. */56 RTIOPORT port;57 } HGSMIGUESTCOMMANDCONTEXT, *PHGSMIGUESTCOMMANDCONTEXT;58 59 60 /**61 * Structure grouping the context needed for receiving commands from the host62 * via HGSMI63 */64 typedef struct HGSMIHOSTCOMMANDCONTEXT65 {66 /** Information about the memory area located in VRAM in which the host67 * places data structures to be read by the guest. */68 HGSMIAREA areaCtx;69 /** Convenience structure used for matching host commands to handlers. */70 /** @todo handlers are registered individually in code rather than just71 * passing a static structure in order to gain extra flexibility. There is72 * currently no expected usage case for this though. Is the additional73 * complexity really justified? */74 HGSMICHANNELINFO channels;75 /** Flag to indicate that one thread is currently processing the command76 * queue. */77 volatile bool fHostCmdProcessing;78 /* Pointer to the VRAM location where the HGSMI host flags are kept. */79 volatile HGSMIHOSTFLAGS *pfHostFlags;80 /** The I/O port used for receiving commands from the host as offsets into81 * the memory area and sending back confirmations (command completion,82 * IRQ acknowlegement). */83 RTIOPORT port;84 } HGSMIHOSTCOMMANDCONTEXT, *PHGSMIHOSTCOMMANDCONTEXT;85 35 86 36 /** @name Base HGSMI Buffer APIs … … 93 43 } 94 44 95 DECLHIDDEN(void) VBoxHGSMISetupHostContext(PHGSMIHOSTCOMMANDCONTEXT pCtx,96 void *pvBaseMapping,97 uint32_t offHostFlags,98 void *pvHostAreaMapping,99 uint32_t offVRAMHostArea,100 uint32_t cbHostArea);101 DECLHIDDEN(void) VBoxHGSMIHostCmdComplete(PHGSMIHOSTCOMMANDCONTEXT pCtx,102 void *pvMem);103 DECLHIDDEN(void) VBoxHGSMIProcessHostQueue(PHGSMIHOSTCOMMANDCONTEXT pCtx);104 /** @todo we should provide a cleanup function too as part of the API */105 DECLHIDDEN(int) VBoxHGSMISetupGuestContext(PHGSMIGUESTCOMMANDCONTEXT pCtx,106 void *pvGuestHeapMemory,107 uint32_t cbGuestHeapMemory,108 uint32_t offVRAMGuestHeapMemory,109 const HGSMIENV *pEnv);110 45 DECLHIDDEN(void *) VBoxHGSMIBufferAlloc(PHGSMIGUESTCOMMANDCONTEXT pCtx, 111 46 HGSMISIZE cbData, -
trunk/include/VBox/Graphics/HGSMIContext.h
r66696 r67066 1 1 /** @file 2 * VBox Host Guest Shared Memory Interface (HGSMI) buffer management.2 * VBox Host Guest Shared Memory Interface (HGSMI) command contexts. 3 3 */ 4 4 … … 25 25 26 26 27 #ifndef ___VBox_Graphics_HGSMI Buffers_h___28 #define ___VBox_Graphics_HGSMI Buffers_h___27 #ifndef ___VBox_Graphics_HGSMIContext_h___ 28 #define ___VBox_Graphics_HGSMIContext_h___ 29 29 30 30 #include <HGSMI.h> … … 84 84 } HGSMIHOSTCOMMANDCONTEXT, *PHGSMIHOSTCOMMANDCONTEXT; 85 85 86 /** @name Base HGSMI Buffer APIs86 /** @name HGSMI context initialisation APIs. 87 87 * @{ */ 88 88 89 /** Acknowlege an IRQ.*/90 DECL INLINE(void) VBoxHGSMIClearIrq(PHGSMIHOSTCOMMANDCONTEXT pCtx)91 { 92 VBVO_PORT_WRITE_U32(pCtx->port, HGSMIOFFSET_VOID);93 } 94 89 /** @todo we should provide a cleanup function too as part of the API */ 90 DECLHIDDEN(int) VBoxHGSMISetupGuestContext(PHGSMIGUESTCOMMANDCONTEXT pCtx, 91 void *pvGuestHeapMemory, 92 uint32_t cbGuestHeapMemory, 93 uint32_t offVRAMGuestHeapMemory, 94 const HGSMIENV *pEnv); 95 95 DECLHIDDEN(void) VBoxHGSMISetupHostContext(PHGSMIHOSTCOMMANDCONTEXT pCtx, 96 96 void *pvBaseMapping, … … 99 99 uint32_t offVRAMHostArea, 100 100 uint32_t cbHostArea); 101 DECLHIDDEN(void) VBoxHGSMIHostCmdComplete(PHGSMIHOSTCOMMANDCONTEXT pCtx, 102 void *pvMem); 103 DECLHIDDEN(void) VBoxHGSMIProcessHostQueue(PHGSMIHOSTCOMMANDCONTEXT pCtx); 104 /** @todo we should provide a cleanup function too as part of the API */ 105 DECLHIDDEN(int) VBoxHGSMISetupGuestContext(PHGSMIGUESTCOMMANDCONTEXT pCtx, 106 void *pvGuestHeapMemory, 107 uint32_t cbGuestHeapMemory, 108 uint32_t offVRAMGuestHeapMemory, 109 const HGSMIENV *pEnv); 110 DECLHIDDEN(void *) VBoxHGSMIBufferAlloc(PHGSMIGUESTCOMMANDCONTEXT pCtx, 111 HGSMISIZE cbData, 112 uint8_t u8Ch, 113 uint16_t u16Op); 114 DECLHIDDEN(void) VBoxHGSMIBufferFree(PHGSMIGUESTCOMMANDCONTEXT pCtx, 115 void *pvBuffer); 116 DECLHIDDEN(int) VBoxHGSMIBufferSubmit(PHGSMIGUESTCOMMANDCONTEXT pCtx, 117 void *pvBuffer); 101 118 102 /** @} */ 119 103 -
trunk/include/VBox/Graphics/HGSMIHostCmd.h
r66696 r67066 25 25 26 26 27 #ifndef ___VBox_Graphics_HGSMI Buffers_h___28 #define ___VBox_Graphics_HGSMI Buffers_h___27 #ifndef ___VBox_Graphics_HGSMIHostCmd_h___ 28 #define ___VBox_Graphics_HGSMIHostCmd_h___ 29 29 30 30 #include <HGSMI.h> 31 #include <HGSMIC hSetup.h>31 #include <HGSMIContext.h> 32 32 #include <VBoxVideoIPRT.h> 33 34 #ifdef VBOX_WDDM_MINIPORT35 # include "wddm/VBoxMPShgsmi.h"36 typedef VBOXSHGSMI HGSMIGUESTCMDHEAP;37 # define HGSMIGUESTCMDHEAP_GET(_p) (&(_p)->Heap)38 #else39 typedef HGSMIHEAP HGSMIGUESTCMDHEAP;40 # define HGSMIGUESTCMDHEAP_GET(_p) (_p)41 #endif42 33 43 34 RT_C_DECLS_BEGIN 44 35 45 /** 46 * Structure grouping the context needed for submitting commands to the host 47 * via HGSMI 48 */ 49 typedef struct HGSMIGUESTCOMMANDCONTEXT 50 { 51 /** Information about the memory heap located in VRAM from which data 52 * structures to be sent to the host are allocated. */ 53 HGSMIGUESTCMDHEAP heapCtx; 54 /** The I/O port used for submitting commands to the host by writing their 55 * offsets into the heap. */ 56 RTIOPORT port; 57 } HGSMIGUESTCOMMANDCONTEXT, *PHGSMIGUESTCOMMANDCONTEXT; 58 59 60 /** 61 * Structure grouping the context needed for receiving commands from the host 62 * via HGSMI 63 */ 64 typedef struct HGSMIHOSTCOMMANDCONTEXT 65 { 66 /** Information about the memory area located in VRAM in which the host 67 * places data structures to be read by the guest. */ 68 HGSMIAREA areaCtx; 69 /** Convenience structure used for matching host commands to handlers. */ 70 /** @todo handlers are registered individually in code rather than just 71 * passing a static structure in order to gain extra flexibility. There is 72 * currently no expected usage case for this though. Is the additional 73 * complexity really justified? */ 74 HGSMICHANNELINFO channels; 75 /** Flag to indicate that one thread is currently processing the command 76 * queue. */ 77 volatile bool fHostCmdProcessing; 78 /* Pointer to the VRAM location where the HGSMI host flags are kept. */ 79 volatile HGSMIHOSTFLAGS *pfHostFlags; 80 /** The I/O port used for receiving commands from the host as offsets into 81 * the memory area and sending back confirmations (command completion, 82 * IRQ acknowlegement). */ 83 RTIOPORT port; 84 } HGSMIHOSTCOMMANDCONTEXT, *PHGSMIHOSTCOMMANDCONTEXT; 85 86 /** @name Base HGSMI Buffer APIs 36 /** @name Base HGSMI host command APIs. 87 37 * @{ */ 88 38 89 /** Acknowlege an IRQ. */90 DECLINLINE(void) VBoxHGSMIClearIrq(PHGSMIHOSTCOMMANDCONTEXT pCtx)91 {92 VBVO_PORT_WRITE_U32(pCtx->port, HGSMIOFFSET_VOID);93 }94 95 DECLHIDDEN(void) VBoxHGSMISetupHostContext(PHGSMIHOSTCOMMANDCONTEXT pCtx,96 void *pvBaseMapping,97 uint32_t offHostFlags,98 void *pvHostAreaMapping,99 uint32_t offVRAMHostArea,100 uint32_t cbHostArea);101 39 DECLHIDDEN(void) VBoxHGSMIHostCmdComplete(PHGSMIHOSTCOMMANDCONTEXT pCtx, 102 40 void *pvMem); 103 41 DECLHIDDEN(void) VBoxHGSMIProcessHostQueue(PHGSMIHOSTCOMMANDCONTEXT pCtx); 104 /** @todo we should provide a cleanup function too as part of the API */ 105 DECLHIDDEN(int) VBoxHGSMISetupGuestContext(PHGSMIGUESTCOMMANDCONTEXT pCtx, 106 void *pvGuestHeapMemory, 107 uint32_t cbGuestHeapMemory, 108 uint32_t offVRAMGuestHeapMemory, 109 const HGSMIENV *pEnv); 110 DECLHIDDEN(void *) VBoxHGSMIBufferAlloc(PHGSMIGUESTCOMMANDCONTEXT pCtx, 111 HGSMISIZE cbData, 112 uint8_t u8Ch, 113 uint16_t u16Op); 114 DECLHIDDEN(void) VBoxHGSMIBufferFree(PHGSMIGUESTCOMMANDCONTEXT pCtx, 115 void *pvBuffer); 116 DECLHIDDEN(int) VBoxHGSMIBufferSubmit(PHGSMIGUESTCOMMANDCONTEXT pCtx, 117 void *pvBuffer); 42 118 43 /** @} */ 119 44 -
trunk/include/VBox/Graphics/VBoxVideoGuest.h
r66685 r67066 30 30 #define ___VBox_Graphics_VBoxVideoGuest_h___ 31 31 32 #include <HGSMIB uffers.h>32 #include <HGSMIBase.h> 33 33 #include <VBoxVideo.h> 34 34 #include <VBoxVideoIPRT.h>
Note:
See TracChangeset
for help on using the changeset viewer.