Permalink
Browse files

Accept command line args to set GPU mode.

`--integrated`: integrated GPU
`--discrete`: discrete GPU
`--dynamic`: use dynamic switching
  • Loading branch information...
1 parent b1abe0a commit 68a5bddc6cd3e13b3cf21a41f88859afaea75a36 @ryotarai ryotarai committed Jan 1, 2014
Showing with 11 additions and 3 deletions.
  1. +11 −3 Classes/gfxCardStatusAppDelegate.m
View
14 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

Please sign in to comment.