1
0
Fork 0

fbdev changes for v4.14:

- make fbcon a built-time depency for fbdev (fbcon was tristate option
   before, now it is a bool) - this is a first step in preparations for
   making console_lock usage saner (currently it acts like the BKL for
   all things fbdev/fbcon) (Daniel Vetter)
 
 - add fbcon=margin:<color> command line option to select the fbcon margin
   color (David Lechner)
 
 - add DMI quirk table for x86 systems which need fbcon rotation (devices
   like Asus T100HA, GPD Pocket, the GPD win and the I.T.Works TW891)
   (Hans de Goede)
 
 - fix 1bpp logo support for unusual width (needed by LEGO MINDSTORMS EV3)
   (David Lechner)
 
 - enable Xilinx FB driver for ARM ZynqMP platform (Michal Simek)
 
 - fix use after free in the error path of udlfb driver (Anton Vasilyev)
 
 - fix error return code handling in pxa3xx_gcu driver (Gustavo A. R. Silva)
 
 - fix bootparams.screeninfo arguments checking in vgacon (Jan H. Schönherr)
 
 - do not leak uninitialized padding in clk to userspace in the debug code of
   atyfb driver (Vladis Dronov)
 
 - fix compiler warnings in fbcon code and matroxfb driver (Arnd Bergmann)
 
 - convert fbdev susbsytem to using %pOF instead of full_name (Rob Herring)
 
 - structures constifications (Arvind Yadav, Bhumika Goyal, Gustavo A. R.
   Silva, Julia Lawall)
 
 - misc cleanups (Gustavo A. R. Silva, Hyun Kwon, Julia Lawall, Kuninori
   Morimoto, Lynn Lei)
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABCAAGBQJZul4fAAoJEH4ztj+gR8ILqasP/3oau30GS0gLZmg76iuBzLdW
 XUI71k0HrSU+5TeSQUPHFXt/u0fkptPZg7rFdWeXNDExOQ86Vi56tGbICRZ0IOqE
 bFjHDnSYtAHTQYNH3326AA8aZ0BoAFd7cfb1oNN3o2xLMG8DLPT9BVl3FWaFMBvQ
 58OwmqbwYlgarC3qE+xDCRPCetrsSYXSmzR8YLkk37sE2pV4Sej4owcm+KJ5WqQk
 kJ6CE+4y9kpLHe3YYdIdXct5CRUa2qT9V8TrMKbio5b0YMsvFudfkpETRK4ebQ5U
 c7JCTAU77Wbl42PvZBlemVkMn1Ugq9tRrTZO4zLdMQfFV4KN0FIoV+mqmikkiYTt
 ON9OYUsOJMXnoP8cZuoELW4VT57jTwmb9YImZsLDnujMF++E9+tVOQ1xlL2SVIL9
 KQ8a7tDlvzaLqpDKyRRXjeeWmvF1xims3L0MiOgBGe+vZlmg2W6zsnMs+/TnomWi
 ytooSQywNS1ZqXVkOcgsv+Be48l/dRTlL0dHzXLYYWLXc0MPSQ57py/lGMfIS5L7
 YAYLvyTvbBXJNTIkvKCKnoo/P4zPYdu4WG9cvbviWoJM9JvVXtuU1CZCU1T4tyCE
 3DjrkJ6tzXVtdKbIN9olr+Nu+cesnmj5CHC1NzfJli7HqUhIxx5QiPOPrkhNCS+V
 22uHfk0Obd4OpUJaUGnF
 =ApgP
 -----END PGP SIGNATURE-----

Merge tag 'fbdev-v4.14' of git://github.com/bzolnier/linux

Pull fbdev updates from Bartlomiej Zolnierkiewicz:

 - make fbcon a built-time depency for fbdev (fbcon was tristate option
   before, now it is a bool) - this is a first step in preparations for
   making console_lock usage saner (currently it acts like the BKL for
   all things fbdev/fbcon) (Daniel Vetter)

 - add fbcon=margin:<color> command line option to select the fbcon
   margin color (David Lechner)

 - add DMI quirk table for x86 systems which need fbcon rotation
   (devices like Asus T100HA, GPD Pocket, the GPD win and the I.T.Works
   TW891) (Hans de Goede)

 - fix 1bpp logo support for unusual width (needed by LEGO MINDSTORMS
   EV3) (David Lechner)

 - enable Xilinx FB driver for ARM ZynqMP platform (Michal Simek)

 - fix use after free in the error path of udlfb driver (Anton Vasilyev)

 - fix error return code handling in pxa3xx_gcu driver (Gustavo A. R.
   Silva)

 - fix bootparams.screeninfo arguments checking in vgacon (Jan H.
   Schönherr)

 - do not leak uninitialized padding in clk to userspace in the debug
   code of atyfb driver (Vladis Dronov)

 - fix compiler warnings in fbcon code and matroxfb driver (Arnd
   Bergmann)

 - convert fbdev susbsytem to using %pOF instead of full_name (Rob
   Herring)

 - structures constifications (Arvind Yadav, Bhumika Goyal, Gustavo A.
   R. Silva, Julia Lawall)

 - misc cleanups (Gustavo A. R. Silva, Hyun Kwon, Julia Lawall, Kuninori
   Morimoto, Lynn Lei)

* tag 'fbdev-v4.14' of git://github.com/bzolnier/linux: (75 commits)
  video/console: Update BIOS dates list for GPD win console rotation DMI quirk
  video/console: Add rotated LCD-panel DMI quirk for the VIOS LTH17
  video: fbdev: sis: fix duplicated code for different branches
  video: fbdev: make fb_var_screeninfo const
  video: fbdev: aty: do not leak uninitialized padding in clk to userspace
  vgacon: Prevent faulty bootparams.screeninfo from causing harm
  video: fbdev: make fb_videomode const
  video/console: Add new BIOS date for GPD pocket to dmi quirk table
  fbcon: remove restriction on margin color
  video: ARM CLCD: constify amba_id
  video: fm2fb: constify zorro_device_id
  video: fbdev: annotate fb_fix_screeninfo with const and __initconst
  omapfb: constify omap_video_timings structures
  video: fbdev: udlfb: Fix use after free on dlfb_usb_probe error path
  fbdev: i810: make fb_ops const
  fbdev: matrox: make fb_ops const
  video: fbdev: pxa3xx_gcu: fix error return code in pxa3xx_gcu_probe()
  video: fbdev: Enable Xilinx FB for ZynqMP
  video: fbdev: Fix multiple style issues in xilinxfb
  video: fbdev: udlfb: constify usb_device_id.
  ...
zero-colors
Linus Torvalds 2017-09-14 13:33:33 -07:00
commit 503f04530f
94 changed files with 398 additions and 269 deletions

View File

@ -148,6 +148,13 @@ C. Boot options
Actually, the underlying fb driver is totally ignorant of console
rotation.
5. fbcon=margin:<color>
This option specifies the color of the margins. The margins are the
leftover area at the right and the bottom of the screen that are not
used by text. By default, this area will be black. The 'color' value
is an integer number that depends on the framebuffer driver being used.
C. Attaching, Detaching and Unloading
Before going on how to attach, detach and unload the framebuffer console, an

View File

@ -117,7 +117,7 @@ config DUMMY_CONSOLE_ROWS
Select 25 if you use a 640x480 resolution by default.
config FRAMEBUFFER_CONSOLE
tristate "Framebuffer Console support"
bool "Framebuffer Console support"
depends on FB && !UML
select VT_HW_CONSOLE_BINDING
select CRC32

View File

@ -7,13 +7,5 @@ obj-$(CONFIG_SGI_NEWPORT_CONSOLE) += newport_con.o
obj-$(CONFIG_STI_CONSOLE) += sticon.o sticore.o
obj-$(CONFIG_VGA_CONSOLE) += vgacon.o
obj-$(CONFIG_MDA_CONSOLE) += mdacon.o
obj-$(CONFIG_FRAMEBUFFER_CONSOLE) += fbcon.o bitblit.o softcursor.o
ifeq ($(CONFIG_FB_TILEBLITTING),y)
obj-$(CONFIG_FRAMEBUFFER_CONSOLE) += tileblit.o
endif
ifeq ($(CONFIG_FRAMEBUFFER_CONSOLE_ROTATION),y)
obj-$(CONFIG_FRAMEBUFFER_CONSOLE) += fbcon_rotate.o fbcon_cw.o fbcon_ud.o \
fbcon_ccw.o
endif
obj-$(CONFIG_FB_STI) += sticore.o

View File

@ -398,9 +398,8 @@ static const char *vgacon_startup(void)
#endif
}
/* boot_params.screen_info initialized? */
if ((screen_info.orig_video_mode == 0) &&
(screen_info.orig_video_lines == 0) &&
/* boot_params.screen_info reasonably initialized? */
if ((screen_info.orig_video_lines == 0) ||
(screen_info.orig_video_cols == 0))
goto no_vga;

View File

@ -72,7 +72,7 @@ static struct fb_var_screeninfo mc68x328fb_default __initdata = {
.vmode = FB_VMODE_NONINTERLACED,
};
static struct fb_fix_screeninfo mc68x328fb_fix __initdata = {
static const struct fb_fix_screeninfo mc68x328fb_fix __initconst = {
.id = "68328fb",
.type = FB_TYPE_PACKED_PIXELS,
.xpanstep = 1,

View File

@ -2173,7 +2173,7 @@ config FB_PS3_DEFAULT_SIZE_M
config FB_XILINX
tristate "Xilinx frame buffer support"
depends on FB && (XILINX_VIRTEX || MICROBLAZE || ARCH_ZYNQ)
depends on FB && (XILINX_VIRTEX || MICROBLAZE || ARCH_ZYNQ || ARCH_ZYNQMP)
select FB_CFB_FILLRECT
select FB_CFB_COPYAREA
select FB_CFB_IMAGEBLIT

View File

@ -1035,7 +1035,7 @@ static struct clcd_vendor_data vendor_nomadik = {
.init_panel = nomadik_clcd_init_panel,
};
static struct amba_id clcdfb_id_table[] = {
static const struct amba_id clcdfb_id_table[] = {
{
.id = 0x00041110,
.mask = 0x000ffffe,

View File

@ -1157,7 +1157,7 @@ fail:
/* List of boards that we are trying to support */
static struct pci_device_id ark_devices[] = {
static const struct pci_device_id ark_devices[] = {
{PCI_DEVICE(0xEDD8, 0xA099)},
{0, 0, 0, 0, 0, 0, 0}
};

View File

@ -592,7 +592,7 @@ static void asiliantfb_remove(struct pci_dev *dp)
framebuffer_release(p);
}
static struct pci_device_id asiliantfb_pci_tbl[] = {
static const struct pci_device_id asiliantfb_pci_tbl[] = {
{ PCI_VENDOR_ID_CT, PCI_DEVICE_ID_CT_69000, PCI_ANY_ID, PCI_ANY_ID },
{ 0 }
};

View File

@ -320,7 +320,7 @@ static inline void atmel_lcdfb_power_control(struct atmel_lcdfb_info *sinfo, int
}
}
static struct fb_fix_screeninfo atmel_lcdfb_fix __initdata = {
static const struct fb_fix_screeninfo atmel_lcdfb_fix __initconst = {
.type = FB_TYPE_PACKED_PIXELS,
.visual = FB_VISUAL_TRUECOLOR,
.xpanstep = 0,

View File

@ -116,7 +116,7 @@ static const struct fb_var_screeninfo default_var = {
/* default modedb mode */
/* 640x480, 60 Hz, Non-Interlaced (25.172 MHz dotclock) */
static struct fb_videomode defaultmode = {
static const struct fb_videomode defaultmode = {
.refresh = 60,
.xres = 640,
.yres = 480,
@ -166,7 +166,7 @@ static int aty128_pci_resume(struct pci_dev *pdev);
static int aty128_do_resume(struct pci_dev *pdev);
/* supported Rage128 chipsets */
static struct pci_device_id aty128_pci_tbl[] = {
static const struct pci_device_id aty128_pci_tbl[] = {
{ PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RAGE128_LE,
PCI_ANY_ID, PCI_ANY_ID, 0, 0, rage_M3_pci },
{ PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RAGE128_LF,

View File

@ -274,7 +274,7 @@ static struct fb_var_screeninfo default_var = {
0, FB_VMODE_NONINTERLACED
};
static struct fb_videomode defmode = {
static const struct fb_videomode defmode = {
/* 640x480 @ 60 Hz, 31.5 kHz hsync */
NULL, 60, 640, 480, 39721, 40, 24, 32, 11, 96, 2,
0, FB_VMODE_NONINTERLACED
@ -1855,7 +1855,7 @@ static int atyfb_ioctl(struct fb_info *info, u_int cmd, u_long arg)
#if defined(DEBUG) && defined(CONFIG_FB_ATY_CT)
case ATYIO_CLKR:
if (M64_HAS(INTEGRATED)) {
struct atyclk clk;
struct atyclk clk = { 0 };
union aty_pll *pll = &par->pll;
u32 dsp_config = pll->ct.dsp_config;
u32 dsp_on_off = pll->ct.dsp_on_off;
@ -3756,7 +3756,7 @@ static void atyfb_pci_remove(struct pci_dev *pdev)
atyfb_remove(info);
}
static struct pci_device_id atyfb_pci_tbl[] = {
static const struct pci_device_id atyfb_pci_tbl[] = {
#ifdef CONFIG_FB_ATY_GX
{ PCI_DEVICE(PCI_VENDOR_ID_ATI, PCI_CHIP_MACH64GX) },
{ PCI_DEVICE(PCI_VENDOR_ID_ATI, PCI_CHIP_MACH64CX) },

View File

@ -96,7 +96,7 @@
#define CHIP_DEF(id, family, flags) \
{ PCI_VENDOR_ID_ATI, id, PCI_ANY_ID, PCI_ANY_ID, 0, 0, (flags) | (CHIP_FAMILY_##family) }
static struct pci_device_id radeonfb_pci_table[] = {
static const struct pci_device_id radeonfb_pci_table[] = {
/* Radeon Xpress 200m */
CHIP_DEF(PCI_CHIP_RS480_5955, RS480, CHIP_HAS_CRTC2 | CHIP_IS_IGP | CHIP_IS_MOBILITY),
CHIP_DEF(PCI_CHIP_RS482_5975, RS480, CHIP_HAS_CRTC2 | CHIP_IS_IGP | CHIP_IS_MOBILITY),
@ -2241,7 +2241,7 @@ static ssize_t radeon_show_edid2(struct file *filp, struct kobject *kobj,
return radeon_show_one_edid(buf, off, count, rinfo->mon2_EDID);
}
static struct bin_attribute edid1_attr = {
static const struct bin_attribute edid1_attr = {
.attr = {
.name = "edid1",
.mode = 0444,
@ -2250,7 +2250,7 @@ static struct bin_attribute edid1_attr = {
.read = radeon_show_edid1,
};
static struct bin_attribute edid2_attr = {
static const struct bin_attribute edid2_attr = {
.attr = {
.name = "edid2",
.mode = 0444,

View File

@ -841,7 +841,7 @@ static int bfin_lq035q1_resume(struct device *dev)
return 0;
}
static struct dev_pm_ops bfin_lq035q1_dev_pm_ops = {
static const struct dev_pm_ops bfin_lq035q1_dev_pm_ops = {
.suspend = bfin_lq035q1_suspend,
.resume = bfin_lq035q1_resume,
};

View File

@ -333,8 +333,8 @@ static int bw2_probe(struct platform_device *op)
dev_set_drvdata(&op->dev, info);
printk(KERN_INFO "%s: bwtwo at %lx:%lx\n",
dp->full_name, par->which_io, info->fix.smem_start);
printk(KERN_INFO "%pOF: bwtwo at %lx:%lx\n",
dp, par->which_io, info->fix.smem_start);
return 0;

View File

@ -553,8 +553,8 @@ static int cg14_probe(struct platform_device *op)
dev_set_drvdata(&op->dev, info);
printk(KERN_INFO "%s: cgfourteen at %lx:%lx, %dMB\n",
dp->full_name,
printk(KERN_INFO "%pOF: cgfourteen at %lx:%lx, %dMB\n",
dp,
par->iospace, info->fix.smem_start,
par->ramsize >> 20);

View File

@ -412,8 +412,8 @@ static int cg3_probe(struct platform_device *op)
dev_set_drvdata(&op->dev, info);
printk(KERN_INFO "%s: cg3 at %lx:%lx\n",
dp->full_name, par->which_io, info->fix.smem_start);
printk(KERN_INFO "%pOF: cg3 at %lx:%lx\n",
dp, par->which_io, info->fix.smem_start);
return 0;

View File

@ -810,8 +810,8 @@ static int cg6_probe(struct platform_device *op)
dev_set_drvdata(&op->dev, info);
printk(KERN_INFO "%s: CGsix [%s] at %lx:%lx\n",
dp->full_name, info->fix.id,
printk(KERN_INFO "%pOF: CGsix [%s] at %lx:%lx\n",
dp, info->fix.id,
par->which_io, info->fix.smem_start);
return 0;

View File

@ -292,7 +292,7 @@ static void chips_hw_init(void)
write_fr(chips_init_fr[i].addr, chips_init_fr[i].data);
}
static struct fb_fix_screeninfo chipsfb_fix = {
static const struct fb_fix_screeninfo chipsfb_fix = {
.id = "C&T 65550",
.type = FB_TYPE_PACKED_PIXELS,
.visual = FB_VISUAL_PSEUDOCOLOR,
@ -309,7 +309,7 @@ static struct fb_fix_screeninfo chipsfb_fix = {
.smem_len = 0x100000, /* 1MB */
};
static struct fb_var_screeninfo chipsfb_var = {
static const struct fb_var_screeninfo chipsfb_var = {
.xres = 800,
.yres = 600,
.xres_virtual = 800,

View File

@ -126,7 +126,7 @@ static void lcd_clear(struct fb_info *info)
lcd_write_control(info, LCD_RESET);
}
static struct fb_fix_screeninfo cobalt_lcdfb_fix = {
static const struct fb_fix_screeninfo cobalt_lcdfb_fix = {
.id = "cobalt-lcd",
.type = FB_TYPE_TEXT,
.type_aux = FB_AUX_TEXT_MDA,

View File

@ -4,6 +4,20 @@ obj-$(CONFIG_FB) += fb.o
fb-y := fbmem.o fbmon.o fbcmap.o fbsysfs.o \
modedb.o fbcvt.o
fb-$(CONFIG_FB_DEFERRED_IO) += fb_defio.o
ifeq ($(CONFIG_FRAMEBUFFER_CONSOLE),y)
fb-y += fbcon.o bitblit.o softcursor.o
ifeq ($(CONFIG_FB_TILEBLITTING),y)
fb-y += tileblit.o
endif
ifeq ($(CONFIG_FRAMEBUFFER_CONSOLE_ROTATION),y)
fb-y += fbcon_rotate.o fbcon_cw.o fbcon_ud.o \
fbcon_ccw.o
endif
ifeq ($(CONFIG_DMI),y)
fb-y += fbcon_dmi_quirks.o
endif
endif
fb-objs := $(fb-y)
obj-$(CONFIG_FB_CFB_FILLRECT) += cfbfillrect.o

View File

@ -203,7 +203,7 @@ static void bit_putcs(struct vc_data *vc, struct fb_info *info,
}
static void bit_clear_margins(struct vc_data *vc, struct fb_info *info,
int bottom_only)
int color, int bottom_only)
{
unsigned int cw = vc->vc_font.width;
unsigned int ch = vc->vc_font.height;
@ -213,7 +213,7 @@ static void bit_clear_margins(struct vc_data *vc, struct fb_info *info,
unsigned int bs = info->var.yres - bh;
struct fb_fillrect region;
region.color = 0;
region.color = color;
region.rop = ROP_COPY;
if (rw && !bottom_only) {
@ -416,7 +416,3 @@ void fbcon_set_bitops(struct fbcon_ops *ops)
EXPORT_SYMBOL(fbcon_set_bitops);
MODULE_AUTHOR("Antonino Daplas <adaplas@pol.net>");
MODULE_DESCRIPTION("Bit Blitting Operation");
MODULE_LICENSE("GPL");

View File

@ -68,6 +68,7 @@
#include <linux/kd.h>
#include <linux/slab.h>
#include <linux/fb.h>
#include <linux/fbcon.h>
#include <linux/vt_kern.h>
#include <linux/selection.h>
#include <linux/font.h>
@ -135,8 +136,9 @@ static char fontname[40];
static int info_idx = -1;
/* console rotation */
static int initial_rotation;
static int initial_rotation = -1;
static int fbcon_has_sysfs;
static int margin_color;
static const struct consw fb_con;
@ -491,6 +493,13 @@ static int __init fb_console_setup(char *this_opt)
initial_rotation = 0;
continue;
}
if (!strncmp(options, "margin:", 7)) {
options += 7;
if (*options)
margin_color = simple_strtoul(options, &options, 0);
continue;
}
}
return 1;
}
@ -563,7 +572,7 @@ static void fbcon_prepare_logo(struct vc_data *vc, struct fb_info *info,
unsigned short *save = NULL, *r, *q;
int logo_height;
if (info->flags & FBINFO_MODULE) {
if (info->fbops->owner) {
logo_shown = FBCON_LOGO_DONTSHOW;
return;
}
@ -954,7 +963,10 @@ static const char *fbcon_startup(void)
ops->cur_rotate = -1;
ops->cur_blink_jiffies = HZ / 5;
info->fbcon_par = ops;
p->con_rotate = initial_rotation;
if (initial_rotation != -1)
p->con_rotate = initial_rotation;
else
p->con_rotate = fbcon_platform_get_rotate(info);
set_blitting_type(vc, info);
if (info->fix.type != FB_TYPE_TEXT) {
@ -1091,7 +1103,10 @@ static void fbcon_init(struct vc_data *vc, int init)
ops = info->fbcon_par;
ops->cur_blink_jiffies = msecs_to_jiffies(vc->vc_cur_blink_ms);
p->con_rotate = initial_rotation;
if (initial_rotation != -1)
p->con_rotate = initial_rotation;
else
p->con_rotate = fbcon_platform_get_rotate(info);
set_blitting_type(vc, info);
cols = vc->vc_cols;
@ -1299,7 +1314,7 @@ static void fbcon_clear_margins(struct vc_data *vc, int bottom_only)
struct fbcon_ops *ops = info->fbcon_par;
if (!fbcon_is_inactive(vc, info))
ops->clear_margins(vc, info, bottom_only);
ops->clear_margins(vc, info, margin_color, bottom_only);
}
static void fbcon_cursor(struct vc_data *vc, int mode)
@ -3606,7 +3621,7 @@ static void fbcon_exit(void)
fbcon_has_exited = 1;
}
static int __init fb_console_init(void)
void __init fb_console_init(void)
{
int i;
@ -3628,11 +3643,8 @@ static int __init fb_console_init(void)
console_unlock();
fbcon_start();
return 0;
}
fs_initcall(fb_console_init);
#ifdef MODULE
static void __exit fbcon_deinit_device(void)
@ -3647,7 +3659,7 @@ static void __exit fbcon_deinit_device(void)
}
}
static void __exit fb_console_exit(void)
void __exit fb_console_exit(void)
{
console_lock();
fb_unregister_client(&fbcon_event_notifier);
@ -3657,9 +3669,4 @@ static void __exit fb_console_exit(void)
do_unregister_con_driver(&fb_con);
console_unlock();
}
module_exit(fb_console_exit);
#endif
MODULE_LICENSE("GPL");

View File

@ -60,7 +60,7 @@ struct fbcon_ops {
const unsigned short *s, int count, int yy, int xx,
int fg, int bg);
void (*clear_margins)(struct vc_data *vc, struct fb_info *info,
int bottom_only);
int color, int bottom_only);
void (*cursor)(struct vc_data *vc, struct fb_info *info, int mode,
int softback_lines, int fg, int bg);
int (*update_start)(struct fb_info *info);
@ -261,5 +261,10 @@ extern void fbcon_set_rotate(struct fbcon_ops *ops);
#define fbcon_set_rotate(x) do {} while(0)
#endif /* CONFIG_FRAMEBUFFER_CONSOLE_ROTATION */
#endif /* _VIDEO_FBCON_H */
#ifdef CONFIG_DMI
int fbcon_platform_get_rotate(struct fb_info *info);
#else
#define fbcon_platform_get_rotate(i) FB_ROTATE_UR
#endif /* CONFIG_DMI */
#endif /* _VIDEO_FBCON_H */

View File

@ -189,7 +189,7 @@ static void ccw_putcs(struct vc_data *vc, struct fb_info *info,
}
static void ccw_clear_margins(struct vc_data *vc, struct fb_info *info,
int bottom_only)
int color, int bottom_only)
{
unsigned int cw = vc->vc_font.width;
unsigned int ch = vc->vc_font.height;
@ -198,7 +198,7 @@ static void ccw_clear_margins(struct vc_data *vc, struct fb_info *info,
unsigned int bs = vc->vc_rows*ch;
struct fb_fillrect region;
region.color = 0;
region.color = color;
region.rop = ROP_COPY;
if (rw && !bottom_only) {
@ -418,7 +418,3 @@ void fbcon_rotate_ccw(struct fbcon_ops *ops)
ops->update_start = ccw_update_start;
}
EXPORT_SYMBOL(fbcon_rotate_ccw);
MODULE_AUTHOR("Antonino Daplas <adaplas@pol.net>");
MODULE_DESCRIPTION("Console Rotation (270 degrees) Support");
MODULE_LICENSE("GPL");

View File

@ -172,7 +172,7 @@ static void cw_putcs(struct vc_data *vc, struct fb_info *info,
}
static void cw_clear_margins(struct vc_data *vc, struct fb_info *info,
int bottom_only)
int color, int bottom_only)
{
unsigned int cw = vc->vc_font.width;
unsigned int ch = vc->vc_font.height;
@ -181,7 +181,7 @@ static void cw_clear_margins(struct vc_data *vc, struct fb_info *info,
unsigned int rs = info->var.yres - rw;
struct fb_fillrect region;
region.color = 0;
region.color = color;
region.rop = ROP_COPY;
if (rw && !bottom_only) {
@ -401,7 +401,3 @@ void fbcon_rotate_cw(struct fbcon_ops *ops)
ops->update_start = cw_update_start;
}
EXPORT_SYMBOL(fbcon_rotate_cw);
MODULE_AUTHOR("Antonino Daplas <adaplas@pol.net>");
MODULE_DESCRIPTION("Console Rotation (90 degrees) Support");
MODULE_LICENSE("GPL");

View File

@ -0,0 +1,145 @@
/*
* fbcon_dmi_quirks.c -- DMI based quirk detection for fbcon
*
* Copyright (C) 2017 Hans de Goede <hdegoede@redhat.com>
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file COPYING in the main directory of this archive for
* more details.
*/
#include <linux/dmi.h>
#include <linux/fb.h>
#include <linux/kernel.h>
#include "fbcon.h"
/*
* Some x86 clamshell design devices use portrait tablet screens and a display
* engine which cannot rotate in hardware, so we need to rotate the fbcon to
* compensate. Unfortunately these (cheap) devices also typically have quite
* generic DMI data, so we match on a combination of DMI data, screen resolution
* and a list of known BIOS dates to avoid false positives.
*/
struct fbcon_dmi_rotate_data {
int width;
int height;
const char * const *bios_dates;
int rotate;
};
static const struct fbcon_dmi_rotate_data rotate_data_asus_t100ha = {
.width = 800,
.height = 1280,
.rotate = FB_ROTATE_CCW,
};
static const struct fbcon_dmi_rotate_data rotate_data_gpd_pocket = {
.width = 1200,
.height = 1920,
.bios_dates = (const char * const []){ "05/26/2017", "06/28/2017",
"07/05/2017", "08/07/2017", NULL },
.rotate = FB_ROTATE_CW,
};
static const struct fbcon_dmi_rotate_data rotate_data_gpd_win = {
.width = 720,
.height = 1280,
.bios_dates = (const char * const []){
"10/25/2016", "11/18/2016", "12/23/2016", "12/26/2016",
"02/21/2017", "03/20/2017", "05/25/2017", NULL },
.rotate = FB_ROTATE_CW,
};
static const struct fbcon_dmi_rotate_data rotate_data_itworks_tw891 = {
.width = 800,
.height = 1280,
.bios_dates = (const char * const []){ "10/16/2015", NULL },
.rotate = FB_ROTATE_CW,
};
static const struct fbcon_dmi_rotate_data rotate_data_vios_lth17 = {
.width = 800,
.height = 1280,
.rotate = FB_ROTATE_CW,
};
static const struct dmi_system_id rotate_data[] = {
{ /* Asus T100HA */
.matches = {
DMI_EXACT_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "T100HAN"),
},
.driver_data = (void *)&rotate_data_asus_t100ha,
}, { /*
* GPD Pocket, note that the the DMI data is less generic then
* it seems, devices with a board-vendor of "AMI Corporation"
* are quite rare, as are devices which have both board- *and*
* product-id set to "Default String"
*/
.matches = {
DMI_EXACT_MATCH(DMI_BOARD_VENDOR, "AMI Corporation"),
DMI_EXACT_MATCH(DMI_BOARD_NAME, "Default string"),
DMI_EXACT_MATCH(DMI_BOARD_SERIAL, "Default string"),
DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "Default string"),
},
.driver_data = (void *)&rotate_data_gpd_pocket,
}, { /* GPD Win (same note on DMI match as GPD Pocket) */
.matches = {
DMI_EXACT_MATCH(DMI_BOARD_VENDOR, "AMI Corporation"),
DMI_EXACT_MATCH(DMI_BOARD_NAME, "Default string"),
DMI_EXACT_MATCH(DMI_BOARD_SERIAL, "Default string"),
DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "Default string"),
},
.driver_data = (void *)&rotate_data_gpd_win,
}, { /* I.T.Works TW891 */
.matches = {
DMI_EXACT_MATCH(DMI_SYS_VENDOR, "To be filled by O.E.M."),
DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "TW891"),
DMI_EXACT_MATCH(DMI_BOARD_VENDOR, "To be filled by O.E.M."),
DMI_EXACT_MATCH(DMI_BOARD_NAME, "TW891"),
},
.driver_data = (void *)&rotate_data_itworks_tw891,
}, { /* VIOS LTH17 */
.matches = {
DMI_EXACT_MATCH(DMI_SYS_VENDOR, "VIOS"),
DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "LTH17"),
DMI_EXACT_MATCH(DMI_BOARD_VENDOR, "VIOS"),
DMI_EXACT_MATCH(DMI_BOARD_NAME, "LTH17"),
},
.driver_data = (void *)&rotate_data_vios_lth17,
},
{}
};
int fbcon_platform_get_rotate(struct fb_info *info)
{
const struct dmi_system_id *match;
const struct fbcon_dmi_rotate_data *data;
const char *bios_date;
int i;
for (match = dmi_first_match(rotate_data);
match;
match = dmi_first_match(match + 1)) {
data = match->driver_data;
if (data->width != info->var.xres ||
data->height != info->var.yres)
continue;
if (!data->bios_dates)
return data->rotate;
bios_date = dmi_get_system_info(DMI_BIOS_DATE);
if (!bios_date)
continue;
for (i = 0; data->bios_dates[i]; i++) {
if (!strcmp(data->bios_dates[i], bios_date))
return data->rotate;
}
}
return FB_ROTATE_UR;
}

View File

@ -110,7 +110,3 @@ void fbcon_set_rotate(struct fbcon_ops *ops)
}
}
EXPORT_SYMBOL(fbcon_set_rotate);
MODULE_AUTHOR("Antonino Daplas <adaplas@pol.net>");
MODULE_DESCRIPTION("Console Rotation Support");
MODULE_LICENSE("GPL");

View File

@ -220,7 +220,7 @@ static void ud_putcs(struct vc_data *vc, struct fb_info *info,
}
static void ud_clear_margins(struct vc_data *vc, struct fb_info *info,
int bottom_only)
int color, int bottom_only)
{
unsigned int cw = vc->vc_font.width;
unsigned int ch = vc->vc_font.height;
@ -228,7 +228,7 @@ static void ud_clear_margins(struct vc_data *vc, struct fb_info *info,
unsigned int bh = info->var.yres - (vc->vc_rows*ch);
struct fb_fillrect region;
region.color = 0;
region.color = color;
region.rop = ROP_COPY;
if (rw && !bottom_only) {
@ -446,7 +446,3 @@ void fbcon_rotate_ud(struct fbcon_ops *ops)
ops->update_start = ud_update_start;
}
EXPORT_SYMBOL(fbcon_rotate_ud);
MODULE_AUTHOR("Antonino Daplas <adaplas@pol.net>");
MODULE_DESCRIPTION("Console Rotation (180 degrees) Support");
MODULE_LICENSE("GPL");

View File

@ -32,6 +32,7 @@
#include <linux/device.h>
#include <linux/efi.h>
#include <linux/fb.h>
#include <linux/fbcon.h>
#include <linux/mem_encrypt.h>
#include <asm/fb.h>
@ -316,7 +317,7 @@ static void fb_set_logo(struct fb_info *info,
for (i = 0; i < logo->height; i++) {
for (j = 0; j < logo->width; src++) {
d = *src ^ xor;
for (k = 7; k >= 0; k--) {
for (k = 7; k >= 0 && j < logo->width; k--) {
*dst++ = ((d >> k) & 1) ? fg : 0;
j++;
}
@ -463,7 +464,7 @@ static int fb_show_logo_line(struct fb_info *info, int rotate,
/* Return if the frame buffer is not mapped or suspended */
if (logo == NULL || info->state != FBINFO_STATE_RUNNING ||
info->flags & FBINFO_MODULE)
info->fbops->owner)
return 0;
image.depth = 8;
@ -601,7 +602,7 @@ int fb_prepare_logo(struct fb_info *info, int rotate)
memset(&fb_logo, 0, sizeof(struct logo_data));
if (info->flags & FBINFO_MISC_TILEBLITTING ||
info->flags & FBINFO_MODULE)
info->fbops->owner)
return 0;
if (info->fix.visual == FB_VISUAL_DIRECTCOLOR) {
@ -1892,6 +1893,9 @@ fbmem_init(void)
fb_class = NULL;
goto err_class;
}
fb_console_init();
return 0;
err_class:
@ -1906,6 +1910,8 @@ module_init(fbmem_init);
static void __exit
fbmem_exit(void)
{
fb_console_exit();
remove_proc_entry("fb", NULL);
class_destroy(fb_class);
unregister_chrdev(FB_MAJOR, "fb");

View File

@ -1479,8 +1479,8 @@ int of_get_fb_videomode(struct device_node *np, struct fb_videomode *fb,
if (ret)
return ret;
pr_debug("%s: got %dx%d display mode from %s\n",
of_node_full_name(np), vm.hactive, vm.vactive, np->name);
pr_debug("%pOF: got %dx%d display mode from %s\n",
np, vm.hactive, vm.vactive, np->name);
dump_fb_videomode(fb);
return 0;

View File

@ -76,7 +76,3 @@ int soft_cursor(struct fb_info *info, struct fb_cursor *cursor)
}
EXPORT_SYMBOL(soft_cursor);
MODULE_AUTHOR("James Simmons <jsimmons@users.sf.net>");
MODULE_DESCRIPTION("Generic software cursor");
MODULE_LICENSE("GPL");

View File

@ -74,7 +74,7 @@ static void tile_putcs(struct vc_data *vc, struct fb_info *info,
}
static void tile_clear_margins(struct vc_data *vc, struct fb_info *info,
int bottom_only)
int color, int bottom_only)
{
return;
}
@ -152,8 +152,3 @@ void fbcon_set_tileops(struct vc_data *vc, struct fb_info *info)
}
EXPORT_SYMBOL(fbcon_set_tileops);
MODULE_AUTHOR("Antonino Daplas <adaplas@pol.net>");
MODULE_DESCRIPTION("Tile Blitting Operation");
MODULE_LICENSE("GPL");

View File

@ -1336,7 +1336,7 @@ static void cyber2000fb_i2c_unregister(struct cfb_info *cfb)
* These parameters give
* 640x480, hsync 31.5kHz, vsync 60Hz
*/
static struct fb_videomode cyber2000fb_default_mode = {
static const struct fb_videomode cyber2000fb_default_mode = {
.refresh = 60,
.xres = 640,
.yres = 480,

View File

@ -1341,7 +1341,7 @@ static int fb_probe(struct platform_device *device)
{
struct da8xx_lcdc_platform_data *fb_pdata =
dev_get_platdata(&device->dev);
static struct resource *lcdc_regs;
struct resource *lcdc_regs;
struct lcd_ctrl_config *lcd_cfg;
struct fb_videomode *lcdc_info;
struct fb_info *da8xx_fb_info;

View File

@ -126,7 +126,7 @@ struct fb_var_screeninfo dnfb_var = {
.vmode = FB_VMODE_NONINTERLACED,
};
static struct fb_fix_screeninfo dnfb_fix = {
static const struct fb_fix_screeninfo dnfb_fix = {
.id = "Apollo Mono",
.smem_start = (FRAME_BUFFER_START + IO_BASE),
.smem_len = FRAME_BUFFER_LEN,

View File

@ -69,7 +69,7 @@ static const struct fb_videomode unifb_modes[] = {
0, FB_VMODE_NONINTERLACED, FB_MODE_IS_VESA },
};
static struct fb_var_screeninfo unifb_default = {
static const struct fb_var_screeninfo unifb_default = {
.xres = 640,
.yres = 480,
.xres_virtual = 640,

View File

@ -997,9 +997,9 @@ static int ffb_probe(struct platform_device *op)
dev_set_drvdata(&op->dev, info);
printk(KERN_INFO "%s: %s at %016lx, type %d, "
printk(KERN_INFO "%pOF: %s at %016lx, type %d, "
"DAC pnum[%x] rev[%d] manuf_rev[%d]\n",
dp->full_name,
dp,
((par->flags & FFB_FLAG_AFB) ? "AFB" : "FFB"),
par->physbase, par->board_type,
dac_pnum, dac_rev, dac_mrev);

View File

@ -213,7 +213,7 @@ static int fm2fb_setcolreg(u_int regno, u_int red, u_int green, u_int blue,
static int fm2fb_probe(struct zorro_dev *z, const struct zorro_device_id *id);
static struct zorro_device_id fm2fb_devices[] = {
static const struct zorro_device_id fm2fb_devices[] = {
{ ZORRO_PROD_BSC_FRAMEMASTER_II },
{ ZORRO_PROD_HELFRICH_RAINBOW_II },
{ 0 }

View File

@ -474,7 +474,7 @@ static void gxfb_remove(struct pci_dev *pdev)
framebuffer_release(info);
}
static struct pci_device_id gxfb_id_table[] = {
static const struct pci_device_id gxfb_id_table[] = {
{ PCI_DEVICE(PCI_VENDOR_ID_NS, PCI_DEVICE_ID_NS_GX_VIDEO) },
{ 0, }
};

View File

@ -70,7 +70,7 @@ static const struct fb_videomode grvga_modedb[] = {
}
};
static struct fb_fix_screeninfo grvga_fix = {
static const struct fb_fix_screeninfo grvga_fix = {
.id = "AG SVGACTRL",
.type = FB_TYPE_PACKED_PIXELS,
.visual = FB_VISUAL_PSEUDOCOLOR,

View File

@ -107,7 +107,7 @@ static const char * const i810_pci_list[] = {
"Intel(R) 815 (Internal Graphics with AGP) Framebuffer Device"
};
static struct pci_device_id i810fb_pci_tbl[] = {
static const struct pci_device_id i810fb_pci_tbl[] = {
{ PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82810_IG1,
PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
{ PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82810_IG3,
@ -1542,7 +1542,7 @@ static int i810fb_cursor(struct fb_info *info, struct fb_cursor *cursor)
return 0;
}
static struct fb_ops i810fb_ops = {
static const struct fb_ops i810fb_ops = {
.owner = THIS_MODULE,
.fb_open = i810fb_open,
.fb_release = i810fb_release,

View File

@ -1318,7 +1318,7 @@ imsttfb_ioctl(struct fb_info *info, u_int cmd, u_long arg)
}
}
static struct pci_device_id imsttfb_pci_tbl[] = {
static const struct pci_device_id imsttfb_pci_tbl[] = {
{ PCI_VENDOR_ID_IMS, PCI_DEVICE_ID_IMS_TT128,
PCI_ANY_ID, PCI_ANY_ID, 0, 0, IBM },
{ PCI_VENDOR_ID_IMS, PCI_DEVICE_ID_IMS_TT3D,

View File

@ -173,7 +173,7 @@ static int intelfb_set_fbinfo(struct intelfb_info *dinfo);
#define INTELFB_CLASS_MASK 0
#endif
static struct pci_device_id intelfb_pci_table[] = {
static const struct pci_device_id intelfb_pci_table[] = {
{ PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_830M, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_DISPLAY_VGA << 8, INTELFB_CLASS_MASK, INTEL_830M },
{ PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_845G, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_DISPLAY_VGA << 8, INTELFB_CLASS_MASK, INTEL_845G },
{ PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_85XGM, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_DISPLAY_VGA << 8, INTELFB_CLASS_MASK, INTEL_85XGM },

View File

@ -633,7 +633,7 @@ static int kyrofb_ioctl(struct fb_info *info,
return 0;
}
static struct pci_device_id kyrofb_pci_tbl[] = {
static const struct pci_device_id kyrofb_pci_tbl[] = {
{ PCI_VENDOR_ID_ST, PCI_DEVICE_ID_STG4000,
PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
{ 0, }

View File

@ -619,8 +619,8 @@ static int leo_probe(struct platform_device *op)
dev_set_drvdata(&op->dev, info);
printk(KERN_INFO "%s: leo at %lx:%lx\n",
dp->full_name,
printk(KERN_INFO "%pOF: leo at %lx:%lx\n",
dp,
par->which_io, info->fix.smem_start);
return 0;

View File

@ -1198,7 +1198,7 @@ static int matroxfb_blank(int blank, struct fb_info *info)
return 0;
}
static struct fb_ops matroxfb_ops = {
static const struct fb_ops matroxfb_ops = {
.owner = THIS_MODULE,
.fb_open = matroxfb_open,
.fb_release = matroxfb_release,
@ -1573,14 +1573,14 @@ static struct board {
NULL}};
#ifndef MODULE
static struct fb_videomode defaultmode = {
static const struct fb_videomode defaultmode = {
/* 640x480 @ 60Hz, 31.5 kHz */
NULL, 60, 640, 480, 39721, 40, 24, 32, 11, 96, 2,
0, FB_VMODE_NONINTERLACED
};
#endif /* !MODULE */
static int hotplug = 0;
#endif /* !MODULE */
static void setDefaultOutputs(struct matrox_fb_info *minfo)
{
@ -1623,7 +1623,7 @@ static int initMatrox2(struct matrox_fb_info *minfo, struct board *b)
unsigned int memsize;
int err;
static struct pci_device_id intel_82437[] = {
static const struct pci_device_id intel_82437[] = {
{ PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82437) },
{ },
};
@ -1794,9 +1794,7 @@ static int initMatrox2(struct matrox_fb_info *minfo, struct board *b)
minfo->fbops = matroxfb_ops;
minfo->fbcon.fbops = &minfo->fbops;
minfo->fbcon.pseudo_palette = minfo->cmap;
/* after __init time we are like module... no logo */
minfo->fbcon.flags = hotplug ? FBINFO_FLAG_MODULE : FBINFO_FLAG_DEFAULT;
minfo->fbcon.flags |= FBINFO_PARTIAL_PAN_OK | /* Prefer panning for scroll under MC viewer/edit */
minfo->fbcon.flags = FBINFO_PARTIAL_PAN_OK | /* Prefer panning for scroll under MC viewer/edit */
FBINFO_HWACCEL_COPYAREA | /* We have hw-assisted bmove */
FBINFO_HWACCEL_FILLRECT | /* And fillrect */
FBINFO_HWACCEL_IMAGEBLIT | /* And imageblit */
@ -2116,7 +2114,7 @@ static void pci_remove_matrox(struct pci_dev* pdev) {
matroxfb_remove(minfo, 1);
}
static struct pci_device_id matroxfb_devices[] = {
static const struct pci_device_id matroxfb_devices[] = {
#ifdef CONFIG_FB_MATROX_MILLENIUM
{PCI_VENDOR_ID_MATROX, PCI_DEVICE_ID_MATROX_MIL,
PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},

View File

@ -39,7 +39,7 @@
static struct fb_info fb_info;
static struct fb_var_screeninfo maxinefb_defined = {
static const struct fb_var_screeninfo maxinefb_defined = {
.xres = 1024,
.yres = 768,
.xres_virtual = 1024,

View File

@ -982,7 +982,7 @@ static inline int mb862xx_pci_gdc_init(struct mb862xxfb_par *par)
#define CHIP_ID(id) \
{ PCI_DEVICE(PCI_VENDOR_ID_FUJITSU_LIMITED, id) }
static struct pci_device_id mb862xx_pci_tbl[] = {
static const struct pci_device_id mb862xx_pci_tbl[] = {
/* MB86295/MB86296 */
CHIP_ID(PCI_DEVICE_ID_FUJITSU_CORALP),
CHIP_ID(PCI_DEVICE_ID_FUJITSU_CORALPA),

View File

@ -79,7 +79,7 @@ struct mbxfb_info {
};
static struct fb_var_screeninfo mbxfb_default = {
static const struct fb_var_screeninfo mbxfb_default = {
.xres = 640,
.yres = 480,
.xres_virtual = 640,
@ -102,7 +102,7 @@ static struct fb_var_screeninfo mbxfb_default = {
.sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
};
static struct fb_fix_screeninfo mbxfb_fix = {
static const struct fb_fix_screeninfo mbxfb_fix = {
.id = "MBX",
.type = FB_TYPE_PACKED_PIXELS,
.visual = FB_VISUAL_TRUECOLOR,

View File

@ -2138,7 +2138,7 @@ static void neofb_remove(struct pci_dev *dev)
}
}
static struct pci_device_id neofb_devices[] = {
static const struct pci_device_id neofb_devices[] = {
{PCI_VENDOR_ID_NEOMAGIC, PCI_CHIP_NM2070,
PCI_ANY_ID, PCI_ANY_ID, 0, 0, FB_ACCEL_NEOMAGIC_NM2070},

View File

@ -55,7 +55,7 @@
/* HW cursor parameters */
#define MAX_CURS 32
static struct pci_device_id nvidiafb_pci_tbl[] = {
static const struct pci_device_id nvidiafb_pci_tbl[] = {
{PCI_VENDOR_ID_NVIDIA, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID,
PCI_BASE_CLASS_DISPLAY << 16, 0xff0000, 0},
{ 0, }

View File

@ -383,7 +383,7 @@ static void offb_init_palette_hacks(struct fb_info *info, struct device_node *dp
FB_VISUAL_PSEUDOCOLOR : FB_VISUAL_STATIC_PSEUDOCOLOR;
}
static void __init offb_init_fb(const char *name, const char *full_name,
static void __init offb_init_fb(const char *name,
int width, int height, int depth,
int pitch, unsigned long address,
int foreign_endian, struct device_node *dp)
@ -402,14 +402,13 @@ static void __init offb_init_fb(const char *name, const char *full_name,
"Using unsupported %dx%d %s at %lx, depth=%d, pitch=%d\n",
width, height, name, address, depth, pitch);
if (depth != 8 && depth != 15 && depth != 16 && depth != 32) {
printk(KERN_ERR "%s: can't use depth = %d\n", full_name,
depth);
printk(KERN_ERR "%pOF: can't use depth = %d\n", dp, depth);
release_mem_region(res_start, res_size);
return;
}
info = framebuffer_alloc(sizeof(u32) * 16, NULL);
if (info == 0) {
release_mem_region(res_start, res_size);
return;
@ -515,7 +514,7 @@ static void __init offb_init_fb(const char *name, const char *full_name,
if (register_framebuffer(info) < 0)
goto out_err;
fb_info(info, "Open Firmware frame buffer device on %s\n", full_name);
fb_info(info, "Open Firmware frame buffer device on %pOF\n", dp);
return;
out_err:
@ -644,7 +643,6 @@ static void __init offb_init_nodriver(struct device_node *dp, int no_real_node)
if (strcmp(dp->name, "valkyrie") == 0)
address += 0x1000;
offb_init_fb(no_real_node ? "bootx" : dp->name,
no_real_node ? "display" : dp->full_name,
width, height, depth, pitch, address,
foreign_endian, no_real_node ? NULL : dp);
}

View File

@ -496,7 +496,7 @@ static void mipid_cleanup(struct lcd_panel *panel)
mipid_esd_stop_check(md);
}
static struct lcd_panel mipid_panel = {
static const struct lcd_panel mipid_panel = {
.config = OMAP_LCDC_PANEL_TFT,
.bpp = 16,

View File

@ -18,7 +18,7 @@
#include <video/omapfb_dss.h>
static struct omap_video_timings lb035q02_timings = {
static const struct omap_video_timings lb035q02_timings = {
.x_res = 320,
.y_res = 240,

View File

@ -509,7 +509,7 @@ static struct attribute *bldev_attrs[] = {
NULL,
};
static struct attribute_group bldev_attr_group = {
static const struct attribute_group bldev_attr_group = {
.attrs = bldev_attrs,
};

View File

@ -41,7 +41,7 @@ struct panel_drv_data {
struct spi_device *spi_dev;
};
static struct omap_video_timings td028ttec1_panel_timings = {
static const struct omap_video_timings td028ttec1_panel_timings = {
.x_res = 480,
.y_res = 640,
.pixelclock = 22153000,

View File

@ -282,7 +282,7 @@ static struct attribute *tpo_td043_attrs[] = {
NULL,
};
static struct attribute_group tpo_td043_attr_group = {
static const struct attribute_group tpo_td043_attr_group = {
.attrs = tpo_td043_attrs,
};

View File

@ -16,6 +16,7 @@
#include <linux/err.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/of_graph.h>
#include <linux/seq_file.h>
#include <video/omapfb_dss.h>
@ -128,7 +129,7 @@ static struct device_node *omapdss_of_get_remote_port(const struct device_node *
{
struct device_node *np;
np = of_parse_phandle(node, "remote-endpoint", 0);
np = of_graph_get_remote_endpoint(node);
if (!np)
return NULL;

View File

@ -304,8 +304,8 @@ static int p9100_probe(struct platform_device *op)
dev_set_drvdata(&op->dev, info);
printk(KERN_INFO "%s: p9100 at %lx:%lx\n",
dp->full_name,
printk(KERN_INFO "%pOF: p9100 at %lx:%lx\n",
dp,
par->which_io, info->fix.smem_start);
return 0;

View File

@ -1732,7 +1732,7 @@ static void pm2fb_remove(struct pci_dev *pdev)
framebuffer_release(info);
}
static struct pci_device_id pm2fb_id_table[] = {
static const struct pci_device_id pm2fb_id_table[] = {
{ PCI_VENDOR_ID_TI, PCI_DEVICE_ID_TI_TVP4020,
PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
{ PCI_VENDOR_ID_3DLABS, PCI_DEVICE_ID_3DLABS_PERMEDIA2,

View File

@ -1479,7 +1479,7 @@ static void pm3fb_remove(struct pci_dev *dev)
}
}
static struct pci_device_id pm3fb_id_table[] = {
static const struct pci_device_id pm3fb_id_table[] = {
{ PCI_VENDOR_ID_3DLABS, 0x0a,
PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
{ 0, }

View File

@ -67,7 +67,7 @@ struct aafb_par {
struct bt431_regs __iomem *bt431;
};
static struct fb_var_screeninfo aafb_defined = {
static const struct fb_var_screeninfo aafb_defined = {
.xres = 1280,
.yres = 1024,
.xres_virtual = 2048,
@ -90,7 +90,7 @@ static struct fb_var_screeninfo aafb_defined = {
.vmode = FB_VMODE_NONINTERLACED,
};
static struct fb_fix_screeninfo aafb_fix = {
static const struct fb_fix_screeninfo aafb_fix = {
.id = "PMAG-AA",
.smem_len = (2048 * 1024),
.type = FB_TYPE_PACKED_PIXELS,

View File

@ -43,7 +43,7 @@ struct pmagbafb_par {
};
static struct fb_var_screeninfo pmagbafb_defined = {
static const struct fb_var_screeninfo pmagbafb_defined = {
.xres = 1024,
.yres = 864,
.xres_virtual = 1024,
@ -67,7 +67,7 @@ static struct fb_var_screeninfo pmagbafb_defined = {
.vmode = FB_VMODE_NONINTERLACED,
};
static struct fb_fix_screeninfo pmagbafb_fix = {
static const struct fb_fix_screeninfo pmagbafb_fix = {
.id = "PMAG-BA",
.smem_len = (1024 * 1024),
.type = FB_TYPE_PACKED_PIXELS,

View File

@ -44,7 +44,7 @@ struct pmagbbfb_par {
};
static struct fb_var_screeninfo pmagbbfb_defined = {
static const struct fb_var_screeninfo pmagbbfb_defined = {
.bits_per_pixel = 8,
.red.length = 8,
.green.length = 8,
@ -57,7 +57,7 @@ static struct fb_var_screeninfo pmagbbfb_defined = {
.vmode = FB_VMODE_NONINTERLACED,
};
static struct fb_fix_screeninfo pmagbbfb_fix = {
static const struct fb_fix_screeninfo pmagbbfb_fix = {
.id = "PMAGB-BA",
.smem_len = (2048 * 1024),
.type = FB_TYPE_PACKED_PIXELS,

View File

@ -952,7 +952,7 @@ static struct fb_ops ps3fb_ops = {
.fb_compat_ioctl = ps3fb_ioctl
};
static struct fb_fix_screeninfo ps3fb_fix = {
static const struct fb_fix_screeninfo ps3fb_fix = {
.id = DEVICE_NAME,
.type = FB_TYPE_PACKED_PIXELS,
.visual = FB_VISUAL_TRUECOLOR,

View File

@ -154,7 +154,7 @@ static struct fb_fix_screeninfo pvr2_fix = {
.accel = FB_ACCEL_NONE,
};
static struct fb_var_screeninfo pvr2_var = {
static const struct fb_var_screeninfo pvr2_var = {
.xres = 640,
.yres = 480,
.xres_virtual = 640,
@ -966,7 +966,7 @@ static void pvr2fb_pci_remove(struct pci_dev *pdev)
pci_release_regions(pdev);
}
static struct pci_device_id pvr2fb_pci_tbl[] = {
static const struct pci_device_id pvr2fb_pci_tbl[] = {
{ PCI_VENDOR_ID_NEC, PCI_DEVICE_ID_NEC_NEON250,
PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
{ 0, },

View File

@ -626,8 +626,8 @@ static int pxa3xx_gcu_probe(struct platform_device *pdev)
/* request the IRQ */
irq = platform_get_irq(pdev, 0);
if (irq < 0) {
dev_err(dev, "no IRQ defined\n");
return -ENODEV;
dev_err(dev, "no IRQ defined: %d\n", irq);
return irq;
}
ret = devm_request_irq(dev, irq, pxa3xx_gcu_handle_irq,

View File

@ -36,7 +36,7 @@ static struct fb_fix_screeninfo q40fb_fix = {
.accel = FB_ACCEL_NONE,
};
static struct fb_var_screeninfo q40fb_var = {
static const struct fb_var_screeninfo q40fb_var = {
.xres = 1024,
.yres = 512,
.xres_virtual = 1024,

View File

@ -101,7 +101,7 @@ static int rivafb_blank(int blank, struct fb_info *info);
*
* ------------------------------------------------------------------------- */
static struct pci_device_id rivafb_pci_tbl[] = {
static const struct pci_device_id rivafb_pci_tbl[] = {
{ PCI_VENDOR_ID_NVIDIA_SGS, PCI_DEVICE_ID_NVIDIA_SGS_RIVA128,
PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
{ PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_TNT,

View File

@ -1483,7 +1483,7 @@ static int s3_pci_resume(struct pci_dev* dev)
/* List of boards that we are trying to support */
static struct pci_device_id s3_devices[] = {
static const struct pci_device_id s3_devices[] = {
{PCI_DEVICE(PCI_VENDOR_ID_S3, 0x8810), .driver_data = CHIP_XXX_TRIO},
{PCI_DEVICE(PCI_VENDOR_ID_S3, 0x8811), .driver_data = CHIP_XXX_TRIO},
{PCI_DEVICE(PCI_VENDOR_ID_S3, 0x8812), .driver_data = CHIP_M65_AURORA64VP},

View File

@ -2429,7 +2429,7 @@ static int savagefb_resume(struct pci_dev* dev)
}
static struct pci_device_id savagefb_devices[] = {
static const struct pci_device_id savagefb_devices[] = {
{PCI_VENDOR_ID_S3, PCI_CHIP_SUPSAV_MX128,
PCI_ANY_ID, PCI_ANY_ID, 0, 0, FB_ACCEL_SUPERSAVAGE},

View File

@ -6848,8 +6848,6 @@ SiS_SetGroup2(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short
if(SiS_Pr->SiS_VGAHDE >= 1280) {
tempch = 20;
tempbx &= ~0x20;
} else if(SiS_Pr->SiS_VGAHDE >= 1024) {
tempch = 25;
} else {
tempch = 25; /* OK */
}
@ -7964,14 +7962,9 @@ SiS_SetCHTVReg(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short
}
}
} else { /* ---- PAL ---- */
/* We don't play around with FSCI in PAL mode */
if(resindex == 0x04) {
SiS_SetCH70xxANDOR(SiS_Pr,0x20,0x00,0xEF); /* loop filter off */
SiS_SetCH70xxANDOR(SiS_Pr,0x21,0x01,0xFE); /* ACIV on */
} else {
SiS_SetCH70xxANDOR(SiS_Pr,0x20,0x00,0xEF); /* loop filter off */
SiS_SetCH70xxANDOR(SiS_Pr,0x21,0x01,0xFE); /* ACIV on */
}
/* We don't play around with FSCI in PAL mode */
SiS_SetCH70xxANDOR(SiS_Pr, 0x20, 0x00, 0xEF); /* loop filter off */
SiS_SetCH70xxANDOR(SiS_Pr, 0x21, 0x01, 0xFE); /* ACIV on */
}
#endif /* 300 */
@ -9657,8 +9650,6 @@ SetDelayComp(struct SiS_Private *SiS_Pr, unsigned short ModeNo)
delay = 0x0a;
} else if(IS_SIS740) {
delay = 0x00;
} else if(SiS_Pr->ChipType < SIS_330) {
delay = 0x0c;
} else {
delay = 0x0c;
}

View File

@ -84,7 +84,7 @@ struct xxx_par;
* if we don't use modedb. If we do use modedb see xxxfb_init how to use it
* to get a fb_var_screeninfo. Otherwise define a default var as well.
*/
static struct fb_fix_screeninfo xxxfb_fix = {
static const struct fb_fix_screeninfo xxxfb_fix = {
.id = "FB's name",
.type = FB_TYPE_PACKED_PIXELS,
.visual = FB_VISUAL_PSEUDOCOLOR,
@ -866,7 +866,7 @@ static int xxxfb_resume(struct pci_dev *dev)
#define xxxfb_resume NULL
#endif /* CONFIG_PM */
static struct pci_device_id xxxfb_id_table[] = {
static const struct pci_device_id xxxfb_id_table[] = {
{ PCI_VENDOR_ID_XXX, PCI_DEVICE_ID_XXX,
PCI_ANY_ID, PCI_ANY_ID, PCI_BASE_CLASS_DISPLAY << 16,
PCI_CLASS_MASK, 0 },

View File

@ -46,7 +46,7 @@
static char *fb_mode = "640x480-16@60";
static unsigned long default_bpp = 16;
static struct fb_videomode sm501_default_mode = {
static const struct fb_videomode sm501_default_mode = {
.refresh = 60,
.xres = 640,
.yres = 480,

View File

@ -33,8 +33,8 @@
#include "sm712.h"
/*
* Private structure
*/
* Private structure
*/
struct smtcfb_info {
struct pci_dev *pdev;
struct fb_info *fb;
@ -785,7 +785,7 @@ static void __init sm7xx_vga_setup(char *options)
smtc_scr_info.lfb_height = 0;
smtc_scr_info.lfb_depth = 0;
pr_debug("sm7xx_vga_setup = %s\n", options);
pr_debug("%s = %s\n", __func__, options);
for (i = 0; i < ARRAY_SIZE(vesa_mode_table); i++) {
if (strstr(options, vesa_mode_table[i].index)) {
@ -798,8 +798,8 @@ static void __init sm7xx_vga_setup(char *options)
}
}
static void sm712_setpalette(int regno, unsigned red, unsigned green,
unsigned blue, struct fb_info *info)
static void sm712_setpalette(int regno, unsigned int red, unsigned int green,
unsigned int blue, struct fb_info *info)
{
/* set bit 5:4 = 01 (write LCD RAM only) */
smtc_seqw(0x66, (smtc_seqr(0x66) & 0xC3) | 0x10);
@ -896,8 +896,9 @@ static int smtc_blank(int blank_mode, struct fb_info *info)
return 0;
}
static int smtc_setcolreg(unsigned regno, unsigned red, unsigned green,
unsigned blue, unsigned trans, struct fb_info *info)
static int smtc_setcolreg(unsigned int regno, unsigned int red,
unsigned int green, unsigned int blue,
unsigned int trans, struct fb_info *info)
{
struct smtcfb_info *sfb;
u32 val;
@ -1477,7 +1478,7 @@ static int smtcfb_pci_probe(struct pci_dev *pdev,
}
/* can support 32 bpp */
if (15 == sfb->fb->var.bits_per_pixel)
if (sfb->fb->var.bits_per_pixel == 15)
sfb->fb->var.bits_per_pixel = 16;
sfb->fb->var.xres_virtual = sfb->fb->var.xres;

View File

@ -122,7 +122,7 @@ static const u32 smscufx_info_flags = FBINFO_DEFAULT | FBINFO_READS_FAST |
FBINFO_VIRTFB | FBINFO_HWACCEL_IMAGEBLIT | FBINFO_HWACCEL_FILLRECT |
FBINFO_HWACCEL_COPYAREA | FBINFO_MISC_ALWAYS_SETPAR;
static struct usb_device_id id_table[] = {
static const struct usb_device_id id_table[] = {
{USB_DEVICE(0x0424, 0x9d00),},
{USB_DEVICE(0x0424, 0x9d01),},
{},

View File

@ -33,8 +33,8 @@ static int gfb_get_props(struct gfb_info *gp)
gp->depth = of_getintprop_default(gp->of_node, "depth", 32);
if (!gp->width || !gp->height) {
printk(KERN_ERR "gfb: Critical properties missing for %s\n",
gp->of_node->full_name);
printk(KERN_ERR "gfb: Critical properties missing for %pOF\n",
gp->of_node);
return -EINVAL;
}
@ -151,12 +151,12 @@ static int gfb_probe(struct platform_device *op)
if (err)
goto err_unmap_fb;
printk("gfb: Found device at %s\n", dp->full_name);
printk("gfb: Found device at %pOF\n", dp);
err = register_framebuffer(info);
if (err < 0) {
printk(KERN_ERR "gfb: Could not register framebuffer %s\n",
dp->full_name);
printk(KERN_ERR "gfb: Could not register framebuffer %pOF\n",
dp);
goto err_unmap_fb;
}

View File

@ -220,7 +220,7 @@ err_out:
return err;
}
static struct pci_device_id s3d_pci_table[] = {
static const struct pci_device_id s3d_pci_table[] = {
{ PCI_DEVICE(PCI_VENDOR_ID_3DLABS, 0x002c), },
{ PCI_DEVICE(PCI_VENDOR_ID_3DLABS, 0x002d), },
{ PCI_DEVICE(PCI_VENDOR_ID_3DLABS, 0x002e), },

View File

@ -393,7 +393,7 @@ err_out:
return err;
}
static struct pci_device_id e3d_pci_table[] = {
static const struct pci_device_id e3d_pci_table[] = {
{ PCI_DEVICE(PCI_VENDOR_ID_3DLABS, 0x7a0), },
{ PCI_DEVICE(0x1091, 0x7a0), },
{ PCI_DEVICE(PCI_VENDOR_ID_3DLABS, 0x7a2), },

View File

@ -467,8 +467,8 @@ static int tcx_probe(struct platform_device *op)
dev_set_drvdata(&op->dev, info);
printk(KERN_INFO "%s: TCX at %lx:%lx, %s\n",
dp->full_name,
printk(KERN_INFO "%pOF: TCX at %lx:%lx, %s\n",
dp,
par->which_io,
info->fix.smem_start,
par->lowdepth ? "8-bit only" : "24-bit depth");

View File

@ -120,7 +120,7 @@ static const struct fb_var_screeninfo tdfx_var = {
static int tdfxfb_probe(struct pci_dev *pdev, const struct pci_device_id *id);
static void tdfxfb_remove(struct pci_dev *pdev);
static struct pci_device_id tdfxfb_id_table[] = {
static const struct pci_device_id tdfxfb_id_table[] = {
{ PCI_VENDOR_ID_3DFX, PCI_DEVICE_ID_3DFX_BANSHEE,
PCI_ANY_ID, PCI_ANY_ID, PCI_BASE_CLASS_DISPLAY << 16,
0xff0000, 0 },

View File

@ -1737,7 +1737,7 @@ static void trident_pci_remove(struct pci_dev *dev)
}
/* List of boards that we are trying to support */
static struct pci_device_id trident_devices[] = {
static const struct pci_device_id trident_devices[] = {
{PCI_VENDOR_ID_TRIDENT, BLADE3D, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
{PCI_VENDOR_ID_TRIDENT, CYBERBLADEi7, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
{PCI_VENDOR_ID_TRIDENT, CYBERBLADEi7D, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},

View File

@ -54,7 +54,7 @@ static const u32 udlfb_info_flags = FBINFO_DEFAULT | FBINFO_READS_FAST |
* which is compatible with all known USB 2.0 era graphics chips and firmware,
* but allows DisplayLink to increment those for any future incompatible chips
*/
static struct usb_device_id id_table[] = {
static const struct usb_device_id id_table[] = {
{.idVendor = 0x17e9,
.bInterfaceClass = 0xff,
.bInterfaceSubClass = 0x00,
@ -1465,7 +1465,7 @@ static ssize_t metrics_reset_store(struct device *fbdev,
return count;
}
static struct bin_attribute edid_attr = {
static const struct bin_attribute edid_attr = {
.attr.name = "edid",
.attr.mode = 0666,
.size = EDID_LENGTH,
@ -1655,7 +1655,6 @@ static int dlfb_usb_probe(struct usb_interface *interface,
error:
if (dev) {
kref_put(&dev->kref, dlfb_free); /* ref for framebuffer */
kref_put(&dev->kref, dlfb_free); /* last ref from kref_init */
/* dev has been deallocated. Do not dereference */

View File

@ -1666,7 +1666,7 @@ static struct attribute *uvesafb_dev_attrs[] = {
NULL,
};
static struct attribute_group uvesafb_dev_attgrp = {
static const struct attribute_group uvesafb_dev_attgrp = {
.name = NULL,
.attrs = uvesafb_dev_attrs,
};

View File

@ -55,7 +55,7 @@ static struct list_head global_has_mode;
static struct fb_ops vmlfb_ops;
static struct vml_sys *subsys = NULL;
static char *vml_default_mode = "1024x768@60";
static struct fb_videomode defaultmode = {
static const struct fb_videomode defaultmode = {
NULL, 60, 1024, 768, 12896, 144, 24, 29, 3, 136, 6,
0, FB_VMODE_NONINTERLACED
};
@ -1044,7 +1044,7 @@ static struct fb_ops vmlfb_ops = {
.fb_setcolreg = vmlfb_setcolreg
};
static struct pci_device_id vml_ids[] = {
static const struct pci_device_id vml_ids[] = {
{PCI_DEVICE(PCI_VENDOR_ID_INTEL, VML_DEVICE_VDC)},
{0}
};

View File

@ -724,7 +724,7 @@ static void via_pci_remove(struct pci_dev *pdev)
}
static struct pci_device_id via_pci_table[] = {
static const struct pci_device_id via_pci_table[] = {
{ PCI_DEVICE(PCI_VENDOR_ID_VIA, UNICHROME_CLE266_DID),
.driver_data = UNICHROME_CLE266 },
{ PCI_DEVICE(PCI_VENDOR_ID_VIA, UNICHROME_K400_DID),

View File

@ -81,7 +81,7 @@ static struct vga_regset vt8623_line_compare_regs[] = {{0x18, 0, 7}, {0x07, 4,
static struct vga_regset vt8623_fetch_count_regs[] = {{0x1C, 0, 7}, {0x1D, 0, 1}, VGA_REGSET_END};
static struct vga_regset vt8623_start_address_regs[] = {{0x0d, 0, 7}, {0x0c, 0, 7}, {0x34, 0, 7}, {0x48, 0, 1}, VGA_REGSET_END};
static struct svga_timing_regs vt8623_timing_regs = {
static const struct svga_timing_regs vt8623_timing_regs = {
vt8623_h_total_regs, vt8623_h_display_regs, vt8623_h_blank_start_regs,
vt8623_h_blank_end_regs, vt8623_h_sync_start_regs, vt8623_h_sync_end_regs,
vt8623_v_total_regs, vt8623_v_display_regs, vt8623_v_blank_start_regs,
@ -888,7 +888,7 @@ fail:
/* List of boards that we are trying to support */
static struct pci_device_id vt8623_devices[] = {
static const struct pci_device_id vt8623_devices[] = {
{PCI_DEVICE(PCI_VENDOR_ID_VIA, 0x3122)},
{0, 0, 0, 0, 0, 0, 0}
};

View File

@ -41,7 +41,6 @@
#define DRIVER_NAME "xilinxfb"
/*
* Xilinx calls it "TFT LCD Controller" though it can also be used for
* the VGA port on the Xilinx ML40x board. This is a hardware display
@ -92,15 +91,16 @@ struct xilinxfb_platform_data {
u32 xvirt, yvirt; /* resolution of memory buffer */
/* Physical address of framebuffer memory; If non-zero, driver
* will use provided memory address instead of allocating one from
* the consistent pool. */
* will use provided memory address instead of allocating one from
* the consistent pool.
*/
u32 fb_phys;
};
/*
* Default xilinxfb configuration
*/
static struct xilinxfb_platform_data xilinx_fb_default_pdata = {
static const struct xilinxfb_platform_data xilinx_fb_default_pdata = {
.xres = 640,
.yres = 480,
.xvirt = 1024,
@ -110,14 +110,14 @@ static struct xilinxfb_platform_data xilinx_fb_default_pdata = {
/*
* Here are the default fb_fix_screeninfo and fb_var_screeninfo structures
*/
static struct fb_fix_screeninfo xilinx_fb_fix = {
static const struct fb_fix_screeninfo xilinx_fb_fix = {
.id = "Xilinx",
.type = FB_TYPE_PACKED_PIXELS,
.visual = FB_VISUAL_TRUECOLOR,
.accel = FB_ACCEL_NONE
};
static struct fb_var_screeninfo xilinx_fb_var = {
static const struct fb_var_screeninfo xilinx_fb_var = {
.bits_per_pixel = BITS_PER_PIXEL,
.red = { RED_SHIFT, 8, 0 },
@ -128,18 +128,18 @@ static struct fb_var_screeninfo xilinx_fb_var = {
.activate = FB_ACTIVATE_NOW
};
#define BUS_ACCESS_FLAG 0x1 /* 1 = BUS, 0 = DCR */
#define LITTLE_ENDIAN_ACCESS 0x2 /* LITTLE ENDIAN IO functions */
struct xilinxfb_drvdata {
struct fb_info info; /* FB driver info record */
phys_addr_t regs_phys; /* phys. address of the control
registers */
* registers
*/
void __iomem *regs; /* virt. address of the control
registers */
* registers
*/
#ifdef CONFIG_PPC_DCR
dcr_host_t dcr_host;
unsigned int dcr_len;
@ -148,7 +148,7 @@ struct xilinxfb_drvdata {
dma_addr_t fb_phys; /* phys. address of the frame buffer */
int fb_alloced; /* Flag, was the fb memory alloced? */
u8 flags; /* features of the driver */
u8 flags; /* features of the driver */
u32 reg_ctrl_default;
@ -165,7 +165,7 @@ struct xilinxfb_drvdata {
* which bus its connected and call the appropriate write API.
*/
static void xilinx_fb_out32(struct xilinxfb_drvdata *drvdata, u32 offset,
u32 val)
u32 val)
{
if (drvdata->flags & BUS_ACCESS_FLAG) {
if (drvdata->flags & LITTLE_ENDIAN_ACCESS)
@ -195,8 +195,8 @@ static u32 xilinx_fb_in32(struct xilinxfb_drvdata *drvdata, u32 offset)
}
static int
xilinx_fb_setcolreg(unsigned regno, unsigned red, unsigned green, unsigned blue,
unsigned transp, struct fb_info *fbi)
xilinx_fb_setcolreg(unsigned int regno, unsigned int red, unsigned int green,
unsigned int blue, unsigned int transp, struct fb_info *fbi)
{
u32 *palette = fbi->pseudo_palette;
@ -205,9 +205,11 @@ xilinx_fb_setcolreg(unsigned regno, unsigned red, unsigned green, unsigned blue,
if (fbi->var.grayscale) {
/* Convert color to grayscale.
* grayscale = 0.30*R + 0.59*G + 0.11*B */
red = green = blue =
(red * 77 + green * 151 + blue * 28 + 127) >> 8;
* grayscale = 0.30*R + 0.59*G + 0.11*B
*/
blue = (red * 77 + green * 151 + blue * 28 + 127) >> 8;
green = blue;
red = green;
}
/* fbi->fix.visual is always FB_VISUAL_TRUECOLOR */
@ -241,13 +243,11 @@ xilinx_fb_blank(int blank_mode, struct fb_info *fbi)
xilinx_fb_out32(drvdata, REG_CTRL, 0);
default:
break;
}
return 0; /* success */
}
static struct fb_ops xilinxfb_ops =
{
static struct fb_ops xilinxfb_ops = {
.owner = THIS_MODULE,
.fb_setcolreg = xilinx_fb_setcolreg,
.fb_blank = xilinx_fb_blank,
@ -286,7 +286,8 @@ static int xilinxfb_assign(struct platform_device *pdev,
} else {
drvdata->fb_alloced = 1;
drvdata->fb_virt = dma_alloc_coherent(dev, PAGE_ALIGN(fbsize),
&drvdata->fb_phys, GFP_KERNEL);
&drvdata->fb_phys,
GFP_KERNEL);
}
if (!drvdata->fb_virt) {
@ -300,7 +301,7 @@ static int xilinxfb_assign(struct platform_device *pdev,
/* Tell the hardware where the frame buffer is */
xilinx_fb_out32(drvdata, REG_FB_ADDR, drvdata->fb_phys);
rc = xilinx_fb_in32(drvdata, REG_FB_ADDR);
/* Endianess detection */
/* Endianness detection */
if (rc != drvdata->fb_phys) {
drvdata->flags |= LITTLE_ENDIAN_ACCESS;
xilinx_fb_out32(drvdata, REG_FB_ADDR, drvdata->fb_phys);
@ -310,8 +311,7 @@ static int xilinxfb_assign(struct platform_device *pdev,
drvdata->reg_ctrl_default = REG_CTRL_ENABLE;
if (pdata->rotate_screen)
drvdata->reg_ctrl_default |= REG_CTRL_ROTATE;
xilinx_fb_out32(drvdata, REG_CTRL,
drvdata->reg_ctrl_default);
xilinx_fb_out32(drvdata, REG_CTRL, drvdata->reg_ctrl_default);
/* Fill struct fb_info */
drvdata->info.device = dev;
@ -364,7 +364,7 @@ err_regfb:
err_cmap:
if (drvdata->fb_alloced)
dma_free_coherent(dev, PAGE_ALIGN(fbsize), drvdata->fb_virt,
drvdata->fb_phys);
drvdata->fb_phys);
else
iounmap(drvdata->fb_virt);
@ -435,12 +435,12 @@ static int xilinxfb_of_probe(struct platform_device *pdev)
* Fill the resource structure if its direct BUS interface
* otherwise fill the dcr_host structure.
*/
if (tft_access) {
if (tft_access)
drvdata->flags |= BUS_ACCESS_FLAG;
}
#ifdef CONFIG_PPC_DCR
else {
int start;
start = dcr_resource_start(pdev->dev.of_node, 0);
drvdata->dcr_len = dcr_resource_len(pdev->dev.of_node, 0);
drvdata->dcr_host = dcr_map(pdev->dev.of_node, start, drvdata->dcr_len);
@ -452,19 +452,19 @@ static int xilinxfb_of_probe(struct platform_device *pdev)
#endif
prop = of_get_property(pdev->dev.of_node, "phys-size", &size);
if ((prop) && (size >= sizeof(u32)*2)) {
if ((prop) && (size >= sizeof(u32) * 2)) {
pdata.screen_width_mm = prop[0];
pdata.screen_height_mm = prop[1];
}
prop = of_get_property(pdev->dev.of_node, "resolution", &size);
if ((prop) && (size >= sizeof(u32)*2)) {
if ((prop) && (size >= sizeof(u32) * 2)) {
pdata.xres = prop[0];
pdata.yres = prop[1];
}
prop = of_get_property(pdev->dev.of_node, "virtual-resolution", &size);
if ((prop) && (size >= sizeof(u32)*2)) {
if ((prop) && (size >= sizeof(u32) * 2)) {
pdata.xvirt = prop[0];
pdata.yvirt = prop[1];
}
@ -482,7 +482,7 @@ static int xilinxfb_of_remove(struct platform_device *op)
}
/* Match table for of_platform binding */
static struct of_device_id xilinxfb_of_match[] = {
static const struct of_device_id xilinxfb_of_match[] = {
{ .compatible = "xlnx,xps-tft-1.00.a", },
{ .compatible = "xlnx,xps-tft-2.00.a", },
{ .compatible = "xlnx,xps-tft-2.01.a", },

View File

@ -31,8 +31,7 @@ static int parse_timing_property(const struct device_node *np, const char *name,
prop = of_find_property(np, name, &length);
if (!prop) {
pr_err("%s: could not find property %s\n",
of_node_full_name(np), name);
pr_err("%pOF: could not find property %s\n", np, name);
return -EINVAL;
}
@ -44,8 +43,7 @@ static int parse_timing_property(const struct device_node *np, const char *name,
} else if (cells == 3) {
ret = of_property_read_u32_array(np, name, &result->min, cells);
} else {
pr_err("%s: illegal timing specification in %s\n",
of_node_full_name(np), name);
pr_err("%pOF: illegal timing specification in %s\n", np, name);
return -EINVAL;
}
@ -105,8 +103,7 @@ static int of_parse_display_timing(const struct device_node *np,
dt->flags |= DISPLAY_FLAGS_DOUBLECLK;
if (ret) {
pr_err("%s: error reading timing properties\n",
of_node_full_name(np));
pr_err("%pOF: error reading timing properties\n", np);
return -EINVAL;
}
@ -129,8 +126,7 @@ int of_get_display_timing(const struct device_node *np, const char *name,
timing_np = of_get_child_by_name(np, name);
if (!timing_np) {
pr_err("%s: could not find node '%s'\n",
of_node_full_name(np), name);
pr_err("%pOF: could not find node '%s'\n", np, name);
return -ENOENT;
}
@ -154,15 +150,13 @@ struct display_timings *of_get_display_timings(const struct device_node *np)
timings_np = of_get_child_by_name(np, "display-timings");
if (!timings_np) {
pr_err("%s: could not find display-timings node\n",
of_node_full_name(np));
pr_err("%pOF: could not find display-timings node\n", np);
return NULL;
}
disp = kzalloc(sizeof(*disp), GFP_KERNEL);
if (!disp) {
pr_err("%s: could not allocate struct disp'\n",
of_node_full_name(np));
pr_err("%pOF: could not allocate struct disp'\n", np);
goto dispfail;
}
@ -172,28 +166,25 @@ struct display_timings *of_get_display_timings(const struct device_node *np)
entry = of_get_next_child(timings_np, NULL);
/* if there is no child, it is useless to go on */
if (!entry) {
pr_err("%s: no timing specifications given\n",
of_node_full_name(np));
pr_err("%pOF: no timing specifications given\n", np);
goto entryfail;
}
pr_debug("%s: using %s as default timing\n",
of_node_full_name(np), entry->name);
pr_debug("%pOF: using %s as default timing\n", np, entry->name);
native_mode = entry;
disp->num_timings = of_get_child_count(timings_np);
if (disp->num_timings == 0) {
/* should never happen, as entry was already found above */
pr_err("%s: no timings specified\n", of_node_full_name(np));
pr_err("%pOF: no timings specified\n", np);
goto entryfail;
}
disp->timings = kzalloc(sizeof(struct display_timing *) *
disp->num_timings, GFP_KERNEL);
if (!disp->timings) {
pr_err("%s: could not allocate timings array\n",
of_node_full_name(np));
pr_err("%pOF: could not allocate timings array\n", np);
goto entryfail;
}
@ -206,8 +197,8 @@ struct display_timings *of_get_display_timings(const struct device_node *np)
dt = kzalloc(sizeof(*dt), GFP_KERNEL);
if (!dt) {
pr_err("%s: could not allocate display_timing struct\n",
of_node_full_name(np));
pr_err("%pOF: could not allocate display_timing struct\n",
np);
goto timingfail;
}
@ -217,8 +208,8 @@ struct display_timings *of_get_display_timings(const struct device_node *np)
* to not encourage wrong devicetrees, fail in case of
* an error
*/
pr_err("%s: error in timing %d\n",
of_node_full_name(np), disp->num_timings + 1);
pr_err("%pOF: error in timing %d\n",
np, disp->num_timings + 1);
kfree(dt);
goto timingfail;
}
@ -236,8 +227,8 @@ struct display_timings *of_get_display_timings(const struct device_node *np)
*/
of_node_put(native_mode);
pr_debug("%s: got %d timings. Using timing #%d as default\n",
of_node_full_name(np), disp->num_timings,
pr_debug("%pOF: got %d timings. Using timing #%d as default\n",
np, disp->num_timings,
disp->native_mode + 1);
return disp;

View File

@ -36,7 +36,7 @@ int of_get_videomode(struct device_node *np, struct videomode *vm,
disp = of_get_display_timings(np);
if (!disp) {
pr_err("%s: no timings specified\n", of_node_full_name(np));
pr_err("%pOF: no timings specified\n", np);
return -EINVAL;
}

View File

@ -400,7 +400,7 @@ struct fb_tile_ops {
#endif /* CONFIG_FB_TILEBLITTING */
/* FBINFO_* = fb_info.flags bit flags */
#define FBINFO_MODULE 0x0001 /* Low-level driver is a module */
#define FBINFO_DEFAULT 0
#define FBINFO_HWACCEL_DISABLED 0x0002
/* When FBINFO_HWACCEL_DISABLED is set:
* Hardware acceleration is turned off. Software implementations
@ -533,14 +533,6 @@ static inline struct apertures_struct *alloc_apertures(unsigned int max_num) {
return a;
}
#ifdef MODULE
#define FBINFO_DEFAULT FBINFO_MODULE
#else
#define FBINFO_DEFAULT 0
#endif
// This will go away
#define FBINFO_FLAG_MODULE FBINFO_MODULE
#define FBINFO_FLAG_DEFAULT FBINFO_DEFAULT
/* This will go away

View File

@ -0,0 +1,12 @@
#ifndef _LINUX_FBCON_H
#define _LINUX_FBCON_H
#ifdef CONFIG_FRAMEBUFFER_CONSOLE
void __init fb_console_init(void);
void __exit fb_console_exit(void);
#else
static inline void fb_console_init(void) {}
static inline void fb_console_exit(void) {}
#endif
#endif /* _LINUX_FBCON_H */