Permalink
Browse files
Accept command line args to set GPU mode.
`--integrated`: integrated GPU
`--discrete`: discrete GPU
`--dynamic`: use dynamic switching
- Loading branch information...
Showing
with
11 additions
and
3 deletions.
-
+11
−3
Classes/gfxCardStatusAppDelegate.m
|
|
@@ -47,10 +47,18 @@ - (void)applicationDidFinishLaunching:(NSNotification *)aNotification |
|
|
GTMLoggerInfo(@"Integrated GPU name: %@", [GSGPU integratedGPUName]);
|
|
|
GTMLoggerInfo(@"Discrete GPU name: %@", [GSGPU discreteGPUName]);
|
|
|
|
|
|
- // Set the machine to dynamic switching to get it out of any kind of
|
|
|
- // weird state from the get go.
|
|
|
- if (![GSGPU isLegacyMachine])
|
|
|
+ NSArray *args = [[NSProcessInfo processInfo] arguments];
|
|
|
+ if ([args indexOfObject:@"--discrete"] != NSNotFound) {
|
|
|
+ [GSMux setMode:GSSwitcherModeForceDiscrete];
|
|
|
+ } else if ([args indexOfObject:@"--integrated"] != NSNotFound) {
|
|
|
+ [GSMux setMode:GSSwitcherModeForceIntegrated];
|
|
|
+ } else if ([args indexOfObject:@"--dynamic"] != NSNotFound) {
|
|
|
[GSMux setMode:GSSwitcherModeDynamicSwitching];
|
|
|
+ } else if (![GSGPU isLegacyMachine]) {
|
|
|
+ // Set the machine to dynamic switching to get it out of any kind of
|
|
|
+ // weird state from the get go.
|
|
|
+ [GSMux setMode:GSSwitcherModeDynamicSwitching];
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
// Now accepting GPU change notifications! Apply at your nearest GSGPU today.
|
|
|
|
0 comments on commit
68a5bdd