VirtualBox

Changeset 55392 in vbox


Ignore:
Timestamp:
Apr 22, 2015 7:59:49 PM (10 years ago)
Author:
vboxsync
Message:

Additions/x11/vboxvideo: simplify some initialisation.

Location:
trunk/src/VBox/Additions/x11/vboxvideo
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/x11/vboxvideo/vboxvideo.c

    r55391 r55392  
    945945
    946946    /* 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;
    948948    pScrn->virtualY = pScrn->currentMode->VDisplay;
    949949
     
    951951
    952952    /* Needed before we initialise DRI. */
    953     pVBox->cbLine = vboxLineLength(pScrn, pScrn->virtualX);
    954     pScrn->displayWidth = vboxDisplayPitch(pScrn, pVBox->cbLine);
     953    pScrn->displayWidth = pScrn->virtualX;
    955954
    956955    xf86PrintModes(pScrn);
  • trunk/src/VBox/Additions/x11/vboxvideo/vboxvideo.h

    r55391 r55392  
    190190    /** The size of the framebuffer and the VBVA buffers at the end of it. */
    191191    unsigned long cbView;
    192     /** The current line size in bytes */
    193     uint32_t cbLine;
    194192    /** Whether the pre-X-server mode was a VBE mode */
    195193    bool fSavedVBEMode;
     
    295293extern void VBOXDRICloseScreen(ScreenPtr pScreen, VBOXPtr pVBox);
    296294
    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 
    318295#endif /* _VBOXVIDEO_H_ */
    319296
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette