fbdev fixes for v5.0-rc3:

- 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)
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABCAAGBQJcQcZZAAoJEH4ztj+gR8IL/7wQAKbpzwH5WnxTvZzRIacnHcoS
 BAzlgG4QSYqr2h09BRbsgi5GlrWKdMkk0AH7q/jkVfcmaJIkaibS755LnH7imumy
 +y8OGPYlNq0ys/F2wV4gYr+yZJ+FCplZA0Nl4DoZxjG9kTw3/Akayh/RbnzEgKkU
 LvNse8sP/ksON74p9AzBEtp9VLUL3QcyqksN0jtse/7UmLcL+o+j8kWPqwM2XRQ6
 XUSpIvhVhcl/l4zT5feMy2x0TCZ8GPLcjKDcevvGypPlMbDr9jPdnYDCU5SIqCsM
 gOl4Uiuhnd4Amg5eOWgYxzBnmGFWwqNjYLDNUmuPy95NaIDeIpQw/QY3+GAo+BDh
 O6u8BKFbUhy5RVQF9s/wP2p8HXUy29oUpNuorowFUd46fHsBvd6hfb1/diwKy6iB
 2HXaEplIWcEk34hH7uM0gUrJ+57YQAv30TmLGBH+zyhfgpb8OyHSVpDqmRWBBP8s
 HU/YGwQMBQE/lGqoAq5ku6Q8Ex4kJ9GSBJELKyiwyElB5eZNX6gSnMv5iURS3tlZ
 Wh1hTutmsktVW5+ndlAzXcRX0SbvfoLfWiTaAXdKZv17+7uaBoZvsnc7bLahOOVU
 xY5WAYSgqWEVX03Owb2QM8sJsrIIrQ4w44SAb4UNNDw1o1HCVDkhrHq5uG68k0na
 +UskmI44TNIA5ZIQiMC4
 =O8jy
 -----END PGP SIGNATURE-----

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
This commit is contained in:
Linus Torvalds 2019-01-19 05:43:05 +12:00
commit 2a8cbf2a02
7 changed files with 37 additions and 27 deletions

View File

@ -163,6 +163,14 @@ C. Boot options
be preserved until there actually is some text is output to the console.
This option causes fbcon to bind immediately to the fbdev device.
7. fbcon=logo-pos:<location>
The only possible 'location' is 'center' (without quotes), and when
given, the bootup logo is moved from the default top-left corner
location to the center of the framebuffer. If more than one logo is
displayed due to multiple CPUs, the collected line of logos is moved
as a whole.
C. Attaching, Detaching and Unloading
Before going on to how to attach, detach and unload the framebuffer console, an

View File

@ -510,6 +510,13 @@ static int __init fb_console_setup(char *this_opt)
continue;
}
#endif
if (!strncmp(options, "logo-pos:", 9)) {
options += 9;
if (!strcmp(options, "center"))
fb_center_logo = true;
continue;
}
}
return 1;
}

View File

@ -53,6 +53,9 @@ EXPORT_SYMBOL(registered_fb);
int num_registered_fb __read_mostly;
EXPORT_SYMBOL(num_registered_fb);
bool fb_center_logo __read_mostly;
EXPORT_SYMBOL(fb_center_logo);
static struct fb_info *get_fb_info(unsigned int idx)
{
struct fb_info *fb_info;
@ -506,8 +509,7 @@ static int fb_show_logo_line(struct fb_info *info, int rotate,
fb_set_logo(info, logo, logo_new, fb_logo.depth);
}
#ifdef CONFIG_FB_LOGO_CENTER
{
if (fb_center_logo) {
int xres = info->var.xres;
int yres = info->var.yres;
@ -520,11 +522,11 @@ static int fb_show_logo_line(struct fb_info *info, int rotate,
--n;
image.dx = (xres - n * (logo->width + 8) - 8) / 2;
image.dy = y ?: (yres - logo->height) / 2;
} else {
image.dx = 0;
image.dy = y;
}
#else
image.dx = 0;
image.dy = y;
#endif
image.width = logo->width;
image.height = logo->height;
@ -684,9 +686,8 @@ int fb_prepare_logo(struct fb_info *info, int rotate)
}
height = fb_logo.logo->height;
#ifdef CONFIG_FB_LOGO_CENTER
height += (yres - fb_logo.logo->height) / 2;
#endif
if (fb_center_logo)
height += (yres - fb_logo.logo->height) / 2;
return fb_prepare_extra_logos(info, height, yres);
}

View File

@ -318,28 +318,28 @@ static void __iomem *offb_map_reg(struct device_node *np, int index,
}
static void offb_init_palette_hacks(struct fb_info *info, struct device_node *dp,
const char *name, unsigned long address)
unsigned long address)
{
struct offb_par *par = (struct offb_par *) info->par;
if (dp && !strncmp(name, "ATY,Rage128", 11)) {
if (of_node_name_prefix(dp, "ATY,Rage128")) {
par->cmap_adr = offb_map_reg(dp, 2, 0, 0x1fff);
if (par->cmap_adr)
par->cmap_type = cmap_r128;
} else if (dp && (!strncmp(name, "ATY,RageM3pA", 12)
|| !strncmp(name, "ATY,RageM3p12A", 14))) {
} else if (of_node_name_prefix(dp, "ATY,RageM3pA") ||
of_node_name_prefix(dp, "ATY,RageM3p12A")) {
par->cmap_adr = offb_map_reg(dp, 2, 0, 0x1fff);
if (par->cmap_adr)
par->cmap_type = cmap_M3A;
} else if (dp && !strncmp(name, "ATY,RageM3pB", 12)) {
} else if (of_node_name_prefix(dp, "ATY,RageM3pB")) {
par->cmap_adr = offb_map_reg(dp, 2, 0, 0x1fff);
if (par->cmap_adr)
par->cmap_type = cmap_M3B;
} else if (dp && !strncmp(name, "ATY,Rage6", 9)) {
} else if (of_node_name_prefix(dp, "ATY,Rage6")) {
par->cmap_adr = offb_map_reg(dp, 1, 0, 0x1fff);
if (par->cmap_adr)
par->cmap_type = cmap_radeon;
} else if (!strncmp(name, "ATY,", 4)) {
} else if (of_node_name_prefix(dp, "ATY,")) {
unsigned long base = address & 0xff000000UL;
par->cmap_adr =
ioremap(base + 0x7ff000, 0x1000) + 0xcc0;
@ -350,7 +350,7 @@ static void offb_init_palette_hacks(struct fb_info *info, struct device_node *dp
par->cmap_adr = offb_map_reg(dp, 0, 0x6000, 0x1000);
if (par->cmap_adr)
par->cmap_type = cmap_gxt2000;
} else if (dp && !strncmp(name, "vga,Display-", 12)) {
} else if (of_node_name_prefix(dp, "vga,Display-")) {
/* Look for AVIVO initialized by SLOF */
struct device_node *pciparent = of_get_parent(dp);
const u32 *vid, *did;
@ -438,7 +438,7 @@ static void __init offb_init_fb(const char *name,
par->cmap_type = cmap_unknown;
if (depth == 8)
offb_init_palette_hacks(info, dp, name, address);
offb_init_palette_hacks(info, dp, address);
else
fix->visual = FB_VISUAL_TRUECOLOR;

View File

@ -609,6 +609,8 @@ int omapfb_ioctl(struct fb_info *fbi, unsigned int cmd, unsigned long arg)
int r = 0;
memset(&p, 0, sizeof(p));
switch (cmd) {
case OMAPFB_SYNC_GFX:
DBG("ioctl SYNC_GFX\n");

View File

@ -10,15 +10,6 @@ menuconfig LOGO
if LOGO
config FB_LOGO_CENTER
bool "Center the logo"
depends on FB=y
help
When this option is selected, the bootup logo is centered both
horizontally and vertically. If more than one logo is displayed
due to multiple CPUs, the collected line of logos is centered
as a whole.
config FB_LOGO_EXTRA
bool
depends on FB=y

View File

@ -653,6 +653,7 @@ extern int fb_new_modelist(struct fb_info *info);
extern struct fb_info *registered_fb[FB_MAX];
extern int num_registered_fb;
extern bool fb_center_logo;
extern struct class *fb_class;
#define for_each_registered_fb(i) \