Changeset 26324 in vbox for trunk/src/VBox/Additions/WINNT/Graphics/Miniport/VBoxVideo.cpp
- Timestamp:
- Feb 8, 2010 1:03:29 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/VBoxVideo.cpp
r26320 r26324 172 172 /* preferred mode index */ 173 173 static uint32_t gPreferredVideoMode = 0; 174 175 static D3DKMDT_2DREGION g_VBoxWddmVideoResolutions[RT_ELEMENTS(VideoModes)]; 176 static uint32_t g_VBoxWddmNumResolutions; 177 178 DECLINLINE(int) vboxWddmRectComparator(const D3DKMDT_2DREGION *pReg1, const D3DKMDT_2DREGION *pReg2) 179 { 180 int tmp = pReg1->cx - pReg2->cx; 181 if(tmp) 182 return tmp; 183 tmp = pReg1->cy - pReg2->cy; 184 return tmp; 185 } 186 187 /* builds a g_VBoxWddmVideoResolutions given VideoModes info */ 188 VOID vboxWddmBuildResolutionTable() 189 { 190 g_VBoxWddmNumResolutions = 0; 191 192 /* we don't care about the efficiency at this time */ 193 for (uint32_t i = 0; i < gNumVideoModes; ++i) 194 { 195 VIDEO_MODE_INFORMATION *pMode = &VideoModes[i]; 196 bool bFound = false; 197 for (uint32_t j = 0; j < g_VBoxWddmNumResolutions; ++j) 198 { 199 if (g_VBoxWddmVideoResolutions[j].cx == pMode->VisScreenWidth 200 && g_VBoxWddmVideoResolutions[j].cy == pMode->VisScreenHeight) 201 { 202 bFound = true; 203 break; 204 } 205 } 206 207 if (!bFound) 208 { 209 g_VBoxWddmVideoResolutions[g_VBoxWddmNumResolutions].cx = pMode->VisScreenWidth; 210 g_VBoxWddmVideoResolutions[g_VBoxWddmNumResolutions].cy = pMode->VisScreenHeight; 211 } 212 } 213 } 174 214 #endif 175 215 … … 893 933 #endif 894 934 935 #ifdef VBOXWDDM 936 vboxWddmBuildResolutionTable(); 937 #endif 938 895 939 VBoxVideoCmnRegFini(Reg); 896 940 } … … 903 947 * or the available VRAM does not allow for additional modes. 904 948 */ 905 VOID VBoxWddmGetModesTable(PDEVICE_EXTENSION DeviceExtension, bool bRebuildTable, VIDEO_MODE_INFORMATION ** ppModes, uint32_t * pcModes, uint32_t * pPreferrableMode) 949 VOID VBoxWddmGetModesTable(PDEVICE_EXTENSION DeviceExtension, bool bRebuildTable, 950 VIDEO_MODE_INFORMATION ** ppModes, uint32_t * pcModes, uint32_t * pPreferrableMode, 951 D3DKMDT_2DREGION **ppResolutions, uint32_t * pcResolutions) 906 952 { 907 953 static bool bTableInitialized = false; … … 915 961 *pcModes = gNumVideoModes; 916 962 *pPreferrableMode = gPreferredVideoMode; 963 *ppResolutions = g_VBoxWddmVideoResolutions; 964 *pcResolutions = g_VBoxWddmNumResolutions; 917 965 } 918 966
Note:
See TracChangeset
for help on using the changeset viewer.