mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-12-27 10:01:39 -05:00
Merge tag 'fbdev-for-6.16-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/linux-fbdev
Pull fbdev updates from Helge Deller: "Many small but important fixes for special cases in the fbdev, fbcon and vgacon code which were found with Syzkaller, Svace and other tools by various people and teams (e.g. Linux Verification Center). Some smaller code cleanups in the nvidiafb, arkfb, atyfb and viafb drivers and two spelling fixes" * tag 'fbdev-for-6.16-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/linux-fbdev: fbdev: Fix fb_set_var to prevent null-ptr-deref in fb_videomode_to_var fbdev: Fix do_register_framebuffer to prevent null-ptr-deref in fb_videomode_to_var fbdev: sstfb.rst: Fix spelling mistake fbdev: core: fbcvt: avoid division by 0 in fb_cvt_hperiod() fbcon: Make sure modelist not set on unregistered console vgacon: Add check for vc_origin address range in vgacon_scroll() fbdev: arkfb: Cast ics5342_init() allocation type fbdev: nvidiafb: Correct const string length in nvidiafb_setup() fbdev: atyfb: Remove unused PCI vendor ID fbdev: carminefb: Fix spelling mistake of CARMINE_TOTAL_DIPLAY_MEM fbdev: via: use new GPIO line value setter callbacks
This commit is contained in:
@@ -192,7 +192,7 @@ Todo
|
||||
- Get rid of the previous paragraph.
|
||||
- Buy more coffee.
|
||||
- test/port to other arch.
|
||||
- try to add panning using tweeks with front and back buffer .
|
||||
- try to add panning using tweaks with front and back buffer.
|
||||
- try to implement accel on voodoo2, this board can actually do a
|
||||
lot in 2D even if it was sold as a 3D only board ...
|
||||
|
||||
|
||||
@@ -1168,7 +1168,7 @@ static bool vgacon_scroll(struct vc_data *c, unsigned int t, unsigned int b,
|
||||
c->vc_screenbuf_size - delta);
|
||||
c->vc_origin = vga_vram_end - c->vc_screenbuf_size;
|
||||
vga_rolled_over = 0;
|
||||
} else
|
||||
} else if (oldo - delta >= (unsigned long)c->vc_screenbuf)
|
||||
c->vc_origin -= delta;
|
||||
c->vc_scr_end = c->vc_origin + c->vc_screenbuf_size;
|
||||
scr_memsetw((u16 *) (c->vc_origin), c->vc_video_erase_char,
|
||||
|
||||
@@ -431,9 +431,10 @@ static struct dac_ops ics5342_ops = {
|
||||
|
||||
static struct dac_info * ics5342_init(dac_read_regs_t drr, dac_write_regs_t dwr, void *data)
|
||||
{
|
||||
struct dac_info *info = kzalloc(sizeof(struct ics5342_info), GFP_KERNEL);
|
||||
struct ics5342_info *ics_info = kzalloc(sizeof(struct ics5342_info), GFP_KERNEL);
|
||||
struct dac_info *info = &ics_info->dac;
|
||||
|
||||
if (! info)
|
||||
if (!ics_info)
|
||||
return NULL;
|
||||
|
||||
info->dacops = &ics5342_ops;
|
||||
|
||||
@@ -649,13 +649,13 @@ static int carminefb_probe(struct pci_dev *dev, const struct pci_device_id *ent)
|
||||
* is required for that largest resolution to avoid remaps at run
|
||||
* time
|
||||
*/
|
||||
if (carminefb_fix.smem_len > CARMINE_TOTAL_DIPLAY_MEM)
|
||||
carminefb_fix.smem_len = CARMINE_TOTAL_DIPLAY_MEM;
|
||||
if (carminefb_fix.smem_len > CARMINE_TOTAL_DISPLAY_MEM)
|
||||
carminefb_fix.smem_len = CARMINE_TOTAL_DISPLAY_MEM;
|
||||
|
||||
else if (carminefb_fix.smem_len < CARMINE_TOTAL_DIPLAY_MEM) {
|
||||
else if (carminefb_fix.smem_len < CARMINE_TOTAL_DISPLAY_MEM) {
|
||||
printk(KERN_ERR "carminefb: Memory bar is only %d bytes, %d "
|
||||
"are required.", carminefb_fix.smem_len,
|
||||
CARMINE_TOTAL_DIPLAY_MEM);
|
||||
CARMINE_TOTAL_DISPLAY_MEM);
|
||||
goto err_unmap_vregs;
|
||||
}
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
#define MAX_DISPLAY 2
|
||||
#define CARMINE_DISPLAY_MEM (800 * 600 * 4)
|
||||
#define CARMINE_TOTAL_DIPLAY_MEM (CARMINE_DISPLAY_MEM * MAX_DISPLAY)
|
||||
#define CARMINE_TOTAL_DISPLAY_MEM (CARMINE_DISPLAY_MEM * MAX_DISPLAY)
|
||||
|
||||
#define CARMINE_USE_DISPLAY0 (1 << 0)
|
||||
#define CARMINE_USE_DISPLAY1 (1 << 1)
|
||||
|
||||
@@ -117,9 +117,14 @@ static signed char con2fb_map_boot[MAX_NR_CONSOLES];
|
||||
|
||||
static struct fb_info *fbcon_info_from_console(int console)
|
||||
{
|
||||
signed char fb;
|
||||
WARN_CONSOLE_UNLOCKED();
|
||||
|
||||
return fbcon_registered_fb[con2fb_map[console]];
|
||||
fb = con2fb_map[console];
|
||||
if (fb < 0 || fb >= ARRAY_SIZE(fbcon_registered_fb))
|
||||
return NULL;
|
||||
|
||||
return fbcon_registered_fb[fb];
|
||||
}
|
||||
|
||||
static int logo_lines;
|
||||
|
||||
@@ -312,7 +312,7 @@ int fb_find_mode_cvt(struct fb_videomode *mode, int margins, int rb)
|
||||
cvt.f_refresh = cvt.refresh;
|
||||
cvt.interlace = 1;
|
||||
|
||||
if (!cvt.xres || !cvt.yres || !cvt.refresh) {
|
||||
if (!cvt.xres || !cvt.yres || !cvt.refresh || cvt.f_refresh > INT_MAX) {
|
||||
printk(KERN_INFO "fbcvt: Invalid input parameters\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -328,8 +328,10 @@ fb_set_var(struct fb_info *info, struct fb_var_screeninfo *var)
|
||||
!list_empty(&info->modelist))
|
||||
ret = fb_add_videomode(&mode, &info->modelist);
|
||||
|
||||
if (ret)
|
||||
if (ret) {
|
||||
info->var = old_var;
|
||||
return ret;
|
||||
}
|
||||
|
||||
event.info = info;
|
||||
event.data = &mode;
|
||||
@@ -388,7 +390,7 @@ static int fb_check_foreignness(struct fb_info *fi)
|
||||
|
||||
static int do_register_framebuffer(struct fb_info *fb_info)
|
||||
{
|
||||
int i;
|
||||
int i, err = 0;
|
||||
struct fb_videomode mode;
|
||||
|
||||
if (fb_check_foreignness(fb_info))
|
||||
@@ -397,10 +399,18 @@ static int do_register_framebuffer(struct fb_info *fb_info)
|
||||
if (num_registered_fb == FB_MAX)
|
||||
return -ENXIO;
|
||||
|
||||
num_registered_fb++;
|
||||
for (i = 0 ; i < FB_MAX; i++)
|
||||
if (!registered_fb[i])
|
||||
break;
|
||||
|
||||
if (!fb_info->modelist.prev || !fb_info->modelist.next)
|
||||
INIT_LIST_HEAD(&fb_info->modelist);
|
||||
|
||||
fb_var_to_videomode(&mode, &fb_info->var);
|
||||
err = fb_add_videomode(&mode, &fb_info->modelist);
|
||||
if (err < 0)
|
||||
return err;
|
||||
|
||||
fb_info->node = i;
|
||||
refcount_set(&fb_info->count, 1);
|
||||
mutex_init(&fb_info->lock);
|
||||
@@ -426,16 +436,12 @@ static int do_register_framebuffer(struct fb_info *fb_info)
|
||||
if (bitmap_empty(fb_info->pixmap.blit_y, FB_MAX_BLIT_HEIGHT))
|
||||
bitmap_fill(fb_info->pixmap.blit_y, FB_MAX_BLIT_HEIGHT);
|
||||
|
||||
if (!fb_info->modelist.prev || !fb_info->modelist.next)
|
||||
INIT_LIST_HEAD(&fb_info->modelist);
|
||||
|
||||
if (fb_info->skip_vt_switch)
|
||||
pm_vt_switch_required(fb_info->device, false);
|
||||
else
|
||||
pm_vt_switch_required(fb_info->device, true);
|
||||
|
||||
fb_var_to_videomode(&mode, &fb_info->var);
|
||||
fb_add_videomode(&mode, &fb_info->modelist);
|
||||
num_registered_fb++;
|
||||
registered_fb[i] = fb_info;
|
||||
|
||||
#ifdef CONFIG_GUMSTIX_AM200EPD
|
||||
|
||||
@@ -1484,7 +1484,7 @@ static int nvidiafb_setup(char *options)
|
||||
flatpanel = 1;
|
||||
} else if (!strncmp(this_opt, "hwcur", 5)) {
|
||||
hwcur = 1;
|
||||
} else if (!strncmp(this_opt, "noaccel", 6)) {
|
||||
} else if (!strncmp(this_opt, "noaccel", 7)) {
|
||||
noaccel = 1;
|
||||
} else if (!strncmp(this_opt, "noscale", 7)) {
|
||||
noscale = 1;
|
||||
|
||||
@@ -81,8 +81,7 @@ struct viafb_gpio_cfg {
|
||||
/*
|
||||
* GPIO access functions
|
||||
*/
|
||||
static void via_gpio_set(struct gpio_chip *chip, unsigned int nr,
|
||||
int value)
|
||||
static int via_gpio_set(struct gpio_chip *chip, unsigned int nr, int value)
|
||||
{
|
||||
struct viafb_gpio_cfg *cfg = gpiochip_get_data(chip);
|
||||
u8 reg;
|
||||
@@ -99,13 +98,14 @@ static void via_gpio_set(struct gpio_chip *chip, unsigned int nr,
|
||||
reg &= ~(0x10 << gpio->vg_mask_shift);
|
||||
via_write_reg(VIASR, gpio->vg_port_index, reg);
|
||||
spin_unlock_irqrestore(&cfg->vdev->reg_lock, flags);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int via_gpio_dir_out(struct gpio_chip *chip, unsigned int nr,
|
||||
int value)
|
||||
{
|
||||
via_gpio_set(chip, nr, value);
|
||||
return 0;
|
||||
return via_gpio_set(chip, nr, value);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -146,7 +146,7 @@ static struct viafb_gpio_cfg viafb_gpio_config = {
|
||||
.label = "VIAFB onboard GPIO",
|
||||
.owner = THIS_MODULE,
|
||||
.direction_output = via_gpio_dir_out,
|
||||
.set = via_gpio_set,
|
||||
.set_rv = via_gpio_set,
|
||||
.direction_input = via_gpio_dir_input,
|
||||
.get = via_gpio_get,
|
||||
.base = -1,
|
||||
|
||||
@@ -934,9 +934,6 @@
|
||||
#define MEM_BNDRY_EN 0x00040000
|
||||
|
||||
#define ONE_MB 0x100000
|
||||
/* ATI PCI constants */
|
||||
#define PCI_ATI_VENDOR_ID 0x1002
|
||||
|
||||
|
||||
/* CNFG_CHIP_ID register constants */
|
||||
#define CFG_CHIP_TYPE 0x0000FFFF
|
||||
|
||||
Reference in New Issue
Block a user