This source file includes following definitions.
- fb_get_options
- video_setup
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 #include <linux/init.h>
18 #include <linux/fb.h>
19
20 static char *video_options[FB_MAX] __read_mostly;
21 static int ofonly __read_mostly;
22
23 const char *fb_mode_option;
24 EXPORT_SYMBOL_GPL(fb_mode_option);
25
26
27
28
29
30
31
32
33
34
35 int fb_get_options(const char *name, char **option)
36 {
37 char *opt, *options = NULL;
38 int retval = 0;
39 int name_len = strlen(name), i;
40
41 if (name_len && ofonly && strncmp(name, "offb", 4))
42 retval = 1;
43
44 if (name_len && !retval) {
45 for (i = 0; i < FB_MAX; i++) {
46 if (video_options[i] == NULL)
47 continue;
48 if (!video_options[i][0])
49 continue;
50 opt = video_options[i];
51 if (!strncmp(name, opt, name_len) &&
52 opt[name_len] == ':')
53 options = opt + name_len + 1;
54 }
55 }
56
57 if (!options && option && fb_mode_option)
58 options = kstrdup(fb_mode_option, GFP_KERNEL);
59 if (options && !strncmp(options, "off", 3))
60 retval = 1;
61
62 if (option)
63 *option = options;
64
65 return retval;
66 }
67 EXPORT_SYMBOL(fb_get_options);
68
69
70
71
72
73
74
75
76
77
78
79 static int __init video_setup(char *options)
80 {
81 if (!options || !*options)
82 goto out;
83
84 if (!strncmp(options, "ofonly", 6)) {
85 ofonly = 1;
86 goto out;
87 }
88
89 if (strchr(options, ':')) {
90
91 int i;
92
93 for (i = 0; i < FB_MAX; i++) {
94 if (video_options[i] == NULL) {
95 video_options[i] = options;
96 break;
97 }
98 }
99 } else {
100
101 fb_mode_option = options;
102 }
103
104 out:
105 return 1;
106 }
107 __setup("video=", video_setup);