1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 // Determines whether a certain gpu is prefered in a dual-gpu situation.
6 // A valid gpu_switching_list.json file are in the format of
18 // Each entry contains the following fields (fields are optional unless
19 // specifically described as mandatory below):
20 // 1. "id" is an integer. 0 is reserved. This field is mandatory.
21 // 2. "os" contains "type" and an optional "version". "type" could be "macosx",
22 // "linux", "win", "chromeos", or "any". "any" is the same as not specifying
24 // "version" is a VERSION structure (defined below).
25 // 3. "vendor_id" is a string. 0 is reserved.
26 // 4. "device_id" is an array of strings. 0 is reserved.
27 // 5. "multi_gpu_style" is a string, valid values include "optimus", and
29 // 6. "multi_gpu_category" is a string, valid values include "any", "primary",
30 // and "secondary". If unspecified, the default value is "primary".
31 // 7. "driver_vendor" is a STRING structure (defined below).
32 // 8. "driver_version" is a VERSION structure (defined below).
33 // 9. "driver_date" is a VERSION structure (defined below).
34 // The version is interpreted as "year.month.day".
35 // 10. "gl_vendor" is a STRING structure (defined below).
36 // 11. "gl_renderer" is a STRING structure (defined below).
37 // 12. "gl_extensions" is a STRING structure (defined below).
38 // 13. "perf_graphics" is a FLOAT structure (defined below).
39 // 14. "perf_gaming" is a FLOAT structure (defined below).
40 // 15. "perf_overall" is a FLOAT structure (defined below).
41 // 16. "machine_model" contais "name" and an optional "version". "name" is a
42 // STRING structure and "version" is a VERSION structure (defined below).
43 // 17. "gpu_count" is a INT structure (defined below).
44 // 18 "cpu_info" is a STRING structure (defined below).
45 // 19. "exceptions" is a list of entries.
46 // 20. "features" is a list of gpu switching options, including
47 // "force_discrete" and "force_integrated".
48 // This field is mandatory.
49 // 21. "description" has the description of the entry.
50 // 22. "webkit_bugs" is an array of associated webkit bug numbers.
51 // 23. "cr_bugs" is an array of associated webkit bug numbers.
52 // 24. "browser_version" is a VERSION structure (defined below). If this
53 // condition is not satisfied, the entry will be ignored. If it is not
54 // present, then the entry applies to all versions of the browser.
55 // 25. "disabled" is a boolean. If it is present, the entry will be skipped.
56 // This can not be used in exceptions.
58 // VERSION includes "op", "style", "number", and "number2". "op" can be any of
59 // the following values: "=", "<", "<=", ">", ">=", "any", "between". "style"
60 // is optional and can be "lexical" or "numerical"; if it's not specified, it
61 // defaults to "numerical". "number2" is only used if "op" is "between".
62 // "between" is "number <= * <= number2".
63 // "number" is used for all "op" values except "any". "number" and "number2"
64 // are in the format of x, x.x, x.x.x, etc.
65 // Only "driver_version" supports lexical style if the format is major.minor;
66 // in that case, major is still numerical, but minor is lexical.
68 // STRING includes "op" and "value". "op" can be any of the following values:
69 // "contains", "beginwith", "endwith", "=". "value" is a string.
71 // FLOAT includes "op" "value", and "value2". "op" can be any of the
72 // following values: "=", "<", "<=", ">", ">=", "any", "between". "value2" is
73 // only used if "op" is "between". "value" is used for all "op" values except
74 // "any". "value" and "value2" are valid float numbers.
75 // INT is very much like FLOAT, except that the values need to be integers.
77 #include "gpu/config/gpu_control_list_jsons.h"
79 #define LONG_STRING_CONST(...) #__VA_ARGS__
83 const char kGpuSwitchingListJson
[] = LONG_STRING_CONST(
86 "name": "gpu switching list",
87 // Please update the version number whenever you change this file.
92 "description": "Force to use discrete GPU on older MacBookPro models.",
104 "value": "MacBookPro"
122 ); // LONG_STRING_CONST macro