Merge tag 'fbdev-for-6.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/linux-fbdev

Pull fbdev updates from Helge Deller:
 "The Termius 10x18 console bitmap font has been added. It is good
  match for modern 13-16 inch laptop displays with resolutions like
  1280x800 and 1440x900 pixels.

  The gbefb and tcx.c drivers got some fixes to restore X11 support,
  pxafb was not actually clamping input values and the ssd1307fb driver
  leaked memory in the failure path.

  The other patches convert some common drivers to use dev_info() and
  dev_dbg() instead of printk(). Summary:

  Framework updates:
   - fonts: Add Terminus 10x18 console font [Neilay Kharwadkar]

  Driver fixes:
   - gbefb: fix to use physical address instead of dma address [René Rebe]
   - tcx.c fix mem_map to correct smem_start offset [René Rebe]
   - pxafb: Fix multiple clamped values in pxafb_adjust_timing [Thorsten Blum]
   - ssd1307fb: fix potential page leak in ssd1307fb_probe() [Abdun Nihaal]

  Cleanups:
   - vga16fb: Request memory region [Javier Garcia]
   - vga16fb: replace printk() with dev_*() in probe [Vivek BalachandharTN]
   - vesafb, gxt4500fb, tridentfb: Use dev_dbg() instead of printk() [Javier Garcia]
   - i810: use dev_info() [Shi Hao]"

* tag 'fbdev-for-6.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/linux-fbdev:
  fbdev: ssd1307fb: fix potential page leak in ssd1307fb_probe()
  fbdev: i810: use appopriate log interface dev_info
  fbdev: tridentfb: replace printk() with dev_*() in probe
  lib/fonts: Add Terminus 10x18 console font
  fbdev: pxafb: Fix multiple clamped values in pxafb_adjust_timing
  fbdev: tcx.c fix mem_map to correct smem_start offset
  fbdev: gxt4500fb: Use dev_err instead of printk
  fbdev: gbefb: fix to use physical address instead of dma address
  fbdev: vesafb: Use dev_* fn's instead printk
  fbdev: vga16fb: Request memory region
  fbdev: vga16fb: replace printk() with dev_*() in probe
This commit is contained in:
Linus Torvalds
2025-12-06 15:41:26 -08:00
14 changed files with 5231 additions and 57 deletions

View File

@@ -12,6 +12,7 @@
#include <linux/delay.h>
#include <linux/platform_device.h>
#include <linux/dma-mapping.h>
#include <linux/dma-direct.h>
#include <linux/errno.h>
#include <linux/gfp.h>
#include <linux/fb.h>
@@ -65,7 +66,7 @@ struct gbefb_par {
static unsigned int gbe_mem_size = CONFIG_FB_GBE_MEM * 1024*1024;
static void *gbe_mem;
static dma_addr_t gbe_dma_addr;
static unsigned long gbe_mem_phys;
static phys_addr_t gbe_mem_phys;
static struct {
uint16_t *cpu;
@@ -1183,7 +1184,7 @@ static int gbefb_probe(struct platform_device *p_dev)
goto out_release_mem_region;
}
gbe_mem_phys = (unsigned long) gbe_dma_addr;
gbe_mem_phys = dma_to_phys(&p_dev->dev, gbe_dma_addr);
}
par = info->par;

View File

@@ -704,7 +704,7 @@ static int gxt4500_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
}
info->var = var;
if (gxt4500_set_par(info)) {
printk(KERN_ERR "gxt4500: cannot set video mode\n");
dev_err(&pdev->dev, "cannot set video mode\n");
goto err_free_cmap;
}

View File

@@ -1012,7 +1012,7 @@ static int i810_check_params(struct fb_var_screeninfo *var,
var->bits_per_pixel);
vidmem = line_length * info->var.yres;
if (vxres < var->xres) {
printk("i810fb: required video memory, "
dev_info(&par->dev->dev, "required video memory, "
"%d bytes, for %dx%d-%d (virtual) "
"is out of range\n",
vidmem, vxres, vyres,
@@ -1067,9 +1067,9 @@ static int i810_check_params(struct fb_var_screeninfo *var,
|(info->monspecs.hfmax-HFMAX)
|(info->monspecs.vfmin-VFMIN)
|(info->monspecs.vfmax-VFMAX);
printk("i810fb: invalid video mode%s\n",
default_sync ? "" : ". Specifying "
"vsyncN/hsyncN parameters may help");
dev_err(&par->dev->dev, "invalid video mode%s\n",
default_sync ? "" : ". Specifying "
"vsyncN/hsyncN parameters may help");
retval = -EINVAL;
}
}
@@ -1674,19 +1674,19 @@ static int i810_alloc_agp_mem(struct fb_info *info)
size = par->fb.size + par->iring.size;
if (!(bridge = agp_backend_acquire(par->dev))) {
printk("i810fb_alloc_fbmem: cannot acquire agpgart\n");
dev_warn(&par->dev->dev, "cannot acquire agpgart\n");
return -ENODEV;
}
if (!(par->i810_gtt.i810_fb_memory =
agp_allocate_memory(bridge, size >> 12, AGP_NORMAL_MEMORY))) {
printk("i810fb_alloc_fbmem: can't allocate framebuffer "
dev_warn(&par->dev->dev, "can't allocate framebuffer "
"memory\n");
agp_backend_release(bridge);
return -ENOMEM;
}
if (agp_bind_memory(par->i810_gtt.i810_fb_memory,
par->fb.offset)) {
printk("i810fb_alloc_fbmem: can't bind framebuffer memory\n");
dev_warn(&par->dev->dev, "can't bind framebuffer memory\n");
agp_backend_release(bridge);
return -EBUSY;
}
@@ -1694,14 +1694,14 @@ static int i810_alloc_agp_mem(struct fb_info *info)
if (!(par->i810_gtt.i810_cursor_memory =
agp_allocate_memory(bridge, par->cursor_heap.size >> 12,
AGP_PHYSICAL_MEMORY))) {
printk("i810fb_alloc_cursormem: can't allocate "
dev_warn(&par->dev->dev, "can't allocate "
"cursor memory\n");
agp_backend_release(bridge);
return -ENOMEM;
}
if (agp_bind_memory(par->i810_gtt.i810_cursor_memory,
par->cursor_heap.offset)) {
printk("i810fb_alloc_cursormem: cannot bind cursor memory\n");
dev_warn(&par->dev->dev, "cannot bind cursor memory\n");
agp_backend_release(bridge);
return -EBUSY;
}
@@ -1844,7 +1844,7 @@ static int i810_allocate_pci_resource(struct i810fb_par *par,
int err;
if ((err = pci_enable_device(par->dev))) {
printk("i810fb_init: cannot enable device\n");
dev_err(&par->dev->dev, "cannot enable device\n");
return err;
}
par->res_flags |= PCI_DEVICE_ENABLED;
@@ -1859,14 +1859,14 @@ static int i810_allocate_pci_resource(struct i810fb_par *par,
par->mmio_start_phys = pci_resource_start(par->dev, 0);
}
if (!par->aperture.size) {
printk("i810fb_init: device is disabled\n");
dev_warn(&par->dev->dev, "device is disabled\n");
return -ENOMEM;
}
if (!request_mem_region(par->aperture.physical,
par->aperture.size,
i810_pci_list[entry->driver_data])) {
printk("i810fb_init: cannot request framebuffer region\n");
dev_warn(&par->dev->dev, "cannot request framebuffer region\n");
return -ENODEV;
}
par->res_flags |= FRAMEBUFFER_REQ;
@@ -1874,14 +1874,14 @@ static int i810_allocate_pci_resource(struct i810fb_par *par,
par->aperture.virtual = ioremap_wc(par->aperture.physical,
par->aperture.size);
if (!par->aperture.virtual) {
printk("i810fb_init: cannot remap framebuffer region\n");
dev_warn(&par->dev->dev, "cannot remap framebuffer region\n");
return -ENODEV;
}
if (!request_mem_region(par->mmio_start_phys,
MMIO_SIZE,
i810_pci_list[entry->driver_data])) {
printk("i810fb_init: cannot request mmio region\n");
dev_warn(&par->dev->dev, "cannot request mmio region\n");
return -ENODEV;
}
par->res_flags |= MMIO_REQ;
@@ -1889,7 +1889,7 @@ static int i810_allocate_pci_resource(struct i810fb_par *par,
par->mmio_start_virtual = ioremap(par->mmio_start_phys,
MMIO_SIZE);
if (!par->mmio_start_virtual) {
printk("i810fb_init: cannot remap mmio region\n");
dev_warn(&par->dev->dev, "cannot remap mmio region\n");
return -ENODEV;
}
@@ -1921,12 +1921,12 @@ static void i810fb_find_init_mode(struct fb_info *info)
}
if (!err)
printk("i810fb_init_pci: DDC probe successful\n");
dev_info(&par->dev->dev, "DDC probe successful\n");
fb_edid_to_monspecs(par->edid, specs);
if (specs->modedb == NULL)
printk("i810fb_init_pci: Unable to get Mode Database\n");
dev_info(&par->dev->dev, "Unable to get Mode Database\n");
fb_videomode_to_modelist(specs->modedb, specs->modedb_len,
&info->modelist);
@@ -2072,7 +2072,7 @@ static int i810fb_init_pci(struct pci_dev *dev,
if (err < 0) {
i810fb_release_resource(info, par);
printk("i810fb_init: cannot register framebuffer device\n");
dev_warn(&par->dev->dev, "cannot register framebuffer device\n");
return err;
}
@@ -2084,10 +2084,10 @@ static int i810fb_init_pci(struct pci_dev *dev,
vfreq = hfreq/(info->var.yres + info->var.upper_margin +
info->var.vsync_len + info->var.lower_margin);
printk("I810FB: fb%d : %s v%d.%d.%d%s\n"
"I810FB: Video RAM : %dK\n"
"I810FB: Monitor : H: %d-%d KHz V: %d-%d Hz\n"
"I810FB: Mode : %dx%d-%dbpp@%dHz\n",
dev_info(&par->dev->dev, "fb%d : %s v%d.%d.%d%s\n"
"Video RAM : %dK\n"
"Monitor : H: %d-%d KHz V: %d-%d Hz\n"
"Mode : %dx%d-%dbpp@%dHz\n",
info->node,
i810_pci_list[entry->driver_data],
VERSION_MAJOR, VERSION_MINOR, VERSION_TEENIE, BRANCH_VERSION,
@@ -2137,7 +2137,7 @@ static void i810fb_remove_pci(struct pci_dev *dev)
unregister_framebuffer(info);
i810fb_release_resource(info, par);
printk("cleanup_module: unloaded i810 framebuffer device\n");
dev_info(&par->dev->dev, "unloaded i810 framebuffer device\n");
}
#ifndef MODULE

View File

@@ -419,12 +419,12 @@ static int pxafb_adjust_timing(struct pxafb_info *fbi,
var->yres = max_t(int, var->yres, MIN_YRES);
if (!(fbi->lccr0 & LCCR0_LCDT)) {
clamp_val(var->hsync_len, 1, 64);
clamp_val(var->vsync_len, 1, 64);
clamp_val(var->left_margin, 1, 255);
clamp_val(var->right_margin, 1, 255);
clamp_val(var->upper_margin, 1, 255);
clamp_val(var->lower_margin, 1, 255);
var->hsync_len = clamp(var->hsync_len, 1, 64);
var->vsync_len = clamp(var->vsync_len, 1, 64);
var->left_margin = clamp(var->left_margin, 1, 255);
var->right_margin = clamp(var->right_margin, 1, 255);
var->upper_margin = clamp(var->upper_margin, 1, 255);
var->lower_margin = clamp(var->lower_margin, 1, 255);
}
/* make sure each line is aligned on word boundary */

View File

@@ -680,7 +680,7 @@ static int ssd1307fb_probe(struct i2c_client *client)
if (!ssd1307fb_defio) {
dev_err(dev, "Couldn't allocate deferred io.\n");
ret = -ENOMEM;
goto fb_alloc_error;
goto fb_defio_error;
}
ssd1307fb_defio->delay = HZ / refreshrate;
@@ -757,6 +757,8 @@ regulator_enable_error:
regulator_disable(par->vbat_reg);
reset_oled_error:
fb_deferred_io_cleanup(info);
fb_defio_error:
__free_pages(vmem, get_order(vmem_size));
fb_alloc_error:
framebuffer_release(info);
return ret;

View File

@@ -428,7 +428,7 @@ static int tcx_probe(struct platform_device *op)
j = i;
break;
}
par->mmap_map[i].poff = op->resource[j].start;
par->mmap_map[i].poff = op->resource[j].start - info->fix.smem_start;
}
info->fbops = &tcx_ops;

View File

@@ -1631,7 +1631,7 @@ static int trident_pci_probe(struct pci_dev *dev,
}
if (noaccel) {
printk(KERN_DEBUG "disabling acceleration\n");
dev_dbg(&dev->dev, "disabling acceleration\n");
info->flags |= FBINFO_HWACCEL_DISABLED;
info->pixmap.scan_align = 1;
}
@@ -1693,7 +1693,7 @@ static int trident_pci_probe(struct pci_dev *dev,
info->var.activate |= FB_ACTIVATE_NOW;
info->device = &dev->dev;
if (register_framebuffer(info) < 0) {
printk(KERN_ERR "tridentfb: could not register framebuffer\n");
dev_err(&dev->dev, "could not register framebuffer\n");
fb_dealloc_cmap(&info->cmap);
err = -EINVAL;
goto out_unmap2;

View File

@@ -314,8 +314,8 @@ static int vesafb_probe(struct platform_device *dev)
#endif
if (!request_mem_region(vesafb_fix.smem_start, size_total, "vesafb")) {
printk(KERN_WARNING
"vesafb: cannot reserve video memory at 0x%lx\n",
dev_warn(&dev->dev,
"cannot reserve video memory at 0x%lx\n",
vesafb_fix.smem_start);
/* We cannot make this fatal. Sometimes this comes from magic
spaces our resource handlers simply don't know about */
@@ -333,12 +333,12 @@ static int vesafb_probe(struct platform_device *dev)
par->base = si->lfb_base;
par->size = size_total;
printk(KERN_INFO "vesafb: mode is %dx%dx%d, linelength=%d, pages=%d\n",
dev_info(&dev->dev, "mode is %dx%dx%d, linelength=%d, pages=%d\n",
vesafb_defined.xres, vesafb_defined.yres, vesafb_defined.bits_per_pixel,
vesafb_fix.line_length, si->pages);
if (si->vesapm_seg) {
printk(KERN_INFO "vesafb: protected mode interface info at %04x:%04x\n",
dev_info(&dev->dev, "protected mode interface info at %04x:%04x\n",
si->vesapm_seg, si->vesapm_off);
}
@@ -352,9 +352,10 @@ static int vesafb_probe(struct platform_device *dev)
pmi_base = (unsigned short *)phys_to_virt(pmi_phys);
pmi_start = (void*)((char*)pmi_base + pmi_base[1]);
pmi_pal = (void*)((char*)pmi_base + pmi_base[2]);
printk(KERN_INFO "vesafb: pmi: set display start = %p, set palette = %p\n",pmi_start,pmi_pal);
dev_info(&dev->dev, "pmi: set display start = %p, set palette = %p\n",
pmi_start, pmi_pal);
if (pmi_base[3]) {
printk(KERN_INFO "vesafb: pmi: ports = ");
dev_info(&dev->dev, "pmi: ports = ");
for (i = pmi_base[3]/2; pmi_base[i] != 0xffff; i++)
printk("%x ", pmi_base[i]);
printk("\n");
@@ -365,14 +366,14 @@ static int vesafb_probe(struct platform_device *dev)
* Rules are: we have to set up a descriptor for the requested
* memory area and pass it in the ES register to the BIOS function.
*/
printk(KERN_INFO "vesafb: can't handle memory requests, pmi disabled\n");
dev_info(&dev->dev, "can't handle memory requests, pmi disabled\n");
ypan = pmi_setpal = 0;
}
}
}
if (vesafb_defined.bits_per_pixel == 8 && !pmi_setpal && !vga_compat) {
printk(KERN_WARNING "vesafb: hardware palette is unchangeable,\n"
dev_warn(&dev->dev, "hardware palette is unchangeable,\n"
" colors may be incorrect\n");
vesafb_fix.visual = FB_VISUAL_STATIC_PSEUDOCOLOR;
}
@@ -380,10 +381,10 @@ static int vesafb_probe(struct platform_device *dev)
vesafb_defined.xres_virtual = vesafb_defined.xres;
vesafb_defined.yres_virtual = vesafb_fix.smem_len / vesafb_fix.line_length;
if (ypan && vesafb_defined.yres_virtual > vesafb_defined.yres) {
printk(KERN_INFO "vesafb: scrolling: %s using protected mode interface, yres_virtual=%d\n",
dev_info(&dev->dev, "scrolling: %s using protected mode interface, yres_virtual=%d\n",
(ypan > 1) ? "ywrap" : "ypan",vesafb_defined.yres_virtual);
} else {
printk(KERN_INFO "vesafb: scrolling: redraw\n");
dev_info(&dev->dev, "scrolling: redraw\n");
vesafb_defined.yres_virtual = vesafb_defined.yres;
ypan = 0;
}
@@ -410,7 +411,7 @@ static int vesafb_probe(struct platform_device *dev)
vesafb_defined.bits_per_pixel;
}
printk(KERN_INFO "vesafb: %s: "
dev_info(&dev->dev, "%s: "
"size=%d:%d:%d:%d, shift=%d:%d:%d:%d\n",
(vesafb_defined.bits_per_pixel > 8) ?
"Truecolor" : (vga_compat || pmi_setpal) ?
@@ -453,14 +454,14 @@ static int vesafb_probe(struct platform_device *dev)
}
if (!info->screen_base) {
printk(KERN_ERR
"vesafb: abort, cannot ioremap video memory 0x%x @ 0x%lx\n",
dev_err(&dev->dev,
"abort, cannot ioremap video memory 0x%x @ 0x%lx\n",
vesafb_fix.smem_len, vesafb_fix.smem_start);
err = -EIO;
goto err_release_region;
}
printk(KERN_INFO "vesafb: framebuffer at 0x%lx, mapped to 0x%p, "
dev_info(&dev->dev, "framebuffer at 0x%lx, mapped to 0x%p, "
"using %dk, total %dk\n",
vesafb_fix.smem_start, info->screen_base,
size_remap/1024, size_total/1024);

View File

@@ -1319,7 +1319,12 @@ static int vga16fb_probe(struct platform_device *dev)
if (ret)
return ret;
printk(KERN_DEBUG "vga16fb: initializing\n");
dev_dbg(&dev->dev, "initializing\n");
if (!request_mem_region(vga16fb_fix.smem_start, vga16fb_fix.smem_len,
"vga16b")) {
dev_err(&dev->dev, "cannot reserve video memory at 0x%lx\n",
vga16fb_fix.smem_start);
}
info = framebuffer_alloc(sizeof(struct vga16fb_par), &dev->dev);
if (!info) {
@@ -1331,12 +1336,12 @@ static int vga16fb_probe(struct platform_device *dev)
info->screen_base = (void __iomem *)VGA_MAP_MEM(VGA_FB_PHYS_BASE, 0);
if (!info->screen_base) {
printk(KERN_ERR "vga16fb: unable to map device\n");
dev_err(&dev->dev, "unable to map device\n");
ret = -ENOMEM;
goto err_ioremap;
}
printk(KERN_INFO "vga16fb: mapped to 0x%p\n", info->screen_base);
dev_info(&dev->dev, "mapped to 0x%p\n", info->screen_base);
par = info->par;
par->isVGA = screen_info_video_type(si) == VIDEO_TYPE_VGAC;
@@ -1364,13 +1369,13 @@ static int vga16fb_probe(struct platform_device *dev)
i = (info->var.bits_per_pixel == 8) ? 256 : 16;
ret = fb_alloc_cmap(&info->cmap, i, 0);
if (ret) {
printk(KERN_ERR "vga16fb: unable to allocate colormap\n");
dev_err(&dev->dev, "unable to allocate colormap\n");
ret = -ENOMEM;
goto err_alloc_cmap;
}
if (vga16fb_check_var(&info->var, info)) {
printk(KERN_ERR "vga16fb: unable to validate variable\n");
dev_err(&dev->dev, "unable to validate variable\n");
ret = -EINVAL;
goto err_check_var;
}
@@ -1381,7 +1386,7 @@ static int vga16fb_probe(struct platform_device *dev)
if (ret)
goto err_check_var;
if (register_framebuffer(info) < 0) {
printk(KERN_ERR "vga16fb: unable to register framebuffer\n");
dev_err(&dev->dev, "unable to register framebuffer\n");
ret = -EINVAL;
goto err_check_var;
}
@@ -1398,6 +1403,8 @@ static int vga16fb_probe(struct platform_device *dev)
err_ioremap:
framebuffer_release(info);
err_fb_alloc:
release_mem_region(vga16fb_fix.smem_start,
vga16fb_fix.smem_len);
return ret;
}
@@ -1407,6 +1414,8 @@ static void vga16fb_remove(struct platform_device *dev)
if (info)
unregister_framebuffer(info);
release_mem_region(vga16fb_fix.smem_start,
vga16fb_fix.smem_len);
}
static const struct platform_device_id vga16fb_driver_id_table[] = {

View File

@@ -35,6 +35,7 @@ struct font_desc {
#define FONT6x10_IDX 10
#define TER16x32_IDX 11
#define FONT6x8_IDX 12
#define TER10x18_IDX 13
extern const struct font_desc font_vga_8x8,
font_vga_8x16,
@@ -48,7 +49,8 @@ extern const struct font_desc font_vga_8x8,
font_mini_4x6,
font_6x10,
font_ter_16x32,
font_6x8;
font_6x8,
font_ter_10x18;
/* Find a font with a specific name */

View File

@@ -112,6 +112,17 @@ config FONT_SUN12x22
big letters (like the letters used in the SPARC PROM). If the
standard font is unreadable for you, say Y, otherwise say N.
config FONT_TER10x18
bool "Terminus 10x18 font (not supported by all drivers)"
depends on FRAMEBUFFER_CONSOLE || DRM_PANIC
depends on !SPARC && FONTS || SPARC
help
Terminus Font is a clean, fixed width bitmap font, designed
for long (8 and more hours per day) work with computers.
This is the high resolution version made for use with 13-16" laptops.
It fits between the normal 8x16 font and Terminus 16x32.
If other fonts are unreadable for you, say Y, otherwise say N.
config FONT_TER16x32
bool "Terminus 16x32 font (not supported by all drivers)"
depends on FRAMEBUFFER_CONSOLE || DRM_PANIC
@@ -140,6 +151,7 @@ config FONT_AUTOSELECT
depends on !FONT_SUN8x16
depends on !FONT_SUN12x22
depends on !FONT_10x18
depends on !FONT_TER10x18
depends on !FONT_TER16x32
depends on !FONT_6x8
select FONT_8x16

View File

@@ -14,6 +14,7 @@ font-objs-$(CONFIG_FONT_PEARL_8x8) += font_pearl_8x8.o
font-objs-$(CONFIG_FONT_ACORN_8x8) += font_acorn_8x8.o
font-objs-$(CONFIG_FONT_MINI_4x6) += font_mini_4x6.o
font-objs-$(CONFIG_FONT_6x10) += font_6x10.o
font-objs-$(CONFIG_FONT_TER10x18) += font_ter10x18.o
font-objs-$(CONFIG_FONT_TER16x32) += font_ter16x32.o
font-objs-$(CONFIG_FONT_6x8) += font_6x8.o

5143
lib/fonts/font_ter10x18.c Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -54,6 +54,9 @@ static const struct font_desc *fonts[] = {
#ifdef CONFIG_FONT_6x10
&font_6x10,
#endif
#ifdef CONFIG_FONT_TER10x18
&font_ter_10x18,
#endif
#ifdef CONFIG_FONT_TER16x32
&font_ter_16x32,
#endif