VirtualBox

Changeset 27887 in vbox


Ignore:
Timestamp:
Mar 31, 2010 12:29:32 PM (15 years ago)
Author:
vboxsync
Message:

Windows guest additions VBoxVideo multimonitor fixes (xTracker 4655).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/WINNT/Graphics/Miniport/VBoxVideo.cpp

    r27839 r27887  
    849849    }
    850850
     851    dprintf(("display = %d, DeviceExtension->iDevice = %d\n", display, DeviceExtension->iDevice));
     852    if (display != DeviceExtension->iDevice)
     853    {
     854        /* No need to go through the custom mode logic. And no need to clear the custom mode
     855         * entry in the next 'for' loop.
     856         */
     857        fDisplayChangeRequest = FALSE;
     858    }
     859
    851860    dprintf(("VBoxVideo: fDisplayChangeRequest = %d\n", fDisplayChangeRequest));
    852861
     
    859868        if (fDisplayChangeRequest && iCustomMode == display)
    860869        {
    861             /* Do not keep info for this display to make sure that
     870            /* Do not keep info for this display, which received a video mode hint, to make sure that
    862871             * the new mode will be taken from the alternating index entries actually.
    863872             */
     
    877886        gNumVideoModes++;
    878887    }
     888
     889    if (display != DeviceExtension->iDevice)
     890    {
     891        /* The display change is for another monitor. Just add 2 standard modes to the table
     892         * to make enough entries. This is not necessary if it is a first mode set (CurrentMode == 0),
     893         * because these 2 entries will be added by "if (fDisplayChangeRequest || DeviceExtension->CurrentMode == 0)"
     894         * code branch.
     895         */
     896        if (DeviceExtension->CurrentMode != 0)
     897        {
     898            dprintf(("Filling custom mode entries.\n"));
     899            memcpy(&VideoModes[gNumVideoModes], &VideoModes[3], sizeof(VIDEO_MODE_INFORMATION));
     900            VideoModes[gNumVideoModes].ModeIndex = gNumVideoModes + 1;
     901            gNumVideoModes++;
     902            memcpy(&VideoModes[gNumVideoModes], &VideoModes[3], sizeof(VIDEO_MODE_INFORMATION));
     903            VideoModes[gNumVideoModes].ModeIndex = gNumVideoModes + 1;
     904            gNumVideoModes++;
     905        }
     906    }
    879907#endif /* VBOX_WITH_MULTIMONITOR_FIX */
    880908
    881    
    882909#ifndef VBOX_WITH_MULTIMONITOR_FIX
    883910    uint32_t xres = 0, yres = 0, bpp = 0, display = 0;
     
    907934            if (!bpp)
    908935                bpp  = gCustomBPP;
     936            dprintf(("VBoxVideo: using stored custom resolution %dx%dx%d\n", xres, yres, bpp));
    909937#else
    910938            if (!xres)
    911                 xres = CustomVideoModes[display].VisScreenWidth;
     939                xres = CustomVideoModes[DeviceExtension->iDevice].VisScreenWidth;
    912940            if (!yres)
    913                 yres = CustomVideoModes[display].VisScreenHeight;
     941                yres = CustomVideoModes[DeviceExtension->iDevice].VisScreenHeight;
    914942            if (!bpp)
    915                 bpp  = CustomVideoModes[display].BitsPerPlane;
     943                bpp  = CustomVideoModes[DeviceExtension->iDevice].BitsPerPlane;
     944            dprintf(("VBoxVideo: using stored custom resolution %dx%dx%d for %d\n", xres, yres, bpp, DeviceExtension->iDevice));
    916945#endif /* VBOX_WITH_MULTIMONITOR_FIX */
    917             dprintf(("VBoxVideo: using stored custom resolution %dx%dx%d\n", xres, yres, bpp));
    918946        }
    919947        /* round down to multiple of 8 */
     
    10861114#ifdef VBOX_WITH_MULTIMONITOR_FIX
    10871115                /* Save the mode in the list of custom modes for this display. */
    1088                 CustomVideoModes[display] = VideoModes[gNumVideoModes];
     1116                CustomVideoModes[DeviceExtension->iDevice] = VideoModes[gNumVideoModes];
    10891117#endif /* VBOX_WITH_MULTIMONITOR_FIX */
    10901118                ++gNumVideoModes;
     
    11251153#else
    11261154                /* Save the custom mode for this display. */
    1127                 if (display == 0)
     1155                if (DeviceExtension->iDevice == 0)
    11281156                {
    11291157                    /* Name without a suffix */
     
    11411169                {
    11421170                    wchar_t keyname[32];
    1143                     swprintf(keyname, L"CustomXRes%d", display);
     1171                    swprintf(keyname, L"CustomXRes%d", DeviceExtension->iDevice);
    11441172                    status = VBoxVideoCmnRegSetDword(Reg, keyname, xres);
    11451173                    if (status != NO_ERROR)
    1146                         dprintf(("VBoxVideo: error %d writing CustomXRes%d\n", status, display));
    1147                     swprintf(keyname, L"CustomYRes%d", display);
     1174                        dprintf(("VBoxVideo: error %d writing CustomXRes%d\n", status, DeviceExtension->iDevice));
     1175                    swprintf(keyname, L"CustomYRes%d", DeviceExtension->iDevice);
    11481176                    status = VBoxVideoCmnRegSetDword(Reg, keyname, yres);
    11491177                    if (status != NO_ERROR)
    1150                         dprintf(("VBoxVideo: error %d writing CustomYRes%d\n", status, display));
    1151                     swprintf(keyname, L"CustomBPP%d", display);
     1178                        dprintf(("VBoxVideo: error %d writing CustomYRes%d\n", status, DeviceExtension->iDevice));
     1179                    swprintf(keyname, L"CustomBPP%d", DeviceExtension->iDevice);
    11521180                    status = VBoxVideoCmnRegSetDword(Reg, keyname, bpp);
    11531181                    if (status != NO_ERROR)
    1154                         dprintf(("VBoxVideo: error %d writing CustomBPP%d\n", status, display));
     1182                        dprintf(("VBoxVideo: error %d writing CustomBPP%d\n", status, DeviceExtension->iDevice));
    11551183                }
    11561184#endif /* VBOX_WITH_MULTIMONITOR_FIX */
     
    11791207        int i;
    11801208#ifndef VBOXWDDM
    1181         dprintf(("VBoxVideo: VideoModes (CurrentMode = %d)\n", DeviceExtension->CurrentMode));
     1209        dprintf(("VBoxVideo: VideoModes (CurrentMode = %d, last #%d)\n", DeviceExtension->CurrentMode, gNumVideoModes));
    11821210#endif
    1183         for (i=0; i<MAX_VIDEO_MODES + 2; i++)
     1211        for (i = 0; i < RT_ELEMENTS(VideoModes); i++)
    11841212        {
    11851213            if (   VideoModes[i].VisScreenWidth
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