Changeset 32677 in vbox for trunk/src/VBox/Additions/WINNT/Graphics/Miniport
- Timestamp:
- Sep 21, 2010 5:12:27 PM (14 years ago)
- Location:
- trunk/src/VBox/Additions/WINNT/Graphics/Miniport
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/Makefile.kmk
r32622 r32677 90 90 endif 91 91 VBoxVideoWddm_DEFS += LOG_ENABLED 92 #VBoxVideoWddm_DEFS += VBOX_WITH_MULTIMONITOR_FIX 92 93 #VBoxVideoWddm_DEFS += LOG_TO_BACKDOOR 93 94 VBoxVideoWddm_INCS += ../../include -
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/VBoxVideo.cpp
r32650 r32677 51 51 */ 52 52 #ifndef VBOX_WITH_MULTIMONITOR_FIX 53 ULONGgCustomXRes = 0;54 ULONGgCustomYRes = 0;55 ULONGgCustomBPP = 0;53 uint32_t gCustomXRes = 0; 54 uint32_t gCustomYRes = 0; 55 uint32_t gCustomBPP = 0; 56 56 #endif /* !VBOX_WITH_MULTIMONITOR_FIX */ 57 57 … … 333 333 { 1600, 1200 }, 334 334 { 1920, 1440 }, 335 #ifndef VBOX_WITH_WDDM 335 336 /* multi screen modes with 1280x1024 */ 336 337 { 2560, 1024 }, … … 341 342 { 4800, 1200 }, 342 343 { 6400, 1200 }, 344 #endif 343 345 }; 344 346 size_t matrixSize = sizeof(resolutionMatrix) / sizeof(resolutionMatrix[0]); … … 1797 1799 #endif /* !VBOX_WITH_HGSMI */ 1798 1800 1801 void vboxVideoInitCustomVideoModes(PDEVICE_EXTENSION pDevExt) 1802 { 1803 VP_STATUS status; 1804 VBOXCMNREG Reg; 1805 1806 VBoxVideoCmnRegInit(pDevExt, &Reg); 1807 1808 dprintf(("VBoxVideo::vboxVideoInitCustomVideoModes\n")); 1809 1810 #ifndef VBOX_WITH_MULTIMONITOR_FIX 1811 /* 1812 * Get the last custom resolution 1813 */ 1814 status = VBoxVideoCmnRegQueryDword(Reg, L"CustomXRes", &gCustomXRes); 1815 if (status != NO_ERROR) 1816 gCustomXRes = 0; 1817 1818 status = VBoxVideoCmnRegQueryDword(Reg, L"CustomYRes", &gCustomYRes); 1819 if (status != NO_ERROR) 1820 gCustomYRes = 0; 1821 status = VBoxVideoCmnRegQueryDword(Reg, L"CustomBPP", &gCustomBPP); 1822 if (status != NO_ERROR) 1823 gCustomBPP = 0; 1824 1825 dprintf(("VBoxVideo: got stored custom resolution %dx%dx%d\n", gCustomXRes, gCustomYRes, gCustomBPP)); 1826 #else 1827 /* Initialize all custom modes to the 800x600x32. */ 1828 initVideoModeInformation(&CustomVideoModes[0], 800, 600, 32, 0, 0); 1829 1830 int iCustomMode; 1831 for (iCustomMode = 1; iCustomMode < RT_ELEMENTS(CustomVideoModes); iCustomMode++) 1832 { 1833 CustomVideoModes[iCustomMode] = CustomVideoModes[0]; 1834 } 1835 1836 /* Load stored custom resolution from the registry. */ 1837 for (iCustomMode = 0; 1838 #ifdef VBOX_WITH_WDDM 1839 iCustomMode < pDevExt->u.primary.cDisplays; 1840 #else 1841 iCustomMode < pDevExt->pPrimary->u.primary.cDisplays; 1842 #endif 1843 iCustomMode++) 1844 { 1845 /* 1846 * Get the last custom resolution 1847 */ 1848 uint32_t CustomXRes = 0, CustomYRes = 0, CustomBPP = 0; 1849 1850 if (iCustomMode == 0) 1851 { 1852 /* Name without a suffix */ 1853 status = VBoxVideoCmnRegQueryDword(Reg, L"CustomXRes", &CustomXRes); 1854 if (status != NO_ERROR) 1855 CustomXRes = 0; 1856 status = VBoxVideoCmnRegQueryDword(Reg, L"CustomYRes", &CustomYRes); 1857 if (status != NO_ERROR) 1858 CustomYRes = 0; 1859 status = VBoxVideoCmnRegQueryDword(Reg, L"CustomBPP", &CustomBPP); 1860 if (status != NO_ERROR) 1861 CustomBPP = 0; 1862 } 1863 else 1864 { 1865 wchar_t keyname[32]; 1866 swprintf(keyname, L"CustomXRes%d", iCustomMode); 1867 status = VBoxVideoCmnRegQueryDword(Reg, keyname, &CustomXRes); 1868 if (status != NO_ERROR) 1869 CustomXRes = 0; 1870 swprintf(keyname, L"CustomYRes%d", iCustomMode); 1871 status = VBoxVideoCmnRegQueryDword(Reg, keyname, &CustomYRes); 1872 if (status != NO_ERROR) 1873 CustomYRes = 0; 1874 swprintf(keyname, L"CustomBPP%d", iCustomMode); 1875 status = VBoxVideoCmnRegQueryDword(Reg, keyname, &CustomBPP); 1876 if (status != NO_ERROR) 1877 CustomBPP = 0; 1878 } 1879 1880 dprintf(("VBoxVideo: got stored custom resolution[%d] %dx%dx%d\n", iCustomMode, CustomXRes, CustomYRes, CustomBPP)); 1881 1882 if (CustomXRes || CustomYRes || CustomBPP) 1883 { 1884 if (CustomXRes == 0) 1885 { 1886 CustomXRes = CustomVideoModes[iCustomMode].VisScreenWidth; 1887 } 1888 if (CustomYRes == 0) 1889 { 1890 CustomYRes = CustomVideoModes[iCustomMode].VisScreenHeight; 1891 } 1892 if (CustomBPP == 0) 1893 { 1894 CustomBPP = CustomVideoModes[iCustomMode].BitsPerPlane; 1895 } 1896 1897 initVideoModeInformation(&CustomVideoModes[iCustomMode], CustomXRes, CustomYRes, CustomBPP, 0, 0); 1898 } 1899 } 1900 #endif /* VBOX_WITH_MULTIMONITOR_FIX */ 1901 1902 VBoxVideoCmnRegFini(Reg); 1903 } 1904 1799 1905 #ifndef VBOX_WITH_WDDM 1800 1906 … … 1943 2049 BOOLEAN VBoxVideoInitialize(PVOID HwDeviceExtension) 1944 2050 { 1945 VP_STATUS status;1946 1947 2051 dprintf(("VBoxVideo::VBoxVideoInitialize\n")); 1948 2052 … … 1952 2056 pDevExt->u.primary.pvReqFlush = NULL; 1953 2057 1954 #ifndef VBOX_WITH_MULTIMONITOR_FIX 1955 /* 1956 * Get the last custom resolution 1957 */ 1958 status = VideoPortGetRegistryParameters(HwDeviceExtension, 1959 L"CustomXRes", 1960 FALSE, 1961 VBoxRegistryCallback, 1962 &gCustomXRes); 1963 if (status != NO_ERROR) 1964 gCustomXRes = 0; 1965 status = VideoPortGetRegistryParameters(HwDeviceExtension, 1966 L"CustomYRes", 1967 FALSE, 1968 VBoxRegistryCallback, 1969 &gCustomYRes); 1970 if (status != NO_ERROR) 1971 gCustomYRes = 0; 1972 status = VideoPortGetRegistryParameters(HwDeviceExtension, 1973 L"CustomBPP", 1974 FALSE, 1975 VBoxRegistryCallback, 1976 &gCustomBPP); 1977 if (status != NO_ERROR) 1978 gCustomBPP = 0; 1979 1980 dprintf(("VBoxVideo: got stored custom resolution %dx%dx%d\n", gCustomXRes, gCustomYRes, gCustomBPP)); 1981 #else 1982 /* Initialize all custom modes to the 800x600x32. */ 1983 initVideoModeInformation(&CustomVideoModes[0], 800, 600, 32, 0, 0); 1984 1985 int iCustomMode; 1986 for (iCustomMode = 1; iCustomMode < RT_ELEMENTS(CustomVideoModes); iCustomMode++) 1987 { 1988 CustomVideoModes[iCustomMode] = CustomVideoModes[0]; 1989 } 1990 1991 /* Load stored custom resolution from the registry. */ 1992 PDEVICE_EXTENSION DeviceExtension = (PDEVICE_EXTENSION)HwDeviceExtension; 1993 for (iCustomMode = 0; iCustomMode < DeviceExtension->pPrimary->u.primary.cDisplays; iCustomMode++) 1994 { 1995 /* 1996 * Get the last custom resolution 1997 */ 1998 ULONG CustomXRes = 0, CustomYRes = 0, CustomBPP = 0; 1999 2000 if (iCustomMode == 0) 2001 { 2002 /* Name without a suffix */ 2003 status = VideoPortGetRegistryParameters(HwDeviceExtension, 2004 L"CustomXRes", 2005 FALSE, 2006 VBoxRegistryCallback, 2007 &CustomXRes); 2008 if (status != NO_ERROR) 2009 CustomXRes = 0; 2010 status = VideoPortGetRegistryParameters(HwDeviceExtension, 2011 L"CustomYRes", 2012 FALSE, 2013 VBoxRegistryCallback, 2014 &CustomYRes); 2015 if (status != NO_ERROR) 2016 CustomYRes = 0; 2017 status = VideoPortGetRegistryParameters(HwDeviceExtension, 2018 L"CustomBPP", 2019 FALSE, 2020 VBoxRegistryCallback, 2021 &CustomBPP); 2022 if (status != NO_ERROR) 2023 CustomBPP = 0; 2024 } 2025 else 2026 { 2027 wchar_t keyname[32]; 2028 swprintf(keyname, L"CustomXRes%d", iCustomMode); 2029 status = VideoPortGetRegistryParameters(HwDeviceExtension, 2030 keyname, 2031 FALSE, 2032 VBoxRegistryCallback, 2033 &CustomXRes); 2034 if (status != NO_ERROR) 2035 CustomXRes = 0; 2036 swprintf(keyname, L"CustomYRes%d", iCustomMode); 2037 status = VideoPortGetRegistryParameters(HwDeviceExtension, 2038 keyname, 2039 FALSE, 2040 VBoxRegistryCallback, 2041 &CustomYRes); 2042 if (status != NO_ERROR) 2043 CustomYRes = 0; 2044 swprintf(keyname, L"CustomBPP%d", iCustomMode); 2045 status = VideoPortGetRegistryParameters(HwDeviceExtension, 2046 keyname, 2047 FALSE, 2048 VBoxRegistryCallback, 2049 &CustomBPP); 2050 if (status != NO_ERROR) 2051 CustomBPP = 0; 2052 } 2053 2054 dprintf(("VBoxVideo: got stored custom resolution[%d] %dx%dx%d\n", iCustomMode, CustomXRes, CustomYRes, CustomBPP)); 2055 2056 if (CustomXRes || CustomYRes || CustomBPP) 2057 { 2058 if (CustomXRes == 0) 2059 { 2060 CustomXRes = CustomVideoModes[iCustomMode].VisScreenWidth; 2061 } 2062 if (CustomYRes == 0) 2063 { 2064 CustomYRes = CustomVideoModes[iCustomMode].VisScreenHeight; 2065 } 2066 if (CustomBPP == 0) 2067 { 2068 CustomBPP = CustomVideoModes[iCustomMode].BitsPerPlane; 2069 } 2070 2071 initVideoModeInformation(&CustomVideoModes[iCustomMode], CustomXRes, CustomYRes, CustomBPP, 0, 0); 2072 } 2073 } 2074 #endif /* VBOX_WITH_MULTIMONITOR_FIX */ 2058 vboxVideoInitCustomVideoModes(pDevExt); 2075 2059 2076 2060 return TRUE; -
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/VBoxVideo.h
r32622 r32677 655 655 D3DKMDT_2DREGION **ppResolutions, uint32_t * pcResolutions); 656 656 657 void vboxVideoInitCustomVideoModes(PDEVICE_EXTENSION pDevExt); 658 657 659 VOID VBoxWddmInvalidateModesTable(PDEVICE_EXTENSION DeviceExtension); 658 660 -
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoWddm.cpp
r32496 r32677 193 193 return STATUS_INVALID_PARAMETER; 194 194 195 Assert(0); 195 196 /* 196 197 * Set the current mode into the hardware. … … 221 222 bool vboxWddmCheckUpdateShadowAddress(PDEVICE_EXTENSION pDevExt, PVBOXWDDM_SOURCE pSource, UINT SegmentId, VBOXVIDEOOFFSET offVram) 222 223 { 224 if (pSource->pPrimaryAllocation->enmType == VBOXWDDM_ALLOC_TYPE_UMD_RC_GENERIC) 225 { 226 Assert(pSource->offVram == VBOXVIDEOOFFSET_VOID); 227 return false; 228 } 223 229 if (pSource->offVram == offVram) 224 230 return false; … … 2173 2179 VBOXWDDM_DMA_PRIVATEDATA_PRESENTHDR *pPrivateData = (VBOXWDDM_DMA_PRIVATEDATA_PRESENTHDR*)pPrivateDataBase; 2174 2180 VBOXWDDM_SOURCE *pSource = &pDevExt->aSources[pPrivateData->SrcAllocInfo.srcId]; 2181 PVBOXWDDM_ALLOCATION pDstAlloc = pPrivateData->DstAllocInfo.pAlloc; 2182 PVBOXWDDM_ALLOCATION pSrcAlloc = pPrivateData->SrcAllocInfo.pAlloc; 2183 vboxWddmAssignShadow(pDevExt, pSource, pSrcAlloc, pDstAlloc->SurfDesc.VidPnSourceId); 2175 2184 vboxWddmCheckUpdateShadowAddress(pDevExt, pSource, pPrivateData->SrcAllocInfo.segmentIdAlloc, pPrivateData->SrcAllocInfo.offAlloc); 2176 2185 PVBOXWDDM_DMA_PRESENT_RENDER_FROM_SHADOW pRFS = (PVBOXWDDM_DMA_PRESENT_RENDER_FROM_SHADOW)pPrivateData; … … 3360 3369 Assert (pAllocation->SegmentId); 3361 3370 Assert (!pAllocation->bVisible); 3362 #ifndef VBOXWDDM_RENDER_FROM_SHADOW 3363 if (pAllocation->bVisible) 3364 { 3371 Assert(pAllocation->enmType == VBOXWDDM_ALLOC_TYPE_STD_SHAREDPRIMARYSURFACE 3372 || pAllocation->enmType == VBOXWDDM_ALLOC_TYPE_UMD_RC_GENERIC); 3373 if ( 3374 #ifdef VBOXWDDM_RENDER_FROM_SHADOW 3375 /* this is the case of full-screen d3d, ensure we notify host */ 3376 pAllocation->enmType == VBOXWDDM_ALLOC_TYPE_UMD_RC_GENERIC && 3377 #endif 3378 pAllocation->bVisible) 3379 { 3380 #ifdef VBOXWDDM_RENDER_FROM_SHADOW 3381 /* to ensure the resize request gets issued in case we exit a full-screen D3D mode */ 3382 pSource->offVram = VBOXVIDEOOFFSET_VOID; 3383 #endif 3365 3384 /* should not generally happen, but still inform host*/ 3366 3385 Status = vboxWddmGhDisplaySetInfo(pDevExt, pSource); … … 3369 3388 drprintf((__FUNCTION__": vboxWddmGhDisplaySetInfo failed, Status (0x%x)\n", Status)); 3370 3389 } 3371 #endif3372 3390 } 3373 3391 else … … 3409 3427 PVBOXWDDM_SOURCE pSource = &pDevExt->aSources[pSetVidPnSourceVisibility->VidPnSourceId]; 3410 3428 PVBOXWDDM_ALLOCATION pAllocation = pSource->pPrimaryAllocation; 3411 3429 Assert(pAllocation->enmType == VBOXWDDM_ALLOC_TYPE_STD_SHAREDPRIMARYSURFACE 3430 || pAllocation->enmType == VBOXWDDM_ALLOC_TYPE_UMD_RC_GENERIC); 3412 3431 if (pAllocation) 3413 3432 { … … 3416 3435 { 3417 3436 pAllocation->bVisible = pSetVidPnSourceVisibility->Visible; 3418 #ifndef VBOXWDDM_RENDER_FROM_SHADOW3419 3437 if (pAllocation->bVisible) 3420 3438 { 3421 Status = vboxWddmGhDisplaySetInfo(pDevExt, pSource); 3422 Assert(Status == STATUS_SUCCESS); 3423 if (Status != STATUS_SUCCESS) 3424 drprintf((__FUNCTION__": vboxWddmGhDisplaySetInfo failed, Status (0x%x)\n", Status)); 3439 #ifdef VBOXWDDM_RENDER_FROM_SHADOW 3440 if (/* this is the case of full-screen d3d, ensure we notify host */ 3441 pAllocation->enmType == VBOXWDDM_ALLOC_TYPE_UMD_RC_GENERIC 3442 ) 3443 #endif 3444 { 3445 #ifdef VBOXWDDM_RENDER_FROM_SHADOW 3446 /* to ensure the resize request gets issued in case we exit a full-screen D3D mode */ 3447 pSource->offVram = VBOXVIDEOOFFSET_VOID; 3448 #endif 3449 Status = vboxWddmGhDisplaySetInfo(pDevExt, pSource); 3450 Assert(Status == STATUS_SUCCESS); 3451 if (Status != STATUS_SUCCESS) 3452 drprintf((__FUNCTION__": vboxWddmGhDisplaySetInfo failed, Status (0x%x)\n", Status)); 3453 } 3425 3454 } 3455 #ifdef VBOXVDMA 3426 3456 else 3427 3457 { … … 4070 4100 pPrivateData->BaseHdr.enmCmd = VBOXVDMACMD_TYPE_DMA_PRESENT_SHADOW2PRIMARY; 4071 4101 vboxWddmPopulateDmaAllocInfo(&pPrivateData->SrcAllocInfo, pSrcAlloc, pSrc); 4072 // no need to fill dst surf info here 4073 // vboxWddmPopulateDmaAllocInfo(&pPrivateData->DstAllocInfo, pDstAlloc, pDst); 4102 vboxWddmPopulateDmaAllocInfo(&pPrivateData->DstAllocInfo, pDstAlloc, pDst); 4074 4103 PVBOXWDDM_DMA_PRESENT_RENDER_FROM_SHADOW pRFS = (PVBOXWDDM_DMA_PRESENT_RENDER_FROM_SHADOW)pPrivateData; 4075 4104 pRFS->rect = rect;
Note:
See TracChangeset
for help on using the changeset viewer.