VirtualBox

Changeset 49458 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Nov 13, 2013 10:32:13 AM (11 years ago)
Author:
vboxsync
Message:

WINNT/VBoxVideo: separate mode table for each guest monitor.

Location:
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/common
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/common/VBoxMPDevExt.h

    r49450 r49458  
    2828# include <video.h>
    2929# include "common/xpdm/VBoxVideoPortAPI.h"
    30 #include <VBox/Hardware/VBoxVideoVBE.h>
    3130#endif
    3231
     
    8079   ULONG iDevice;                              /* Device index: 0 for primary, otherwise a secondary device. */
    8180   /* Standart video modes list.
    82     * Additional space is reserved for custom video modes for VBOX_VIDEO_MAX_SCREENS guest monitors.
    83     * The custom video mode index is alternating for each mode set and 2 indexes are needed for each custom mode.
     81    * Additional space is reserved for a custom video mode for this guest monitor.
     82    * The custom video mode index is alternating for each mode set and 2 indexes are needed for the custom mode.
    8483    */
    85    VIDEO_MODE_INFORMATION aVideoModes[VBOXMP_MAX_VIDEO_MODES + VBOX_VIDEO_MAX_SCREENS * 2];
     84   VIDEO_MODE_INFORMATION aVideoModes[VBOXMP_MAX_VIDEO_MODES + 2];
    8685   /* Number of available video modes, set by VBoxMPCmnBuildVideoModesTable. */
    8786   uint32_t cVideoModes;
  • trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/common/VBoxMPVidModes.cpp

    r49450 r49458  
    733733void VBoxMPXpdmBuildVideoModesTable(PVBOXMP_DEVEXT pExt)
    734734{
    735     uint32_t cStandartModes, cCustomModes;
     735    uint32_t cStandartModes;
    736736    BOOLEAN bPending, bHaveSpecial;
    737737    VIDEO_MODE_INFORMATION specialMode;
     
    743743    cStandartModes = VBoxMPFillModesTable(pExt, pExt->iDevice, pExt->aVideoModes, VBOXMP_MAX_VIDEO_MODES, NULL);
    744744
    745     /* Add custom modes for all displays to the table */
    746     cCustomModes = VBoxCommonFromDeviceExt(pExt)->cDisplays;
    747     PVBOXMP_DEVEXT pDisplayExt = pExt->pPrimary; /* Corresponds to the display number in the loop. */
    748     for (uint32_t i=0; i<cCustomModes; i++)
    749     {
    750         /* Make 2 entries in the video mode table. */
    751         uint32_t iModeBase = cStandartModes + 2*i;
    752         uint32_t iSpecialMode;
    753 
    754         if (pDisplayExt)
    755         {
    756             /* Take the alternating index into account. */
    757             BOOLEAN bAlternativeIndex = (pDisplayExt->iInvocationCounter % 2)? TRUE: FALSE;
    758 
    759             iSpecialMode = iModeBase + (bAlternativeIndex? 1: 0);
    760             uint32_t iStandardMode = iModeBase + (bAlternativeIndex? 0: 1);
    761 
    762             /* Fill the special mode. */
    763             memcpy(&pDisplayExt->aVideoModes[iSpecialMode], &g_CustomVideoModes[i], sizeof(VIDEO_MODE_INFORMATION));
    764             pDisplayExt->aVideoModes[iSpecialMode].ModeIndex = iSpecialMode + 1;
    765 
    766             /* Wipe the other entry so it is not selected. */
    767             memcpy(&pDisplayExt->aVideoModes[iStandardMode], &pDisplayExt->aVideoModes[3], sizeof(VIDEO_MODE_INFORMATION));
    768             pDisplayExt->aVideoModes[iStandardMode].ModeIndex = iStandardMode + 1;
    769 
    770             pDisplayExt = pDisplayExt->pNext;
    771         }
    772         else
    773         {
    774             /* Should not happen, but better to fallback than to crash. */
    775             memcpy(&pExt->aVideoModes[iModeBase], &g_CustomVideoModes[i], sizeof(VIDEO_MODE_INFORMATION));
    776             pExt->aVideoModes[iModeBase].ModeIndex = iModeBase + 1;
    777 
    778             pExt->aVideoModes[iModeBase + 1] = pExt->aVideoModes[iModeBase];
    779             pExt->aVideoModes[iModeBase + 1].ModeIndex += 1;
    780 
    781             iSpecialMode = iModeBase;
    782         }
    783 
    784         LOG(("added special mode[%d] %dx%d:%d for display %d\n",
    785              iSpecialMode,
    786              pExt->aVideoModes[iSpecialMode].VisScreenWidth,
    787              pExt->aVideoModes[iSpecialMode].VisScreenHeight,
    788              pExt->aVideoModes[iSpecialMode].BitsPerPlane,
    789              i));
    790     }
     745    /* Add custom mode for this display to the table */
     746    /* Make 2 entries in the video mode table. */
     747    uint32_t iModeBase = cStandartModes;
     748
     749    /* Take the alternating index into account. */
     750    BOOLEAN bAlternativeIndex = (pExt->iInvocationCounter % 2)? TRUE: FALSE;
     751
     752    uint32_t iSpecialMode = iModeBase + (bAlternativeIndex? 1: 0);
     753    uint32_t iStandardMode = iModeBase + (bAlternativeIndex? 0: 1);
     754
     755    /* Fill the special mode. */
     756    memcpy(&pExt->aVideoModes[iSpecialMode], &g_CustomVideoModes[pExt->iDevice], sizeof(VIDEO_MODE_INFORMATION));
     757    pExt->aVideoModes[iSpecialMode].ModeIndex = iSpecialMode + 1;
     758
     759    /* Wipe the other entry so it is not selected. */
     760    memcpy(&pExt->aVideoModes[iStandardMode], &pExt->aVideoModes[3], sizeof(VIDEO_MODE_INFORMATION));
     761    pExt->aVideoModes[iStandardMode].ModeIndex = iStandardMode + 1;
     762
     763    LOG(("added special mode[%d] %dx%d:%d for display %d\n",
     764         iSpecialMode,
     765         pExt->aVideoModes[iSpecialMode].VisScreenWidth,
     766         pExt->aVideoModes[iSpecialMode].VisScreenHeight,
     767         pExt->aVideoModes[iSpecialMode].BitsPerPlane,
     768         pExt->iDevice));
    791769
    792770    /* Check if host wants us to switch video mode and it's for this adapter */
     
    811789
    812790    /* Update number of modes. Each display has 2 entries for alternating custom mode index. */
    813     pExt->cVideoModes = cStandartModes + cCustomModes * 2;
     791    pExt->cVideoModes = cStandartModes + 2;
    814792
    815793    if (bHaveSpecial)
     
    851829        }
    852830
    853         uint32_t iSpecialModeElement = cStandartModes + 2 * pExt->iDevice + (bAlternativeIndex? 1: 0);
    854         uint32_t iSpecialModeElementOld = cStandartModes + 2 * pExt->iDevice + (bAlternativeIndex? 0: 1);
     831        uint32_t iSpecialModeElement = cStandartModes + (bAlternativeIndex? 1: 0);
     832        uint32_t iSpecialModeElementOld = cStandartModes + (bAlternativeIndex? 0: 1);
    855833
    856834        LOG(("add special mode[%d] %dx%d:%d for display %d (bChanged=%d, bAlternativeIndex=%d)",
     
    878856    do
    879857    {
    880         LOG(("Filled %d modes", pExt->cVideoModes));
     858        LOG(("Filled %d modes for display %d", pExt->cVideoModes, pExt->iDevice));
    881859
    882860        for (uint32_t i=0; i < pExt->cVideoModes; ++i)
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