VirtualBox

Changeset 8337 in vbox


Ignore:
Timestamp:
Apr 23, 2008 5:05:13 PM (17 years ago)
Author:
vboxsync
Message:

Fix check of seamless VRAM requirements. Avoided incorrect duplicate computation of required size and added rounding. Both qt3 and qt4 GUIs.

Location:
trunk/src/VBox/Frontends
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/include/VBoxProblemReporter.h

    r8155 r8337  
    183183    void cannotFindMachineByName (const CVirtualBox &vbox, const QString &name);
    184184
    185     void cannotEnterSeamlessMode (ULONG aWidth, ULONG aHeight, ULONG aBpp);
     185    void cannotEnterSeamlessMode (ULONG aWidth, ULONG aHeight, ULONG aBpp, ULONG64 aMinVRAM);
    186186
    187187    bool confirmMachineDeletion (const CMachine &machine);
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxConsoleWnd.cpp

    r8324 r8337  
    19621962        /* Check if the Guest Video RAM enough for the seamless mode. */
    19631963        QRect screen = QApplication::desktop()->screenGeometry (this);
    1964         ULONG64 availBits = (csession.GetMachine().GetVRAMSize() /* vram */
     1964        ULONG64 availBits = csession.GetMachine().GetVRAMSize() /* vram */
    19651965                          * _1M /* mb to bytes */
    1966                           - 4096 /* adapter info */
    1967                           - _1M /* current cache - may be changed in future */)
    1968                           / csession.GetMachine().GetMonitorCount()
    19691966                          * 8; /* to bits */
    1970         ULONG64 usedBits = screen.width() /* display width */
     1967        ULONG guestBpp = console->console().GetDisplay().GetBitsPerPixel();
     1968        ULONG64 usedBits = (screen.width() /* display width */
    19711969                         * screen.height() /* display height */
    1972                          * QColor::numBitPlanes(); /* bit per pixel */
     1970                         * guestBpp
     1971                         + _1M * 8) /* current cache per screen - may be changed in future */
     1972                         * csession.GetMachine().GetMonitorCount() /**< @todo fix assumption that all screens have same resolution */
     1973                         + 4096 * 8; /* adapter info */
    19731974        CGuest guest = console->console().GetGuest();
    19741975        ULONG maxWidth  = guest.GetMaxGuestWidth();
     
    19811982        {
    19821983            vboxProblem().cannotEnterSeamlessMode (screen.width(),
    1983                 screen.height(), QColor::numBitPlanes());
     1984                screen.height(), guestBpp, (((usedBits + 7) / 8 + _1M - 1) / _1M) * _1M);
    19841985            return false;
    19851986        }
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxProblemReporter.cpp

    r8202 r8337  
    935935void VBoxProblemReporter::cannotEnterSeamlessMode (ULONG aWidth,
    936936                                                   ULONG aHeight,
    937                                                    ULONG aBpp)
     937                                                   ULONG aBpp,
     938                                                   ULONG64 aMinVRAM)
    938939{
    939940    message (&vboxGlobal().consoleWnd(), Error,
     
    942943                 "<p>You should configure the VM to have at least <b>%1</b> "
    943944                 "of video memory.</p>")
    944              .arg (VBoxGlobal::formatSize ((ULONG64) (aWidth * aHeight *
    945                                                       aBpp / 8 + _1M - 1))));
     945             .arg (VBoxGlobal::formatSize (aMinVRAM)));
    946946}
    947947
  • trunk/src/VBox/Frontends/VirtualBox4/include/VBoxProblemReporter.h

    r8155 r8337  
    182182    void cannotFindMachineByName (const CVirtualBox &vbox, const QString &name);
    183183
    184     void cannotEnterSeamlessMode (ULONG aWidth, ULONG aHeight, ULONG aBpp);
     184    void cannotEnterSeamlessMode (ULONG aWidth, ULONG aHeight, ULONG aBpp, ULONG64 aMinVRAM);
    185185
    186186    bool confirmMachineDeletion (const CMachine &machine);
  • trunk/src/VBox/Frontends/VirtualBox4/src/VBoxConsoleWnd.cpp

    r8323 r8337  
    19851985        /* Check if the Guest Video RAM enough for the seamless mode. */
    19861986        QRect screen = QApplication::desktop()->screenGeometry (this);
    1987         ULONG64 availBits = (csession.GetMachine().GetVRAMSize() /* vram */
     1987        ULONG64 availBits = csession.GetMachine().GetVRAMSize() /* vram */
    19881988                          * _1M /* mb to bytes */
    1989                           - 4096 /* adapter info */
    1990                           - _1M /* current cache - may be changed in future */)
    1991                           / csession.GetMachine().GetMonitorCount()
    19921989                          * 8; /* to bits */
    1993         ULONG64 usedBits = screen.width() /* display width */
     1990        ULONG guestBpp = console->console().GetDisplay().GetBitsPerPixel();
     1991        ULONG64 usedBits = (screen.width() /* display width */
    19941992                         * screen.height() /* display height */
    1995                          * depth(); /* bit per pixel */
     1993                         * guestBpp
     1994                         + _1M * 8) /* current cache per screen - may be changed in future */
     1995                         * csession.GetMachine().GetMonitorCount() /**< @todo fix assumption that all screens have same resolution */
     1996                         + 4096 * 8; /* adapter info */
    19961997        CGuest guest = console->console().GetGuest();
    19971998        ULONG maxWidth  = guest.GetMaxGuestWidth();
     
    20042005        {
    20052006            vboxProblem().cannotEnterSeamlessMode (screen.width(),
    2006                 screen.height(), depth());
     2007                screen.height(), guestBpp, (((usedBits + 7) / 8 + _1M - 1) / _1M) * _1M);
    20072008            return false;
    20082009        }
  • trunk/src/VBox/Frontends/VirtualBox4/src/VBoxProblemReporter.cpp

    r8155 r8337  
    943943void VBoxProblemReporter::cannotEnterSeamlessMode (ULONG aWidth,
    944944                                                   ULONG aHeight,
    945                                                    ULONG aBpp)
     945                                                   ULONG aBpp,
     946                                                   ULONG64 aMinVRAM)
    946947{
    947948    message (&vboxGlobal().consoleWnd(), Error,
     
    950951                 "<p>You should configure the VM to have at least <b>%1</b> "
    951952                 "of video memory.</p>")
    952              .arg (VBoxGlobal::formatSize ((ULONG64) (aWidth * aHeight *
    953                                                       aBpp / 8 + _1M - 1))));
     953             .arg (VBoxGlobal::formatSize (aMinVRAM)));
    954954}
    955955
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