Changeset 71146 in vbox for trunk/src/VBox/Additions/common
- Timestamp:
- Feb 28, 2018 9:54:40 AM (7 years ago)
- svn:sync-xref-src-repo-rev:
- 121039
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/common/VBoxVideo/Modesetting.cpp
r69309 r71146 59 59 60 60 /** 61 * Query whether the virtual hardware supports VBE_DISPI_ID_CFG 62 * and set the interface. 63 * 64 * @returns Whether the interface is supported. 65 */ 66 DECLHIDDEN(bool) VBoxVGACfgAvailable(void) 67 { 68 VBVO_PORT_WRITE_U16(VBE_DISPI_IOPORT_INDEX, VBE_DISPI_INDEX_ID); 69 VBVO_PORT_WRITE_U16(VBE_DISPI_IOPORT_DATA, VBE_DISPI_ID_CFG); 70 const uint16_t DispiId = VBVO_PORT_READ_U16(VBE_DISPI_IOPORT_DATA); 71 return (DispiId == VBE_DISPI_ID_CFG); 72 } 73 74 75 /** 76 * Query a configuration value from the virtual hardware which supports VBE_DISPI_ID_CFG. 77 * I.e. use this function only if VBoxVGACfgAvailable returns true. 78 * 79 * @returns Whether the value is supported. 80 * @param u16Id Identifier of the configuration value (VBE_DISPI_CFG_ID_*). 81 * @param pu32Value Where to store value from the host. 82 */ 83 DECLHIDDEN(bool) VBoxVGACfgQuery(uint16_t u16Id, uint32_t *pu32Value) 84 { 85 VBVO_PORT_WRITE_U16(VBE_DISPI_IOPORT_INDEX, VBE_DISPI_INDEX_CFG); 86 VBVO_PORT_WRITE_U16(VBE_DISPI_IOPORT_DATA, VBE_DISPI_CFG_MASK_SUPPORT | u16Id); 87 const uint32_t u32 = VBVO_PORT_READ_U32(VBE_DISPI_IOPORT_DATA); 88 if (u32) 89 { 90 VBVO_PORT_WRITE_U16(VBE_DISPI_IOPORT_DATA, u16Id); 91 *pu32Value = VBVO_PORT_READ_U32(VBE_DISPI_IOPORT_DATA); 92 return true; 93 } 94 95 return false; 96 } 97 98 99 /** 61 100 * Returns the size of the video RAM in bytes. 62 101 * … … 65 104 DECLHIDDEN(uint32_t) VBoxVideoGetVRAMSize(void) 66 105 { 67 /** @note A 32bit read on this port returns the VRAM size . */106 /** @note A 32bit read on this port returns the VRAM size if interface is older than VBE_DISPI_ID_CFG. */ 68 107 return VBVO_PORT_READ_U32(VBE_DISPI_IOPORT_DATA); 69 108 }
Note:
See TracChangeset
for help on using the changeset viewer.