Add GpuMode and unify fallback logic.
This CL fixes an issue where if GPU process initialization fails and then GPU process crashes we end up incrementing the wrong UMA histogram and recent crash count. This happens because when the GPU process initialization fails we do a GPU mode fallback, eg. disable hardware aceleration or SwiftShader, which modifies values in GpuDataManagerImplPrivate. When the GPU process crashes, it checks the values in GpuDataManagerImplPrivate that were already changed. For example, if hardware acceleration was tried and GPU process initialization fails then hardware acceleration will be disabled from GpuProcessHost::DidFailInitialize(). When the GPU process crashes, GpuProcessHost::RecordProcessCrash() will increment the SwiftShader UMA and recent crash count instead of hardware accelerated UMA and crash count. Add GpuMode which tracks this information and have GpuProcessHost store this on initialization. This way the same UMA histograms are incremented on launch and crash. Also make sure after DidFailInitialize() that RecordProcessCrash() doesn't also trigger GPU mode fallback. Move the fallback logic into GpuDataManagerImplPrivate::GpuModeFallback() to ensure it's the same for all cases. Change Chrome OS to also LOG(FATAL) if GPU process crashes too many times or fails to initialize. Chrome OS always crashed in this case, it would just crash later in GpuProcessTransportFactory. Also increase max crashes for Chrome OS from 3 to 6 to match Android. Bug: 852063 Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;luci.chromium.try:linux_optional_gpu_tests_rel;luci.chromium.try:mac_optional_gpu_tests_rel;luci.chromium.try:win_optional_gpu_tests_rel Change-Id: I6870d0d877cdc2766d54428f90517c34cbd54343 Reviewed-on: https://chromium-review.googlesource.com/1099721 Commit-Queue: kylechar <kylechar@chromium.org> Reviewed-by:Zhenyao Mo <zmo@chromium.org> Reviewed-by:
Antoine Labour <piman@chromium.org> Cr-Commit-Position: refs/heads/master@{#567278}
Showing
gpu/config/gpu_mode.h
0 → 100644
Please register or sign in to comment