0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017 #include <linux/init.h>
0018 #include <linux/fb.h>
0019
0020 static char *video_options[FB_MAX] __read_mostly;
0021 static int ofonly __read_mostly;
0022
0023 const char *fb_mode_option;
0024 EXPORT_SYMBOL_GPL(fb_mode_option);
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035 int fb_get_options(const char *name, char **option)
0036 {
0037 char *opt, *options = NULL;
0038 int retval = 0;
0039 int name_len = strlen(name), i;
0040
0041 if (name_len && ofonly && strncmp(name, "offb", 4))
0042 retval = 1;
0043
0044 if (name_len && !retval) {
0045 for (i = 0; i < FB_MAX; i++) {
0046 if (video_options[i] == NULL)
0047 continue;
0048 if (!video_options[i][0])
0049 continue;
0050 opt = video_options[i];
0051 if (!strncmp(name, opt, name_len) &&
0052 opt[name_len] == ':')
0053 options = opt + name_len + 1;
0054 }
0055 }
0056
0057 if (!options && option && fb_mode_option)
0058 options = kstrdup(fb_mode_option, GFP_KERNEL);
0059 if (options && !strncmp(options, "off", 3))
0060 retval = 1;
0061
0062 if (option)
0063 *option = options;
0064
0065 return retval;
0066 }
0067 EXPORT_SYMBOL(fb_get_options);
0068
0069
0070
0071
0072
0073
0074
0075
0076
0077
0078
0079 static int __init video_setup(char *options)
0080 {
0081 if (!options || !*options)
0082 goto out;
0083
0084 if (!strncmp(options, "ofonly", 6)) {
0085 ofonly = 1;
0086 goto out;
0087 }
0088
0089 if (strchr(options, ':')) {
0090
0091 int i;
0092
0093 for (i = 0; i < FB_MAX; i++) {
0094 if (video_options[i] == NULL) {
0095 video_options[i] = options;
0096 break;
0097 }
0098 }
0099 } else {
0100
0101 fb_mode_option = options;
0102 }
0103
0104 out:
0105 return 1;
0106 }
0107 __setup("video=", video_setup);