Commit 1caec412 authored by Maggie Chen's avatar Maggie Chen Committed by Commit Bot

Revert "Fix a GPU watchdog V2 DCHECK in GPU initialization"

This reverts commit 2f859102.

Reason for revert: <This CL causes access violation crashes in  gpu::GpuInit::InitializeAndStartSandbox>

Original change's description:
> Fix a GPU watchdog V2 DCHECK in GPU initialization
> 
> A DCHECK is triggered in GpuWatchdogThreadImplV2::Arm() during GPU
> initialization. Whenever there is an error, GpuInit::InitializeAndStartSandbox()
> exits earlier. watchdog_thread_->OnInitComplete() is not called in those cases
> and arm_disarm_counter_ gets messed up.
> A new class GpuWatchdogInit is created to call OnInitcomplete() in the destructor.
> OnInitComplete() will never be missed at the end of InitializeAndStartSandbox().
> 
> Bug:949839, 995372
> 
> Change-Id: I1a107df0ca48409ff2252260ea41de643fa39b6c
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1762879
> Reviewed-by: Zhenyao Mo <zmo@chromium.org>
> Commit-Queue: Maggie Chen <magchen@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#689343}

TBR=zmo@chromium.org,magchen@chromium.org

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: 949839, 997119
Change-Id: I80de6494321557a4aaaa0eaa8f335b8b558e9664
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1769221Reviewed-by: default avatarMaggie Chen <magchen@chromium.org>
Commit-Queue: Maggie Chen <magchen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#690068}
parent d3b97055
......@@ -122,20 +122,6 @@ bool CanAccessNvidiaDeviceFile() {
}
#endif // OS_LINUX && !OS_CHROMEOS && !IS_CHROMECAST
class GpuWatchdogInit {
public:
GpuWatchdogInit() = default;
~GpuWatchdogInit() {
if (watchdog_ptr_)
watchdog_ptr_->OnInitComplete();
}
void SetGpuWatchdogPtr(gpu::GpuWatchdogThread* ptr) { watchdog_ptr_ = ptr; }
private:
gpu::GpuWatchdogThread* watchdog_ptr_ = nullptr;
};
} // namespace
GpuInit::GpuInit() = default;
......@@ -205,10 +191,6 @@ bool GpuInit::InitializeAndStartSandbox(base::CommandLine* command_line,
enable_watchdog = false;
#endif
// watchdog_init will call watchdog OnInitComplete() at the end of this
// function.
GpuWatchdogInit watchdog_init;
bool delayed_watchdog_enable = false;
#if defined(OS_CHROMEOS)
......@@ -223,7 +205,6 @@ bool GpuInit::InitializeAndStartSandbox(base::CommandLine* command_line,
if (base::FeatureList::IsEnabled(features::kGpuWatchdogV2)) {
watchdog_thread_ = gpu::GpuWatchdogThreadImplV2::Create(
gpu_preferences_.watchdog_starts_backgrounded);
watchdog_init.SetGpuWatchdogPtr(watchdog_thread_.get());
} else {
watchdog_thread_ = gpu::GpuWatchdogThreadImplV1::Create(
gpu_preferences_.watchdog_starts_backgrounded);
......@@ -434,7 +415,6 @@ bool GpuInit::InitializeAndStartSandbox(base::CommandLine* command_line,
if (base::FeatureList::IsEnabled(features::kGpuWatchdogV2)) {
watchdog_thread_ = gpu::GpuWatchdogThreadImplV2::Create(
gpu_preferences_.watchdog_starts_backgrounded);
watchdog_init.SetGpuWatchdogPtr(watchdog_thread_.get());
} else {
watchdog_thread_ = gpu::GpuWatchdogThreadImplV1::Create(
gpu_preferences_.watchdog_starts_backgrounded);
......@@ -450,6 +430,11 @@ bool GpuInit::InitializeAndStartSandbox(base::CommandLine* command_line,
UMA_HISTOGRAM_BOOLEAN("GPU.Sandbox.InitializedSuccessfully",
gpu_info_.sandboxed);
// Notify the gpu watchdog that the gpu init has completed So the watchdog
// can be disarmed.
if (watchdog_thread_)
watchdog_thread_->OnInitComplete();
init_successful_ = true;
#if defined(USE_OZONE)
ui::OzonePlatform::GetInstance()->AfterSandboxEntry();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment