diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2019-01-18 12:43:05 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2019-01-18 12:43:05 -0500 |
commit | 2a8cbf2a02784efc02f7093000010e20c4ebc9ea (patch) | |
tree | 8009bcdbcc7a547089483acc80f2bbb8cb644402 | |
parent | c3653ebdf89315a3a683f03b8b181942e452d603 (diff) | |
parent | 890d14d2d4b57ff5a149309da3ed36c8a529987f (diff) |
Merge tag 'fbdev-v5.0-rc3' of git://github.com/bzolnier/linux
Pull fbdev fixes from Bartlomiej Zolnierkiewicz:
- fix stack memory leak in omap2fb driver (Vlad Tsyrklevich)
- fix OF node name handling v4.20 regression in offb driver (Rob
Herring)
- convert CONFIG_FB_LOGO_CENTER config option added in v5.0-rc1 into a
kernel parameter (Peter Rosin)
* tag 'fbdev-v5.0-rc3' of git://github.com/bzolnier/linux:
fbdev: fbmem: convert CONFIG_FB_LOGO_CENTER into a cmd line option
fbdev: offb: Fix OF node name handling
omap2fb: Fix stack memory disclosure
-rw-r--r-- | Documentation/fb/fbcon.txt | 8 | ||||
-rw-r--r-- | drivers/video/fbdev/core/fbcon.c | 7 | ||||
-rw-r--r-- | drivers/video/fbdev/core/fbmem.c | 19 | ||||
-rw-r--r-- | drivers/video/fbdev/offb.c | 18 | ||||
-rw-r--r-- | drivers/video/fbdev/omap2/omapfb/omapfb-ioctl.c | 2 | ||||
-rw-r--r-- | drivers/video/logo/Kconfig | 9 | ||||
-rw-r--r-- | include/linux/fb.h | 1 |
7 files changed, 37 insertions, 27 deletions
diff --git a/Documentation/fb/fbcon.txt b/Documentation/fb/fbcon.txt index 62af30511a95..60a5ec04e8f0 100644 --- a/Documentation/fb/fbcon.txt +++ b/Documentation/fb/fbcon.txt | |||
@@ -163,6 +163,14 @@ C. Boot options | |||
163 | be preserved until there actually is some text is output to the console. | 163 | be preserved until there actually is some text is output to the console. |
164 | This option causes fbcon to bind immediately to the fbdev device. | 164 | This option causes fbcon to bind immediately to the fbdev device. |
165 | 165 | ||
166 | 7. fbcon=logo-pos:<location> | ||
167 | |||
168 | The only possible 'location' is 'center' (without quotes), and when | ||
169 | given, the bootup logo is moved from the default top-left corner | ||
170 | location to the center of the framebuffer. If more than one logo is | ||
171 | displayed due to multiple CPUs, the collected line of logos is moved | ||
172 | as a whole. | ||
173 | |||
166 | C. Attaching, Detaching and Unloading | 174 | C. Attaching, Detaching and Unloading |
167 | 175 | ||
168 | Before going on to how to attach, detach and unload the framebuffer console, an | 176 | Before going on to how to attach, detach and unload the framebuffer console, an |
diff --git a/drivers/video/fbdev/core/fbcon.c b/drivers/video/fbdev/core/fbcon.c index 8976190b6c1f..bfa1360ec750 100644 --- a/drivers/video/fbdev/core/fbcon.c +++ b/drivers/video/fbdev/core/fbcon.c | |||
@@ -510,6 +510,13 @@ static int __init fb_console_setup(char *this_opt) | |||
510 | continue; | 510 | continue; |
511 | } | 511 | } |
512 | #endif | 512 | #endif |
513 | |||
514 | if (!strncmp(options, "logo-pos:", 9)) { | ||
515 | options += 9; | ||
516 | if (!strcmp(options, "center")) | ||
517 | fb_center_logo = true; | ||
518 | continue; | ||
519 | } | ||
513 | } | 520 | } |
514 | return 1; | 521 | return 1; |
515 | } | 522 | } |
diff --git a/drivers/video/fbdev/core/fbmem.c b/drivers/video/fbdev/core/fbmem.c index 558ed2ed3124..cb43a2258c51 100644 --- a/drivers/video/fbdev/core/fbmem.c +++ b/drivers/video/fbdev/core/fbmem.c | |||
@@ -53,6 +53,9 @@ EXPORT_SYMBOL(registered_fb); | |||
53 | int num_registered_fb __read_mostly; | 53 | int num_registered_fb __read_mostly; |
54 | EXPORT_SYMBOL(num_registered_fb); | 54 | EXPORT_SYMBOL(num_registered_fb); |
55 | 55 | ||
56 | bool fb_center_logo __read_mostly; | ||
57 | EXPORT_SYMBOL(fb_center_logo); | ||
58 | |||
56 | static struct fb_info *get_fb_info(unsigned int idx) | 59 | static struct fb_info *get_fb_info(unsigned int idx) |
57 | { | 60 | { |
58 | struct fb_info *fb_info; | 61 | struct fb_info *fb_info; |
@@ -506,8 +509,7 @@ static int fb_show_logo_line(struct fb_info *info, int rotate, | |||
506 | fb_set_logo(info, logo, logo_new, fb_logo.depth); | 509 | fb_set_logo(info, logo, logo_new, fb_logo.depth); |
507 | } | 510 | } |
508 | 511 | ||
509 | #ifdef CONFIG_FB_LOGO_CENTER | 512 | if (fb_center_logo) { |
510 | { | ||
511 | int xres = info->var.xres; | 513 | int xres = info->var.xres; |
512 | int yres = info->var.yres; | 514 | int yres = info->var.yres; |
513 | 515 | ||
@@ -520,11 +522,11 @@ static int fb_show_logo_line(struct fb_info *info, int rotate, | |||
520 | --n; | 522 | --n; |
521 | image.dx = (xres - n * (logo->width + 8) - 8) / 2; | 523 | image.dx = (xres - n * (logo->width + 8) - 8) / 2; |
522 | image.dy = y ?: (yres - logo->height) / 2; | 524 | image.dy = y ?: (yres - logo->height) / 2; |
525 | } else { | ||
526 | image.dx = 0; | ||
527 | image.dy = y; | ||
523 | } | 528 | } |
524 | #else | 529 | |
525 | image.dx = 0; | ||
526 | image.dy = y; | ||
527 | #endif | ||
528 | image.width = logo->width; | 530 | image.width = logo->width; |
529 | image.height = logo->height; | 531 | image.height = logo->height; |
530 | 532 | ||
@@ -684,9 +686,8 @@ int fb_prepare_logo(struct fb_info *info, int rotate) | |||
684 | } | 686 | } |
685 | 687 | ||
686 | height = fb_logo.logo->height; | 688 | height = fb_logo.logo->height; |
687 | #ifdef CONFIG_FB_LOGO_CENTER | 689 | if (fb_center_logo) |
688 | height += (yres - fb_logo.logo->height) / 2; | 690 | height += (yres - fb_logo.logo->height) / 2; |
689 | #endif | ||
690 | 691 | ||
691 | return fb_prepare_extra_logos(info, height, yres); | 692 | return fb_prepare_extra_logos(info, height, yres); |
692 | } | 693 | } |
diff --git a/drivers/video/fbdev/offb.c b/drivers/video/fbdev/offb.c index 31f769d67195..057d3cdef92e 100644 --- a/drivers/video/fbdev/offb.c +++ b/drivers/video/fbdev/offb.c | |||
@@ -318,28 +318,28 @@ static void __iomem *offb_map_reg(struct device_node *np, int index, | |||
318 | } | 318 | } |
319 | 319 | ||
320 | static void offb_init_palette_hacks(struct fb_info *info, struct device_node *dp, | 320 | static void offb_init_palette_hacks(struct fb_info *info, struct device_node *dp, |
321 | const char *name, unsigned long address) | 321 | unsigned long address) |
322 | { | 322 | { |
323 | struct offb_par *par = (struct offb_par *) info->par; | 323 | struct offb_par *par = (struct offb_par *) info->par; |
324 | 324 | ||
325 | if (dp && !strncmp(name, "ATY,Rage128", 11)) { | 325 | if (of_node_name_prefix(dp, "ATY,Rage128")) { |
326 | par->cmap_adr = offb_map_reg(dp, 2, 0, 0x1fff); | 326 | par->cmap_adr = offb_map_reg(dp, 2, 0, 0x1fff); |
327 | if (par->cmap_adr) | 327 | if (par->cmap_adr) |
328 | par->cmap_type = cmap_r128; | 328 | par->cmap_type = cmap_r128; |
329 | } else if (dp && (!strncmp(name, "ATY,RageM3pA", 12) | 329 | } else if (of_node_name_prefix(dp, "ATY,RageM3pA") || |
330 | || !strncmp(name, "ATY,RageM3p12A", 14))) { | 330 | of_node_name_prefix(dp, "ATY,RageM3p12A")) { |
331 | par->cmap_adr = offb_map_reg(dp, 2, 0, 0x1fff); | 331 | par->cmap_adr = offb_map_reg(dp, 2, 0, 0x1fff); |
332 | if (par->cmap_adr) | 332 | if (par->cmap_adr) |
333 | par->cmap_type = cmap_M3A; | 333 | par->cmap_type = cmap_M3A; |
334 | } else if (dp && !strncmp(name, "ATY,RageM3pB", 12)) { | 334 | } else if (of_node_name_prefix(dp, "ATY,RageM3pB")) { |
335 | par->cmap_adr = offb_map_reg(dp, 2, 0, 0x1fff); | 335 | par->cmap_adr = offb_map_reg(dp, 2, 0, 0x1fff); |
336 | if (par->cmap_adr) | 336 | if (par->cmap_adr) |
337 | par->cmap_type = cmap_M3B; | 337 | par->cmap_type = cmap_M3B; |
338 | } else if (dp && !strncmp(name, "ATY,Rage6", 9)) { | 338 | } else if (of_node_name_prefix(dp, "ATY,Rage6")) { |
339 | par->cmap_adr = offb_map_reg(dp, 1, 0, 0x1fff); | 339 | par->cmap_adr = offb_map_reg(dp, 1, 0, 0x1fff); |
340 | if (par->cmap_adr) | 340 | if (par->cmap_adr) |
341 | par->cmap_type = cmap_radeon; | 341 | par->cmap_type = cmap_radeon; |
342 | } else if (!strncmp(name, "ATY,", 4)) { | 342 | } else if (of_node_name_prefix(dp, "ATY,")) { |
343 | unsigned long base = address & 0xff000000UL; | 343 | unsigned long base = address & 0xff000000UL; |
344 | par->cmap_adr = | 344 | par->cmap_adr = |
345 | ioremap(base + 0x7ff000, 0x1000) + 0xcc0; | 345 | ioremap(base + 0x7ff000, 0x1000) + 0xcc0; |
@@ -350,7 +350,7 @@ static void offb_init_palette_hacks(struct fb_info *info, struct device_node *dp | |||
350 | par->cmap_adr = offb_map_reg(dp, 0, 0x6000, 0x1000); | 350 | par->cmap_adr = offb_map_reg(dp, 0, 0x6000, 0x1000); |
351 | if (par->cmap_adr) | 351 | if (par->cmap_adr) |
352 | par->cmap_type = cmap_gxt2000; | 352 | par->cmap_type = cmap_gxt2000; |
353 | } else if (dp && !strncmp(name, "vga,Display-", 12)) { | 353 | } else if (of_node_name_prefix(dp, "vga,Display-")) { |
354 | /* Look for AVIVO initialized by SLOF */ | 354 | /* Look for AVIVO initialized by SLOF */ |
355 | struct device_node *pciparent = of_get_parent(dp); | 355 | struct device_node *pciparent = of_get_parent(dp); |
356 | const u32 *vid, *did; | 356 | const u32 *vid, *did; |
@@ -438,7 +438,7 @@ static void __init offb_init_fb(const char *name, | |||
438 | 438 | ||
439 | par->cmap_type = cmap_unknown; | 439 | par->cmap_type = cmap_unknown; |
440 | if (depth == 8) | 440 | if (depth == 8) |
441 | offb_init_palette_hacks(info, dp, name, address); | 441 | offb_init_palette_hacks(info, dp, address); |
442 | else | 442 | else |
443 | fix->visual = FB_VISUAL_TRUECOLOR; | 443 | fix->visual = FB_VISUAL_TRUECOLOR; |
444 | 444 | ||
diff --git a/drivers/video/fbdev/omap2/omapfb/omapfb-ioctl.c b/drivers/video/fbdev/omap2/omapfb/omapfb-ioctl.c index 53f93616c671..8e23160ec59f 100644 --- a/drivers/video/fbdev/omap2/omapfb/omapfb-ioctl.c +++ b/drivers/video/fbdev/omap2/omapfb/omapfb-ioctl.c | |||
@@ -609,6 +609,8 @@ int omapfb_ioctl(struct fb_info *fbi, unsigned int cmd, unsigned long arg) | |||
609 | 609 | ||
610 | int r = 0; | 610 | int r = 0; |
611 | 611 | ||
612 | memset(&p, 0, sizeof(p)); | ||
613 | |||
612 | switch (cmd) { | 614 | switch (cmd) { |
613 | case OMAPFB_SYNC_GFX: | 615 | case OMAPFB_SYNC_GFX: |
614 | DBG("ioctl SYNC_GFX\n"); | 616 | DBG("ioctl SYNC_GFX\n"); |
diff --git a/drivers/video/logo/Kconfig b/drivers/video/logo/Kconfig index 1e972c4e88b1..d1f6196c8b9a 100644 --- a/drivers/video/logo/Kconfig +++ b/drivers/video/logo/Kconfig | |||
@@ -10,15 +10,6 @@ menuconfig LOGO | |||
10 | 10 | ||
11 | if LOGO | 11 | if LOGO |
12 | 12 | ||
13 | config FB_LOGO_CENTER | ||
14 | bool "Center the logo" | ||
15 | depends on FB=y | ||
16 | help | ||
17 | When this option is selected, the bootup logo is centered both | ||
18 | horizontally and vertically. If more than one logo is displayed | ||
19 | due to multiple CPUs, the collected line of logos is centered | ||
20 | as a whole. | ||
21 | |||
22 | config FB_LOGO_EXTRA | 13 | config FB_LOGO_EXTRA |
23 | bool | 14 | bool |
24 | depends on FB=y | 15 | depends on FB=y |
diff --git a/include/linux/fb.h b/include/linux/fb.h index 7cdd31a69719..f52ef0ad6781 100644 --- a/include/linux/fb.h +++ b/include/linux/fb.h | |||
@@ -653,6 +653,7 @@ extern int fb_new_modelist(struct fb_info *info); | |||
653 | 653 | ||
654 | extern struct fb_info *registered_fb[FB_MAX]; | 654 | extern struct fb_info *registered_fb[FB_MAX]; |
655 | extern int num_registered_fb; | 655 | extern int num_registered_fb; |
656 | extern bool fb_center_logo; | ||
656 | extern struct class *fb_class; | 657 | extern struct class *fb_class; |
657 | 658 | ||
658 | #define for_each_registered_fb(i) \ | 659 | #define for_each_registered_fb(i) \ |