Changeset 55392 in vbox
- Timestamp:
- Apr 22, 2015 7:59:49 PM (10 years ago)
- Location:
- trunk/src/VBox/Additions/x11/vboxvideo
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/x11/vboxvideo/vboxvideo.c
r55391 r55392 945 945 946 946 /* Set the right virtual resolution. */ 947 pScrn->virtualX = pScrn-> currentMode->HDisplay;947 pScrn->virtualX = pScrn->bitsPerPixel == 16 ? (pScrn->currentMode->HDisplay + 1) & ~1 : pScrn->currentMode->HDisplay; 948 948 pScrn->virtualY = pScrn->currentMode->VDisplay; 949 949 … … 951 951 952 952 /* Needed before we initialise DRI. */ 953 pVBox->cbLine = vboxLineLength(pScrn, pScrn->virtualX); 954 pScrn->displayWidth = vboxDisplayPitch(pScrn, pVBox->cbLine); 953 pScrn->displayWidth = pScrn->virtualX; 955 954 956 955 xf86PrintModes(pScrn); -
trunk/src/VBox/Additions/x11/vboxvideo/vboxvideo.h
r55391 r55392 190 190 /** The size of the framebuffer and the VBVA buffers at the end of it. */ 191 191 unsigned long cbView; 192 /** The current line size in bytes */193 uint32_t cbLine;194 192 /** Whether the pre-X-server mode was a VBE mode */ 195 193 bool fSavedVBEMode; … … 295 293 extern void VBOXDRICloseScreen(ScreenPtr pScreen, VBOXPtr pVBox); 296 294 297 /* Utilities */298 299 /** Calculate the BPP from the screen depth */300 static inline uint16_t vboxBPP(ScrnInfoPtr pScrn)301 {302 return pScrn->depth == 24 ? 32 : 16;303 }304 305 /** Calculate the scan line length for a display width */306 static inline int32_t vboxLineLength(ScrnInfoPtr pScrn, int32_t cDisplayWidth)307 {308 uint32_t cbLine = (cDisplayWidth * vboxBPP(pScrn) / 8 + 3) & ~3;309 return cbLine < INT32_MAX ? cbLine : INT32_MAX;310 }311 312 /** Calculate the display pitch from the scan line length */313 static inline int32_t vboxDisplayPitch(ScrnInfoPtr pScrn, int32_t cbLine)314 {315 return cbLine * 8 / vboxBPP(pScrn);316 }317 318 295 #endif /* _VBOXVIDEO_H_ */ 319 296
Note:
See TracChangeset
for help on using the changeset viewer.