Changeset 49450 in vbox for trunk/src/VBox/Additions/WINNT/Graphics
- Timestamp:
- Nov 12, 2013 12:33:30 PM (11 years ago)
- Location:
- trunk/src/VBox/Additions/WINNT/Graphics/Video/mp
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/common/VBoxMPCommon.h
r48070 r49450 30 30 31 31 /* Video modes related */ 32 #define VBOXMP_MAX_VIDEO_MODES 12833 32 void VBoxMPCmnInitCustomVideoModes(PVBOXMP_DEVEXT pExt); 34 33 VIDEO_MODE_INFORMATION* VBoxMPCmnGetCustomVideoModeInfo(ULONG ulIndex); 35 34 36 35 #ifdef VBOX_XPDM_MINIPORT 37 VIDEO_MODE_INFORMATION* VBoxMPCmnGetVideoModeInfo( ULONG ulIndex);36 VIDEO_MODE_INFORMATION* VBoxMPCmnGetVideoModeInfo(PVBOXMP_DEVEXT pExt, ULONG ulIndex); 38 37 VIDEO_MODE_INFORMATION* VBoxMPXpdmCurrentVideoMode(PVBOXMP_DEVEXT pExt); 39 ULONG VBoxMPXpdmGetVideoModesCount( );38 ULONG VBoxMPXpdmGetVideoModesCount(PVBOXMP_DEVEXT pExt); 40 39 void VBoxMPXpdmBuildVideoModesTable(PVBOXMP_DEVEXT pExt); 41 40 #endif -
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/common/VBoxMPDevExt.h
r49332 r49450 28 28 # include <video.h> 29 29 # include "common/xpdm/VBoxVideoPortAPI.h" 30 #include <VBox/Hardware/VBoxVideoVBE.h> 30 31 #endif 31 32 … … 37 38 #endif 38 39 40 #define VBOXMP_MAX_VIDEO_MODES 128 39 41 typedef struct VBOXMP_COMMON 40 42 { … … 77 79 78 80 ULONG iDevice; /* Device index: 0 for primary, otherwise a secondary device. */ 79 81 /* 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. 84 */ 85 VIDEO_MODE_INFORMATION aVideoModes[VBOXMP_MAX_VIDEO_MODES + VBOX_VIDEO_MAX_SCREENS * 2]; 86 /* Number of available video modes, set by VBoxMPCmnBuildVideoModesTable. */ 87 uint32_t cVideoModes; 80 88 ULONG CurrentMode; /* Saved information about video modes */ 81 89 ULONG CurrentModeWidth; -
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/common/VBoxMPVidModes.cpp
r49273 r49450 32 32 /* Custom video modes which are being read from registry at driver startup. */ 33 33 static VIDEO_MODE_INFORMATION g_CustomVideoModes[VBOX_VIDEO_MAX_SCREENS] = { 0 }; 34 35 #ifdef VBOX_XPDM_MINIPORT36 /* Standart video modes list.37 * Additional space is reserved for custom video modes for VBOX_VIDEO_MAX_SCREENS guest monitors.38 * The custom video mode index is alternating for each mode set and 2 indexes are needed for each custom mode.39 */40 static VIDEO_MODE_INFORMATION g_VideoModes[VBOXMP_MAX_VIDEO_MODES + VBOX_VIDEO_MAX_SCREENS * 2] = { 0 };41 42 /* Number of available video modes, set by VBoxMPCmnBuildVideoModesTable. */43 static uint32_t g_NumVideoModes = 0;44 #endif45 34 46 35 static BOOLEAN … … 218 207 219 208 #ifdef VBOX_XPDM_MINIPORT 220 VIDEO_MODE_INFORMATION* VBoxMPCmnGetVideoModeInfo( ULONG ulIndex)221 { 222 return (ulIndex<RT_ELEMENTS( g_VideoModes)) ? &g_VideoModes[ulIndex] : NULL;209 VIDEO_MODE_INFORMATION* VBoxMPCmnGetVideoModeInfo(PVBOXMP_DEVEXT pExt, ULONG ulIndex) 210 { 211 return (ulIndex<RT_ELEMENTS(pExt->aVideoModes)) ? &pExt->aVideoModes[ulIndex] : NULL; 223 212 } 224 213 #endif … … 728 717 VIDEO_MODE_INFORMATION* VBoxMPXpdmCurrentVideoMode(PVBOXMP_DEVEXT pExt) 729 718 { 730 return VBoxMPCmnGetVideoModeInfo(pExt ->CurrentMode - 1);731 } 732 733 ULONG VBoxMPXpdmGetVideoModesCount( )734 { 735 return g_NumVideoModes;719 return VBoxMPCmnGetVideoModeInfo(pExt, pExt->CurrentMode - 1); 720 } 721 722 ULONG VBoxMPXpdmGetVideoModesCount(PVBOXMP_DEVEXT pExt) 723 { 724 return pExt->cVideoModes; 736 725 } 737 726 … … 752 741 * for custom mode alternating indexes. 753 742 */ 754 cStandartModes = VBoxMPFillModesTable(pExt, pExt->iDevice, g_VideoModes, VBOXMP_MAX_VIDEO_MODES, NULL);743 cStandartModes = VBoxMPFillModesTable(pExt, pExt->iDevice, pExt->aVideoModes, VBOXMP_MAX_VIDEO_MODES, NULL); 755 744 756 745 /* Add custom modes for all displays to the table */ … … 772 761 773 762 /* Fill the special mode. */ 774 memcpy(& g_VideoModes[iSpecialMode], &g_CustomVideoModes[i], sizeof(VIDEO_MODE_INFORMATION));775 g_VideoModes[iSpecialMode].ModeIndex = iSpecialMode + 1;763 memcpy(&pDisplayExt->aVideoModes[iSpecialMode], &g_CustomVideoModes[i], sizeof(VIDEO_MODE_INFORMATION)); 764 pDisplayExt->aVideoModes[iSpecialMode].ModeIndex = iSpecialMode + 1; 776 765 777 766 /* Wipe the other entry so it is not selected. */ 778 memcpy(& g_VideoModes[iStandardMode], &g_VideoModes[3], sizeof(VIDEO_MODE_INFORMATION));779 g_VideoModes[iStandardMode].ModeIndex = iStandardMode + 1;767 memcpy(&pDisplayExt->aVideoModes[iStandardMode], &pDisplayExt->aVideoModes[3], sizeof(VIDEO_MODE_INFORMATION)); 768 pDisplayExt->aVideoModes[iStandardMode].ModeIndex = iStandardMode + 1; 780 769 781 770 pDisplayExt = pDisplayExt->pNext; … … 784 773 { 785 774 /* Should not happen, but better to fallback than to crash. */ 786 memcpy(& g_VideoModes[iModeBase], &g_CustomVideoModes[i], sizeof(VIDEO_MODE_INFORMATION));787 g_VideoModes[iModeBase].ModeIndex = iModeBase + 1;788 789 g_VideoModes[iModeBase + 1] = g_VideoModes[iModeBase];790 g_VideoModes[iModeBase + 1].ModeIndex += 1;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; 791 780 792 781 iSpecialMode = iModeBase; … … 795 784 LOG(("added special mode[%d] %dx%d:%d for display %d\n", 796 785 iSpecialMode, 797 g_VideoModes[iSpecialMode].VisScreenWidth,798 g_VideoModes[iSpecialMode].VisScreenHeight,799 g_VideoModes[iSpecialMode].BitsPerPlane,786 pExt->aVideoModes[iSpecialMode].VisScreenWidth, 787 pExt->aVideoModes[iSpecialMode].VisScreenHeight, 788 pExt->aVideoModes[iSpecialMode].BitsPerPlane, 800 789 i)); 801 790 } … … 822 811 823 812 /* Update number of modes. Each display has 2 entries for alternating custom mode index. */ 824 g_NumVideoModes = cStandartModes + cCustomModes * 2;813 pExt->cVideoModes = cStandartModes + cCustomModes * 2; 825 814 826 815 if (bHaveSpecial) … … 873 862 */ 874 863 specialMode.ModeIndex = iSpecialModeElement + 1; 875 memcpy(& g_VideoModes[iSpecialModeElement], &specialMode, sizeof(VIDEO_MODE_INFORMATION));864 memcpy(&pExt->aVideoModes[iSpecialModeElement], &specialMode, sizeof(VIDEO_MODE_INFORMATION)); 876 865 877 866 /* Save special mode in the custom modes table */ … … 879 868 880 869 /* Wipe the old entry so the special mode will be found in the new positions. */ 881 memcpy(& g_VideoModes[iSpecialModeElementOld], &g_VideoModes[3], sizeof(VIDEO_MODE_INFORMATION));882 g_VideoModes[iSpecialModeElementOld].ModeIndex = iSpecialModeElementOld + 1;870 memcpy(&pExt->aVideoModes[iSpecialModeElementOld], &pExt->aVideoModes[3], sizeof(VIDEO_MODE_INFORMATION)); 871 pExt->aVideoModes[iSpecialModeElementOld].ModeIndex = iSpecialModeElementOld + 1; 883 872 884 873 /* Save special mode info to registry */ … … 889 878 do 890 879 { 891 LOG(("Filled %d modes", g_NumVideoModes));892 893 for (uint32_t i=0; i <g_NumVideoModes; ++i)880 LOG(("Filled %d modes", pExt->cVideoModes)); 881 882 for (uint32_t i=0; i < pExt->cVideoModes; ++i) 894 883 { 895 884 LOG(("Mode[%2d]: %4dx%4d:%2d (idx=%d)", 896 i, g_VideoModes[i].VisScreenWidth, g_VideoModes[i].VisScreenHeight,897 g_VideoModes[i].BitsPerPlane, g_VideoModes[i].ModeIndex));885 i, pExt->aVideoModes[i].VisScreenWidth, pExt->aVideoModes[i].VisScreenHeight, 886 pExt->aVideoModes[i].BitsPerPlane, pExt->aVideoModes[i].ModeIndex)); 898 887 } 899 888 } while (0); -
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/xpdm/VBoxMPDriver.cpp
r48944 r49450 310 310 PVIDEO_MODE_INFORMATION pModes = (PVIDEO_MODE_INFORMATION) RequestPacket->OutputBuffer; 311 311 312 if (RequestPacket->OutputBufferLength < VBoxMPXpdmGetVideoModesCount( )*sizeof(VIDEO_MODE_INFORMATION))312 if (RequestPacket->OutputBufferLength < VBoxMPXpdmGetVideoModesCount(pExt)*sizeof(VIDEO_MODE_INFORMATION)) 313 313 { 314 314 pStatus->Status = ERROR_INSUFFICIENT_BUFFER; -
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/xpdm/VBoxMPIOCTL.cpp
r48944 r49450 193 193 } 194 194 195 pModeInfo = VBoxMPCmnGetVideoModeInfo( RequestedMode-1);195 pModeInfo = VBoxMPCmnGetVideoModeInfo(pExt, RequestedMode-1); 196 196 if (!pModeInfo) 197 197 { … … 250 250 VBoxMPXpdmBuildVideoModesTable(pExt); 251 251 252 pNumModes->NumModes = VBoxMPXpdmGetVideoModesCount( );252 pNumModes->NumModes = VBoxMPXpdmGetVideoModesCount(pExt); 253 253 pNumModes->ModeInformationLength = sizeof(VIDEO_MODE_INFORMATION); 254 254 pStatus->Information = sizeof(VIDEO_NUM_MODES); … … 265 265 LOGF_ENTER(); 266 266 267 ULONG ulSize = VBoxMPXpdmGetVideoModesCount( )*sizeof(VIDEO_MODE_INFORMATION);267 ULONG ulSize = VBoxMPXpdmGetVideoModesCount(pExt)*sizeof(VIDEO_MODE_INFORMATION); 268 268 pStatus->Information = ulSize; 269 VideoPortMoveMemory(pModes, VBoxMPCmnGetVideoModeInfo( 0), ulSize);269 VideoPortMoveMemory(pModes, VBoxMPCmnGetVideoModeInfo(pExt, 0), ulSize); 270 270 271 271 LOGF_LEAVE();
Note:
See TracChangeset
for help on using the changeset viewer.