diff options
author | Dave Airlie <airlied@redhat.com> | 2014-08-25 19:04:03 -0400 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2014-08-25 19:04:03 -0400 |
commit | c0ee755fc57319a623e0d9ef839cf8fb26ce8d60 (patch) | |
tree | 727fe78a158757f75b54d7e037b383ad6a39843c /drivers/video/fbdev | |
parent | 52addcf9d6669fa439387610bc65c92fa0980cef (diff) | |
parent | 14f476fa24e81d0beea1aa14d763102958518d60 (diff) |
Merge tag 'topic/core-stuff-2014-08-15' of git://anongit.freedesktop.org/drm-intel into drm-next
So small drm stuff all over for 3.18. Biggest one is the cmdline parsing
from Chris with a few fixes from me to make it work for stupid kernel
configs.
Plus the atomic prep series.
Tested for more than a week in -nightly and Ville/Imre indeed discovered
some fun which is now fixed (and i915 vblank patches postponed since the
fixups need this branch plus drm-intel-next merged together).
* tag 'topic/core-stuff-2014-08-15' of git://anongit.freedesktop.org/drm-intel:
drm: Use the type of the array element when reallocating
drm: Don't return 0 for a value used as a denominator
drm: Docbook fixes
drm/irq: Implement a generic vblank_wait function
drm: Add a plane->reset hook
drm: trylock modest locking for fbdev panics
drm: Move ->old_fb from crtc to plane
drm: Handle legacy per-crtc locking with full acquire ctx
drm: Move modeset_lock_all helpers to drm_modeset_lock.[hc]
drm: Add drm_plane/connector_index
drm: idiot-proof vblank
drm: Warn when leaking flip events on close
drm: Perform cmdline mode parsing during connector initialisation
video/fbdev: Always built-in video= cmdline parsing
drm: Don't grab an fb reference for the idr
Diffstat (limited to 'drivers/video/fbdev')
-rw-r--r-- | drivers/video/fbdev/Kconfig | 4 | ||||
-rw-r--r-- | drivers/video/fbdev/core/Makefile | 1 | ||||
-rw-r--r-- | drivers/video/fbdev/core/fb_cmdline.c | 110 | ||||
-rw-r--r-- | drivers/video/fbdev/core/fbmem.c | 92 | ||||
-rw-r--r-- | drivers/video/fbdev/core/modedb.c | 3 |
5 files changed, 115 insertions, 95 deletions
diff --git a/drivers/video/fbdev/Kconfig b/drivers/video/fbdev/Kconfig index e911b9c96e19..ccbe2ae22ac5 100644 --- a/drivers/video/fbdev/Kconfig +++ b/drivers/video/fbdev/Kconfig | |||
@@ -4,6 +4,7 @@ | |||
4 | 4 | ||
5 | menuconfig FB | 5 | menuconfig FB |
6 | tristate "Support for frame buffer devices" | 6 | tristate "Support for frame buffer devices" |
7 | select FB_CMDLINE | ||
7 | ---help--- | 8 | ---help--- |
8 | The frame buffer device provides an abstraction for the graphics | 9 | The frame buffer device provides an abstraction for the graphics |
9 | hardware. It represents the frame buffer of some video hardware and | 10 | hardware. It represents the frame buffer of some video hardware and |
@@ -52,6 +53,9 @@ config FIRMWARE_EDID | |||
52 | combination with certain motherboards and monitors are known to | 53 | combination with certain motherboards and monitors are known to |
53 | suffer from this problem. | 54 | suffer from this problem. |
54 | 55 | ||
56 | config FB_CMDLINE | ||
57 | bool | ||
58 | |||
55 | config FB_DDC | 59 | config FB_DDC |
56 | tristate | 60 | tristate |
57 | depends on FB | 61 | depends on FB |
diff --git a/drivers/video/fbdev/core/Makefile b/drivers/video/fbdev/core/Makefile index fa306538dac2..67f28e20a892 100644 --- a/drivers/video/fbdev/core/Makefile +++ b/drivers/video/fbdev/core/Makefile | |||
@@ -1,4 +1,5 @@ | |||
1 | obj-y += fb_notify.o | 1 | obj-y += fb_notify.o |
2 | obj-$(CONFIG_FB_CMDLINE) += fb_cmdline.o | ||
2 | obj-$(CONFIG_FB) += fb.o | 3 | obj-$(CONFIG_FB) += fb.o |
3 | fb-y := fbmem.o fbmon.o fbcmap.o fbsysfs.o \ | 4 | fb-y := fbmem.o fbmon.o fbcmap.o fbsysfs.o \ |
4 | modedb.o fbcvt.o | 5 | modedb.o fbcvt.o |
diff --git a/drivers/video/fbdev/core/fb_cmdline.c b/drivers/video/fbdev/core/fb_cmdline.c new file mode 100644 index 000000000000..39509ccd92f1 --- /dev/null +++ b/drivers/video/fbdev/core/fb_cmdline.c | |||
@@ -0,0 +1,110 @@ | |||
1 | /* | ||
2 | * linux/drivers/video/fb_cmdline.c | ||
3 | * | ||
4 | * Copyright (C) 2014 Intel Corp | ||
5 | * Copyright (C) 1994 Martin Schaller | ||
6 | * | ||
7 | * 2001 - Documented with DocBook | ||
8 | * - Brad Douglas <brad@neruo.com> | ||
9 | * | ||
10 | * This file is subject to the terms and conditions of the GNU General Public | ||
11 | * License. See the file COPYING in the main directory of this archive | ||
12 | * for more details. | ||
13 | * | ||
14 | * Authors: | ||
15 | * Vetter <danie.vetter@ffwll.ch> | ||
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 | * fb_get_options - get kernel boot parameters | ||
28 | * @name: framebuffer name as it would appear in | ||
29 | * the boot parameter line | ||
30 | * (video=<name>:<options>) | ||
31 | * @option: the option will be stored here | ||
32 | * | ||
33 | * NOTE: Needed to maintain backwards compatibility | ||
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 | /* No match, pass global option */ | ||
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 | * video_setup - process command line options | ||
71 | * @options: string of options | ||
72 | * | ||
73 | * Process command line options for frame buffer subsystem. | ||
74 | * | ||
75 | * NOTE: This function is a __setup and __init function. | ||
76 | * It only stores the options. Drivers have to call | ||
77 | * fb_get_options() as necessary. | ||
78 | * | ||
79 | * Returns zero. | ||
80 | * | ||
81 | */ | ||
82 | static int __init video_setup(char *options) | ||
83 | { | ||
84 | int i, global = 0; | ||
85 | |||
86 | if (!options || !*options) | ||
87 | global = 1; | ||
88 | |||
89 | if (!global && !strncmp(options, "ofonly", 6)) { | ||
90 | ofonly = 1; | ||
91 | global = 1; | ||
92 | } | ||
93 | |||
94 | if (!global && !strchr(options, ':')) { | ||
95 | fb_mode_option = options; | ||
96 | global = 1; | ||
97 | } | ||
98 | |||
99 | if (!global) { | ||
100 | for (i = 0; i < FB_MAX; i++) { | ||
101 | if (video_options[i] == NULL) { | ||
102 | video_options[i] = options; | ||
103 | break; | ||
104 | } | ||
105 | } | ||
106 | } | ||
107 | |||
108 | return 1; | ||
109 | } | ||
110 | __setup("video=", video_setup); | ||
diff --git a/drivers/video/fbdev/core/fbmem.c b/drivers/video/fbdev/core/fbmem.c index b5e85f6c1c26..0705d8883ede 100644 --- a/drivers/video/fbdev/core/fbmem.c +++ b/drivers/video/fbdev/core/fbmem.c | |||
@@ -1908,96 +1908,4 @@ int fb_new_modelist(struct fb_info *info) | |||
1908 | return err; | 1908 | return err; |
1909 | } | 1909 | } |
1910 | 1910 | ||
1911 | static char *video_options[FB_MAX] __read_mostly; | ||
1912 | static int ofonly __read_mostly; | ||
1913 | |||
1914 | /** | ||
1915 | * fb_get_options - get kernel boot parameters | ||
1916 | * @name: framebuffer name as it would appear in | ||
1917 | * the boot parameter line | ||
1918 | * (video=<name>:<options>) | ||
1919 | * @option: the option will be stored here | ||
1920 | * | ||
1921 | * NOTE: Needed to maintain backwards compatibility | ||
1922 | */ | ||
1923 | int fb_get_options(const char *name, char **option) | ||
1924 | { | ||
1925 | char *opt, *options = NULL; | ||
1926 | int retval = 0; | ||
1927 | int name_len = strlen(name), i; | ||
1928 | |||
1929 | if (name_len && ofonly && strncmp(name, "offb", 4)) | ||
1930 | retval = 1; | ||
1931 | |||
1932 | if (name_len && !retval) { | ||
1933 | for (i = 0; i < FB_MAX; i++) { | ||
1934 | if (video_options[i] == NULL) | ||
1935 | continue; | ||
1936 | if (!video_options[i][0]) | ||
1937 | continue; | ||
1938 | opt = video_options[i]; | ||
1939 | if (!strncmp(name, opt, name_len) && | ||
1940 | opt[name_len] == ':') | ||
1941 | options = opt + name_len + 1; | ||
1942 | } | ||
1943 | } | ||
1944 | /* No match, pass global option */ | ||
1945 | if (!options && option && fb_mode_option) | ||
1946 | options = kstrdup(fb_mode_option, GFP_KERNEL); | ||
1947 | if (options && !strncmp(options, "off", 3)) | ||
1948 | retval = 1; | ||
1949 | |||
1950 | if (option) | ||
1951 | *option = options; | ||
1952 | |||
1953 | return retval; | ||
1954 | } | ||
1955 | EXPORT_SYMBOL(fb_get_options); | ||
1956 | |||
1957 | #ifndef MODULE | ||
1958 | /** | ||
1959 | * video_setup - process command line options | ||
1960 | * @options: string of options | ||
1961 | * | ||
1962 | * Process command line options for frame buffer subsystem. | ||
1963 | * | ||
1964 | * NOTE: This function is a __setup and __init function. | ||
1965 | * It only stores the options. Drivers have to call | ||
1966 | * fb_get_options() as necessary. | ||
1967 | * | ||
1968 | * Returns zero. | ||
1969 | * | ||
1970 | */ | ||
1971 | static int __init video_setup(char *options) | ||
1972 | { | ||
1973 | int i, global = 0; | ||
1974 | |||
1975 | if (!options || !*options) | ||
1976 | global = 1; | ||
1977 | |||
1978 | if (!global && !strncmp(options, "ofonly", 6)) { | ||
1979 | ofonly = 1; | ||
1980 | global = 1; | ||
1981 | } | ||
1982 | |||
1983 | if (!global && !strchr(options, ':')) { | ||
1984 | fb_mode_option = options; | ||
1985 | global = 1; | ||
1986 | } | ||
1987 | |||
1988 | if (!global) { | ||
1989 | for (i = 0; i < FB_MAX; i++) { | ||
1990 | if (video_options[i] == NULL) { | ||
1991 | video_options[i] = options; | ||
1992 | break; | ||
1993 | } | ||
1994 | |||
1995 | } | ||
1996 | } | ||
1997 | |||
1998 | return 1; | ||
1999 | } | ||
2000 | __setup("video=", video_setup); | ||
2001 | #endif | ||
2002 | |||
2003 | MODULE_LICENSE("GPL"); | 1911 | MODULE_LICENSE("GPL"); |
diff --git a/drivers/video/fbdev/core/modedb.c b/drivers/video/fbdev/core/modedb.c index a9a907c440d7..388f7971494b 100644 --- a/drivers/video/fbdev/core/modedb.c +++ b/drivers/video/fbdev/core/modedb.c | |||
@@ -29,9 +29,6 @@ | |||
29 | #define DPRINTK(fmt, args...) | 29 | #define DPRINTK(fmt, args...) |
30 | #endif | 30 | #endif |
31 | 31 | ||
32 | const char *fb_mode_option; | ||
33 | EXPORT_SYMBOL_GPL(fb_mode_option); | ||
34 | |||
35 | /* | 32 | /* |
36 | * Standard video mode definitions (taken from XFree86) | 33 | * Standard video mode definitions (taken from XFree86) |
37 | */ | 34 | */ |