Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(202)

Unified Diff: gpu/config/gpu_control_list.cc

Issue 338183005: Add semantics to apply gpu blakclist to AMD swichable when a discrete/integrated GPU is in use (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gpu/config/gpu_control_list.h ('k') | gpu/config/gpu_control_list_format.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/config/gpu_control_list.cc
diff --git a/gpu/config/gpu_control_list.cc b/gpu/config/gpu_control_list.cc
index f921b003c8977d68affd2112df29c22b40db47d3..e881606723bf12e7c58f274ccb502592bbc4f45c 100644
--- a/gpu/config/gpu_control_list.cc
+++ b/gpu/config/gpu_control_list.cc
@@ -87,6 +87,10 @@ int CompareLexicalNumberStrings(
}
const char kMultiGpuStyleStringAMDSwitchable[] = "amd_switchable";
+const char kMultiGpuStyleStringAMDSwitchableDiscrete[] =
+ "amd_switchable_discrete";
+const char kMultiGpuStyleStringAMDSwitchableIntegrated[] =
+ "amd_switchable_integrated";
const char kMultiGpuStyleStringOptimus[] = "optimus";
const char kMultiGpuCategoryStringPrimary[] = "primary";
@@ -1078,6 +1082,10 @@ GpuControlList::GpuControlListEntry::StringToMultiGpuStyle(
return kMultiGpuStyleOptimus;
if (style == kMultiGpuStyleStringAMDSwitchable)
return kMultiGpuStyleAMDSwitchable;
+ if (style == kMultiGpuStyleStringAMDSwitchableIntegrated)
+ return kMultiGpuStyleAMDSwitchableIntegrated;
+ if (style == kMultiGpuStyleStringAMDSwitchableDiscrete)
+ return kMultiGpuStyleAMDSwitchableDiscrete;
return kMultiGpuStyleNone;
}
@@ -1199,6 +1207,22 @@ bool GpuControlList::GpuControlListEntry::Contains(
if (!gpu_info.amd_switchable)
return false;
break;
+ case kMultiGpuStyleAMDSwitchableDiscrete:
+ if (!gpu_info.amd_switchable)
+ return false;
+ // The discrete GPU is always the primary GPU.
+ // This is guaranteed by GpuInfoCollector.
+ if (!gpu_info.gpu.active)
+ return false;
+ break;
+ case kMultiGpuStyleAMDSwitchableIntegrated:
+ if (!gpu_info.amd_switchable)
+ return false;
+ // Assume the integrated GPU is the first in the secondary GPU list.
+ if (gpu_info.secondary_gpus.size() == 0 ||
+ !gpu_info.secondary_gpus[0].active)
+ return false;
+ break;
case kMultiGpuStyleNone:
break;
}
« no previous file with comments | « gpu/config/gpu_control_list.h ('k') | gpu/config/gpu_control_list_format.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698