Changeset 35948 in vbox for trunk/src/VBox
- Timestamp:
- Feb 11, 2011 11:24:57 PM (14 years ago)
- Location:
- trunk/src/VBox/Additions
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/VBoxVideo.cpp
r35656 r35948 4106 4106 ULONG xOffset = 0, yOffset = 0; 4107 4107 #endif 4108 VBoxVideoSetModeRegisters(width, height, width, bpp, (uint16_t)xOffset,4109 (uint16_t) yOffset);4108 VBoxVideoSetModeRegisters(width, height, width, bpp, 0, 4109 (uint16_t)xOffset, (uint16_t)yOffset); 4110 4110 /** @todo read from the port to see if the mode switch was successful */ 4111 4111 -
trunk/src/VBox/Additions/common/VBoxVideo/Modesetting.cpp
r35150 r35948 85 85 * Set a video mode using port registers. This must be done for the first 86 86 * screen before every HGSMI modeset and also works when HGSM is not enabled. 87 * @param cWidth the mode width 88 * @param cHeight the mode height 89 * @param cBPP the colour depth of the mode 90 * @param cx the horizontal panning offset 91 * @param cy the vertical panning offset 87 * @param cWidth the mode width 88 * @param cHeight the mode height 89 * @param cVirtWidth the mode pitch 90 * @param cBPP the colour depth of the mode 91 * @param fFlags flags for the mode. These will be or-ed with the 92 * default _ENABLED flag, so unless you are restoring 93 * a saved mode or have special requirements you can pass 94 * zero here. 95 * @param cx the horizontal panning offset 96 * @param cy the vertical panning offset 92 97 */ 93 98 RTDECL(void) VBoxVideoSetModeRegisters(uint16_t cWidth, uint16_t cHeight, 94 99 uint16_t cVirtWidth, uint16_t cBPP, 95 uint16_t cx, uint16_t cy) 100 uint16_t fFlags, uint16_t cx, 101 uint16_t cy) 96 102 { 97 103 /* set the mode characteristics */ … … 100 106 VBoxVideoCmnPortWriteUshort(VBE_DISPI_IOPORT_INDEX, VBE_DISPI_INDEX_YRES); 101 107 VBoxVideoCmnPortWriteUshort(VBE_DISPI_IOPORT_DATA, cHeight); 102 VBoxVideoCmnPortWriteUshort(VBE_DISPI_IOPORT_INDEX, VBE_DISPI_INDEX_VIRT_WIDTH); 108 VBoxVideoCmnPortWriteUshort(VBE_DISPI_IOPORT_INDEX, 109 VBE_DISPI_INDEX_VIRT_WIDTH); 103 110 VBoxVideoCmnPortWriteUshort(VBE_DISPI_IOPORT_DATA, cVirtWidth); 104 111 VBoxVideoCmnPortWriteUshort(VBE_DISPI_IOPORT_INDEX, VBE_DISPI_INDEX_BPP); 105 112 VBoxVideoCmnPortWriteUshort(VBE_DISPI_IOPORT_DATA, cBPP); 106 113 /* enable the mode */ 107 VBoxVideoCmnPortWriteUshort(VBE_DISPI_IOPORT_INDEX, VBE_DISPI_INDEX_ENABLE); 108 VBoxVideoCmnPortWriteUshort(VBE_DISPI_IOPORT_DATA, VBE_DISPI_ENABLED | VBE_DISPI_LFB_ENABLED); 114 VBoxVideoCmnPortWriteUshort(VBE_DISPI_IOPORT_INDEX, 115 VBE_DISPI_INDEX_ENABLE | VBE_DISPI_LFB_ENABLED); 116 VBoxVideoCmnPortWriteUshort(VBE_DISPI_IOPORT_DATA, 117 fFlags | VBE_DISPI_ENABLED); 109 118 /* Panning registers */ 110 VBoxVideoCmnPortWriteUshort(VBE_DISPI_IOPORT_INDEX, VBE_DISPI_INDEX_X_OFFSET); 119 VBoxVideoCmnPortWriteUshort(VBE_DISPI_IOPORT_INDEX, 120 VBE_DISPI_INDEX_X_OFFSET); 111 121 VBoxVideoCmnPortWriteUshort(VBE_DISPI_IOPORT_DATA, cx); 112 VBoxVideoCmnPortWriteUshort(VBE_DISPI_IOPORT_INDEX, VBE_DISPI_INDEX_Y_OFFSET); 122 VBoxVideoCmnPortWriteUshort(VBE_DISPI_IOPORT_INDEX, 123 VBE_DISPI_INDEX_Y_OFFSET); 113 124 VBoxVideoCmnPortWriteUshort(VBE_DISPI_IOPORT_DATA, cy); 114 125 /** @todo read from the port to see if the mode switch was successful */ 126 } 127 128 129 /** 130 * Get the video mode for the first screen using the port registers. All 131 * parameters are optional 132 * @returns true if the VBE mode returned is active, false if we are in VGA 133 * mode 134 * @note If anyone else needs additional register values just extend the 135 * function with additional parameters and fix any existing callers. 136 * @param pcWidth where to store the mode width 137 * @param pcHeight where to store the mode height 138 * @param pcVirtWidth where to store the mode pitch 139 * @param pcBPP where to store the colour depth of the mode 140 * @param pfFlags where to store the flags for the mode 141 */ 142 RTDECL(bool) VBoxVideoGetModeRegisters(uint16_t *pcWidth, uint16_t *pcHeight, 143 uint16_t *pcVirtWidth, uint16_t *pcBPP, 144 uint16_t *pfFlags) 145 { 146 uint16_t fFlags; 147 148 VBoxVideoCmnPortWriteUshort(VBE_DISPI_IOPORT_INDEX, 149 VBE_DISPI_ENABLED); 150 fFlags = VBoxVideoCmnPortReadUshort(VBE_DISPI_IOPORT_DATA); 151 if (pcWidth) 152 { 153 VBoxVideoCmnPortWriteUshort(VBE_DISPI_IOPORT_INDEX, 154 VBE_DISPI_INDEX_XRES); 155 *pcWidth = VBoxVideoCmnPortReadUshort(VBE_DISPI_IOPORT_DATA); 156 } 157 if (pcHeight) 158 { 159 VBoxVideoCmnPortWriteUshort(VBE_DISPI_IOPORT_INDEX, 160 VBE_DISPI_INDEX_YRES); 161 *pcHeight = VBoxVideoCmnPortReadUshort(VBE_DISPI_IOPORT_DATA); 162 } 163 if (pcVirtWidth) 164 { 165 VBoxVideoCmnPortWriteUshort(VBE_DISPI_IOPORT_INDEX, 166 VBE_DISPI_INDEX_VIRT_WIDTH); 167 *pcVirtWidth = VBoxVideoCmnPortReadUshort(VBE_DISPI_IOPORT_DATA); 168 } 169 if (pcBPP) 170 { 171 VBoxVideoCmnPortWriteUshort(VBE_DISPI_IOPORT_INDEX, 172 VBE_DISPI_INDEX_BPP); 173 *pcBPP = VBoxVideoCmnPortReadUshort(VBE_DISPI_IOPORT_DATA); 174 } 175 if (pfFlags) 176 *pfFlags = fFlags; 177 return RT_BOOL(fFlags & VBE_DISPI_ENABLED); 178 } 179 180 181 /** 182 * Get the video mode for the first screen using the port registers. All 183 * parameters are optional 184 * @note If anyone else needs additional values just extend the function with 185 * additional parameters and fix any existing callers. 186 * @param pcWidth where to store the mode width 187 * @param pcHeight where to store the mode height 188 * @param pcVirtWidth where to store the mode pitch 189 * @param pcBPP where to store the colour depth of the mode 190 * @param pfFlags where to store the flags for the mode 191 */ 192 RTDECL(void) VBoxVideoDisableVBE(void) 193 { 194 VBoxVideoCmnPortWriteUshort(VBE_DISPI_IOPORT_INDEX, 195 VBE_DISPI_INDEX_ENABLE); 196 VBoxVideoCmnPortWriteUshort(VBE_DISPI_IOPORT_DATA, 0); 115 197 } 116 198 -
trunk/src/VBox/Additions/x11/vboxvideo/vboxvideo.c
r35933 r35948 1338 1338 if (cDisplay == 0) 1339 1339 VBoxVideoSetModeRegisters(cwReal, cHeight, pScrn->displayWidth, 1340 vboxBPP(pScrn), x, y);1340 vboxBPP(pScrn), 0, x, y); 1341 1341 /* Tell the host we support graphics */ 1342 1342 if (vbox_device_available(pVBox))
Note:
See TracChangeset
for help on using the changeset viewer.