Changeset 33929 in vbox
- Timestamp:
- Nov 10, 2010 9:31:48 AM (14 years ago)
- Location:
- trunk/src/VBox
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/Graphics/Display/wddm/VBoxDispCm.cpp
r33540 r33929 137 137 pContext->pDevice = pDevice; 138 138 } 139 else 140 { 141 exit(1); 142 } 143 139 144 return hr; 140 145 } … … 190 195 if (!pCmd->Hdr.cbCmdsReturned && !pCmd->Hdr.cbRemainingFirstCmd) 191 196 hr = S_FALSE; 197 } 198 else 199 { 200 exit(1); 192 201 } 193 202 } -
trunk/src/VBox/Additions/WINNT/Graphics/Display/wddm/VBoxUhgsmiKmt.cpp
r33715 r33929 572 572 } 573 573 574 HRESULT vboxDispKmtAdpHdcCreate(HDC *phDc) 575 { 576 HRESULT hr = E_FAIL; 577 DISPLAY_DEVICE DDev; 578 memset(&DDev, 0, sizeof (DDev)); 579 DDev.cb = sizeof (DDev); 580 581 for (int i = 0; ; ++i) 582 { 583 if (EnumDisplayDevices(NULL, /* LPCTSTR lpDevice */ i, /* DWORD iDevNum */ 584 &DDev, 0 /* DWORD dwFlags*/)) 585 { 586 if (DDev.StateFlags & DISPLAY_DEVICE_PRIMARY_DEVICE) 587 { 588 HDC hDc = CreateDC(NULL, DDev.DeviceName, NULL, NULL); 589 if (hDc) 590 { 591 *phDc = hDc; 592 return S_OK; 593 } 594 else 595 { 596 DWORD winEr = GetLastError(); 597 Assert(0); 598 hr = HRESULT_FROM_WIN32(winEr); 599 Assert(FAILED(hr)); 600 break; 601 } 602 } 603 } 604 else 605 { 606 DWORD winEr = GetLastError(); 607 Assert(0); 608 hr = HRESULT_FROM_WIN32(winEr); 609 Assert(FAILED(hr)); 610 break; 611 } 612 } 613 614 return hr; 615 } 616 574 617 HRESULT vboxDispKmtOpenAdapter(PVBOXDISPKMT_CALLBACKS pCallbacks, PVBOXDISPKMT_ADAPTER pAdapter) 575 618 { 576 D3DKMT_OPENADAPTERFROMGDIDISPLAYNAME OpenAdapterData = {0}; 577 wcsncpy(OpenAdapterData.DeviceName, L"\\\\.\\DISPLAY1", RT_ELEMENTS(OpenAdapterData.DeviceName) - 1 /* the last one is always \0 */); 578 HRESULT hr = S_OK; 579 NTSTATUS Status = pCallbacks->pfnD3DKMTOpenAdapterFromGdiDisplayName(&OpenAdapterData); 580 Assert(!Status); 581 if (!Status) 582 { 583 pAdapter->hAdapter = OpenAdapterData.hAdapter; 584 pAdapter->pCallbacks = pCallbacks; 585 return S_OK; 586 } 587 else 588 { 589 Log((__FUNCTION__": pfnD3DKMTOpenAdapterFromGdiDisplayName failed, Status (0x%x)\n", Status)); 590 hr = E_FAIL; 619 D3DKMT_OPENADAPTERFROMHDC OpenAdapterData = {0}; 620 OpenAdapterData.hDc = GetWindowDC(NULL); 621 HRESULT hr = vboxDispKmtAdpHdcCreate(&OpenAdapterData.hDc); 622 if (OpenAdapterData.hDc) 623 { 624 NTSTATUS Status = pCallbacks->pfnD3DKMTOpenAdapterFromHdc(&OpenAdapterData); 625 Assert(!Status); 626 if (!Status) 627 { 628 pAdapter->hAdapter = OpenAdapterData.hAdapter; 629 pAdapter->hDc = OpenAdapterData.hDc; 630 pAdapter->pCallbacks = pCallbacks; 631 return S_OK; 632 } 633 else 634 { 635 Log((__FUNCTION__": pfnD3DKMTOpenAdapterFromGdiDisplayName failed, Status (0x%x)\n", Status)); 636 hr = E_FAIL; 637 } 638 639 ReleaseDC(NULL, OpenAdapterData.hDc); 591 640 } 592 641 593 642 return hr; 594 595 643 } 596 644 … … 603 651 if (!Status) 604 652 { 653 ReleaseDC(NULL, pAdapter->hDc); 605 654 return S_OK; 606 655 } 607 656 608 657 Log((__FUNCTION__": pfnD3DKMTCloseAdapter failed, Status (0x%x)\n", Status)); 609 /* ignore */ 610 Status = 0; 658 611 659 return E_FAIL; 612 660 } -
trunk/src/VBox/Additions/WINNT/Graphics/Display/wddm/VBoxUhgsmiKmt.h
r33530 r33929 52 52 { 53 53 D3DKMT_HANDLE hAdapter; 54 HDC hDc; 54 55 PVBOXDISPKMT_CALLBACKS pCallbacks; 55 56 }VBOXDISPKMT_ADAPTER, *PVBOXDISPKMT_ADAPTER; -
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoVidPn.cpp
r33879 r33929 1717 1717 return Status == STATUS_SUCCESS; 1718 1718 } 1719 1720 #define VBOXVIDPNDUMP_STRCASE(_t) \ 1721 case _t: return #_t; 1722 #define VBOXVIDPNDUMP_STRCASE_UNKNOWN() \ 1723 default: return "Unknown"; 1724 1725 #define VBOXVIDPNDUMP_STRFLAGS(_v, _t) \ 1726 if ((_v)._t return #_t; 1727 1728 const char* vboxVidPnDumpStrImportance(D3DKMDT_VIDPN_PRESENT_PATH_IMPORTANCE ImportanceOrdinal) 1729 { 1730 switch (ImportanceOrdinal) 1731 { 1732 VBOXVIDPNDUMP_STRCASE(D3DKMDT_VPPI_UNINITIALIZED); 1733 VBOXVIDPNDUMP_STRCASE(D3DKMDT_VPPI_PRIMARY); 1734 VBOXVIDPNDUMP_STRCASE(D3DKMDT_VPPI_SECONDARY); 1735 VBOXVIDPNDUMP_STRCASE(D3DKMDT_VPPI_TERTIARY); 1736 VBOXVIDPNDUMP_STRCASE(D3DKMDT_VPPI_QUATERNARY); 1737 VBOXVIDPNDUMP_STRCASE(D3DKMDT_VPPI_QUINARY); 1738 VBOXVIDPNDUMP_STRCASE(D3DKMDT_VPPI_SENARY); 1739 VBOXVIDPNDUMP_STRCASE(D3DKMDT_VPPI_SEPTENARY); 1740 VBOXVIDPNDUMP_STRCASE(D3DKMDT_VPPI_OCTONARY); 1741 VBOXVIDPNDUMP_STRCASE(D3DKMDT_VPPI_NONARY); 1742 VBOXVIDPNDUMP_STRCASE(D3DKMDT_VPPI_DENARY); 1743 VBOXVIDPNDUMP_STRCASE_UNKNOWN(); 1744 } 1745 } 1746 1747 const char* vboxVidPnDumpStrScaling(D3DKMDT_VIDPN_PRESENT_PATH_SCALING Scaling) 1748 { 1749 switch (Scaling) 1750 { 1751 VBOXVIDPNDUMP_STRCASE(D3DKMDT_VPPS_UNINITIALIZED); 1752 VBOXVIDPNDUMP_STRCASE(D3DKMDT_VPPS_IDENTITY); 1753 VBOXVIDPNDUMP_STRCASE(D3DKMDT_VPPS_CENTERED); 1754 VBOXVIDPNDUMP_STRCASE(D3DKMDT_VPPS_STRETCHED); 1755 VBOXVIDPNDUMP_STRCASE(D3DKMDT_VPPS_UNPINNED); 1756 VBOXVIDPNDUMP_STRCASE(D3DKMDT_VPPS_NOTSPECIFIED); 1757 VBOXVIDPNDUMP_STRCASE_UNKNOWN(); 1758 } 1759 } 1760 1761 const char* vboxVidPnDumpStrRotation(D3DKMDT_VIDPN_PRESENT_PATH_ROTATION Rotation) 1762 { 1763 switch (Rotation) 1764 { 1765 VBOXVIDPNDUMP_STRCASE(D3DKMDT_VPPR_UNINITIALIZED); 1766 VBOXVIDPNDUMP_STRCASE(D3DKMDT_VPPR_IDENTITY); 1767 VBOXVIDPNDUMP_STRCASE(D3DKMDT_VPPR_ROTATE90); 1768 VBOXVIDPNDUMP_STRCASE(D3DKMDT_VPPR_ROTATE180); 1769 VBOXVIDPNDUMP_STRCASE(D3DKMDT_VPPR_ROTATE270); 1770 VBOXVIDPNDUMP_STRCASE(D3DKMDT_VPPR_UNPINNED); 1771 VBOXVIDPNDUMP_STRCASE(D3DKMDT_VPPR_NOTSPECIFIED); 1772 VBOXVIDPNDUMP_STRCASE_UNKNOWN(); 1773 } 1774 } 1775 1776 const char* vboxVidPnDumpStrColorBasis(D3DKMDT_COLOR_BASIS ColorBasis) 1777 { 1778 switch (ColorBasis) 1779 { 1780 VBOXVIDPNDUMP_STRCASE(D3DKMDT_CB_UNINITIALIZED); 1781 VBOXVIDPNDUMP_STRCASE(D3DKMDT_CB_INTENSITY); 1782 VBOXVIDPNDUMP_STRCASE(D3DKMDT_CB_SRGB); 1783 VBOXVIDPNDUMP_STRCASE(D3DKMDT_CB_SCRGB); 1784 VBOXVIDPNDUMP_STRCASE(D3DKMDT_CB_YCBCR); 1785 VBOXVIDPNDUMP_STRCASE(D3DKMDT_CB_YPBPR); 1786 VBOXVIDPNDUMP_STRCASE_UNKNOWN(); 1787 } 1788 } 1789 1790 const char* vboxVidPnDumpStrContent(D3DKMDT_VIDPN_PRESENT_PATH_CONTENT Content) 1791 { 1792 switch (Content) 1793 { 1794 VBOXVIDPNDUMP_STRCASE(D3DKMDT_VPPC_UNINITIALIZED); 1795 VBOXVIDPNDUMP_STRCASE(D3DKMDT_VPPC_GRAPHICS); 1796 VBOXVIDPNDUMP_STRCASE(D3DKMDT_VPPC_VIDEO); 1797 VBOXVIDPNDUMP_STRCASE(D3DKMDT_VPPC_NOTSPECIFIED); 1798 VBOXVIDPNDUMP_STRCASE_UNKNOWN(); 1799 } 1800 } 1801 1802 const char* vboxVidPnDumpStrCopyProtectionType(D3DKMDT_VIDPN_PRESENT_PATH_COPYPROTECTION_TYPE CopyProtectionType) 1803 { 1804 switch (CopyProtectionType) 1805 { 1806 VBOXVIDPNDUMP_STRCASE(D3DKMDT_VPPMT_UNINITIALIZED); 1807 VBOXVIDPNDUMP_STRCASE(D3DKMDT_VPPMT_NOPROTECTION); 1808 VBOXVIDPNDUMP_STRCASE(D3DKMDT_VPPMT_MACROVISION_APSTRIGGER); 1809 VBOXVIDPNDUMP_STRCASE(D3DKMDT_VPPMT_MACROVISION_FULLSUPPORT); 1810 VBOXVIDPNDUMP_STRCASE_UNKNOWN(); 1811 } 1812 } 1813 1814 const char* vboxVidPnDumpStrGammaRampType(D3DDDI_GAMMARAMP_TYPE Type) 1815 { 1816 switch (Type) 1817 { 1818 VBOXVIDPNDUMP_STRCASE(D3DDDI_GAMMARAMP_UNINITIALIZED); 1819 VBOXVIDPNDUMP_STRCASE(D3DDDI_GAMMARAMP_DEFAULT); 1820 VBOXVIDPNDUMP_STRCASE(D3DDDI_GAMMARAMP_RGB256x3x16); 1821 VBOXVIDPNDUMP_STRCASE(D3DDDI_GAMMARAMP_DXGI_1); 1822 VBOXVIDPNDUMP_STRCASE_UNKNOWN(); 1823 } 1824 } 1825 1826 1827 void vboxVidPnDumpCopyProtectoin(const D3DKMDT_VIDPN_PRESENT_PATH_COPYPROTECTION *pCopyProtection) 1828 { 1829 drprintf(("CopyProtection: CopyProtectionType(%s), TODO: Dump All the rest\n", 1830 vboxVidPnDumpStrCopyProtectionType(pCopyProtection->CopyProtectionType))); 1831 } 1832 1833 1834 void vboxVidPnDumpPathTransformation(const D3DKMDT_VIDPN_PRESENT_PATH_TRANSFORMATION *pContentTransformation) 1835 { 1836 drprintf(("Transformation: Scaling(%s), ScalingSupport(%d), Rotation(%s), RotationSupport(%d)\n", 1837 vboxVidPnDumpStrScaling(pContentTransformation->Scaling), pContentTransformation->ScalingSupport, 1838 vboxVidPnDumpStrRotation(pContentTransformation->Rotation), pContentTransformation->RotationSupport)); 1839 } 1840 1841 void vboxVidPnDumpRegion(const char *pPrefix, const D3DKMDT_2DREGION *pRegion, const char *pSuffix) 1842 { 1843 drprintf(("%scx(%d), cy(%d)%s", pPrefix, pRegion->cx, pRegion->cy, pSuffix)); 1844 } 1845 1846 void vboxVidPnDumpRanges(const char *pPrefix, const D3DKMDT_COLOR_COEFF_DYNAMIC_RANGES *pDynamicRanges, const char *pSuffix) 1847 { 1848 drprintf(("%sFirstChannel(%d), SecondChannel(%d), ThirdChannel(%d), FourthChannel(%d)%s", pPrefix, 1849 pDynamicRanges->FirstChannel, 1850 pDynamicRanges->SecondChannel, 1851 pDynamicRanges->ThirdChannel, 1852 pDynamicRanges->FourthChannel, 1853 pSuffix)); 1854 } 1855 1856 void vboxVidPnDumpGammaRamp(const char *pPrefix, const D3DKMDT_GAMMA_RAMP *pGammaRamp, const char *pSuffix) 1857 { 1858 drprintf(("%Type(%s), DataSize(%d), TODO: dump the rest%s", pPrefix, 1859 vboxVidPnDumpStrGammaRampType(pGammaRamp->Type), pGammaRamp->DataSize, 1860 pSuffix)); 1861 } 1862 1863 1864 void vboxVidPnDumpPath(struct _DEVICE_EXTENSION* pDevExt, const D3DKMDT_HVIDPN hVidPn, const DXGK_VIDPN_INTERFACE* pVidPnInterface, 1865 const D3DKMDT_VIDPN_PRESENT_PATH *pVidPnPresentPathInfo) 1866 { 1867 drprintf((" >>Start Dump VidPn Path>>\n")); 1868 drprintf(("VidPnSourceId(%d), VidPnTargetId(%d), ImportanceOrdinal(%s), VidPnTargetColorBasis(%s), Content(%s)\n", 1869 pVidPnPresentPathInfo->VidPnSourceId, pVidPnPresentPathInfo->VidPnTargetId, 1870 vboxVidPnDumpStrImportance(pVidPnPresentPathInfo->ImportanceOrdinal), 1871 vboxVidPnDumpStrColorBasis(pVidPnPresentPathInfo->VidPnTargetColorBasis), 1872 vboxVidPnDumpStrContent(pVidPnPresentPathInfo->Content))); 1873 vboxVidPnDumpPathTransformation(&pVidPnPresentPathInfo->ContentTransformation); 1874 vboxVidPnDumpRegion("VisibleFromActiveTLOffset: ", &pVidPnPresentPathInfo->VisibleFromActiveTLOffset, "\n"); 1875 vboxVidPnDumpRegion("VisibleFromActiveBROffset: ", &pVidPnPresentPathInfo->VisibleFromActiveBROffset, "\n"); 1876 vboxVidPnDumpRanges("VidPnTargetColorCoeffDynamicRanges: ", &pVidPnPresentPathInfo->VidPnTargetColorCoeffDynamicRanges, "\n"); 1877 vboxVidPnDumpCopyProtectoin(&pVidPnPresentPathInfo->CopyProtection); 1878 vboxVidPnDumpGammaRamp("GammaRamp: ", &pVidPnPresentPathInfo->GammaRamp, "\n"); 1879 1880 drprintf((" <<Stop Dump VidPn Path<<\n")); 1881 } 1882 1883 static DECLCALLBACK(BOOLEAN) vboxVidPnDumpPathEnum(struct _DEVICE_EXTENSION* pDevExt, const D3DKMDT_HVIDPN hVidPn, const DXGK_VIDPN_INTERFACE* pVidPnInterface, 1884 D3DKMDT_HVIDPNTOPOLOGY hVidPnTopology, const DXGK_VIDPNTOPOLOGY_INTERFACE* pVidPnTopologyInterface, 1885 const D3DKMDT_VIDPN_PRESENT_PATH *pVidPnPresentPathInfo, PVOID pContext) 1886 { 1887 vboxVidPnDumpPath(pDevExt, hVidPn, pVidPnInterface, pVidPnPresentPathInfo); 1888 1889 pVidPnTopologyInterface->pfnReleasePathInfo(hVidPnTopology, pVidPnPresentPathInfo); 1890 return TRUE; 1891 } 1892 1893 void vboxVidPnDumpVidPn(PDEVICE_EXTENSION pDevExt, D3DKMDT_HVIDPN hVidPn, const DXGK_VIDPN_INTERFACE* pVidPnInterface) 1894 { 1895 drprintf ((">>>>>>>>>>>>>>>>>Start Dumping VidPn>>>>>>>>>>>>>>>>>>>>>>\n")); 1896 1897 D3DKMDT_HVIDPNTOPOLOGY hVidPnTopology; 1898 const DXGK_VIDPNTOPOLOGY_INTERFACE* pVidPnTopologyInterface; 1899 NTSTATUS Status = pVidPnInterface->pfnGetTopology(hVidPn, &hVidPnTopology, &pVidPnTopologyInterface); 1900 Assert(Status == STATUS_SUCCESS); 1901 if (Status == STATUS_SUCCESS) 1902 { 1903 Status = vboxVidPnEnumPaths(pDevExt, hVidPn, pVidPnInterface, 1904 hVidPnTopology, pVidPnTopologyInterface, 1905 vboxVidPnDumpPathEnum, NULL); 1906 Assert(Status == STATUS_SUCCESS); 1907 } 1908 1909 drprintf (("<<<<<<<<<<<<<<<<<Stop Dumping VidPn<<<<<<<<<<<<<<<<<<<<<<\n")); 1910 } -
trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxDispIf.cpp
r32622 r33929 115 115 DWORD err = NO_ERROR; 116 116 NTSTATUS Status = pIf->modeData.wddm.pfnD3DKMTOpenAdapterFromGdiDisplayName(&OpenAdapterData); 117 Assert(!Status); 117 118 if (!Status) 118 119 { -
trunk/src/VBox/GuestHost/OpenGL/util/vboxhgcm.c
r33714 r33929 1237 1237 if (RT_FAILURE(rc) || RT_FAILURE(parms.hdr.result)) 1238 1238 { 1239 Assert(0); 1240 1239 1241 crWarning("Host doesn't accept our version %d.%d. Make sure you have appropriate additions installed!", 1240 1242 parms.vMajor.u.value32, parms.vMinor.u.value32); … … 1278 1280 if (g_crvboxhgcm.hGuestDrv == INVALID_HANDLE_VALUE) 1279 1281 { 1282 Assert(0); 1280 1283 crDebug("could not open VBox Guest Additions driver! rc = %d\n", GetLastError()); 1281 1284 VBOXCRHGSMIPROFILE_FUNC_EPILOGUE(); … … 1292 1295 crDebug("could not open Guest Additions kernel module! rc = %d\n", errno); 1293 1296 VBOXCRHGSMIPROFILE_FUNC_EPILOGUE(); 1297 Assert(0); 1294 1298 return FALSE; 1295 1299 } … … 1333 1337 { 1334 1338 crDebug("HGCM connect failed with rc=0x%x\n", info.result); 1339 Assert(0); 1335 1340 1336 1341 VBOXCRHGSMIPROFILE_FUNC_EPILOGUE(); … … 1341 1346 { 1342 1347 #ifdef RT_OS_WINDOWS 1343 crDebug("IOCTL for HGCM connect failed with rc=0x%x\n", GetLastError()); 1348 DWORD winEr = GetLastError(); 1349 Assert(0); 1350 crDebug("IOCTL for HGCM connect failed with rc=0x%x\n", winEr); 1344 1351 #else 1345 1352 crDebug("IOCTL for HGCM connect failed with rc=0x%x\n", errno); … … 1627 1634 if (RT_FAILURE(rc)) 1628 1635 { 1629 cr Warning("pfnBufferSubmitAsynch failed with %d \n", rc);1636 crError("pfnBufferSubmitAsynch failed with %d \n", rc); 1630 1637 return; 1631 1638 } … … 1761 1768 if (RT_FAILURE(rc)) 1762 1769 { 1763 cr Warning("pfnBufferSubmitAsynch failed with %d \n", rc);1770 crError("pfnBufferSubmitAsynch failed with %d \n", rc); 1764 1771 break; 1765 1772 } … … 1881 1888 callRes = _crVBoxHGSMICmdBufferGetRc(pClient); 1882 1889 } 1890 else 1891 { 1892 /* we can not recover at this point, report error & exit */ 1893 crError("pfnBufferSubmitAsynch failed with %d \n", rc); 1894 } 1883 1895 } 1884 1896 else … … 1914 1926 1915 1927 callRes = _crVBoxHGSMICmdBufferGetRc(pClient); 1928 } 1929 else 1930 { 1931 /* we can not recover at this point, report error & exit */ 1932 crError("Failed to submit CrHhgsmi buffer"); 1916 1933 } 1917 1934 }
Note:
See TracChangeset
for help on using the changeset viewer.