VirtualBox

Changeset 32978 in vbox


Ignore:
Timestamp:
Oct 7, 2010 2:11:18 PM (14 years ago)
Author:
vboxsync
Message:

DevVGA: Update the number of pages for all VBE modes based on VRAM size.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Graphics/DevVGA.cpp

    r32974 r32978  
    61516151}
    61526152
     6153/**
     6154 * Adjust VBE mode information
     6155 *
     6156 * Depending on the configured VRAM size, certain parts of VBE mode
     6157 * information must be updated.
     6158 *
     6159 * @param   pThis       The device instance data.
     6160 * @param   pMode       The mode information structure.
     6161 */
     6162static void vgaAdjustModeInfo(PVGASTATE pThis, ModeInfoListItem *pMode)
     6163{
     6164    int         nPages;
     6165
     6166    /* The "number of image pages" is really the max page index... */
     6167    nPages = pThis->vram_size / (pMode->info.YResolution * pMode->info.BytesPerScanLine) - 1;
     6168    Assert(nPages);
     6169    if (nPages > 255)
     6170        nPages = 255;   /* 8-bit value. */
     6171    pMode->info.NumberOfImagePages  = nPages;
     6172    pMode->info.LinNumberOfPages    = nPages;
     6173}
    61536174
    61546175/**
     
    61656186    uint32_t    cyReduction;
    61666187    uint32_t    cbPitch;
    6167     int         nPages;
    61686188    PVBEHEADER  pVBEDataHdr;
    61696189    ModeInfoListItem *pCurMode;
     
    65696589            continue;
    65706590        *pCurMode = mode_info_list[i];
     6591        vgaAdjustModeInfo(pThis, pCurMode);
    65716592        pCurMode++;
    65726593    }
     
    66746695
    66756696                /* adjust defaults */
    6676                 /* The "number of image pages" is really the max page index... */
    6677                 nPages = pThis->vram_size / (cy * cbPitch) - 1;
    6678                 Assert(nPages);
    6679                 if (nPages > 255)
    6680                     nPages = 255;   /* 8-bit value. */
    66816697                pCurMode->info.XResolution = cx;
    66826698                pCurMode->info.YResolution = cy;
    66836699                pCurMode->info.BytesPerScanLine    = cbPitch;
    66846700                pCurMode->info.LinBytesPerScanLine = cbPitch;
    6685                 pCurMode->info.NumberOfImagePages  = nPages;
    6686                 pCurMode->info.LinNumberOfPages    = nPages;
     6701                vgaAdjustModeInfo(pThis, pCurMode);
    66876702
    66886703                /* commit it */
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