Changeset 106686 in vbox for trunk/src/VBox/Additions
- Timestamp:
- Oct 25, 2024 10:50:00 AM (3 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxDispIf.cpp
r106452 r106686 1948 1948 * Try to find the source mode. 1949 1949 */ 1950 DISPLAYCONFIG_MODE_INFO *pSrcModeInfo = NULL; 1951 int iSrcModeInfo = -1; 1950 DISPLAYCONFIG_MODE_INFO *pSrcModeInfo = NULL, *pTgtModeInfo = NULL; 1951 int iSrcModeInfo = -1, iTgtModeInfo = -1; 1952 int cModeInfoNew = 0; 1953 1952 1954 for (UINT j = 0; j < DispCfg.cModeInfoArray; ++j) 1953 1955 { … … 1961 1963 } 1962 1964 1965 for (UINT j = 0; j < DispCfg.cModeInfoArray; ++j) 1966 { 1967 if ( DispCfg.pModeInfoArray[j].infoType == DISPLAYCONFIG_MODE_INFO_TYPE_TARGET 1968 && DispCfg.pModeInfoArray[j].id == pDispDef->idDisplay) 1969 { 1970 pTgtModeInfo = &DispCfg.pModeInfoArray[j]; 1971 iTgtModeInfo = (int)j; 1972 break; 1973 } 1974 } 1975 1963 1976 if (pSrcModeInfo == NULL) 1977 cModeInfoNew++; 1978 1979 if (pTgtModeInfo == NULL) 1980 cModeInfoNew++; 1981 1982 if (cModeInfoNew > 0) 1964 1983 { 1965 /* No mode yet. Add the new mode to the ModeInfo array. */1966 1984 DISPLAYCONFIG_MODE_INFO *paModeInfo = (DISPLAYCONFIG_MODE_INFO *)RTMemRealloc(DispCfg.pModeInfoArray, 1967 (DispCfg.cModeInfoArray + 1)1985 (DispCfg.cModeInfoArray + cModeInfoNew) 1968 1986 * sizeof(paModeInfo[0])); 1987 1969 1988 if (!paModeInfo) 1970 1989 { … … 1974 1993 1975 1994 DispCfg.pModeInfoArray = paModeInfo; 1976 DispCfg.cModeInfoArray += 1; 1977 1978 iSrcModeInfo = DispCfg.cModeInfoArray - 1; 1979 pSrcModeInfo = &DispCfg.pModeInfoArray[iSrcModeInfo]; 1980 RT_ZERO(*pSrcModeInfo); 1981 1982 pSrcModeInfo->infoType = DISPLAYCONFIG_MODE_INFO_TYPE_SOURCE; 1983 pSrcModeInfo->id = pDispDef->idDisplay; 1984 pSrcModeInfo->adapterId = DispCfg.pModeInfoArray[0].adapterId; 1995 1996 if (pSrcModeInfo == NULL) 1997 { 1998 iSrcModeInfo = DispCfg.cModeInfoArray; 1999 pSrcModeInfo = &paModeInfo[iSrcModeInfo]; 2000 DispCfg.cModeInfoArray++; 2001 2002 RT_ZERO(*pSrcModeInfo); 2003 pSrcModeInfo->infoType = DISPLAYCONFIG_MODE_INFO_TYPE_SOURCE; 2004 pSrcModeInfo->id = pDispDef->idDisplay; 2005 pSrcModeInfo->adapterId = DispCfg.pModeInfoArray[0].adapterId; 2006 } 2007 2008 if (pTgtModeInfo == NULL) 2009 { 2010 iTgtModeInfo = DispCfg.cModeInfoArray; 2011 pTgtModeInfo = &paModeInfo[iTgtModeInfo]; 2012 DispCfg.cModeInfoArray++; 2013 2014 RT_ZERO(*pTgtModeInfo); 2015 pTgtModeInfo->infoType = DISPLAYCONFIG_MODE_INFO_TYPE_TARGET; 2016 pTgtModeInfo->id = pDispDef->idDisplay; 2017 pTgtModeInfo->adapterId = DispCfg.pModeInfoArray[0].adapterId; 2018 2019 pTgtModeInfo->targetMode.targetVideoSignalInfo.pixelRate = 0xfffffffe; 2020 pTgtModeInfo->targetMode.targetVideoSignalInfo.hSyncFreq.Numerator = 0xfffffffe; 2021 pTgtModeInfo->targetMode.targetVideoSignalInfo.hSyncFreq.Denominator = 0xfffffffe; 2022 pTgtModeInfo->targetMode.targetVideoSignalInfo.vSyncFreq.Numerator = 0xfffffffe; 2023 pTgtModeInfo->targetMode.targetVideoSignalInfo.vSyncFreq.Denominator = 0xfffffffe; 2024 pTgtModeInfo->targetMode.targetVideoSignalInfo.videoStandard = 255; 2025 pTgtModeInfo->targetMode.targetVideoSignalInfo.scanLineOrdering = DISPLAYCONFIG_SCANLINE_ORDERING_PROGRESSIVE; 2026 } 1985 2027 } 1986 2028 … … 1989 2031 { 1990 2032 pSrcModeInfo->sourceMode.width = pDispDef->cx; 2033 pTgtModeInfo->targetMode.targetVideoSignalInfo.activeSize.cx = 2034 pTgtModeInfo->targetMode.targetVideoSignalInfo.totalSize.cx = pDispDef->cx; 1991 2035 } 1992 2036 … … 1994 2038 { 1995 2039 pSrcModeInfo->sourceMode.height = pDispDef->cy; 2040 pTgtModeInfo->targetMode.targetVideoSignalInfo.activeSize.cy = 2041 pTgtModeInfo->targetMode.targetVideoSignalInfo.totalSize.cy = pDispDef->cy; 1996 2042 } 1997 2043 … … 2030 2076 2031 2077 Assert(pPathInfo->targetInfo.id == pDispDef->idDisplay); 2032 /* "If the index value is DISPLAYCONFIG_PATH_MODE_IDX_INVALID ..., this indicates 2033 * the mode information is not being specified. It is valid for the path plus source mode ... 2034 * information to be specified for a given path." 2035 */ 2036 pPathInfo->targetInfo.modeInfoIdx = DISPLAYCONFIG_PATH_MODE_IDX_INVALID; 2078 pPathInfo->targetInfo.modeInfoIdx = iTgtModeInfo; 2037 2079 pPathInfo->targetInfo.outputTechnology = DISPLAYCONFIG_OUTPUT_TECHNOLOGY_HD15; 2038 2080 pPathInfo->targetInfo.rotation = DISPLAYCONFIG_ROTATION_IDENTITY; … … 2070 2112 vboxDispIfWddmDcLogRel(&DispCfg, fSetFlags); 2071 2113 fSetFlags |= SDC_ALLOW_CHANGES; 2114 } 2115 else 2116 { 2117 WARN(("VBoxTray:(WDDM) pfnSetDisplayConfig Ok to VALIDATE winEr %d.\n", winEr)); 2118 vboxDispIfWddmDcLogRel(&DispCfg, fSetFlags); 2072 2119 } 2073 2120
Note:
See TracChangeset
for help on using the changeset viewer.