diff options
author | Kai Koehne <kai.koehne@qt.io> | 2018-07-16 15:51:11 +0200 |
---|---|---|
committer | Kai Koehne <kai.koehne@qt.io> | 2018-07-17 07:45:36 +0000 |
commit | db81dc68a8c22ed99d429c2d0278c0d71da5cf48 (patch) | |
tree | b201cd75056dcb3b6f11624bad3525cf01d9fdcc | |
parent | b11fd882e84f4675bb6b5f5e26cfcb59d31eb788 (diff) |
Remove incomplete logic to detect AMD K2 CPU's
The check for cpu.family() == 15 will also trigger for newer
ThreadRipper CPU's, resulting in a DCHECK on debug builds and
potentially suboptimal behavior in release builds. To fix this,
the check would have to take the extFamily() and maybe model()
into account, but I couldn't find the correct values for the
AMD K2 CPU's anywhere.
Anyhow, it is unclear whether newer Windows versions are still
affected by the original problem. The commit that introduced the
original check - https://codereview.chromium.org/4092 - is more
than 9 years old. There are hints that the underlying issue got
fixed in Windows XP SP2 and/or Windows 7. Hence this patch just
removes the check.
See https://chromium-review.googlesource.com/c/chromium/src/+/1138241
for the proposed upstream change.
Task-number: QTBUG-67801
Change-Id: Ie101d14996c32a99ce842f4fb3d5121790a3c35e
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
-rw-r--r-- | chromium/base/time/time_win.cc | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/chromium/base/time/time_win.cc b/chromium/base/time/time_win.cc index 44d442d0a04..913c0a09e5d 100644 --- a/chromium/base/time/time_win.cc +++ b/chromium/base/time/time_win.cc @@ -512,11 +512,6 @@ TimeDelta QPCNow() { return QPCValueToTimeDelta(QPCNowRaw()); } -bool IsBuggyAthlon(const base::CPU& cpu) { - // On Athlon X2 CPUs (e.g. model 15) QueryPerformanceCounter is unreliable. - return cpu.vendor_name() == "AuthenticAMD" && cpu.family() == 15; -} - void InitializeNowFunctionPointer() { LARGE_INTEGER ticks_per_sec = {}; if (!QueryPerformanceFrequency(&ticks_per_sec)) @@ -528,15 +523,13 @@ void InitializeNowFunctionPointer() { // If the QPC implementation is expensive and/or unreliable, TimeTicks::Now() // will still use the low-resolution clock. A CPU lacking a non-stop time // counter will cause Windows to provide an alternate QPC implementation that - // works, but is expensive to use. Certain Athlon CPUs are known to make the - // QPC implementation unreliable. + // works, but is expensive to use. // // Otherwise, Now uses the high-resolution QPC clock. As of 21 August 2015, // ~72% of users fall within this category. NowFunction now_function; base::CPU cpu; - if (ticks_per_sec.QuadPart <= 0 || - !cpu.has_non_stop_time_stamp_counter() || IsBuggyAthlon(cpu)) { + if (ticks_per_sec.QuadPart <= 0 || !cpu.has_non_stop_time_stamp_counter()) { now_function = &RolloverProtectedNow; } else { now_function = &QPCNow; @@ -637,8 +630,7 @@ ThreadTicks ThreadTicks::GetForThread( // static bool ThreadTicks::IsSupportedWin() { - static bool is_supported = base::CPU().has_non_stop_time_stamp_counter() && - !IsBuggyAthlon(base::CPU()); + static bool is_supported = base::CPU().has_non_stop_time_stamp_counter()); return is_supported; } |