Changeset 66679 in vbox for trunk/src/VBox/Additions
- Timestamp:
- Apr 26, 2017 3:24:20 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/common/VBoxVideo/HGSMIBase.cpp
r66544 r66679 31 31 #include <VBoxVideoIPRT.h> 32 32 33 /** 34 * Initialise the host context structure. 35 * 36 * @param pCtx the context structure to initialise 37 * @param pvBaseMapping where the basic HGSMI structures are mapped at 38 * @param offHostFlags the offset of the host flags into the basic HGSMI 39 * structures 40 * @param pvHostAreaMapping where the area for the host heap is mapped at 41 * @param offVRAMHostArea offset of the host heap area into VRAM 42 * @param cbHostArea size in bytes of the host heap area 43 */ 44 DECLHIDDEN(void) VBoxHGSMISetupHostContext(PHGSMIHOSTCOMMANDCONTEXT pCtx, 45 void *pvBaseMapping, 46 uint32_t offHostFlags, 47 void *pvHostAreaMapping, 48 uint32_t offVRAMHostArea, 49 uint32_t cbHostArea) 50 { 51 uint8_t *pu8HostFlags = ((uint8_t *)pvBaseMapping) + offHostFlags; 52 pCtx->pfHostFlags = (HGSMIHOSTFLAGS *)pu8HostFlags; 53 /** @todo should we really be using a fixed ISA port value here? */ 54 pCtx->port = (RTIOPORT)VGA_PORT_HGSMI_HOST; 55 HGSMIAreaInitialize(&pCtx->areaCtx, pvHostAreaMapping, cbHostArea, 56 offVRAMHostArea); 57 } 58 59 33 60 /** Send completion notification to the host for the command located at offset 34 61 * @a offt into the host command buffer. */ … … 103 130 104 131 105 /** Detect whether HGSMI is supported by the host. */ 106 DECLHIDDEN(bool) VBoxHGSMIIsSupported(void) 107 { 108 uint16_t DispiId; 109 110 VBVO_PORT_WRITE_U16(VBE_DISPI_IOPORT_INDEX, VBE_DISPI_INDEX_ID); 111 VBVO_PORT_WRITE_U16(VBE_DISPI_IOPORT_DATA, VBE_DISPI_ID_HGSMI); 112 113 DispiId = VBVO_PORT_READ_U16(VBE_DISPI_IOPORT_DATA); 114 115 return (DispiId == VBE_DISPI_ID_HGSMI); 132 /** 133 * Set up the HGSMI guest-to-host command context. 134 * @returns iprt status value 135 * @param pCtx the context to set up 136 * @param pvGuestHeapMemory a pointer to the mapped backing memory for 137 * the guest heap 138 * @param cbGuestHeapMemory the size of the backing memory area 139 * @param offVRAMGuestHeapMemory the offset of the memory pointed to by 140 * @a pvGuestHeapMemory within the video RAM 141 * @param pEnv HGSMI environment. 142 */ 143 DECLHIDDEN(int) VBoxHGSMISetupGuestContext(PHGSMIGUESTCOMMANDCONTEXT pCtx, 144 void *pvGuestHeapMemory, 145 uint32_t cbGuestHeapMemory, 146 uint32_t offVRAMGuestHeapMemory, 147 const HGSMIENV *pEnv) 148 { 149 /** @todo should we be using a fixed ISA port value here? */ 150 pCtx->port = (RTIOPORT)VGA_PORT_HGSMI_GUEST; 151 #ifdef VBOX_WDDM_MINIPORT 152 return VBoxSHGSMIInit(&pCtx->heapCtx, pvGuestHeapMemory, 153 cbGuestHeapMemory, offVRAMGuestHeapMemory, pEnv); 154 #else 155 return HGSMIHeapSetup(&pCtx->heapCtx, pvGuestHeapMemory, 156 cbGuestHeapMemory, offVRAMGuestHeapMemory, pEnv); 157 #endif 116 158 } 117 159 … … 180 222 181 223 return VERR_INVALID_PARAMETER; 224 } 225 226 227 /** Detect whether HGSMI is supported by the host. */ 228 DECLHIDDEN(bool) VBoxHGSMIIsSupported(void) 229 { 230 uint16_t DispiId; 231 232 VBVO_PORT_WRITE_U16(VBE_DISPI_IOPORT_INDEX, VBE_DISPI_INDEX_ID); 233 VBVO_PORT_WRITE_U16(VBE_DISPI_IOPORT_DATA, VBE_DISPI_ID_HGSMI); 234 235 DispiId = VBVO_PORT_READ_U16(VBE_DISPI_IOPORT_DATA); 236 237 return (DispiId == VBE_DISPI_ID_HGSMI); 182 238 } 183 239 … … 346 402 347 403 /** 348 * Set up the HGSMI guest-to-host command context.349 * @returns iprt status value350 * @param pCtx the context to set up351 * @param pvGuestHeapMemory a pointer to the mapped backing memory for352 * the guest heap353 * @param cbGuestHeapMemory the size of the backing memory area354 * @param offVRAMGuestHeapMemory the offset of the memory pointed to by355 * @a pvGuestHeapMemory within the video RAM356 * @param pEnv HGSMI environment.357 */358 DECLHIDDEN(int) VBoxHGSMISetupGuestContext(PHGSMIGUESTCOMMANDCONTEXT pCtx,359 void *pvGuestHeapMemory,360 uint32_t cbGuestHeapMemory,361 uint32_t offVRAMGuestHeapMemory,362 const HGSMIENV *pEnv)363 {364 /** @todo should we be using a fixed ISA port value here? */365 pCtx->port = (RTIOPORT)VGA_PORT_HGSMI_GUEST;366 #ifdef VBOX_WDDM_MINIPORT367 return VBoxSHGSMIInit(&pCtx->heapCtx, pvGuestHeapMemory,368 cbGuestHeapMemory, offVRAMGuestHeapMemory, pEnv);369 #else370 return HGSMIHeapSetup(&pCtx->heapCtx, pvGuestHeapMemory,371 cbGuestHeapMemory, offVRAMGuestHeapMemory, pEnv);372 #endif373 }374 375 376 /**377 404 * Get the information needed to map the area used by the host to send back 378 405 * requests. … … 418 445 // LogFunc(("offVRAMHostArea = 0x%08X, cbHostArea = 0x%08X\n", 419 446 // offVRAMHostArea, cbHostArea)); 420 }421 422 423 /**424 * Initialise the host context structure.425 *426 * @param pCtx the context structure to initialise427 * @param pvBaseMapping where the basic HGSMI structures are mapped at428 * @param offHostFlags the offset of the host flags into the basic HGSMI429 * structures430 * @param pvHostAreaMapping where the area for the host heap is mapped at431 * @param offVRAMHostArea offset of the host heap area into VRAM432 * @param cbHostArea size in bytes of the host heap area433 */434 DECLHIDDEN(void) VBoxHGSMISetupHostContext(PHGSMIHOSTCOMMANDCONTEXT pCtx,435 void *pvBaseMapping,436 uint32_t offHostFlags,437 void *pvHostAreaMapping,438 uint32_t offVRAMHostArea,439 uint32_t cbHostArea)440 {441 uint8_t *pu8HostFlags = ((uint8_t *)pvBaseMapping) + offHostFlags;442 pCtx->pfHostFlags = (HGSMIHOSTFLAGS *)pu8HostFlags;443 /** @todo should we really be using a fixed ISA port value here? */444 pCtx->port = (RTIOPORT)VGA_PORT_HGSMI_HOST;445 HGSMIAreaInitialize(&pCtx->areaCtx, pvHostAreaMapping, cbHostArea,446 offVRAMHostArea);447 447 } 448 448
Note:
See TracChangeset
for help on using the changeset viewer.