VirtualBox

Changeset 35656 in vbox for trunk/src/VBox/Additions


Ignore:
Timestamp:
Jan 20, 2011 2:48:13 PM (14 years ago)
Author:
vboxsync
Message:

Miniport/VBoxVideo: removed obsolete code.

Location:
trunk/src/VBox/Additions/WINNT/Graphics/Miniport
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/WINNT/Graphics/Miniport/Makefile.kmk

    r34848 r35656  
    3535 VBoxVideo_DEFS      += VBOX_WITH_VIDEOHWACCEL
    3636endif
    37 VBoxVideo_DEFS        += VBOX_WITH_MULTIMONITOR_FIX
    3837#VBoxVideo_DEFS        += LOG_ENABLED
    3938VBoxVideo_INCS        = ../../include
     
    9392  VBoxVideoWddm_DEFS       += LOG_ENABLED
    9493 endif
    95  #VBoxVideoWddm_DEFS       += VBOX_WITH_MULTIMONITOR_FIX
    9694 VBoxVideoWddm_DEFS       += LOG_TO_BACKDOOR
    9795 VBoxVideoWddm_INCS       += ../../include
  • trunk/src/VBox/Additions/WINNT/Graphics/Miniport/VBoxVideo.cpp

    r34686 r35656  
    4848    { 0x000A0000, 0x00000000, 0x00020000, 0, 0, 1, 0 }, /* 0xA0000-0xBFFFF */
    4949};
    50 /*
    51  * Globals for the last custom resolution set. This is important
    52  * for system startup so that we report the last currently set
    53  * custom resolution and Windows can use it again.
    54  */
    55 #ifndef VBOX_WITH_MULTIMONITOR_FIX
    56 uint32_t gCustomXRes = 0;
    57 uint32_t gCustomYRes = 0;
    58 uint32_t gCustomBPP  = 0;
    59 #endif /* !VBOX_WITH_MULTIMONITOR_FIX */
    6050
    6151/*******************************************************************************
     
    332322}
    333323#endif
     324
     325static void initVideoModeInformation(VIDEO_MODE_INFORMATION *pVideoMode, ULONG xres, ULONG yres, ULONG bpp, ULONG index, ULONG yoffset)
     326{
     327    /*
     328     * Build mode entry.
     329     */
     330    memset(pVideoMode, 0, sizeof(VIDEO_MODE_INFORMATION));
     331
     332    pVideoMode->Length                       = sizeof(VIDEO_MODE_INFORMATION);
     333    pVideoMode->ModeIndex                    = index;
     334    pVideoMode->VisScreenWidth               = xres;
     335    pVideoMode->VisScreenHeight              = yres - yoffset;
     336    pVideoMode->ScreenStride                 = xres * ((bpp + 7) / 8);
     337    pVideoMode->NumberOfPlanes               = 1;
     338    pVideoMode->BitsPerPlane                 = bpp;
     339    pVideoMode->Frequency                    = 60;
     340    pVideoMode->XMillimeter                  = 320;
     341    pVideoMode->YMillimeter                  = 240;
     342    switch (bpp)
     343    {
     344#ifdef VBOX_WITH_8BPP_MODES
     345        case 8:
     346            pVideoMode->NumberRedBits        = 6;
     347            pVideoMode->NumberGreenBits      = 6;
     348            pVideoMode->NumberBlueBits       = 6;
     349            pVideoMode->RedMask              = 0;
     350            pVideoMode->GreenMask            = 0;
     351            pVideoMode->BlueMask             = 0;
     352            break;
     353#endif
     354        case 16:
     355            pVideoMode->NumberRedBits        = 5;
     356            pVideoMode->NumberGreenBits      = 6;
     357            pVideoMode->NumberBlueBits       = 5;
     358            pVideoMode->RedMask              = 0xF800;
     359            pVideoMode->GreenMask            = 0x7E0;
     360            pVideoMode->BlueMask             = 0x1F;
     361            break;
     362        case 24:
     363            pVideoMode->NumberRedBits        = 8;
     364            pVideoMode->NumberGreenBits      = 8;
     365            pVideoMode->NumberBlueBits       = 8;
     366            pVideoMode->RedMask              = 0xFF0000;
     367            pVideoMode->GreenMask            = 0xFF00;
     368            pVideoMode->BlueMask             = 0xFF;
     369            break;
     370        case 32:
     371            pVideoMode->NumberRedBits        = 8;
     372            pVideoMode->NumberGreenBits      = 8;
     373            pVideoMode->NumberBlueBits       = 8;
     374            pVideoMode->RedMask              = 0xFF0000;
     375            pVideoMode->GreenMask            = 0xFF00;
     376            pVideoMode->BlueMask             = 0xFF;
     377            break;
     378    }
     379    pVideoMode->AttributeFlags               = VIDEO_MODE_GRAPHICS | VIDEO_MODE_COLOR | VIDEO_MODE_NO_OFF_SCREEN;
     380#ifdef VBOX_WITH_8BPP_MODES
     381    if (bpp == 8)
     382        pVideoMode->AttributeFlags          |= VIDEO_MODE_PALETTE_DRIVEN | VIDEO_MODE_MANAGED_PALETTE;
     383#endif
     384    pVideoMode->VideoMemoryBitmapWidth       = xres;
     385    pVideoMode->VideoMemoryBitmapHeight      = yres - yoffset;
     386    pVideoMode->DriverSpecificAttributeFlags = 0;
     387}
    334388
    335389#ifdef VBOX_WITH_GENERIC_MULTIMONITOR
     
    13881442 */
    13891443#define MAX_VIDEO_MODES 128
    1390 #ifndef VBOX_WITH_MULTIMONITOR_FIX
    1391 static VIDEO_MODE_INFORMATION VideoModes[MAX_VIDEO_MODES + 2] = { 0 };
    1392 #else
    13931444/*
    13941445 * Additional space is reserved for custom video modes for 64 guest monitors.
     
    13961447 */
    13971448static VIDEO_MODE_INFORMATION VideoModes[MAX_VIDEO_MODES + 64 + 2] = { 0 };
    1398 /* On the driver startup this is initialized from registry (replaces gCustom*). */
     1449
     1450/*
     1451 * The last custom resolution set for each display. This is important
     1452 * for system startup so that we report the last currently set
     1453 * custom resolution and Windows can use it again.
     1454 * On the driver startup this is initialized from registry.
     1455 */
    13991456static VIDEO_MODE_INFORMATION CustomVideoModes[64] = { 0 };
    1400 #endif /* VBOX_WITH_MULTIMONITOR_FIX */
     1457
    14011458/* number of available video modes, set by VBoxBuildModesTable  */
    14021459static uint32_t gNumVideoModes = 0;
    14031460
    1404 #ifdef VBOX_WITH_MULTIMONITOR_FIX
    1405 static void initVideoModeInformation(VIDEO_MODE_INFORMATION *pVideoMode, ULONG xres, ULONG yres, ULONG bpp, ULONG index, ULONG yoffset)
    1406 {
    1407     /*
    1408      * Build mode entry.
    1409      */
    1410     memset(pVideoMode, 0, sizeof(VIDEO_MODE_INFORMATION));
    1411 
    1412     pVideoMode->Length                       = sizeof(VIDEO_MODE_INFORMATION);
    1413     pVideoMode->ModeIndex                    = index;
    1414     pVideoMode->VisScreenWidth               = xres;
    1415     pVideoMode->VisScreenHeight              = yres - yoffset;
    1416     pVideoMode->ScreenStride                 = xres * ((bpp + 7) / 8);
    1417     pVideoMode->NumberOfPlanes               = 1;
    1418     pVideoMode->BitsPerPlane                 = bpp;
    1419     pVideoMode->Frequency                    = 60;
    1420     pVideoMode->XMillimeter                  = 320;
    1421     pVideoMode->YMillimeter                  = 240;
    1422     switch (bpp)
    1423     {
    1424 #ifdef VBOX_WITH_8BPP_MODES
    1425         case 8:
    1426             pVideoMode->NumberRedBits        = 6;
    1427             pVideoMode->NumberGreenBits      = 6;
    1428             pVideoMode->NumberBlueBits       = 6;
    1429             pVideoMode->RedMask              = 0;
    1430             pVideoMode->GreenMask            = 0;
    1431             pVideoMode->BlueMask             = 0;
    1432             break;
    1433 #endif
    1434         case 16:
    1435             pVideoMode->NumberRedBits        = 5;
    1436             pVideoMode->NumberGreenBits      = 6;
    1437             pVideoMode->NumberBlueBits       = 5;
    1438             pVideoMode->RedMask              = 0xF800;
    1439             pVideoMode->GreenMask            = 0x7E0;
    1440             pVideoMode->BlueMask             = 0x1F;
    1441             break;
    1442         case 24:
    1443             pVideoMode->NumberRedBits        = 8;
    1444             pVideoMode->NumberGreenBits      = 8;
    1445             pVideoMode->NumberBlueBits       = 8;
    1446             pVideoMode->RedMask              = 0xFF0000;
    1447             pVideoMode->GreenMask            = 0xFF00;
    1448             pVideoMode->BlueMask             = 0xFF;
    1449             break;
    1450         case 32:
    1451             pVideoMode->NumberRedBits        = 8;
    1452             pVideoMode->NumberGreenBits      = 8;
    1453             pVideoMode->NumberBlueBits       = 8;
    1454             pVideoMode->RedMask              = 0xFF0000;
    1455             pVideoMode->GreenMask            = 0xFF00;
    1456             pVideoMode->BlueMask             = 0xFF;
    1457             break;
    1458     }
    1459     pVideoMode->AttributeFlags               = VIDEO_MODE_GRAPHICS | VIDEO_MODE_COLOR | VIDEO_MODE_NO_OFF_SCREEN;
    1460 #ifdef VBOX_WITH_8BPP_MODES
    1461     if (bpp == 8)
    1462         pVideoMode->AttributeFlags          |= VIDEO_MODE_PALETTE_DRIVEN | VIDEO_MODE_MANAGED_PALETTE;
    1463 #endif
    1464     pVideoMode->VideoMemoryBitmapWidth       = xres;
    1465     pVideoMode->VideoMemoryBitmapHeight      = yres - yoffset;
    1466     pVideoMode->DriverSpecificAttributeFlags = 0;
    1467 }
    1468 #endif /* VBOX_WITH_MULTIMONITOR_FIX */
    1469 
    1470 
     1461/* Remember which video mode was not set because there was no enough VRAM.
     1462 * So repeated entries will be not written to the guest log.
     1463 */
    14711464static uint32_t g_xresNoVRAM = 0, g_yresNoVRAM = 0, g_bppNoVRAM = 0;
    14721465
     
    20322025     */
    20332026
    2034 #ifdef VBOX_WITH_MULTIMONITOR_FIX
    20352027    /* Add custom resolutions for each display and then for the display change request, if exists.
    20362028     */
     
    21052097        }
    21062098    }
    2107 #endif /* VBOX_WITH_MULTIMONITOR_FIX */
    2108 
    2109 #ifndef VBOX_WITH_MULTIMONITOR_FIX
    2110     uint32_t xres = 0, yres = 0, bpp = 0, display = 0;
    2111     if (   (   vboxQueryDisplayRequest(&xres, &yres, &bpp, &display)
    2112             && (xres || yres || bpp))
    2113         || (gCustomXRes || gCustomYRes || gCustomBPP))
    2114 #else
     2099
    21152100    if (fDisplayChangeRequest || DeviceExtension->CurrentMode == 0)
    2116 #endif /* VBOX_WITH_MULTIMONITOR_FIX */
    21172101    {
    21182102#ifndef VBOX_WITH_WDDM
     
    21272111             * The custom mode might be not valid anymore and would block any hints from host.
    21282112             */
    2129 #ifndef VBOX_WITH_MULTIMONITOR_FIX
    2130             if (!xres)
    2131                 xres = gCustomXRes;
    2132             if (!yres)
    2133                 yres = gCustomYRes;
    2134             if (!bpp)
    2135                 bpp  = gCustomBPP;
    2136             dprintf(("VBoxVideo: using stored custom resolution %dx%dx%d\n", xres, yres, bpp));
    2137 #else
    21382113            if (!xres)
    21392114                xres = CustomVideoModes[DeviceExtension->iDevice].VisScreenWidth;
     
    21432118                bpp  = CustomVideoModes[DeviceExtension->iDevice].BitsPerPlane;
    21442119            dprintf(("VBoxVideo: using stored custom resolution %dx%dx%d for %d\n", xres, yres, bpp, DeviceExtension->iDevice));
    2145 #endif /* VBOX_WITH_MULTIMONITOR_FIX */
    21462120        }
    21472121        /* round down to multiple of 8 if necessary */
     
    21972171
    21982172            {
    2199                 /* we need an alternating index */
    2200 #ifdef VBOX_WITH_MULTIMONITOR_FIX
    2201                 /* Only alternate index if the new custom mode differs from the last one
     2173                /* We need an alternating index so the guest will recognoize the mode as a new one.
     2174                 * However only alternate index if the new custom mode differs from the last one
    22022175                 * (only resolution and bpp changes are important, a display change does not matter).
    22032176                 * Always add 2 last entries to the mode array, so number of video modes
     
    22182191                }
    22192192                BOOLEAN fAlternatedIndex = FALSE;
    2220 #endif /* VBOX_WITH_MULTIMONITOR_FIX */
    22212193#ifndef VBOX_WITH_WDDM
    22222194                if (DeviceExtension->CurrentMode != 0)
     
    22242196                if (commonFromDeviceExt(DeviceExtension)->cDisplays && DeviceExtension->aSources[0].pPrimaryAllocation)
    22252197#endif
    2226 #ifndef VBOX_WITH_MULTIMONITOR_FIX
    2227                 {
    2228                     if (gInvocationCounter % 2)
    2229                         gNumVideoModes++;
    2230                     gInvocationCounter++;
    2231                 }
    2232 #else
    22332198                {
    22342199                    if (fNewInvocation)
     
    22472212                    fNewInvocation = FALSE;
    22482213                }
    2249 #endif /* VBOX_WITH_MULTIMONITOR_FIX */
    22502214
    22512215                dprintf(("VBoxVideo: setting special mode to xres = %d, yres = %d, bpp = %d, display = %d\n", xres, yres, bpp, display));
    2252 #ifdef VBOX_WITH_MULTIMONITOR_FIX
    22532216                dprintf(("VBoxVideo: fNewInvocation = %d, fAlternatedIndex = %d\n", fNewInvocation, fAlternatedIndex));
    2254 #endif /* VBOX_WITH_MULTIMONITOR_FIX */
    22552217#ifdef VBOX_WITH_WDDM
    22562218                /* assign host-supplied as the most preferable */
     
    23182280                VideoModes[gNumVideoModes].VideoMemoryBitmapHeight      = yres;
    23192281                VideoModes[gNumVideoModes].DriverSpecificAttributeFlags = 0;
    2320 #ifdef VBOX_WITH_MULTIMONITOR_FIX
     2282
    23212283                /* Save the mode in the list of custom modes for this display. */
    23222284                CustomVideoModes[DeviceExtension->iDevice] = VideoModes[gNumVideoModes];
    2323 #endif /* VBOX_WITH_MULTIMONITOR_FIX */
    23242285                ++gNumVideoModes;
    23252286
     
    23362297                    gNumVideoModes++;
    23372298                }
    2338 #ifdef VBOX_WITH_MULTIMONITOR_FIX
    23392299                else if (!fAlternatedIndex)
    23402300                {
     
    23442304                    gNumVideoModes++;
    23452305                }
    2346 #endif /* VBOX_WITH_MULTIMONITOR_FIX */
    2347 
    2348 #ifndef VBOX_WITH_MULTIMONITOR_FIX
    2349                 /* store this video mode as the last custom video mode */
    2350                 status = VBoxVideoCmnRegSetDword(Reg, L"CustomXRes", xres);
    2351                 if (status != NO_ERROR)
    2352                     dprintf(("VBoxVideo: error %d writing CustomXRes\n", status));
    2353                 status = VBoxVideoCmnRegSetDword(Reg, L"CustomYRes", yres);
    2354                 if (status != NO_ERROR)
    2355                     dprintf(("VBoxVideo: error %d writing CustomYRes\n", status));
    2356                 status = VBoxVideoCmnRegSetDword(Reg, L"CustomBPP", bpp);
    2357                 if (status != NO_ERROR)
    2358                     dprintf(("VBoxVideo: error %d writing CustomBPP\n", status));
    2359 #else
     2306
    23602307                /* Save the custom mode for this display. */
    23612308                if (DeviceExtension->iDevice == 0)
     
    23882335                        dprintf(("VBoxVideo: error %d writing CustomBPP%d\n", status, DeviceExtension->iDevice));
    23892336                }
    2390 #endif /* VBOX_WITH_MULTIMONITOR_FIX */
    23912337            }
    23922338            else
     
    29372883    dprintf(("VBoxVideo::vboxVideoInitCustomVideoModes\n"));
    29382884
    2939 #ifndef VBOX_WITH_MULTIMONITOR_FIX
    2940     /*
    2941      * Get the last custom resolution
    2942      */
    2943     status = VBoxVideoCmnRegQueryDword(Reg, L"CustomXRes", &gCustomXRes);
    2944     if (status != NO_ERROR)
    2945         gCustomXRes = 0;
    2946 
    2947     status = VBoxVideoCmnRegQueryDword(Reg, L"CustomYRes", &gCustomYRes);
    2948     if (status != NO_ERROR)
    2949         gCustomYRes = 0;
    2950     status = VBoxVideoCmnRegQueryDword(Reg, L"CustomBPP", &gCustomBPP);
    2951     if (status != NO_ERROR)
    2952         gCustomBPP = 0;
    2953 
    2954    dprintf(("VBoxVideo: got stored custom resolution %dx%dx%d\n", gCustomXRes, gCustomYRes, gCustomBPP));
    2955 #else
    29562885    /* Initialize all custom modes to the 800x600x32. */
    29572886    initVideoModeInformation(&CustomVideoModes[0], 800, 600, 32, 0, 0);
     
    30272956        }
    30282957    }
    3029 #endif /* VBOX_WITH_MULTIMONITOR_FIX */
    30302958
    30312959    VBoxVideoCmnRegFini(Reg);
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