Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[win32] don't use refresh rate workaround for 24/48/60Hz on windows 1… #13125

Merged
merged 1 commit into from Dec 1, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 5 additions & 4 deletions xbmc/utils/SystemInfo.cpp
Expand Up @@ -564,7 +564,7 @@ std::string CSysInfo::GetKernelVersionFull(void)
#if defined(TARGET_WINDOWS_DESKTOP)
OSVERSIONINFOEXW osvi;
if (sysGetVersionExWByRef(osvi))
kernelVersionFull = StringUtils::Format("%d.%d", osvi.dwMajorVersion, osvi.dwMinorVersion);
kernelVersionFull = StringUtils::Format("%d.%d.%d", osvi.dwMajorVersion, osvi.dwMinorVersion, osvi.dwBuildNumber);
#elif defined(TARGET_WINDOWS_STORE)
// get the system version number
auto sv = AnalyticsInfo::VersionInfo->DeviceFamilyVersion;
Expand All @@ -573,8 +573,7 @@ std::string CSysInfo::GetKernelVersionFull(void)
unsigned long long v1 = (v & 0xFFFF000000000000L) >> 48;
unsigned long long v2 = (v & 0x0000FFFF00000000L) >> 32;
unsigned long long v3 = (v & 0x00000000FFFF0000L) >> 16;
unsigned long long v4 = (v & 0x000000000000FFFFL);
kernelVersionFull = StringUtils::Format("%lld.%lld.%lld.%lld", v1, v2, v3, v4);
kernelVersionFull = StringUtils::Format("%lld.%lld.%lld", v1, v2, v3);

#elif defined(TARGET_POSIX)
struct utsname un;
Expand Down Expand Up @@ -873,8 +872,10 @@ CSysInfo::WindowsVersion CSysInfo::GetWindowsVersion()
m_WinVer = WindowsVersionWin8;
else if (osvi.dwMajorVersion == 6 && osvi.dwMinorVersion == 3)
m_WinVer = WindowsVersionWin8_1;
else if (osvi.dwMajorVersion == 10 && osvi.dwMinorVersion == 0)
else if (osvi.dwMajorVersion == 10 && osvi.dwMinorVersion == 0 && osvi.dwBuildNumber < 16299)
m_WinVer = WindowsVersionWin10;
else if (osvi.dwMajorVersion == 10 && osvi.dwMinorVersion == 0 && osvi.dwBuildNumber >= 16299)
m_WinVer = WindowsVersionWin10_FCU;
/* Insert checks for new Windows versions here */
else if ( (osvi.dwMajorVersion == 6 && osvi.dwMinorVersion > 3) || osvi.dwMajorVersion > 10)
m_WinVer = WindowsVersionFuture;
Expand Down
3 changes: 2 additions & 1 deletion xbmc/utils/SystemInfo.h
Expand Up @@ -86,7 +86,8 @@ class CSysInfo : public CInfoLoader, public ISubSettings
WindowsVersionWin7, // Windows 7, Windows Server 2008 R2
WindowsVersionWin8, // Windows 8, Windows Server 2012
WindowsVersionWin8_1, // Windows 8.1
WindowsVersionWin10, // windows 10
WindowsVersionWin10, // Windows 10
WindowsVersionWin10_FCU, // Windows 10 Fall Creators Update
/* Insert new Windows versions here, when they'll be known */
WindowsVersionFuture = 100 // Future Windows version, not known to code
};
Expand Down
5 changes: 4 additions & 1 deletion xbmc/windowing/windows/WinSystemWin32.cpp
Expand Up @@ -675,7 +675,10 @@ bool CWinSystemWin32::ChangeResolution(const RESOLUTION_INFO& res, bool forceCha
bool bResChanged = false;

// Windows 8 refresh rate workaround for 24.0, 48.0 and 60.0 Hz
if (CSysInfo::IsWindowsVersionAtLeast(CSysInfo::WindowsVersionWin8) && (res.fRefreshRate == 24.0 || res.fRefreshRate == 48.0 || res.fRefreshRate == 60.0))
// using this on Win10 Fall Creators Update causes black screen issue on refresh mode change
if ( CSysInfo::IsWindowsVersionAtLeast(CSysInfo::WindowsVersionWin8)
&& !CSysInfo::IsWindowsVersionAtLeast(CSysInfo::WindowsVersionWin10_FCU)
&& (res.fRefreshRate == 24.0 || res.fRefreshRate == 48.0 || res.fRefreshRate == 60.0))
{
CLog::Log(LOGDEBUG, "%s : Using Windows 8+ workaround for refresh rate %d Hz", __FUNCTION__, static_cast<int>(res.fRefreshRate));

Expand Down