VirtualBox

Changeset 5158 in vbox for trunk/src/VBox/Frontends/VBoxBFE


Ignore:
Timestamp:
Oct 4, 2007 2:49:25 PM (17 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
25051
Message:

L4: limit the amount of video memory to the memory we actually got mapped from the guest

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VBoxBFE/VBoxBFE.cpp

    r5126 r5158  
    169169static const char *pszBootDevice = "IDE";
    170170static uint32_t g_u32MemorySizeMB = 128;
    171 static uint32_t g_u32VRamSizeMB = 4;
     171static uint32_t g_u32VRamSize = 4 * _1M;
    172172#ifdef VBOXSDL_ADVANCED_OPTIONS
    173173static bool g_fRawR0 = true;
     
    408408    char *secureLabelFontFile = NULL;
    409409#endif
     410#ifdef RT_OS_L4
     411    uint32_t u32MaxVRAM;
     412#endif
     413
    410414    RTPrintf("VirtualBox Simple SDL GUI built %s %s\n", __DATE__, __TIME__);
    411415
     
    476480            if (++curArg >= argc)
    477481                return SyntaxError("missing argument for vram size!\n");
    478             rc = RTStrToUInt32Ex(argv[curArg], NULL, 0, &g_u32VRamSizeMB);
     482            uint32_t uVRAMMB;
     483            rc = RTStrToUInt32Ex(argv[curArg], NULL, 0, &uVRAMMB);
     484            g_u32VRamSize = uVRAMMB * _1M;
    479485            if (VBOX_FAILURE(rc))
    480486                return SyntaxError("bad video ram size: %s (error %Vrc)\n",
     
    816822#ifdef RT_OS_L4
    817823    /* The L4 console provides (currently) a fixed resolution. */
    818     if (g_u32VRamSizeMB * _1M >=  gFramebuffer->getHostXres()
    819                           * gFramebuffer->getHostYres()
    820                           * (gDisplay->getBitsPerPixel() / 8))
     824    if (g_u32VRamSize >= gFramebuffer->getHostXres()
     825                       * gFramebuffer->getHostYres()
     826                       * (gDisplay->getBitsPerPixel() / 8))
    821827        gDisplay->SetVideoModeHint(gFramebuffer->getHostXres(), gFramebuffer->getHostYres(), 0, 0);
     828    /* Limit the VRAM of the guest to the amount of memory we got actually
     829     * mapped from the L4 console. */
     830    u32MaxVRAM = (gFramebuffer->getHostYres() + 18) /* don't omit the status bar */
     831               * gFramebuffer->getHostXres()
     832               * (gDisplay->getBitsPerPixel() / 8);
     833    if (g_u32VRamSize > u32MaxVRAM)
     834    {
     835        RTPrintf("Limiting the video memory to %u bytes\n", u32MaxVRAM);
     836        g_u32VRamSize = u32MaxVRAM;
     837    }
    822838#endif
    823839
     
    14391455    rc = CFGMR3InsertInteger(pInst, "PCIFunctionNo",  0);                           UPDATE_RC();
    14401456    rc = CFGMR3InsertNode(pInst,    "Config",         &pCfg);                       UPDATE_RC();
    1441     rc = CFGMR3InsertInteger(pCfg,  "VRamSize",       g_u32VRamSizeMB * _1M);       UPDATE_RC();
     1457    rc = CFGMR3InsertInteger(pCfg,  "VRamSize",       g_u32VRamSize);               UPDATE_RC();
    14421458
    14431459#ifdef RT_OS_L4
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