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.
...

+641 -512
+7
Documentation/fb/fbcon.txt
··· 148 Actually, the underlying fb driver is totally ignorant of console 149 rotation. 150 151 C. Attaching, Detaching and Unloading 152 153 Before going on how to attach, detach and unload the framebuffer console, an
··· 148 Actually, the underlying fb driver is totally ignorant of console 149 rotation. 150 151 + 5. fbcon=margin:<color> 152 + 153 + This option specifies the color of the margins. The margins are the 154 + leftover area at the right and the bottom of the screen that are not 155 + used by text. By default, this area will be black. The 'color' value 156 + is an integer number that depends on the framebuffer driver being used. 157 + 158 C. Attaching, Detaching and Unloading 159 160 Before going on how to attach, detach and unload the framebuffer console, an
+1 -1
drivers/video/console/Kconfig
··· 117 Select 25 if you use a 640x480 resolution by default. 118 119 config FRAMEBUFFER_CONSOLE 120 - tristate "Framebuffer Console support" 121 depends on FB && !UML 122 select VT_HW_CONSOLE_BINDING 123 select CRC32
··· 117 Select 25 if you use a 640x480 resolution by default. 118 119 config FRAMEBUFFER_CONSOLE 120 + bool "Framebuffer Console support" 121 depends on FB && !UML 122 select VT_HW_CONSOLE_BINDING 123 select CRC32
-8
drivers/video/console/Makefile
··· 7 obj-$(CONFIG_STI_CONSOLE) += sticon.o sticore.o 8 obj-$(CONFIG_VGA_CONSOLE) += vgacon.o 9 obj-$(CONFIG_MDA_CONSOLE) += mdacon.o 10 - obj-$(CONFIG_FRAMEBUFFER_CONSOLE) += fbcon.o bitblit.o softcursor.o 11 - ifeq ($(CONFIG_FB_TILEBLITTING),y) 12 - obj-$(CONFIG_FRAMEBUFFER_CONSOLE) += tileblit.o 13 - endif 14 - ifeq ($(CONFIG_FRAMEBUFFER_CONSOLE_ROTATION),y) 15 - obj-$(CONFIG_FRAMEBUFFER_CONSOLE) += fbcon_rotate.o fbcon_cw.o fbcon_ud.o \ 16 - fbcon_ccw.o 17 - endif 18 19 obj-$(CONFIG_FB_STI) += sticore.o
··· 7 obj-$(CONFIG_STI_CONSOLE) += sticon.o sticore.o 8 obj-$(CONFIG_VGA_CONSOLE) += vgacon.o 9 obj-$(CONFIG_MDA_CONSOLE) += mdacon.o 10 11 obj-$(CONFIG_FB_STI) += sticore.o
+2 -6
drivers/video/console/bitblit.c drivers/video/fbdev/core/bitblit.c
··· 203 } 204 205 static void bit_clear_margins(struct vc_data *vc, struct fb_info *info, 206 - int bottom_only) 207 { 208 unsigned int cw = vc->vc_font.width; 209 unsigned int ch = vc->vc_font.height; ··· 213 unsigned int bs = info->var.yres - bh; 214 struct fb_fillrect region; 215 216 - region.color = 0; 217 region.rop = ROP_COPY; 218 219 if (rw && !bottom_only) { ··· 415 } 416 417 EXPORT_SYMBOL(fbcon_set_bitops); 418 - 419 - MODULE_AUTHOR("Antonino Daplas <adaplas@pol.net>"); 420 - MODULE_DESCRIPTION("Bit Blitting Operation"); 421 - MODULE_LICENSE("GPL"); 422
··· 203 } 204 205 static void bit_clear_margins(struct vc_data *vc, struct fb_info *info, 206 + int color, int bottom_only) 207 { 208 unsigned int cw = vc->vc_font.width; 209 unsigned int ch = vc->vc_font.height; ··· 213 unsigned int bs = info->var.yres - bh; 214 struct fb_fillrect region; 215 216 + region.color = color; 217 region.rop = ROP_COPY; 218 219 if (rw && !bottom_only) { ··· 415 } 416 417 EXPORT_SYMBOL(fbcon_set_bitops); 418
+22 -15
drivers/video/console/fbcon.c drivers/video/fbdev/core/fbcon.c
··· 68 #include <linux/kd.h> 69 #include <linux/slab.h> 70 #include <linux/fb.h> 71 #include <linux/vt_kern.h> 72 #include <linux/selection.h> 73 #include <linux/font.h> ··· 136 static int info_idx = -1; 137 138 /* console rotation */ 139 - static int initial_rotation; 140 static int fbcon_has_sysfs; 141 142 static const struct consw fb_con; 143 ··· 493 initial_rotation = 0; 494 continue; 495 } 496 } 497 return 1; 498 } ··· 572 unsigned short *save = NULL, *r, *q; 573 int logo_height; 574 575 - if (info->flags & FBINFO_MODULE) { 576 logo_shown = FBCON_LOGO_DONTSHOW; 577 return; 578 } ··· 963 ops->cur_rotate = -1; 964 ops->cur_blink_jiffies = HZ / 5; 965 info->fbcon_par = ops; 966 - p->con_rotate = initial_rotation; 967 set_blitting_type(vc, info); 968 969 if (info->fix.type != FB_TYPE_TEXT) { ··· 1103 1104 ops = info->fbcon_par; 1105 ops->cur_blink_jiffies = msecs_to_jiffies(vc->vc_cur_blink_ms); 1106 - p->con_rotate = initial_rotation; 1107 set_blitting_type(vc, info); 1108 1109 cols = vc->vc_cols; ··· 1314 struct fbcon_ops *ops = info->fbcon_par; 1315 1316 if (!fbcon_is_inactive(vc, info)) 1317 - ops->clear_margins(vc, info, bottom_only); 1318 } 1319 1320 static void fbcon_cursor(struct vc_data *vc, int mode) ··· 3621 fbcon_has_exited = 1; 3622 } 3623 3624 - static int __init fb_console_init(void) 3625 { 3626 int i; 3627 ··· 3643 3644 console_unlock(); 3645 fbcon_start(); 3646 - return 0; 3647 } 3648 - 3649 - fs_initcall(fb_console_init); 3650 3651 #ifdef MODULE 3652 ··· 3659 } 3660 } 3661 3662 - static void __exit fb_console_exit(void) 3663 { 3664 console_lock(); 3665 fb_unregister_client(&fbcon_event_notifier); ··· 3669 do_unregister_con_driver(&fb_con); 3670 console_unlock(); 3671 } 3672 - 3673 - module_exit(fb_console_exit); 3674 - 3675 #endif 3676 - 3677 - MODULE_LICENSE("GPL");
··· 68 #include <linux/kd.h> 69 #include <linux/slab.h> 70 #include <linux/fb.h> 71 + #include <linux/fbcon.h> 72 #include <linux/vt_kern.h> 73 #include <linux/selection.h> 74 #include <linux/font.h> ··· 135 static int info_idx = -1; 136 137 /* console rotation */ 138 + static int initial_rotation = -1; 139 static int fbcon_has_sysfs; 140 + static int margin_color; 141 142 static const struct consw fb_con; 143 ··· 491 initial_rotation = 0; 492 continue; 493 } 494 + 495 + if (!strncmp(options, "margin:", 7)) { 496 + options += 7; 497 + if (*options) 498 + margin_color = simple_strtoul(options, &options, 0); 499 + continue; 500 + } 501 } 502 return 1; 503 } ··· 563 unsigned short *save = NULL, *r, *q; 564 int logo_height; 565 566 + if (info->fbops->owner) { 567 logo_shown = FBCON_LOGO_DONTSHOW; 568 return; 569 } ··· 954 ops->cur_rotate = -1; 955 ops->cur_blink_jiffies = HZ / 5; 956 info->fbcon_par = ops; 957 + if (initial_rotation != -1) 958 + p->con_rotate = initial_rotation; 959 + else 960 + p->con_rotate = fbcon_platform_get_rotate(info); 961 set_blitting_type(vc, info); 962 963 if (info->fix.type != FB_TYPE_TEXT) { ··· 1091 1092 ops = info->fbcon_par; 1093 ops->cur_blink_jiffies = msecs_to_jiffies(vc->vc_cur_blink_ms); 1094 + if (initial_rotation != -1) 1095 + p->con_rotate = initial_rotation; 1096 + else 1097 + p->con_rotate = fbcon_platform_get_rotate(info); 1098 set_blitting_type(vc, info); 1099 1100 cols = vc->vc_cols; ··· 1299 struct fbcon_ops *ops = info->fbcon_par; 1300 1301 if (!fbcon_is_inactive(vc, info)) 1302 + ops->clear_margins(vc, info, margin_color, bottom_only); 1303 } 1304 1305 static void fbcon_cursor(struct vc_data *vc, int mode) ··· 3606 fbcon_has_exited = 1; 3607 } 3608 3609 + void __init fb_console_init(void) 3610 { 3611 int i; 3612 ··· 3628 3629 console_unlock(); 3630 fbcon_start(); 3631 } 3632 3633 #ifdef MODULE 3634 ··· 3647 } 3648 } 3649 3650 + void __exit fb_console_exit(void) 3651 { 3652 console_lock(); 3653 fb_unregister_client(&fbcon_event_notifier); ··· 3657 do_unregister_con_driver(&fb_con); 3658 console_unlock(); 3659 } 3660 #endif
+7 -2
drivers/video/console/fbcon.h drivers/video/fbdev/core/fbcon.h
··· 60 const unsigned short *s, int count, int yy, int xx, 61 int fg, int bg); 62 void (*clear_margins)(struct vc_data *vc, struct fb_info *info, 63 - int bottom_only); 64 void (*cursor)(struct vc_data *vc, struct fb_info *info, int mode, 65 int softback_lines, int fg, int bg); 66 int (*update_start)(struct fb_info *info); ··· 261 #define fbcon_set_rotate(x) do {} while(0) 262 #endif /* CONFIG_FRAMEBUFFER_CONSOLE_ROTATION */ 263 264 - #endif /* _VIDEO_FBCON_H */ 265
··· 60 const unsigned short *s, int count, int yy, int xx, 61 int fg, int bg); 62 void (*clear_margins)(struct vc_data *vc, struct fb_info *info, 63 + int color, int bottom_only); 64 void (*cursor)(struct vc_data *vc, struct fb_info *info, int mode, 65 int softback_lines, int fg, int bg); 66 int (*update_start)(struct fb_info *info); ··· 261 #define fbcon_set_rotate(x) do {} while(0) 262 #endif /* CONFIG_FRAMEBUFFER_CONSOLE_ROTATION */ 263 264 + #ifdef CONFIG_DMI 265 + int fbcon_platform_get_rotate(struct fb_info *info); 266 + #else 267 + #define fbcon_platform_get_rotate(i) FB_ROTATE_UR 268 + #endif /* CONFIG_DMI */ 269 270 + #endif /* _VIDEO_FBCON_H */
+2 -6
drivers/video/console/fbcon_ccw.c drivers/video/fbdev/core/fbcon_ccw.c
··· 189 } 190 191 static void ccw_clear_margins(struct vc_data *vc, struct fb_info *info, 192 - int bottom_only) 193 { 194 unsigned int cw = vc->vc_font.width; 195 unsigned int ch = vc->vc_font.height; ··· 198 unsigned int bs = vc->vc_rows*ch; 199 struct fb_fillrect region; 200 201 - region.color = 0; 202 region.rop = ROP_COPY; 203 204 if (rw && !bottom_only) { ··· 418 ops->update_start = ccw_update_start; 419 } 420 EXPORT_SYMBOL(fbcon_rotate_ccw); 421 - 422 - MODULE_AUTHOR("Antonino Daplas <adaplas@pol.net>"); 423 - MODULE_DESCRIPTION("Console Rotation (270 degrees) Support"); 424 - MODULE_LICENSE("GPL");
··· 189 } 190 191 static void ccw_clear_margins(struct vc_data *vc, struct fb_info *info, 192 + int color, int bottom_only) 193 { 194 unsigned int cw = vc->vc_font.width; 195 unsigned int ch = vc->vc_font.height; ··· 198 unsigned int bs = vc->vc_rows*ch; 199 struct fb_fillrect region; 200 201 + region.color = color; 202 region.rop = ROP_COPY; 203 204 if (rw && !bottom_only) { ··· 418 ops->update_start = ccw_update_start; 419 } 420 EXPORT_SYMBOL(fbcon_rotate_ccw);
+146 -105
drivers/video/console/fbcon_cw.c drivers/video/fbdev/core/fbcon_ud.c
··· 1 /* 2 - * linux/drivers/video/console/fbcon_ud.c -- Software Rotation - 90 degrees 3 * 4 * Copyright (C) 2005 Antonino Daplas <adaplas @pol.net> 5 * ··· 19 #include "fbcon_rotate.h" 20 21 /* 22 - * Rotation 90 degrees 23 */ 24 25 - static void cw_update_attr(u8 *dst, u8 *src, int attribute, 26 struct vc_data *vc) 27 { 28 - int i, j, offset = (vc->vc_font.height < 10) ? 1 : 2; 29 - int width = (vc->vc_font.height + 7) >> 3; 30 - u8 c, msk = ~(0xff >> offset); 31 32 - for (i = 0; i < vc->vc_font.width; i++) { 33 - for (j = 0; j < width; j++) { 34 - c = *src; 35 - if (attribute & FBCON_ATTRIBUTE_UNDERLINE && !j) 36 - c |= msk; 37 - if (attribute & FBCON_ATTRIBUTE_BOLD && i) 38 - c |= *(src-width); 39 - if (attribute & FBCON_ATTRIBUTE_REVERSE) 40 - c = ~c; 41 - src++; 42 - *dst++ = c; 43 - } 44 } 45 } 46 47 48 - static void cw_bmove(struct vc_data *vc, struct fb_info *info, int sy, 49 int sx, int dy, int dx, int height, int width) 50 { 51 struct fbcon_ops *ops = info->fbcon_par; 52 struct fb_copyarea area; 53 u32 vxres = GETVXRES(ops->p->scrollmode, info); 54 55 - area.sx = vxres - ((sy + height) * vc->vc_font.height); 56 - area.sy = sx * vc->vc_font.width; 57 - area.dx = vxres - ((dy + height) * vc->vc_font.height); 58 - area.dy = dx * vc->vc_font.width; 59 - area.width = height * vc->vc_font.height; 60 - area.height = width * vc->vc_font.width; 61 62 info->fbops->fb_copyarea(info, &area); 63 } 64 65 - static void cw_clear(struct vc_data *vc, struct fb_info *info, int sy, 66 int sx, int height, int width) 67 { 68 struct fbcon_ops *ops = info->fbcon_par; 69 struct fb_fillrect region; 70 int bgshift = (vc->vc_hi_font_mask) ? 13 : 12; 71 u32 vxres = GETVXRES(ops->p->scrollmode, info); 72 73 region.color = attr_bgcol_ec(bgshift,vc,info); 74 - region.dx = vxres - ((sy + height) * vc->vc_font.height); 75 - region.dy = sx * vc->vc_font.width; 76 - region.height = width * vc->vc_font.width; 77 - region.width = height * vc->vc_font.height; 78 region.rop = ROP_COPY; 79 80 info->fbops->fb_fillrect(info, &region); 81 } 82 83 - static inline void cw_putcs_aligned(struct vc_data *vc, struct fb_info *info, 84 const u16 *s, u32 attr, u32 cnt, 85 u32 d_pitch, u32 s_pitch, u32 cellsize, 86 struct fb_image *image, u8 *buf, u8 *dst) 87 { 88 struct fbcon_ops *ops = info->fbcon_par; 89 u16 charmask = vc->vc_hi_font_mask ? 0x1ff : 0xff; 90 - u32 idx = (vc->vc_font.height + 7) >> 3; 91 u8 *src; 92 93 while (cnt--) { 94 - src = ops->fontbuffer + (scr_readw(s++) & charmask)*cellsize; 95 96 if (attr) { 97 - cw_update_attr(buf, src, attr, vc); 98 src = buf; 99 } 100 101 if (likely(idx == 1)) 102 __fb_pad_aligned_buffer(dst, d_pitch, src, idx, 103 - vc->vc_font.width); 104 else 105 fb_pad_aligned_buffer(dst, d_pitch, src, idx, 106 - vc->vc_font.width); 107 108 - dst += d_pitch * vc->vc_font.width; 109 } 110 111 info->fbops->fb_imageblit(info, image); 112 } 113 114 - static void cw_putcs(struct vc_data *vc, struct fb_info *info, 115 const unsigned short *s, int count, int yy, int xx, 116 int fg, int bg) 117 { 118 struct fb_image image; 119 struct fbcon_ops *ops = info->fbcon_par; 120 - u32 width = (vc->vc_font.height + 7)/8; 121 - u32 cellsize = width * vc->vc_font.width; 122 u32 maxcnt = info->pixmap.size/cellsize; 123 u32 scan_align = info->pixmap.scan_align - 1; 124 u32 buf_align = info->pixmap.buf_align - 1; 125 - u32 cnt, pitch, size; 126 u32 attribute = get_attribute(info, scr_readw(s)); 127 u8 *dst, *buf = NULL; 128 u32 vxres = GETVXRES(ops->p->scrollmode, info); 129 130 if (!ops->fontbuffer) ··· 170 171 image.fg_color = fg; 172 image.bg_color = bg; 173 - image.dx = vxres - ((yy + 1) * vc->vc_font.height); 174 - image.dy = xx * vc->vc_font.width; 175 - image.width = vc->vc_font.height; 176 image.depth = 1; 177 178 if (attribute) { ··· 181 return; 182 } 183 184 while (count) { 185 if (count > maxcnt) 186 cnt = maxcnt; 187 else 188 cnt = count; 189 190 - image.height = vc->vc_font.width * cnt; 191 pitch = ((image.width + 7) >> 3) + scan_align; 192 pitch &= ~scan_align; 193 size = pitch * image.height + buf_align; 194 size &= ~buf_align; 195 dst = fb_get_buffer_offset(info, &info->pixmap, size); 196 image.data = dst; 197 - cw_putcs_aligned(vc, info, s, attribute, cnt, pitch, 198 - width, cellsize, &image, buf, dst); 199 - image.dy += image.height; 200 count -= cnt; 201 - s += cnt; 202 } 203 204 /* buf is always NULL except when in monochrome mode, so in this case ··· 219 220 } 221 222 - static void cw_clear_margins(struct vc_data *vc, struct fb_info *info, 223 - int bottom_only) 224 { 225 unsigned int cw = vc->vc_font.width; 226 unsigned int ch = vc->vc_font.height; 227 - unsigned int rw = info->var.yres - (vc->vc_cols*cw); 228 - unsigned int bh = info->var.xres - (vc->vc_rows*ch); 229 - unsigned int rs = info->var.yres - rw; 230 struct fb_fillrect region; 231 232 - region.color = 0; 233 region.rop = ROP_COPY; 234 235 if (rw && !bottom_only) { 236 - region.dx = 0; 237 - region.dy = info->var.yoffset + rs; 238 - region.height = rw; 239 - region.width = info->var.xres_virtual; 240 info->fbops->fb_fillrect(info, &region); 241 } 242 243 if (bh) { 244 - region.dx = info->var.xoffset; 245 region.dy = info->var.yoffset; 246 - region.height = info->var.yres; 247 - region.width = bh; 248 info->fbops->fb_fillrect(info, &region); 249 } 250 } 251 252 - static void cw_cursor(struct vc_data *vc, struct fb_info *info, int mode, 253 int softback_lines, int fg, int bg) 254 { 255 struct fb_cursor cursor; 256 struct fbcon_ops *ops = info->fbcon_par; 257 unsigned short charmask = vc->vc_hi_font_mask ? 0x1ff : 0xff; 258 - int w = (vc->vc_font.height + 7) >> 3, c; 259 int y = real_y(ops->p, vc->vc_y); 260 int attribute, use_sw = (vc->vc_cursor_type & 0x10); 261 int err = 1, dx, dy; 262 char *src; 263 u32 vxres = GETVXRES(ops->p->scrollmode, info); 264 265 if (!ops->fontbuffer) ··· 278 279 c = scr_readw((u16 *) vc->vc_pos); 280 attribute = get_attribute(info, c); 281 - src = ops->fontbuffer + ((c & charmask) * (w * vc->vc_font.width)); 282 283 if (ops->cursor_state.image.data != src || 284 ops->cursor_reset) { ··· 289 if (attribute) { 290 u8 *dst; 291 292 - dst = kmalloc(w * vc->vc_font.width, GFP_ATOMIC); 293 if (!dst) 294 return; 295 kfree(ops->cursor_data); 296 ops->cursor_data = dst; 297 - cw_update_attr(dst, src, attribute, vc); 298 src = dst; 299 } 300 ··· 306 cursor.set |= FB_CUR_SETCMAP; 307 } 308 309 - if (ops->cursor_state.image.height != vc->vc_font.width || 310 - ops->cursor_state.image.width != vc->vc_font.height || 311 ops->cursor_reset) { 312 - ops->cursor_state.image.height = vc->vc_font.width; 313 - ops->cursor_state.image.width = vc->vc_font.height; 314 cursor.set |= FB_CUR_SETSIZE; 315 } 316 317 - dx = vxres - ((y * vc->vc_font.height) + vc->vc_font.height); 318 - dy = vc->vc_x * vc->vc_font.width; 319 320 if (ops->cursor_state.image.dx != dx || 321 ops->cursor_state.image.dy != dy || ··· 335 vc->vc_cursor_type != ops->p->cursor_shape || 336 ops->cursor_state.mask == NULL || 337 ops->cursor_reset) { 338 - char *tmp, *mask = kmalloc(w*vc->vc_font.width, GFP_ATOMIC); 339 int cur_height, size, i = 0; 340 - int width = (vc->vc_font.width + 7)/8; 341 342 if (!mask) 343 return; 344 - 345 - tmp = kmalloc(width * vc->vc_font.height, GFP_ATOMIC); 346 - 347 - if (!tmp) { 348 - kfree(mask); 349 - return; 350 - } 351 352 kfree(ops->cursor_state.mask); 353 ops->cursor_state.mask = mask; ··· 370 break; 371 } 372 373 - size = (vc->vc_font.height - cur_height) * width; 374 while (size--) 375 - tmp[i++] = 0; 376 - size = cur_height * width; 377 while (size--) 378 - tmp[i++] = 0xff; 379 - memset(mask, 0, w * vc->vc_font.width); 380 - rotate_cw(tmp, mask, vc->vc_font.width, vc->vc_font.height); 381 - kfree(tmp); 382 } 383 384 switch (mode) { ··· 415 ops->cursor_reset = 0; 416 } 417 418 - static int cw_update_start(struct fb_info *info) 419 { 420 struct fbcon_ops *ops = info->fbcon_par; 421 u32 vxres = GETVXRES(ops->p->scrollmode, info); 422 - u32 xoffset; 423 int err; 424 425 - xoffset = vxres - (info->var.xres + ops->var.yoffset); 426 - ops->var.yoffset = ops->var.xoffset; 427 ops->var.xoffset = xoffset; 428 err = fb_pan_display(info, &ops->var); 429 ops->var.xoffset = info->var.xoffset; 430 ops->var.yoffset = info->var.yoffset; ··· 436 return err; 437 } 438 439 - void fbcon_rotate_cw(struct fbcon_ops *ops) 440 { 441 - ops->bmove = cw_bmove; 442 - ops->clear = cw_clear; 443 - ops->putcs = cw_putcs; 444 - ops->clear_margins = cw_clear_margins; 445 - ops->cursor = cw_cursor; 446 - ops->update_start = cw_update_start; 447 } 448 - EXPORT_SYMBOL(fbcon_rotate_cw); 449 - 450 - MODULE_AUTHOR("Antonino Daplas <adaplas@pol.net>"); 451 - MODULE_DESCRIPTION("Console Rotation (90 degrees) Support"); 452 - MODULE_LICENSE("GPL");
··· 1 /* 2 + * linux/drivers/video/console/fbcon_ud.c -- Software Rotation - 180 degrees 3 * 4 * Copyright (C) 2005 Antonino Daplas <adaplas @pol.net> 5 * ··· 19 #include "fbcon_rotate.h" 20 21 /* 22 + * Rotation 180 degrees 23 */ 24 25 + static void ud_update_attr(u8 *dst, u8 *src, int attribute, 26 struct vc_data *vc) 27 { 28 + int i, offset = (vc->vc_font.height < 10) ? 1 : 2; 29 + int width = (vc->vc_font.width + 7) >> 3; 30 + unsigned int cellsize = vc->vc_font.height * width; 31 + u8 c; 32 33 + offset = offset * width; 34 + 35 + for (i = 0; i < cellsize; i++) { 36 + c = src[i]; 37 + if (attribute & FBCON_ATTRIBUTE_UNDERLINE && i < offset) 38 + c = 0xff; 39 + if (attribute & FBCON_ATTRIBUTE_BOLD) 40 + c |= c << 1; 41 + if (attribute & FBCON_ATTRIBUTE_REVERSE) 42 + c = ~c; 43 + dst[i] = c; 44 } 45 } 46 47 48 + static void ud_bmove(struct vc_data *vc, struct fb_info *info, int sy, 49 int sx, int dy, int dx, int height, int width) 50 { 51 struct fbcon_ops *ops = info->fbcon_par; 52 struct fb_copyarea area; 53 + u32 vyres = GETVYRES(ops->p->scrollmode, info); 54 u32 vxres = GETVXRES(ops->p->scrollmode, info); 55 56 + area.sy = vyres - ((sy + height) * vc->vc_font.height); 57 + area.sx = vxres - ((sx + width) * vc->vc_font.width); 58 + area.dy = vyres - ((dy + height) * vc->vc_font.height); 59 + area.dx = vxres - ((dx + width) * vc->vc_font.width); 60 + area.height = height * vc->vc_font.height; 61 + area.width = width * vc->vc_font.width; 62 63 info->fbops->fb_copyarea(info, &area); 64 } 65 66 + static void ud_clear(struct vc_data *vc, struct fb_info *info, int sy, 67 int sx, int height, int width) 68 { 69 struct fbcon_ops *ops = info->fbcon_par; 70 struct fb_fillrect region; 71 int bgshift = (vc->vc_hi_font_mask) ? 13 : 12; 72 + u32 vyres = GETVYRES(ops->p->scrollmode, info); 73 u32 vxres = GETVXRES(ops->p->scrollmode, info); 74 75 region.color = attr_bgcol_ec(bgshift,vc,info); 76 + region.dy = vyres - ((sy + height) * vc->vc_font.height); 77 + region.dx = vxres - ((sx + width) * vc->vc_font.width); 78 + region.width = width * vc->vc_font.width; 79 + region.height = height * vc->vc_font.height; 80 region.rop = ROP_COPY; 81 82 info->fbops->fb_fillrect(info, &region); 83 } 84 85 + static inline void ud_putcs_aligned(struct vc_data *vc, struct fb_info *info, 86 const u16 *s, u32 attr, u32 cnt, 87 u32 d_pitch, u32 s_pitch, u32 cellsize, 88 struct fb_image *image, u8 *buf, u8 *dst) 89 { 90 struct fbcon_ops *ops = info->fbcon_par; 91 u16 charmask = vc->vc_hi_font_mask ? 0x1ff : 0xff; 92 + u32 idx = vc->vc_font.width >> 3; 93 u8 *src; 94 95 while (cnt--) { 96 + src = ops->fontbuffer + (scr_readw(s--) & charmask)*cellsize; 97 98 if (attr) { 99 + ud_update_attr(buf, src, attr, vc); 100 src = buf; 101 } 102 103 if (likely(idx == 1)) 104 __fb_pad_aligned_buffer(dst, d_pitch, src, idx, 105 + image->height); 106 else 107 fb_pad_aligned_buffer(dst, d_pitch, src, idx, 108 + image->height); 109 110 + dst += s_pitch; 111 } 112 113 info->fbops->fb_imageblit(info, image); 114 } 115 116 + static inline void ud_putcs_unaligned(struct vc_data *vc, 117 + struct fb_info *info, const u16 *s, 118 + u32 attr, u32 cnt, u32 d_pitch, 119 + u32 s_pitch, u32 cellsize, 120 + struct fb_image *image, u8 *buf, 121 + u8 *dst) 122 + { 123 + struct fbcon_ops *ops = info->fbcon_par; 124 + u16 charmask = vc->vc_hi_font_mask ? 0x1ff : 0xff; 125 + u32 shift_low = 0, mod = vc->vc_font.width % 8; 126 + u32 shift_high = 8; 127 + u32 idx = vc->vc_font.width >> 3; 128 + u8 *src; 129 + 130 + while (cnt--) { 131 + src = ops->fontbuffer + (scr_readw(s--) & charmask)*cellsize; 132 + 133 + if (attr) { 134 + ud_update_attr(buf, src, attr, vc); 135 + src = buf; 136 + } 137 + 138 + fb_pad_unaligned_buffer(dst, d_pitch, src, idx, 139 + image->height, shift_high, 140 + shift_low, mod); 141 + shift_low += mod; 142 + dst += (shift_low >= 8) ? s_pitch : s_pitch - 1; 143 + shift_low &= 7; 144 + shift_high = 8 - shift_low; 145 + } 146 + 147 + info->fbops->fb_imageblit(info, image); 148 + 149 + } 150 + 151 + static void ud_putcs(struct vc_data *vc, struct fb_info *info, 152 const unsigned short *s, int count, int yy, int xx, 153 int fg, int bg) 154 { 155 struct fb_image image; 156 struct fbcon_ops *ops = info->fbcon_par; 157 + u32 width = (vc->vc_font.width + 7)/8; 158 + u32 cellsize = width * vc->vc_font.height; 159 u32 maxcnt = info->pixmap.size/cellsize; 160 u32 scan_align = info->pixmap.scan_align - 1; 161 u32 buf_align = info->pixmap.buf_align - 1; 162 + u32 mod = vc->vc_font.width % 8, cnt, pitch, size; 163 u32 attribute = get_attribute(info, scr_readw(s)); 164 u8 *dst, *buf = NULL; 165 + u32 vyres = GETVYRES(ops->p->scrollmode, info); 166 u32 vxres = GETVXRES(ops->p->scrollmode, info); 167 168 if (!ops->fontbuffer) ··· 132 133 image.fg_color = fg; 134 image.bg_color = bg; 135 + image.dy = vyres - ((yy * vc->vc_font.height) + vc->vc_font.height); 136 + image.dx = vxres - ((xx + count) * vc->vc_font.width); 137 + image.height = vc->vc_font.height; 138 image.depth = 1; 139 140 if (attribute) { ··· 143 return; 144 } 145 146 + s += count - 1; 147 + 148 while (count) { 149 if (count > maxcnt) 150 cnt = maxcnt; 151 else 152 cnt = count; 153 154 + image.width = vc->vc_font.width * cnt; 155 pitch = ((image.width + 7) >> 3) + scan_align; 156 pitch &= ~scan_align; 157 size = pitch * image.height + buf_align; 158 size &= ~buf_align; 159 dst = fb_get_buffer_offset(info, &info->pixmap, size); 160 image.data = dst; 161 + 162 + if (!mod) 163 + ud_putcs_aligned(vc, info, s, attribute, cnt, pitch, 164 + width, cellsize, &image, buf, dst); 165 + else 166 + ud_putcs_unaligned(vc, info, s, attribute, cnt, pitch, 167 + width, cellsize, &image, 168 + buf, dst); 169 + 170 + image.dx += image.width; 171 count -= cnt; 172 + s -= cnt; 173 + xx += cnt; 174 } 175 176 /* buf is always NULL except when in monochrome mode, so in this case ··· 171 172 } 173 174 + static void ud_clear_margins(struct vc_data *vc, struct fb_info *info, 175 + int color, int bottom_only) 176 { 177 unsigned int cw = vc->vc_font.width; 178 unsigned int ch = vc->vc_font.height; 179 + unsigned int rw = info->var.xres - (vc->vc_cols*cw); 180 + unsigned int bh = info->var.yres - (vc->vc_rows*ch); 181 struct fb_fillrect region; 182 183 + region.color = color; 184 region.rop = ROP_COPY; 185 186 if (rw && !bottom_only) { 187 + region.dy = 0; 188 + region.dx = info->var.xoffset; 189 + region.width = rw; 190 + region.height = info->var.yres_virtual; 191 info->fbops->fb_fillrect(info, &region); 192 } 193 194 if (bh) { 195 region.dy = info->var.yoffset; 196 + region.dx = info->var.xoffset; 197 + region.height = bh; 198 + region.width = info->var.xres; 199 info->fbops->fb_fillrect(info, &region); 200 } 201 } 202 203 + static void ud_cursor(struct vc_data *vc, struct fb_info *info, int mode, 204 int softback_lines, int fg, int bg) 205 { 206 struct fb_cursor cursor; 207 struct fbcon_ops *ops = info->fbcon_par; 208 unsigned short charmask = vc->vc_hi_font_mask ? 0x1ff : 0xff; 209 + int w = (vc->vc_font.width + 7) >> 3, c; 210 int y = real_y(ops->p, vc->vc_y); 211 int attribute, use_sw = (vc->vc_cursor_type & 0x10); 212 int err = 1, dx, dy; 213 char *src; 214 + u32 vyres = GETVYRES(ops->p->scrollmode, info); 215 u32 vxres = GETVXRES(ops->p->scrollmode, info); 216 217 if (!ops->fontbuffer) ··· 230 231 c = scr_readw((u16 *) vc->vc_pos); 232 attribute = get_attribute(info, c); 233 + src = ops->fontbuffer + ((c & charmask) * (w * vc->vc_font.height)); 234 235 if (ops->cursor_state.image.data != src || 236 ops->cursor_reset) { ··· 241 if (attribute) { 242 u8 *dst; 243 244 + dst = kmalloc(w * vc->vc_font.height, GFP_ATOMIC); 245 if (!dst) 246 return; 247 kfree(ops->cursor_data); 248 ops->cursor_data = dst; 249 + ud_update_attr(dst, src, attribute, vc); 250 src = dst; 251 } 252 ··· 258 cursor.set |= FB_CUR_SETCMAP; 259 } 260 261 + if (ops->cursor_state.image.height != vc->vc_font.height || 262 + ops->cursor_state.image.width != vc->vc_font.width || 263 ops->cursor_reset) { 264 + ops->cursor_state.image.height = vc->vc_font.height; 265 + ops->cursor_state.image.width = vc->vc_font.width; 266 cursor.set |= FB_CUR_SETSIZE; 267 } 268 269 + dy = vyres - ((y * vc->vc_font.height) + vc->vc_font.height); 270 + dx = vxres - ((vc->vc_x * vc->vc_font.width) + vc->vc_font.width); 271 272 if (ops->cursor_state.image.dx != dx || 273 ops->cursor_state.image.dy != dy || ··· 287 vc->vc_cursor_type != ops->p->cursor_shape || 288 ops->cursor_state.mask == NULL || 289 ops->cursor_reset) { 290 + char *mask = kmalloc(w*vc->vc_font.height, GFP_ATOMIC); 291 int cur_height, size, i = 0; 292 + u8 msk = 0xff; 293 294 if (!mask) 295 return; 296 297 kfree(ops->cursor_state.mask); 298 ops->cursor_state.mask = mask; ··· 329 break; 330 } 331 332 + size = cur_height * w; 333 + 334 while (size--) 335 + mask[i++] = msk; 336 + 337 + size = (vc->vc_font.height - cur_height) * w; 338 + 339 while (size--) 340 + mask[i++] = ~msk; 341 } 342 343 switch (mode) { ··· 374 ops->cursor_reset = 0; 375 } 376 377 + static int ud_update_start(struct fb_info *info) 378 { 379 struct fbcon_ops *ops = info->fbcon_par; 380 + int xoffset, yoffset; 381 + u32 vyres = GETVYRES(ops->p->scrollmode, info); 382 u32 vxres = GETVXRES(ops->p->scrollmode, info); 383 int err; 384 385 + xoffset = vxres - info->var.xres - ops->var.xoffset; 386 + yoffset = vyres - info->var.yres - ops->var.yoffset; 387 + if (yoffset < 0) 388 + yoffset += vyres; 389 ops->var.xoffset = xoffset; 390 + ops->var.yoffset = yoffset; 391 err = fb_pan_display(info, &ops->var); 392 ops->var.xoffset = info->var.xoffset; 393 ops->var.yoffset = info->var.yoffset; ··· 391 return err; 392 } 393 394 + void fbcon_rotate_ud(struct fbcon_ops *ops) 395 { 396 + ops->bmove = ud_bmove; 397 + ops->clear = ud_clear; 398 + ops->putcs = ud_putcs; 399 + ops->clear_margins = ud_clear_margins; 400 + ops->cursor = ud_cursor; 401 + ops->update_start = ud_update_start; 402 } 403 + EXPORT_SYMBOL(fbcon_rotate_ud);
-4
drivers/video/console/fbcon_rotate.c drivers/video/fbdev/core/fbcon_rotate.c
··· 110 } 111 } 112 EXPORT_SYMBOL(fbcon_set_rotate); 113 - 114 - MODULE_AUTHOR("Antonino Daplas <adaplas@pol.net>"); 115 - MODULE_DESCRIPTION("Console Rotation Support"); 116 - MODULE_LICENSE("GPL");
··· 110 } 111 } 112 EXPORT_SYMBOL(fbcon_set_rotate);
drivers/video/console/fbcon_rotate.h drivers/video/fbdev/core/fbcon_rotate.h
+101 -150
drivers/video/console/fbcon_ud.c drivers/video/fbdev/core/fbcon_cw.c
··· 1 /* 2 - * linux/drivers/video/console/fbcon_ud.c -- Software Rotation - 180 degrees 3 * 4 * Copyright (C) 2005 Antonino Daplas <adaplas @pol.net> 5 * ··· 19 #include "fbcon_rotate.h" 20 21 /* 22 - * Rotation 180 degrees 23 */ 24 25 - static void ud_update_attr(u8 *dst, u8 *src, int attribute, 26 struct vc_data *vc) 27 { 28 - int i, offset = (vc->vc_font.height < 10) ? 1 : 2; 29 - int width = (vc->vc_font.width + 7) >> 3; 30 - unsigned int cellsize = vc->vc_font.height * width; 31 - u8 c; 32 33 - offset = offset * width; 34 - 35 - for (i = 0; i < cellsize; i++) { 36 - c = src[i]; 37 - if (attribute & FBCON_ATTRIBUTE_UNDERLINE && i < offset) 38 - c = 0xff; 39 - if (attribute & FBCON_ATTRIBUTE_BOLD) 40 - c |= c << 1; 41 - if (attribute & FBCON_ATTRIBUTE_REVERSE) 42 - c = ~c; 43 - dst[i] = c; 44 } 45 } 46 47 48 - static void ud_bmove(struct vc_data *vc, struct fb_info *info, int sy, 49 int sx, int dy, int dx, int height, int width) 50 { 51 struct fbcon_ops *ops = info->fbcon_par; 52 struct fb_copyarea area; 53 - u32 vyres = GETVYRES(ops->p->scrollmode, info); 54 u32 vxres = GETVXRES(ops->p->scrollmode, info); 55 56 - area.sy = vyres - ((sy + height) * vc->vc_font.height); 57 - area.sx = vxres - ((sx + width) * vc->vc_font.width); 58 - area.dy = vyres - ((dy + height) * vc->vc_font.height); 59 - area.dx = vxres - ((dx + width) * vc->vc_font.width); 60 - area.height = height * vc->vc_font.height; 61 - area.width = width * vc->vc_font.width; 62 63 info->fbops->fb_copyarea(info, &area); 64 } 65 66 - static void ud_clear(struct vc_data *vc, struct fb_info *info, int sy, 67 int sx, int height, int width) 68 { 69 struct fbcon_ops *ops = info->fbcon_par; 70 struct fb_fillrect region; 71 int bgshift = (vc->vc_hi_font_mask) ? 13 : 12; 72 - u32 vyres = GETVYRES(ops->p->scrollmode, info); 73 u32 vxres = GETVXRES(ops->p->scrollmode, info); 74 75 region.color = attr_bgcol_ec(bgshift,vc,info); 76 - region.dy = vyres - ((sy + height) * vc->vc_font.height); 77 - region.dx = vxres - ((sx + width) * vc->vc_font.width); 78 - region.width = width * vc->vc_font.width; 79 - region.height = height * vc->vc_font.height; 80 region.rop = ROP_COPY; 81 82 info->fbops->fb_fillrect(info, &region); 83 } 84 85 - static inline void ud_putcs_aligned(struct vc_data *vc, struct fb_info *info, 86 const u16 *s, u32 attr, u32 cnt, 87 u32 d_pitch, u32 s_pitch, u32 cellsize, 88 struct fb_image *image, u8 *buf, u8 *dst) 89 { 90 struct fbcon_ops *ops = info->fbcon_par; 91 u16 charmask = vc->vc_hi_font_mask ? 0x1ff : 0xff; 92 - u32 idx = vc->vc_font.width >> 3; 93 u8 *src; 94 95 while (cnt--) { 96 - src = ops->fontbuffer + (scr_readw(s--) & charmask)*cellsize; 97 98 if (attr) { 99 - ud_update_attr(buf, src, attr, vc); 100 src = buf; 101 } 102 103 if (likely(idx == 1)) 104 __fb_pad_aligned_buffer(dst, d_pitch, src, idx, 105 - image->height); 106 else 107 fb_pad_aligned_buffer(dst, d_pitch, src, idx, 108 - image->height); 109 110 - dst += s_pitch; 111 } 112 113 info->fbops->fb_imageblit(info, image); 114 } 115 116 - static inline void ud_putcs_unaligned(struct vc_data *vc, 117 - struct fb_info *info, const u16 *s, 118 - u32 attr, u32 cnt, u32 d_pitch, 119 - u32 s_pitch, u32 cellsize, 120 - struct fb_image *image, u8 *buf, 121 - u8 *dst) 122 - { 123 - struct fbcon_ops *ops = info->fbcon_par; 124 - u16 charmask = vc->vc_hi_font_mask ? 0x1ff : 0xff; 125 - u32 shift_low = 0, mod = vc->vc_font.width % 8; 126 - u32 shift_high = 8; 127 - u32 idx = vc->vc_font.width >> 3; 128 - u8 *src; 129 - 130 - while (cnt--) { 131 - src = ops->fontbuffer + (scr_readw(s--) & charmask)*cellsize; 132 - 133 - if (attr) { 134 - ud_update_attr(buf, src, attr, vc); 135 - src = buf; 136 - } 137 - 138 - fb_pad_unaligned_buffer(dst, d_pitch, src, idx, 139 - image->height, shift_high, 140 - shift_low, mod); 141 - shift_low += mod; 142 - dst += (shift_low >= 8) ? s_pitch : s_pitch - 1; 143 - shift_low &= 7; 144 - shift_high = 8 - shift_low; 145 - } 146 - 147 - info->fbops->fb_imageblit(info, image); 148 - 149 - } 150 - 151 - static void ud_putcs(struct vc_data *vc, struct fb_info *info, 152 const unsigned short *s, int count, int yy, int xx, 153 int fg, int bg) 154 { 155 struct fb_image image; 156 struct fbcon_ops *ops = info->fbcon_par; 157 - u32 width = (vc->vc_font.width + 7)/8; 158 - u32 cellsize = width * vc->vc_font.height; 159 u32 maxcnt = info->pixmap.size/cellsize; 160 u32 scan_align = info->pixmap.scan_align - 1; 161 u32 buf_align = info->pixmap.buf_align - 1; 162 - u32 mod = vc->vc_font.width % 8, cnt, pitch, size; 163 u32 attribute = get_attribute(info, scr_readw(s)); 164 u8 *dst, *buf = NULL; 165 - u32 vyres = GETVYRES(ops->p->scrollmode, info); 166 u32 vxres = GETVXRES(ops->p->scrollmode, info); 167 168 if (!ops->fontbuffer) ··· 132 133 image.fg_color = fg; 134 image.bg_color = bg; 135 - image.dy = vyres - ((yy * vc->vc_font.height) + vc->vc_font.height); 136 - image.dx = vxres - ((xx + count) * vc->vc_font.width); 137 - image.height = vc->vc_font.height; 138 image.depth = 1; 139 140 if (attribute) { ··· 143 return; 144 } 145 146 - s += count - 1; 147 - 148 while (count) { 149 if (count > maxcnt) 150 cnt = maxcnt; 151 else 152 cnt = count; 153 154 - image.width = vc->vc_font.width * cnt; 155 pitch = ((image.width + 7) >> 3) + scan_align; 156 pitch &= ~scan_align; 157 size = pitch * image.height + buf_align; 158 size &= ~buf_align; 159 dst = fb_get_buffer_offset(info, &info->pixmap, size); 160 image.data = dst; 161 - 162 - if (!mod) 163 - ud_putcs_aligned(vc, info, s, attribute, cnt, pitch, 164 - width, cellsize, &image, buf, dst); 165 - else 166 - ud_putcs_unaligned(vc, info, s, attribute, cnt, pitch, 167 - width, cellsize, &image, 168 - buf, dst); 169 - 170 - image.dx += image.width; 171 count -= cnt; 172 - s -= cnt; 173 - xx += cnt; 174 } 175 176 /* buf is always NULL except when in monochrome mode, so in this case ··· 171 172 } 173 174 - static void ud_clear_margins(struct vc_data *vc, struct fb_info *info, 175 - int bottom_only) 176 { 177 unsigned int cw = vc->vc_font.width; 178 unsigned int ch = vc->vc_font.height; 179 - unsigned int rw = info->var.xres - (vc->vc_cols*cw); 180 - unsigned int bh = info->var.yres - (vc->vc_rows*ch); 181 struct fb_fillrect region; 182 183 - region.color = 0; 184 region.rop = ROP_COPY; 185 186 if (rw && !bottom_only) { 187 - region.dy = 0; 188 - region.dx = info->var.xoffset; 189 - region.width = rw; 190 - region.height = info->var.yres_virtual; 191 info->fbops->fb_fillrect(info, &region); 192 } 193 194 if (bh) { 195 - region.dy = info->var.yoffset; 196 region.dx = info->var.xoffset; 197 - region.height = bh; 198 - region.width = info->var.xres; 199 info->fbops->fb_fillrect(info, &region); 200 } 201 } 202 203 - static void ud_cursor(struct vc_data *vc, struct fb_info *info, int mode, 204 int softback_lines, int fg, int bg) 205 { 206 struct fb_cursor cursor; 207 struct fbcon_ops *ops = info->fbcon_par; 208 unsigned short charmask = vc->vc_hi_font_mask ? 0x1ff : 0xff; 209 - int w = (vc->vc_font.width + 7) >> 3, c; 210 int y = real_y(ops->p, vc->vc_y); 211 int attribute, use_sw = (vc->vc_cursor_type & 0x10); 212 int err = 1, dx, dy; 213 char *src; 214 - u32 vyres = GETVYRES(ops->p->scrollmode, info); 215 u32 vxres = GETVXRES(ops->p->scrollmode, info); 216 217 if (!ops->fontbuffer) ··· 230 231 c = scr_readw((u16 *) vc->vc_pos); 232 attribute = get_attribute(info, c); 233 - src = ops->fontbuffer + ((c & charmask) * (w * vc->vc_font.height)); 234 235 if (ops->cursor_state.image.data != src || 236 ops->cursor_reset) { ··· 241 if (attribute) { 242 u8 *dst; 243 244 - dst = kmalloc(w * vc->vc_font.height, GFP_ATOMIC); 245 if (!dst) 246 return; 247 kfree(ops->cursor_data); 248 ops->cursor_data = dst; 249 - ud_update_attr(dst, src, attribute, vc); 250 src = dst; 251 } 252 ··· 258 cursor.set |= FB_CUR_SETCMAP; 259 } 260 261 - if (ops->cursor_state.image.height != vc->vc_font.height || 262 - ops->cursor_state.image.width != vc->vc_font.width || 263 ops->cursor_reset) { 264 - ops->cursor_state.image.height = vc->vc_font.height; 265 - ops->cursor_state.image.width = vc->vc_font.width; 266 cursor.set |= FB_CUR_SETSIZE; 267 } 268 269 - dy = vyres - ((y * vc->vc_font.height) + vc->vc_font.height); 270 - dx = vxres - ((vc->vc_x * vc->vc_font.width) + vc->vc_font.width); 271 272 if (ops->cursor_state.image.dx != dx || 273 ops->cursor_state.image.dy != dy || ··· 287 vc->vc_cursor_type != ops->p->cursor_shape || 288 ops->cursor_state.mask == NULL || 289 ops->cursor_reset) { 290 - char *mask = kmalloc(w*vc->vc_font.height, GFP_ATOMIC); 291 int cur_height, size, i = 0; 292 - u8 msk = 0xff; 293 294 if (!mask) 295 return; 296 297 kfree(ops->cursor_state.mask); 298 ops->cursor_state.mask = mask; ··· 329 break; 330 } 331 332 - size = cur_height * w; 333 - 334 while (size--) 335 - mask[i++] = msk; 336 - 337 - size = (vc->vc_font.height - cur_height) * w; 338 - 339 while (size--) 340 - mask[i++] = ~msk; 341 } 342 343 switch (mode) { ··· 374 ops->cursor_reset = 0; 375 } 376 377 - static int ud_update_start(struct fb_info *info) 378 { 379 struct fbcon_ops *ops = info->fbcon_par; 380 - int xoffset, yoffset; 381 - u32 vyres = GETVYRES(ops->p->scrollmode, info); 382 u32 vxres = GETVXRES(ops->p->scrollmode, info); 383 int err; 384 385 - xoffset = vxres - info->var.xres - ops->var.xoffset; 386 - yoffset = vyres - info->var.yres - ops->var.yoffset; 387 - if (yoffset < 0) 388 - yoffset += vyres; 389 ops->var.xoffset = xoffset; 390 - ops->var.yoffset = yoffset; 391 err = fb_pan_display(info, &ops->var); 392 ops->var.xoffset = info->var.xoffset; 393 ops->var.yoffset = info->var.yoffset; ··· 391 return err; 392 } 393 394 - void fbcon_rotate_ud(struct fbcon_ops *ops) 395 { 396 - ops->bmove = ud_bmove; 397 - ops->clear = ud_clear; 398 - ops->putcs = ud_putcs; 399 - ops->clear_margins = ud_clear_margins; 400 - ops->cursor = ud_cursor; 401 - ops->update_start = ud_update_start; 402 } 403 - EXPORT_SYMBOL(fbcon_rotate_ud); 404 - 405 - MODULE_AUTHOR("Antonino Daplas <adaplas@pol.net>"); 406 - MODULE_DESCRIPTION("Console Rotation (180 degrees) Support"); 407 - MODULE_LICENSE("GPL");
··· 1 /* 2 + * linux/drivers/video/console/fbcon_ud.c -- Software Rotation - 90 degrees 3 * 4 * Copyright (C) 2005 Antonino Daplas <adaplas @pol.net> 5 * ··· 19 #include "fbcon_rotate.h" 20 21 /* 22 + * Rotation 90 degrees 23 */ 24 25 + static void cw_update_attr(u8 *dst, u8 *src, int attribute, 26 struct vc_data *vc) 27 { 28 + int i, j, offset = (vc->vc_font.height < 10) ? 1 : 2; 29 + int width = (vc->vc_font.height + 7) >> 3; 30 + u8 c, msk = ~(0xff >> offset); 31 32 + for (i = 0; i < vc->vc_font.width; i++) { 33 + for (j = 0; j < width; j++) { 34 + c = *src; 35 + if (attribute & FBCON_ATTRIBUTE_UNDERLINE && !j) 36 + c |= msk; 37 + if (attribute & FBCON_ATTRIBUTE_BOLD && i) 38 + c |= *(src-width); 39 + if (attribute & FBCON_ATTRIBUTE_REVERSE) 40 + c = ~c; 41 + src++; 42 + *dst++ = c; 43 + } 44 } 45 } 46 47 48 + static void cw_bmove(struct vc_data *vc, struct fb_info *info, int sy, 49 int sx, int dy, int dx, int height, int width) 50 { 51 struct fbcon_ops *ops = info->fbcon_par; 52 struct fb_copyarea area; 53 u32 vxres = GETVXRES(ops->p->scrollmode, info); 54 55 + area.sx = vxres - ((sy + height) * vc->vc_font.height); 56 + area.sy = sx * vc->vc_font.width; 57 + area.dx = vxres - ((dy + height) * vc->vc_font.height); 58 + area.dy = dx * vc->vc_font.width; 59 + area.width = height * vc->vc_font.height; 60 + area.height = width * vc->vc_font.width; 61 62 info->fbops->fb_copyarea(info, &area); 63 } 64 65 + static void cw_clear(struct vc_data *vc, struct fb_info *info, int sy, 66 int sx, int height, int width) 67 { 68 struct fbcon_ops *ops = info->fbcon_par; 69 struct fb_fillrect region; 70 int bgshift = (vc->vc_hi_font_mask) ? 13 : 12; 71 u32 vxres = GETVXRES(ops->p->scrollmode, info); 72 73 region.color = attr_bgcol_ec(bgshift,vc,info); 74 + region.dx = vxres - ((sy + height) * vc->vc_font.height); 75 + region.dy = sx * vc->vc_font.width; 76 + region.height = width * vc->vc_font.width; 77 + region.width = height * vc->vc_font.height; 78 region.rop = ROP_COPY; 79 80 info->fbops->fb_fillrect(info, &region); 81 } 82 83 + static inline void cw_putcs_aligned(struct vc_data *vc, struct fb_info *info, 84 const u16 *s, u32 attr, u32 cnt, 85 u32 d_pitch, u32 s_pitch, u32 cellsize, 86 struct fb_image *image, u8 *buf, u8 *dst) 87 { 88 struct fbcon_ops *ops = info->fbcon_par; 89 u16 charmask = vc->vc_hi_font_mask ? 0x1ff : 0xff; 90 + u32 idx = (vc->vc_font.height + 7) >> 3; 91 u8 *src; 92 93 while (cnt--) { 94 + src = ops->fontbuffer + (scr_readw(s++) & charmask)*cellsize; 95 96 if (attr) { 97 + cw_update_attr(buf, src, attr, vc); 98 src = buf; 99 } 100 101 if (likely(idx == 1)) 102 __fb_pad_aligned_buffer(dst, d_pitch, src, idx, 103 + vc->vc_font.width); 104 else 105 fb_pad_aligned_buffer(dst, d_pitch, src, idx, 106 + vc->vc_font.width); 107 108 + dst += d_pitch * vc->vc_font.width; 109 } 110 111 info->fbops->fb_imageblit(info, image); 112 } 113 114 + static void cw_putcs(struct vc_data *vc, struct fb_info *info, 115 const unsigned short *s, int count, int yy, int xx, 116 int fg, int bg) 117 { 118 struct fb_image image; 119 struct fbcon_ops *ops = info->fbcon_par; 120 + u32 width = (vc->vc_font.height + 7)/8; 121 + u32 cellsize = width * vc->vc_font.width; 122 u32 maxcnt = info->pixmap.size/cellsize; 123 u32 scan_align = info->pixmap.scan_align - 1; 124 u32 buf_align = info->pixmap.buf_align - 1; 125 + u32 cnt, pitch, size; 126 u32 attribute = get_attribute(info, scr_readw(s)); 127 u8 *dst, *buf = NULL; 128 u32 vxres = GETVXRES(ops->p->scrollmode, info); 129 130 if (!ops->fontbuffer) ··· 170 171 image.fg_color = fg; 172 image.bg_color = bg; 173 + image.dx = vxres - ((yy + 1) * vc->vc_font.height); 174 + image.dy = xx * vc->vc_font.width; 175 + image.width = vc->vc_font.height; 176 image.depth = 1; 177 178 if (attribute) { ··· 181 return; 182 } 183 184 while (count) { 185 if (count > maxcnt) 186 cnt = maxcnt; 187 else 188 cnt = count; 189 190 + image.height = vc->vc_font.width * cnt; 191 pitch = ((image.width + 7) >> 3) + scan_align; 192 pitch &= ~scan_align; 193 size = pitch * image.height + buf_align; 194 size &= ~buf_align; 195 dst = fb_get_buffer_offset(info, &info->pixmap, size); 196 image.data = dst; 197 + cw_putcs_aligned(vc, info, s, attribute, cnt, pitch, 198 + width, cellsize, &image, buf, dst); 199 + image.dy += image.height; 200 count -= cnt; 201 + s += cnt; 202 } 203 204 /* buf is always NULL except when in monochrome mode, so in this case ··· 219 220 } 221 222 + static void cw_clear_margins(struct vc_data *vc, struct fb_info *info, 223 + int color, int bottom_only) 224 { 225 unsigned int cw = vc->vc_font.width; 226 unsigned int ch = vc->vc_font.height; 227 + unsigned int rw = info->var.yres - (vc->vc_cols*cw); 228 + unsigned int bh = info->var.xres - (vc->vc_rows*ch); 229 + unsigned int rs = info->var.yres - rw; 230 struct fb_fillrect region; 231 232 + region.color = color; 233 region.rop = ROP_COPY; 234 235 if (rw && !bottom_only) { 236 + region.dx = 0; 237 + region.dy = info->var.yoffset + rs; 238 + region.height = rw; 239 + region.width = info->var.xres_virtual; 240 info->fbops->fb_fillrect(info, &region); 241 } 242 243 if (bh) { 244 region.dx = info->var.xoffset; 245 + region.dy = info->var.yoffset; 246 + region.height = info->var.yres; 247 + region.width = bh; 248 info->fbops->fb_fillrect(info, &region); 249 } 250 } 251 252 + static void cw_cursor(struct vc_data *vc, struct fb_info *info, int mode, 253 int softback_lines, int fg, int bg) 254 { 255 struct fb_cursor cursor; 256 struct fbcon_ops *ops = info->fbcon_par; 257 unsigned short charmask = vc->vc_hi_font_mask ? 0x1ff : 0xff; 258 + int w = (vc->vc_font.height + 7) >> 3, c; 259 int y = real_y(ops->p, vc->vc_y); 260 int attribute, use_sw = (vc->vc_cursor_type & 0x10); 261 int err = 1, dx, dy; 262 char *src; 263 u32 vxres = GETVXRES(ops->p->scrollmode, info); 264 265 if (!ops->fontbuffer) ··· 278 279 c = scr_readw((u16 *) vc->vc_pos); 280 attribute = get_attribute(info, c); 281 + src = ops->fontbuffer + ((c & charmask) * (w * vc->vc_font.width)); 282 283 if (ops->cursor_state.image.data != src || 284 ops->cursor_reset) { ··· 289 if (attribute) { 290 u8 *dst; 291 292 + dst = kmalloc(w * vc->vc_font.width, GFP_ATOMIC); 293 if (!dst) 294 return; 295 kfree(ops->cursor_data); 296 ops->cursor_data = dst; 297 + cw_update_attr(dst, src, attribute, vc); 298 src = dst; 299 } 300 ··· 306 cursor.set |= FB_CUR_SETCMAP; 307 } 308 309 + if (ops->cursor_state.image.height != vc->vc_font.width || 310 + ops->cursor_state.image.width != vc->vc_font.height || 311 ops->cursor_reset) { 312 + ops->cursor_state.image.height = vc->vc_font.width; 313 + ops->cursor_state.image.width = vc->vc_font.height; 314 cursor.set |= FB_CUR_SETSIZE; 315 } 316 317 + dx = vxres - ((y * vc->vc_font.height) + vc->vc_font.height); 318 + dy = vc->vc_x * vc->vc_font.width; 319 320 if (ops->cursor_state.image.dx != dx || 321 ops->cursor_state.image.dy != dy || ··· 335 vc->vc_cursor_type != ops->p->cursor_shape || 336 ops->cursor_state.mask == NULL || 337 ops->cursor_reset) { 338 + char *tmp, *mask = kmalloc(w*vc->vc_font.width, GFP_ATOMIC); 339 int cur_height, size, i = 0; 340 + int width = (vc->vc_font.width + 7)/8; 341 342 if (!mask) 343 return; 344 + 345 + tmp = kmalloc(width * vc->vc_font.height, GFP_ATOMIC); 346 + 347 + if (!tmp) { 348 + kfree(mask); 349 + return; 350 + } 351 352 kfree(ops->cursor_state.mask); 353 ops->cursor_state.mask = mask; ··· 370 break; 371 } 372 373 + size = (vc->vc_font.height - cur_height) * width; 374 while (size--) 375 + tmp[i++] = 0; 376 + size = cur_height * width; 377 while (size--) 378 + tmp[i++] = 0xff; 379 + memset(mask, 0, w * vc->vc_font.width); 380 + rotate_cw(tmp, mask, vc->vc_font.width, vc->vc_font.height); 381 + kfree(tmp); 382 } 383 384 switch (mode) { ··· 415 ops->cursor_reset = 0; 416 } 417 418 + static int cw_update_start(struct fb_info *info) 419 { 420 struct fbcon_ops *ops = info->fbcon_par; 421 u32 vxres = GETVXRES(ops->p->scrollmode, info); 422 + u32 xoffset; 423 int err; 424 425 + xoffset = vxres - (info->var.xres + ops->var.yoffset); 426 + ops->var.yoffset = ops->var.xoffset; 427 ops->var.xoffset = xoffset; 428 err = fb_pan_display(info, &ops->var); 429 ops->var.xoffset = info->var.xoffset; 430 ops->var.yoffset = info->var.yoffset; ··· 436 return err; 437 } 438 439 + void fbcon_rotate_cw(struct fbcon_ops *ops) 440 { 441 + ops->bmove = cw_bmove; 442 + ops->clear = cw_clear; 443 + ops->putcs = cw_putcs; 444 + ops->clear_margins = cw_clear_margins; 445 + ops->cursor = cw_cursor; 446 + ops->update_start = cw_update_start; 447 } 448 + EXPORT_SYMBOL(fbcon_rotate_cw);
-4
drivers/video/console/softcursor.c drivers/video/fbdev/core/softcursor.c
··· 76 } 77 78 EXPORT_SYMBOL(soft_cursor); 79 - 80 - MODULE_AUTHOR("James Simmons <jsimmons@users.sf.net>"); 81 - MODULE_DESCRIPTION("Generic software cursor"); 82 - MODULE_LICENSE("GPL");
··· 76 } 77 78 EXPORT_SYMBOL(soft_cursor);
+1 -6
drivers/video/console/tileblit.c drivers/video/fbdev/core/tileblit.c
··· 74 } 75 76 static void tile_clear_margins(struct vc_data *vc, struct fb_info *info, 77 - int bottom_only) 78 { 79 return; 80 } ··· 152 } 153 154 EXPORT_SYMBOL(fbcon_set_tileops); 155 - 156 - MODULE_AUTHOR("Antonino Daplas <adaplas@pol.net>"); 157 - MODULE_DESCRIPTION("Tile Blitting Operation"); 158 - MODULE_LICENSE("GPL"); 159 -
··· 74 } 75 76 static void tile_clear_margins(struct vc_data *vc, struct fb_info *info, 77 + int color, int bottom_only) 78 { 79 return; 80 } ··· 152 } 153 154 EXPORT_SYMBOL(fbcon_set_tileops);
+2 -3
drivers/video/console/vgacon.c
··· 398 #endif 399 } 400 401 - /* boot_params.screen_info initialized? */ 402 - if ((screen_info.orig_video_mode == 0) && 403 - (screen_info.orig_video_lines == 0) && 404 (screen_info.orig_video_cols == 0)) 405 goto no_vga; 406
··· 398 #endif 399 } 400 401 + /* boot_params.screen_info reasonably initialized? */ 402 + if ((screen_info.orig_video_lines == 0) || 403 (screen_info.orig_video_cols == 0)) 404 goto no_vga; 405
+1 -1
drivers/video/fbdev/68328fb.c
··· 72 .vmode = FB_VMODE_NONINTERLACED, 73 }; 74 75 - static struct fb_fix_screeninfo mc68x328fb_fix __initdata = { 76 .id = "68328fb", 77 .type = FB_TYPE_PACKED_PIXELS, 78 .xpanstep = 1,
··· 72 .vmode = FB_VMODE_NONINTERLACED, 73 }; 74 75 + static const struct fb_fix_screeninfo mc68x328fb_fix __initconst = { 76 .id = "68328fb", 77 .type = FB_TYPE_PACKED_PIXELS, 78 .xpanstep = 1,
+1 -1
drivers/video/fbdev/Kconfig
··· 2173 2174 config FB_XILINX 2175 tristate "Xilinx frame buffer support" 2176 - depends on FB && (XILINX_VIRTEX || MICROBLAZE || ARCH_ZYNQ) 2177 select FB_CFB_FILLRECT 2178 select FB_CFB_COPYAREA 2179 select FB_CFB_IMAGEBLIT
··· 2173 2174 config FB_XILINX 2175 tristate "Xilinx frame buffer support" 2176 + depends on FB && (XILINX_VIRTEX || MICROBLAZE || ARCH_ZYNQ || ARCH_ZYNQMP) 2177 select FB_CFB_FILLRECT 2178 select FB_CFB_COPYAREA 2179 select FB_CFB_IMAGEBLIT
+1 -1
drivers/video/fbdev/amba-clcd.c
··· 1035 .init_panel = nomadik_clcd_init_panel, 1036 }; 1037 1038 - static struct amba_id clcdfb_id_table[] = { 1039 { 1040 .id = 0x00041110, 1041 .mask = 0x000ffffe,
··· 1035 .init_panel = nomadik_clcd_init_panel, 1036 }; 1037 1038 + static const struct amba_id clcdfb_id_table[] = { 1039 { 1040 .id = 0x00041110, 1041 .mask = 0x000ffffe,
+1 -1
drivers/video/fbdev/arkfb.c
··· 1157 1158 /* List of boards that we are trying to support */ 1159 1160 - static struct pci_device_id ark_devices[] = { 1161 {PCI_DEVICE(0xEDD8, 0xA099)}, 1162 {0, 0, 0, 0, 0, 0, 0} 1163 };
··· 1157 1158 /* List of boards that we are trying to support */ 1159 1160 + static const struct pci_device_id ark_devices[] = { 1161 {PCI_DEVICE(0xEDD8, 0xA099)}, 1162 {0, 0, 0, 0, 0, 0, 0} 1163 };
+1 -1
drivers/video/fbdev/asiliantfb.c
··· 592 framebuffer_release(p); 593 } 594 595 - static struct pci_device_id asiliantfb_pci_tbl[] = { 596 { PCI_VENDOR_ID_CT, PCI_DEVICE_ID_CT_69000, PCI_ANY_ID, PCI_ANY_ID }, 597 { 0 } 598 };
··· 592 framebuffer_release(p); 593 } 594 595 + static const struct pci_device_id asiliantfb_pci_tbl[] = { 596 { PCI_VENDOR_ID_CT, PCI_DEVICE_ID_CT_69000, PCI_ANY_ID, PCI_ANY_ID }, 597 { 0 } 598 };
+1 -1
drivers/video/fbdev/atmel_lcdfb.c
··· 320 } 321 } 322 323 - static struct fb_fix_screeninfo atmel_lcdfb_fix __initdata = { 324 .type = FB_TYPE_PACKED_PIXELS, 325 .visual = FB_VISUAL_TRUECOLOR, 326 .xpanstep = 0,
··· 320 } 321 } 322 323 + static const struct fb_fix_screeninfo atmel_lcdfb_fix __initconst = { 324 .type = FB_TYPE_PACKED_PIXELS, 325 .visual = FB_VISUAL_TRUECOLOR, 326 .xpanstep = 0,
+2 -2
drivers/video/fbdev/aty/aty128fb.c
··· 116 117 /* default modedb mode */ 118 /* 640x480, 60 Hz, Non-Interlaced (25.172 MHz dotclock) */ 119 - static struct fb_videomode defaultmode = { 120 .refresh = 60, 121 .xres = 640, 122 .yres = 480, ··· 166 static int aty128_do_resume(struct pci_dev *pdev); 167 168 /* supported Rage128 chipsets */ 169 - static struct pci_device_id aty128_pci_tbl[] = { 170 { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RAGE128_LE, 171 PCI_ANY_ID, PCI_ANY_ID, 0, 0, rage_M3_pci }, 172 { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RAGE128_LF,
··· 116 117 /* default modedb mode */ 118 /* 640x480, 60 Hz, Non-Interlaced (25.172 MHz dotclock) */ 119 + static const struct fb_videomode defaultmode = { 120 .refresh = 60, 121 .xres = 640, 122 .yres = 480, ··· 166 static int aty128_do_resume(struct pci_dev *pdev); 167 168 /* supported Rage128 chipsets */ 169 + static const struct pci_device_id aty128_pci_tbl[] = { 170 { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RAGE128_LE, 171 PCI_ANY_ID, PCI_ANY_ID, 0, 0, rage_M3_pci }, 172 { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RAGE128_LF,
+3 -3
drivers/video/fbdev/aty/atyfb_base.c
··· 274 0, FB_VMODE_NONINTERLACED 275 }; 276 277 - static struct fb_videomode defmode = { 278 /* 640x480 @ 60 Hz, 31.5 kHz hsync */ 279 NULL, 60, 640, 480, 39721, 40, 24, 32, 11, 96, 2, 280 0, FB_VMODE_NONINTERLACED ··· 1855 #if defined(DEBUG) && defined(CONFIG_FB_ATY_CT) 1856 case ATYIO_CLKR: 1857 if (M64_HAS(INTEGRATED)) { 1858 - struct atyclk clk; 1859 union aty_pll *pll = &par->pll; 1860 u32 dsp_config = pll->ct.dsp_config; 1861 u32 dsp_on_off = pll->ct.dsp_on_off; ··· 3756 atyfb_remove(info); 3757 } 3758 3759 - static struct pci_device_id atyfb_pci_tbl[] = { 3760 #ifdef CONFIG_FB_ATY_GX 3761 { PCI_DEVICE(PCI_VENDOR_ID_ATI, PCI_CHIP_MACH64GX) }, 3762 { PCI_DEVICE(PCI_VENDOR_ID_ATI, PCI_CHIP_MACH64CX) },
··· 274 0, FB_VMODE_NONINTERLACED 275 }; 276 277 + static const struct fb_videomode defmode = { 278 /* 640x480 @ 60 Hz, 31.5 kHz hsync */ 279 NULL, 60, 640, 480, 39721, 40, 24, 32, 11, 96, 2, 280 0, FB_VMODE_NONINTERLACED ··· 1855 #if defined(DEBUG) && defined(CONFIG_FB_ATY_CT) 1856 case ATYIO_CLKR: 1857 if (M64_HAS(INTEGRATED)) { 1858 + struct atyclk clk = { 0 }; 1859 union aty_pll *pll = &par->pll; 1860 u32 dsp_config = pll->ct.dsp_config; 1861 u32 dsp_on_off = pll->ct.dsp_on_off; ··· 3756 atyfb_remove(info); 3757 } 3758 3759 + static const struct pci_device_id atyfb_pci_tbl[] = { 3760 #ifdef CONFIG_FB_ATY_GX 3761 { PCI_DEVICE(PCI_VENDOR_ID_ATI, PCI_CHIP_MACH64GX) }, 3762 { PCI_DEVICE(PCI_VENDOR_ID_ATI, PCI_CHIP_MACH64CX) },
+3 -3
drivers/video/fbdev/aty/radeon_base.c
··· 96 #define CHIP_DEF(id, family, flags) \ 97 { PCI_VENDOR_ID_ATI, id, PCI_ANY_ID, PCI_ANY_ID, 0, 0, (flags) | (CHIP_FAMILY_##family) } 98 99 - static struct pci_device_id radeonfb_pci_table[] = { 100 /* Radeon Xpress 200m */ 101 CHIP_DEF(PCI_CHIP_RS480_5955, RS480, CHIP_HAS_CRTC2 | CHIP_IS_IGP | CHIP_IS_MOBILITY), 102 CHIP_DEF(PCI_CHIP_RS482_5975, RS480, CHIP_HAS_CRTC2 | CHIP_IS_IGP | CHIP_IS_MOBILITY), ··· 2241 return radeon_show_one_edid(buf, off, count, rinfo->mon2_EDID); 2242 } 2243 2244 - static struct bin_attribute edid1_attr = { 2245 .attr = { 2246 .name = "edid1", 2247 .mode = 0444, ··· 2250 .read = radeon_show_edid1, 2251 }; 2252 2253 - static struct bin_attribute edid2_attr = { 2254 .attr = { 2255 .name = "edid2", 2256 .mode = 0444,
··· 96 #define CHIP_DEF(id, family, flags) \ 97 { PCI_VENDOR_ID_ATI, id, PCI_ANY_ID, PCI_ANY_ID, 0, 0, (flags) | (CHIP_FAMILY_##family) } 98 99 + static const struct pci_device_id radeonfb_pci_table[] = { 100 /* Radeon Xpress 200m */ 101 CHIP_DEF(PCI_CHIP_RS480_5955, RS480, CHIP_HAS_CRTC2 | CHIP_IS_IGP | CHIP_IS_MOBILITY), 102 CHIP_DEF(PCI_CHIP_RS482_5975, RS480, CHIP_HAS_CRTC2 | CHIP_IS_IGP | CHIP_IS_MOBILITY), ··· 2241 return radeon_show_one_edid(buf, off, count, rinfo->mon2_EDID); 2242 } 2243 2244 + static const struct bin_attribute edid1_attr = { 2245 .attr = { 2246 .name = "edid1", 2247 .mode = 0444, ··· 2250 .read = radeon_show_edid1, 2251 }; 2252 2253 + static const struct bin_attribute edid2_attr = { 2254 .attr = { 2255 .name = "edid2", 2256 .mode = 0444,
+1 -1
drivers/video/fbdev/bfin-lq035q1-fb.c
··· 841 return 0; 842 } 843 844 - static struct dev_pm_ops bfin_lq035q1_dev_pm_ops = { 845 .suspend = bfin_lq035q1_suspend, 846 .resume = bfin_lq035q1_resume, 847 };
··· 841 return 0; 842 } 843 844 + static const struct dev_pm_ops bfin_lq035q1_dev_pm_ops = { 845 .suspend = bfin_lq035q1_suspend, 846 .resume = bfin_lq035q1_resume, 847 };
+2 -2
drivers/video/fbdev/bw2.c
··· 333 334 dev_set_drvdata(&op->dev, info); 335 336 - printk(KERN_INFO "%s: bwtwo at %lx:%lx\n", 337 - dp->full_name, par->which_io, info->fix.smem_start); 338 339 return 0; 340
··· 333 334 dev_set_drvdata(&op->dev, info); 335 336 + printk(KERN_INFO "%pOF: bwtwo at %lx:%lx\n", 337 + dp, par->which_io, info->fix.smem_start); 338 339 return 0; 340
+2 -2
drivers/video/fbdev/cg14.c
··· 553 554 dev_set_drvdata(&op->dev, info); 555 556 - printk(KERN_INFO "%s: cgfourteen at %lx:%lx, %dMB\n", 557 - dp->full_name, 558 par->iospace, info->fix.smem_start, 559 par->ramsize >> 20); 560
··· 553 554 dev_set_drvdata(&op->dev, info); 555 556 + printk(KERN_INFO "%pOF: cgfourteen at %lx:%lx, %dMB\n", 557 + dp, 558 par->iospace, info->fix.smem_start, 559 par->ramsize >> 20); 560
+2 -2
drivers/video/fbdev/cg3.c
··· 412 413 dev_set_drvdata(&op->dev, info); 414 415 - printk(KERN_INFO "%s: cg3 at %lx:%lx\n", 416 - dp->full_name, par->which_io, info->fix.smem_start); 417 418 return 0; 419
··· 412 413 dev_set_drvdata(&op->dev, info); 414 415 + printk(KERN_INFO "%pOF: cg3 at %lx:%lx\n", 416 + dp, par->which_io, info->fix.smem_start); 417 418 return 0; 419
+2 -2
drivers/video/fbdev/cg6.c
··· 810 811 dev_set_drvdata(&op->dev, info); 812 813 - printk(KERN_INFO "%s: CGsix [%s] at %lx:%lx\n", 814 - dp->full_name, info->fix.id, 815 par->which_io, info->fix.smem_start); 816 817 return 0;
··· 810 811 dev_set_drvdata(&op->dev, info); 812 813 + printk(KERN_INFO "%pOF: CGsix [%s] at %lx:%lx\n", 814 + dp, info->fix.id, 815 par->which_io, info->fix.smem_start); 816 817 return 0;
+2 -2
drivers/video/fbdev/chipsfb.c
··· 292 write_fr(chips_init_fr[i].addr, chips_init_fr[i].data); 293 } 294 295 - static struct fb_fix_screeninfo chipsfb_fix = { 296 .id = "C&T 65550", 297 .type = FB_TYPE_PACKED_PIXELS, 298 .visual = FB_VISUAL_PSEUDOCOLOR, ··· 309 .smem_len = 0x100000, /* 1MB */ 310 }; 311 312 - static struct fb_var_screeninfo chipsfb_var = { 313 .xres = 800, 314 .yres = 600, 315 .xres_virtual = 800,
··· 292 write_fr(chips_init_fr[i].addr, chips_init_fr[i].data); 293 } 294 295 + static const struct fb_fix_screeninfo chipsfb_fix = { 296 .id = "C&T 65550", 297 .type = FB_TYPE_PACKED_PIXELS, 298 .visual = FB_VISUAL_PSEUDOCOLOR, ··· 309 .smem_len = 0x100000, /* 1MB */ 310 }; 311 312 + static const struct fb_var_screeninfo chipsfb_var = { 313 .xres = 800, 314 .yres = 600, 315 .xres_virtual = 800,
+1 -1
drivers/video/fbdev/cobalt_lcdfb.c
··· 126 lcd_write_control(info, LCD_RESET); 127 } 128 129 - static struct fb_fix_screeninfo cobalt_lcdfb_fix = { 130 .id = "cobalt-lcd", 131 .type = FB_TYPE_TEXT, 132 .type_aux = FB_AUX_TEXT_MDA,
··· 126 lcd_write_control(info, LCD_RESET); 127 } 128 129 + static const struct fb_fix_screeninfo cobalt_lcdfb_fix = { 130 .id = "cobalt-lcd", 131 .type = FB_TYPE_TEXT, 132 .type_aux = FB_AUX_TEXT_MDA,
+14
drivers/video/fbdev/core/Makefile
··· 4 fb-y := fbmem.o fbmon.o fbcmap.o fbsysfs.o \ 5 modedb.o fbcvt.o 6 fb-$(CONFIG_FB_DEFERRED_IO) += fb_defio.o 7 fb-objs := $(fb-y) 8 9 obj-$(CONFIG_FB_CFB_FILLRECT) += cfbfillrect.o
··· 4 fb-y := fbmem.o fbmon.o fbcmap.o fbsysfs.o \ 5 modedb.o fbcvt.o 6 fb-$(CONFIG_FB_DEFERRED_IO) += fb_defio.o 7 + 8 + ifeq ($(CONFIG_FRAMEBUFFER_CONSOLE),y) 9 + fb-y += fbcon.o bitblit.o softcursor.o 10 + ifeq ($(CONFIG_FB_TILEBLITTING),y) 11 + fb-y += tileblit.o 12 + endif 13 + ifeq ($(CONFIG_FRAMEBUFFER_CONSOLE_ROTATION),y) 14 + fb-y += fbcon_rotate.o fbcon_cw.o fbcon_ud.o \ 15 + fbcon_ccw.o 16 + endif 17 + ifeq ($(CONFIG_DMI),y) 18 + fb-y += fbcon_dmi_quirks.o 19 + endif 20 + endif 21 fb-objs := $(fb-y) 22 23 obj-$(CONFIG_FB_CFB_FILLRECT) += cfbfillrect.o
+145
drivers/video/fbdev/core/fbcon_dmi_quirks.c
···
··· 1 + /* 2 + * fbcon_dmi_quirks.c -- DMI based quirk detection for fbcon 3 + * 4 + * Copyright (C) 2017 Hans de Goede <hdegoede@redhat.com> 5 + * 6 + * This file is subject to the terms and conditions of the GNU General Public 7 + * License. See the file COPYING in the main directory of this archive for 8 + * more details. 9 + */ 10 + 11 + #include <linux/dmi.h> 12 + #include <linux/fb.h> 13 + #include <linux/kernel.h> 14 + #include "fbcon.h" 15 + 16 + /* 17 + * Some x86 clamshell design devices use portrait tablet screens and a display 18 + * engine which cannot rotate in hardware, so we need to rotate the fbcon to 19 + * compensate. Unfortunately these (cheap) devices also typically have quite 20 + * generic DMI data, so we match on a combination of DMI data, screen resolution 21 + * and a list of known BIOS dates to avoid false positives. 22 + */ 23 + 24 + struct fbcon_dmi_rotate_data { 25 + int width; 26 + int height; 27 + const char * const *bios_dates; 28 + int rotate; 29 + }; 30 + 31 + static const struct fbcon_dmi_rotate_data rotate_data_asus_t100ha = { 32 + .width = 800, 33 + .height = 1280, 34 + .rotate = FB_ROTATE_CCW, 35 + }; 36 + 37 + static const struct fbcon_dmi_rotate_data rotate_data_gpd_pocket = { 38 + .width = 1200, 39 + .height = 1920, 40 + .bios_dates = (const char * const []){ "05/26/2017", "06/28/2017", 41 + "07/05/2017", "08/07/2017", NULL }, 42 + .rotate = FB_ROTATE_CW, 43 + }; 44 + 45 + static const struct fbcon_dmi_rotate_data rotate_data_gpd_win = { 46 + .width = 720, 47 + .height = 1280, 48 + .bios_dates = (const char * const []){ 49 + "10/25/2016", "11/18/2016", "12/23/2016", "12/26/2016", 50 + "02/21/2017", "03/20/2017", "05/25/2017", NULL }, 51 + .rotate = FB_ROTATE_CW, 52 + }; 53 + 54 + static const struct fbcon_dmi_rotate_data rotate_data_itworks_tw891 = { 55 + .width = 800, 56 + .height = 1280, 57 + .bios_dates = (const char * const []){ "10/16/2015", NULL }, 58 + .rotate = FB_ROTATE_CW, 59 + }; 60 + 61 + static const struct fbcon_dmi_rotate_data rotate_data_vios_lth17 = { 62 + .width = 800, 63 + .height = 1280, 64 + .rotate = FB_ROTATE_CW, 65 + }; 66 + 67 + static const struct dmi_system_id rotate_data[] = { 68 + { /* Asus T100HA */ 69 + .matches = { 70 + DMI_EXACT_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."), 71 + DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "T100HAN"), 72 + }, 73 + .driver_data = (void *)&rotate_data_asus_t100ha, 74 + }, { /* 75 + * GPD Pocket, note that the the DMI data is less generic then 76 + * it seems, devices with a board-vendor of "AMI Corporation" 77 + * are quite rare, as are devices which have both board- *and* 78 + * product-id set to "Default String" 79 + */ 80 + .matches = { 81 + DMI_EXACT_MATCH(DMI_BOARD_VENDOR, "AMI Corporation"), 82 + DMI_EXACT_MATCH(DMI_BOARD_NAME, "Default string"), 83 + DMI_EXACT_MATCH(DMI_BOARD_SERIAL, "Default string"), 84 + DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "Default string"), 85 + }, 86 + .driver_data = (void *)&rotate_data_gpd_pocket, 87 + }, { /* GPD Win (same note on DMI match as GPD Pocket) */ 88 + .matches = { 89 + DMI_EXACT_MATCH(DMI_BOARD_VENDOR, "AMI Corporation"), 90 + DMI_EXACT_MATCH(DMI_BOARD_NAME, "Default string"), 91 + DMI_EXACT_MATCH(DMI_BOARD_SERIAL, "Default string"), 92 + DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "Default string"), 93 + }, 94 + .driver_data = (void *)&rotate_data_gpd_win, 95 + }, { /* I.T.Works TW891 */ 96 + .matches = { 97 + DMI_EXACT_MATCH(DMI_SYS_VENDOR, "To be filled by O.E.M."), 98 + DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "TW891"), 99 + DMI_EXACT_MATCH(DMI_BOARD_VENDOR, "To be filled by O.E.M."), 100 + DMI_EXACT_MATCH(DMI_BOARD_NAME, "TW891"), 101 + }, 102 + .driver_data = (void *)&rotate_data_itworks_tw891, 103 + }, { /* VIOS LTH17 */ 104 + .matches = { 105 + DMI_EXACT_MATCH(DMI_SYS_VENDOR, "VIOS"), 106 + DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "LTH17"), 107 + DMI_EXACT_MATCH(DMI_BOARD_VENDOR, "VIOS"), 108 + DMI_EXACT_MATCH(DMI_BOARD_NAME, "LTH17"), 109 + }, 110 + .driver_data = (void *)&rotate_data_vios_lth17, 111 + }, 112 + {} 113 + }; 114 + 115 + int fbcon_platform_get_rotate(struct fb_info *info) 116 + { 117 + const struct dmi_system_id *match; 118 + const struct fbcon_dmi_rotate_data *data; 119 + const char *bios_date; 120 + int i; 121 + 122 + for (match = dmi_first_match(rotate_data); 123 + match; 124 + match = dmi_first_match(match + 1)) { 125 + data = match->driver_data; 126 + 127 + if (data->width != info->var.xres || 128 + data->height != info->var.yres) 129 + continue; 130 + 131 + if (!data->bios_dates) 132 + return data->rotate; 133 + 134 + bios_date = dmi_get_system_info(DMI_BIOS_DATE); 135 + if (!bios_date) 136 + continue; 137 + 138 + for (i = 0; data->bios_dates[i]; i++) { 139 + if (!strcmp(data->bios_dates[i], bios_date)) 140 + return data->rotate; 141 + } 142 + } 143 + 144 + return FB_ROTATE_UR; 145 + }
+9 -3
drivers/video/fbdev/core/fbmem.c
··· 32 #include <linux/device.h> 33 #include <linux/efi.h> 34 #include <linux/fb.h> 35 #include <linux/mem_encrypt.h> 36 37 #include <asm/fb.h> ··· 317 for (i = 0; i < logo->height; i++) { 318 for (j = 0; j < logo->width; src++) { 319 d = *src ^ xor; 320 - for (k = 7; k >= 0; k--) { 321 *dst++ = ((d >> k) & 1) ? fg : 0; 322 j++; 323 } ··· 464 465 /* Return if the frame buffer is not mapped or suspended */ 466 if (logo == NULL || info->state != FBINFO_STATE_RUNNING || 467 - info->flags & FBINFO_MODULE) 468 return 0; 469 470 image.depth = 8; ··· 602 memset(&fb_logo, 0, sizeof(struct logo_data)); 603 604 if (info->flags & FBINFO_MISC_TILEBLITTING || 605 - info->flags & FBINFO_MODULE) 606 return 0; 607 608 if (info->fix.visual == FB_VISUAL_DIRECTCOLOR) { ··· 1893 fb_class = NULL; 1894 goto err_class; 1895 } 1896 return 0; 1897 1898 err_class: ··· 1910 static void __exit 1911 fbmem_exit(void) 1912 { 1913 remove_proc_entry("fb", NULL); 1914 class_destroy(fb_class); 1915 unregister_chrdev(FB_MAJOR, "fb");
··· 32 #include <linux/device.h> 33 #include <linux/efi.h> 34 #include <linux/fb.h> 35 + #include <linux/fbcon.h> 36 #include <linux/mem_encrypt.h> 37 38 #include <asm/fb.h> ··· 316 for (i = 0; i < logo->height; i++) { 317 for (j = 0; j < logo->width; src++) { 318 d = *src ^ xor; 319 + for (k = 7; k >= 0 && j < logo->width; k--) { 320 *dst++ = ((d >> k) & 1) ? fg : 0; 321 j++; 322 } ··· 463 464 /* Return if the frame buffer is not mapped or suspended */ 465 if (logo == NULL || info->state != FBINFO_STATE_RUNNING || 466 + info->fbops->owner) 467 return 0; 468 469 image.depth = 8; ··· 601 memset(&fb_logo, 0, sizeof(struct logo_data)); 602 603 if (info->flags & FBINFO_MISC_TILEBLITTING || 604 + info->fbops->owner) 605 return 0; 606 607 if (info->fix.visual == FB_VISUAL_DIRECTCOLOR) { ··· 1892 fb_class = NULL; 1893 goto err_class; 1894 } 1895 + 1896 + fb_console_init(); 1897 + 1898 return 0; 1899 1900 err_class: ··· 1906 static void __exit 1907 fbmem_exit(void) 1908 { 1909 + fb_console_exit(); 1910 + 1911 remove_proc_entry("fb", NULL); 1912 class_destroy(fb_class); 1913 unregister_chrdev(FB_MAJOR, "fb");
+2 -2
drivers/video/fbdev/core/fbmon.c
··· 1479 if (ret) 1480 return ret; 1481 1482 - pr_debug("%s: got %dx%d display mode from %s\n", 1483 - of_node_full_name(np), vm.hactive, vm.vactive, np->name); 1484 dump_fb_videomode(fb); 1485 1486 return 0;
··· 1479 if (ret) 1480 return ret; 1481 1482 + pr_debug("%pOF: got %dx%d display mode from %s\n", 1483 + np, vm.hactive, vm.vactive, np->name); 1484 dump_fb_videomode(fb); 1485 1486 return 0;
+1 -1
drivers/video/fbdev/cyber2000fb.c
··· 1336 * These parameters give 1337 * 640x480, hsync 31.5kHz, vsync 60Hz 1338 */ 1339 - static struct fb_videomode cyber2000fb_default_mode = { 1340 .refresh = 60, 1341 .xres = 640, 1342 .yres = 480,
··· 1336 * These parameters give 1337 * 640x480, hsync 31.5kHz, vsync 60Hz 1338 */ 1339 + static const struct fb_videomode cyber2000fb_default_mode = { 1340 .refresh = 60, 1341 .xres = 640, 1342 .yres = 480,
+1 -1
drivers/video/fbdev/da8xx-fb.c
··· 1341 { 1342 struct da8xx_lcdc_platform_data *fb_pdata = 1343 dev_get_platdata(&device->dev); 1344 - static struct resource *lcdc_regs; 1345 struct lcd_ctrl_config *lcd_cfg; 1346 struct fb_videomode *lcdc_info; 1347 struct fb_info *da8xx_fb_info;
··· 1341 { 1342 struct da8xx_lcdc_platform_data *fb_pdata = 1343 dev_get_platdata(&device->dev); 1344 + struct resource *lcdc_regs; 1345 struct lcd_ctrl_config *lcd_cfg; 1346 struct fb_videomode *lcdc_info; 1347 struct fb_info *da8xx_fb_info;
+1 -1
drivers/video/fbdev/dnfb.c
··· 126 .vmode = FB_VMODE_NONINTERLACED, 127 }; 128 129 - static struct fb_fix_screeninfo dnfb_fix = { 130 .id = "Apollo Mono", 131 .smem_start = (FRAME_BUFFER_START + IO_BASE), 132 .smem_len = FRAME_BUFFER_LEN,
··· 126 .vmode = FB_VMODE_NONINTERLACED, 127 }; 128 129 + static const struct fb_fix_screeninfo dnfb_fix = { 130 .id = "Apollo Mono", 131 .smem_start = (FRAME_BUFFER_START + IO_BASE), 132 .smem_len = FRAME_BUFFER_LEN,
+1 -1
drivers/video/fbdev/fb-puv3.c
··· 69 0, FB_VMODE_NONINTERLACED, FB_MODE_IS_VESA }, 70 }; 71 72 - static struct fb_var_screeninfo unifb_default = { 73 .xres = 640, 74 .yres = 480, 75 .xres_virtual = 640,
··· 69 0, FB_VMODE_NONINTERLACED, FB_MODE_IS_VESA }, 70 }; 71 72 + static const struct fb_var_screeninfo unifb_default = { 73 .xres = 640, 74 .yres = 480, 75 .xres_virtual = 640,
+2 -2
drivers/video/fbdev/ffb.c
··· 997 998 dev_set_drvdata(&op->dev, info); 999 1000 - printk(KERN_INFO "%s: %s at %016lx, type %d, " 1001 "DAC pnum[%x] rev[%d] manuf_rev[%d]\n", 1002 - dp->full_name, 1003 ((par->flags & FFB_FLAG_AFB) ? "AFB" : "FFB"), 1004 par->physbase, par->board_type, 1005 dac_pnum, dac_rev, dac_mrev);
··· 997 998 dev_set_drvdata(&op->dev, info); 999 1000 + printk(KERN_INFO "%pOF: %s at %016lx, type %d, " 1001 "DAC pnum[%x] rev[%d] manuf_rev[%d]\n", 1002 + dp, 1003 ((par->flags & FFB_FLAG_AFB) ? "AFB" : "FFB"), 1004 par->physbase, par->board_type, 1005 dac_pnum, dac_rev, dac_mrev);
+1 -1
drivers/video/fbdev/fm2fb.c
··· 213 214 static int fm2fb_probe(struct zorro_dev *z, const struct zorro_device_id *id); 215 216 - static struct zorro_device_id fm2fb_devices[] = { 217 { ZORRO_PROD_BSC_FRAMEMASTER_II }, 218 { ZORRO_PROD_HELFRICH_RAINBOW_II }, 219 { 0 }
··· 213 214 static int fm2fb_probe(struct zorro_dev *z, const struct zorro_device_id *id); 215 216 + static const struct zorro_device_id fm2fb_devices[] = { 217 { ZORRO_PROD_BSC_FRAMEMASTER_II }, 218 { ZORRO_PROD_HELFRICH_RAINBOW_II }, 219 { 0 }
+1 -1
drivers/video/fbdev/geode/gxfb_core.c
··· 474 framebuffer_release(info); 475 } 476 477 - static struct pci_device_id gxfb_id_table[] = { 478 { PCI_DEVICE(PCI_VENDOR_ID_NS, PCI_DEVICE_ID_NS_GX_VIDEO) }, 479 { 0, } 480 };
··· 474 framebuffer_release(info); 475 } 476 477 + static const struct pci_device_id gxfb_id_table[] = { 478 { PCI_DEVICE(PCI_VENDOR_ID_NS, PCI_DEVICE_ID_NS_GX_VIDEO) }, 479 { 0, } 480 };
+1 -1
drivers/video/fbdev/grvga.c
··· 70 } 71 }; 72 73 - static struct fb_fix_screeninfo grvga_fix = { 74 .id = "AG SVGACTRL", 75 .type = FB_TYPE_PACKED_PIXELS, 76 .visual = FB_VISUAL_PSEUDOCOLOR,
··· 70 } 71 }; 72 73 + static const struct fb_fix_screeninfo grvga_fix = { 74 .id = "AG SVGACTRL", 75 .type = FB_TYPE_PACKED_PIXELS, 76 .visual = FB_VISUAL_PSEUDOCOLOR,
+2 -2
drivers/video/fbdev/i810/i810_main.c
··· 107 "Intel(R) 815 (Internal Graphics with AGP) Framebuffer Device" 108 }; 109 110 - static struct pci_device_id i810fb_pci_tbl[] = { 111 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82810_IG1, 112 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, 113 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82810_IG3, ··· 1542 return 0; 1543 } 1544 1545 - static struct fb_ops i810fb_ops = { 1546 .owner = THIS_MODULE, 1547 .fb_open = i810fb_open, 1548 .fb_release = i810fb_release,
··· 107 "Intel(R) 815 (Internal Graphics with AGP) Framebuffer Device" 108 }; 109 110 + static const struct pci_device_id i810fb_pci_tbl[] = { 111 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82810_IG1, 112 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, 113 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82810_IG3, ··· 1542 return 0; 1543 } 1544 1545 + static const struct fb_ops i810fb_ops = { 1546 .owner = THIS_MODULE, 1547 .fb_open = i810fb_open, 1548 .fb_release = i810fb_release,
+1 -1
drivers/video/fbdev/imsttfb.c
··· 1318 } 1319 } 1320 1321 - static struct pci_device_id imsttfb_pci_tbl[] = { 1322 { PCI_VENDOR_ID_IMS, PCI_DEVICE_ID_IMS_TT128, 1323 PCI_ANY_ID, PCI_ANY_ID, 0, 0, IBM }, 1324 { PCI_VENDOR_ID_IMS, PCI_DEVICE_ID_IMS_TT3D,
··· 1318 } 1319 } 1320 1321 + static const struct pci_device_id imsttfb_pci_tbl[] = { 1322 { PCI_VENDOR_ID_IMS, PCI_DEVICE_ID_IMS_TT128, 1323 PCI_ANY_ID, PCI_ANY_ID, 0, 0, IBM }, 1324 { PCI_VENDOR_ID_IMS, PCI_DEVICE_ID_IMS_TT3D,
+1 -1
drivers/video/fbdev/intelfb/intelfbdrv.c
··· 173 #define INTELFB_CLASS_MASK 0 174 #endif 175 176 - static struct pci_device_id intelfb_pci_table[] = { 177 { 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 }, 178 { 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 }, 179 { 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 },
··· 173 #define INTELFB_CLASS_MASK 0 174 #endif 175 176 + static const struct pci_device_id intelfb_pci_table[] = { 177 { 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 }, 178 { 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 }, 179 { 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 },
+1 -1
drivers/video/fbdev/kyro/fbdev.c
··· 633 return 0; 634 } 635 636 - static struct pci_device_id kyrofb_pci_tbl[] = { 637 { PCI_VENDOR_ID_ST, PCI_DEVICE_ID_STG4000, 638 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, 639 { 0, }
··· 633 return 0; 634 } 635 636 + static const struct pci_device_id kyrofb_pci_tbl[] = { 637 { PCI_VENDOR_ID_ST, PCI_DEVICE_ID_STG4000, 638 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, 639 { 0, }
+2 -2
drivers/video/fbdev/leo.c
··· 619 620 dev_set_drvdata(&op->dev, info); 621 622 - printk(KERN_INFO "%s: leo at %lx:%lx\n", 623 - dp->full_name, 624 par->which_io, info->fix.smem_start); 625 626 return 0;
··· 619 620 dev_set_drvdata(&op->dev, info); 621 622 + printk(KERN_INFO "%pOF: leo at %lx:%lx\n", 623 + dp, 624 par->which_io, info->fix.smem_start); 625 626 return 0;
+6 -8
drivers/video/fbdev/matrox/matroxfb_base.c
··· 1198 return 0; 1199 } 1200 1201 - static struct fb_ops matroxfb_ops = { 1202 .owner = THIS_MODULE, 1203 .fb_open = matroxfb_open, 1204 .fb_release = matroxfb_release, ··· 1573 NULL}}; 1574 1575 #ifndef MODULE 1576 - static struct fb_videomode defaultmode = { 1577 /* 640x480 @ 60Hz, 31.5 kHz */ 1578 NULL, 60, 640, 480, 39721, 40, 24, 32, 11, 96, 2, 1579 0, FB_VMODE_NONINTERLACED 1580 }; 1581 - #endif /* !MODULE */ 1582 1583 static int hotplug = 0; 1584 1585 static void setDefaultOutputs(struct matrox_fb_info *minfo) 1586 { ··· 1623 unsigned int memsize; 1624 int err; 1625 1626 - static struct pci_device_id intel_82437[] = { 1627 { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82437) }, 1628 { }, 1629 }; ··· 1794 minfo->fbops = matroxfb_ops; 1795 minfo->fbcon.fbops = &minfo->fbops; 1796 minfo->fbcon.pseudo_palette = minfo->cmap; 1797 - /* after __init time we are like module... no logo */ 1798 - minfo->fbcon.flags = hotplug ? FBINFO_FLAG_MODULE : FBINFO_FLAG_DEFAULT; 1799 - minfo->fbcon.flags |= FBINFO_PARTIAL_PAN_OK | /* Prefer panning for scroll under MC viewer/edit */ 1800 FBINFO_HWACCEL_COPYAREA | /* We have hw-assisted bmove */ 1801 FBINFO_HWACCEL_FILLRECT | /* And fillrect */ 1802 FBINFO_HWACCEL_IMAGEBLIT | /* And imageblit */ ··· 2114 matroxfb_remove(minfo, 1); 2115 } 2116 2117 - static struct pci_device_id matroxfb_devices[] = { 2118 #ifdef CONFIG_FB_MATROX_MILLENIUM 2119 {PCI_VENDOR_ID_MATROX, PCI_DEVICE_ID_MATROX_MIL, 2120 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
··· 1198 return 0; 1199 } 1200 1201 + static const struct fb_ops matroxfb_ops = { 1202 .owner = THIS_MODULE, 1203 .fb_open = matroxfb_open, 1204 .fb_release = matroxfb_release, ··· 1573 NULL}}; 1574 1575 #ifndef MODULE 1576 + static const struct fb_videomode defaultmode = { 1577 /* 640x480 @ 60Hz, 31.5 kHz */ 1578 NULL, 60, 640, 480, 39721, 40, 24, 32, 11, 96, 2, 1579 0, FB_VMODE_NONINTERLACED 1580 }; 1581 1582 static int hotplug = 0; 1583 + #endif /* !MODULE */ 1584 1585 static void setDefaultOutputs(struct matrox_fb_info *minfo) 1586 { ··· 1623 unsigned int memsize; 1624 int err; 1625 1626 + static const struct pci_device_id intel_82437[] = { 1627 { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82437) }, 1628 { }, 1629 }; ··· 1794 minfo->fbops = matroxfb_ops; 1795 minfo->fbcon.fbops = &minfo->fbops; 1796 minfo->fbcon.pseudo_palette = minfo->cmap; 1797 + minfo->fbcon.flags = FBINFO_PARTIAL_PAN_OK | /* Prefer panning for scroll under MC viewer/edit */ 1798 FBINFO_HWACCEL_COPYAREA | /* We have hw-assisted bmove */ 1799 FBINFO_HWACCEL_FILLRECT | /* And fillrect */ 1800 FBINFO_HWACCEL_IMAGEBLIT | /* And imageblit */ ··· 2116 matroxfb_remove(minfo, 1); 2117 } 2118 2119 + static const struct pci_device_id matroxfb_devices[] = { 2120 #ifdef CONFIG_FB_MATROX_MILLENIUM 2121 {PCI_VENDOR_ID_MATROX, PCI_DEVICE_ID_MATROX_MIL, 2122 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
+1 -1
drivers/video/fbdev/maxinefb.c
··· 39 40 static struct fb_info fb_info; 41 42 - static struct fb_var_screeninfo maxinefb_defined = { 43 .xres = 1024, 44 .yres = 768, 45 .xres_virtual = 1024,
··· 39 40 static struct fb_info fb_info; 41 42 + static const struct fb_var_screeninfo maxinefb_defined = { 43 .xres = 1024, 44 .yres = 768, 45 .xres_virtual = 1024,
+1 -1
drivers/video/fbdev/mb862xx/mb862xxfbdrv.c
··· 982 #define CHIP_ID(id) \ 983 { PCI_DEVICE(PCI_VENDOR_ID_FUJITSU_LIMITED, id) } 984 985 - static struct pci_device_id mb862xx_pci_tbl[] = { 986 /* MB86295/MB86296 */ 987 CHIP_ID(PCI_DEVICE_ID_FUJITSU_CORALP), 988 CHIP_ID(PCI_DEVICE_ID_FUJITSU_CORALPA),
··· 982 #define CHIP_ID(id) \ 983 { PCI_DEVICE(PCI_VENDOR_ID_FUJITSU_LIMITED, id) } 984 985 + static const struct pci_device_id mb862xx_pci_tbl[] = { 986 /* MB86295/MB86296 */ 987 CHIP_ID(PCI_DEVICE_ID_FUJITSU_CORALP), 988 CHIP_ID(PCI_DEVICE_ID_FUJITSU_CORALPA),
+2 -2
drivers/video/fbdev/mbx/mbxfb.c
··· 79 80 }; 81 82 - static struct fb_var_screeninfo mbxfb_default = { 83 .xres = 640, 84 .yres = 480, 85 .xres_virtual = 640, ··· 102 .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, 103 }; 104 105 - static struct fb_fix_screeninfo mbxfb_fix = { 106 .id = "MBX", 107 .type = FB_TYPE_PACKED_PIXELS, 108 .visual = FB_VISUAL_TRUECOLOR,
··· 79 80 }; 81 82 + static const struct fb_var_screeninfo mbxfb_default = { 83 .xres = 640, 84 .yres = 480, 85 .xres_virtual = 640, ··· 102 .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, 103 }; 104 105 + static const struct fb_fix_screeninfo mbxfb_fix = { 106 .id = "MBX", 107 .type = FB_TYPE_PACKED_PIXELS, 108 .visual = FB_VISUAL_TRUECOLOR,
+1 -1
drivers/video/fbdev/neofb.c
··· 2138 } 2139 } 2140 2141 - static struct pci_device_id neofb_devices[] = { 2142 {PCI_VENDOR_ID_NEOMAGIC, PCI_CHIP_NM2070, 2143 PCI_ANY_ID, PCI_ANY_ID, 0, 0, FB_ACCEL_NEOMAGIC_NM2070}, 2144
··· 2138 } 2139 } 2140 2141 + static const struct pci_device_id neofb_devices[] = { 2142 {PCI_VENDOR_ID_NEOMAGIC, PCI_CHIP_NM2070, 2143 PCI_ANY_ID, PCI_ANY_ID, 0, 0, FB_ACCEL_NEOMAGIC_NM2070}, 2144
+1 -1
drivers/video/fbdev/nvidia/nvidia.c
··· 55 /* HW cursor parameters */ 56 #define MAX_CURS 32 57 58 - static struct pci_device_id nvidiafb_pci_tbl[] = { 59 {PCI_VENDOR_ID_NVIDIA, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, 60 PCI_BASE_CLASS_DISPLAY << 16, 0xff0000, 0}, 61 { 0, }
··· 55 /* HW cursor parameters */ 56 #define MAX_CURS 32 57 58 + static const struct pci_device_id nvidiafb_pci_tbl[] = { 59 {PCI_VENDOR_ID_NVIDIA, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, 60 PCI_BASE_CLASS_DISPLAY << 16, 0xff0000, 0}, 61 { 0, }
+4 -6
drivers/video/fbdev/offb.c
··· 383 FB_VISUAL_PSEUDOCOLOR : FB_VISUAL_STATIC_PSEUDOCOLOR; 384 } 385 386 - static void __init offb_init_fb(const char *name, const char *full_name, 387 int width, int height, int depth, 388 int pitch, unsigned long address, 389 int foreign_endian, struct device_node *dp) ··· 402 "Using unsupported %dx%d %s at %lx, depth=%d, pitch=%d\n", 403 width, height, name, address, depth, pitch); 404 if (depth != 8 && depth != 15 && depth != 16 && depth != 32) { 405 - printk(KERN_ERR "%s: can't use depth = %d\n", full_name, 406 - depth); 407 release_mem_region(res_start, res_size); 408 return; 409 } 410 411 info = framebuffer_alloc(sizeof(u32) * 16, NULL); 412 - 413 if (info == 0) { 414 release_mem_region(res_start, res_size); 415 return; ··· 514 if (register_framebuffer(info) < 0) 515 goto out_err; 516 517 - fb_info(info, "Open Firmware frame buffer device on %s\n", full_name); 518 return; 519 520 out_err: ··· 643 if (strcmp(dp->name, "valkyrie") == 0) 644 address += 0x1000; 645 offb_init_fb(no_real_node ? "bootx" : dp->name, 646 - no_real_node ? "display" : dp->full_name, 647 width, height, depth, pitch, address, 648 foreign_endian, no_real_node ? NULL : dp); 649 }
··· 383 FB_VISUAL_PSEUDOCOLOR : FB_VISUAL_STATIC_PSEUDOCOLOR; 384 } 385 386 + static void __init offb_init_fb(const char *name, 387 int width, int height, int depth, 388 int pitch, unsigned long address, 389 int foreign_endian, struct device_node *dp) ··· 402 "Using unsupported %dx%d %s at %lx, depth=%d, pitch=%d\n", 403 width, height, name, address, depth, pitch); 404 if (depth != 8 && depth != 15 && depth != 16 && depth != 32) { 405 + printk(KERN_ERR "%pOF: can't use depth = %d\n", dp, depth); 406 release_mem_region(res_start, res_size); 407 return; 408 } 409 410 info = framebuffer_alloc(sizeof(u32) * 16, NULL); 411 + 412 if (info == 0) { 413 release_mem_region(res_start, res_size); 414 return; ··· 515 if (register_framebuffer(info) < 0) 516 goto out_err; 517 518 + fb_info(info, "Open Firmware frame buffer device on %pOF\n", dp); 519 return; 520 521 out_err: ··· 644 if (strcmp(dp->name, "valkyrie") == 0) 645 address += 0x1000; 646 offb_init_fb(no_real_node ? "bootx" : dp->name, 647 width, height, depth, pitch, address, 648 foreign_endian, no_real_node ? NULL : dp); 649 }
+1 -1
drivers/video/fbdev/omap/lcd_mipid.c
··· 496 mipid_esd_stop_check(md); 497 } 498 499 - static struct lcd_panel mipid_panel = { 500 .config = OMAP_LCDC_PANEL_TFT, 501 502 .bpp = 16,
··· 496 mipid_esd_stop_check(md); 497 } 498 499 + static const struct lcd_panel mipid_panel = { 500 .config = OMAP_LCDC_PANEL_TFT, 501 502 .bpp = 16,
+1 -1
drivers/video/fbdev/omap2/omapfb/displays/panel-lgphilips-lb035q02.c
··· 18 19 #include <video/omapfb_dss.h> 20 21 - static struct omap_video_timings lb035q02_timings = { 22 .x_res = 320, 23 .y_res = 240, 24
··· 18 19 #include <video/omapfb_dss.h> 20 21 + static const struct omap_video_timings lb035q02_timings = { 22 .x_res = 320, 23 .y_res = 240, 24
+1 -1
drivers/video/fbdev/omap2/omapfb/displays/panel-sony-acx565akm.c
··· 509 NULL, 510 }; 511 512 - static struct attribute_group bldev_attr_group = { 513 .attrs = bldev_attrs, 514 }; 515
··· 509 NULL, 510 }; 511 512 + static const struct attribute_group bldev_attr_group = { 513 .attrs = bldev_attrs, 514 }; 515
+1 -1
drivers/video/fbdev/omap2/omapfb/displays/panel-tpo-td028ttec1.c
··· 41 struct spi_device *spi_dev; 42 }; 43 44 - static struct omap_video_timings td028ttec1_panel_timings = { 45 .x_res = 480, 46 .y_res = 640, 47 .pixelclock = 22153000,
··· 41 struct spi_device *spi_dev; 42 }; 43 44 + static const struct omap_video_timings td028ttec1_panel_timings = { 45 .x_res = 480, 46 .y_res = 640, 47 .pixelclock = 22153000,
+1 -1
drivers/video/fbdev/omap2/omapfb/displays/panel-tpo-td043mtea1.c
··· 282 NULL, 283 }; 284 285 - static struct attribute_group tpo_td043_attr_group = { 286 .attrs = tpo_td043_attrs, 287 }; 288
··· 282 NULL, 283 }; 284 285 + static const struct attribute_group tpo_td043_attr_group = { 286 .attrs = tpo_td043_attrs, 287 }; 288
+2 -1
drivers/video/fbdev/omap2/omapfb/dss/dss-of.c
··· 16 #include <linux/err.h> 17 #include <linux/module.h> 18 #include <linux/of.h> 19 #include <linux/seq_file.h> 20 21 #include <video/omapfb_dss.h> ··· 129 { 130 struct device_node *np; 131 132 - np = of_parse_phandle(node, "remote-endpoint", 0); 133 if (!np) 134 return NULL; 135
··· 16 #include <linux/err.h> 17 #include <linux/module.h> 18 #include <linux/of.h> 19 + #include <linux/of_graph.h> 20 #include <linux/seq_file.h> 21 22 #include <video/omapfb_dss.h> ··· 128 { 129 struct device_node *np; 130 131 + np = of_graph_get_remote_endpoint(node); 132 if (!np) 133 return NULL; 134
+2 -2
drivers/video/fbdev/p9100.c
··· 304 305 dev_set_drvdata(&op->dev, info); 306 307 - printk(KERN_INFO "%s: p9100 at %lx:%lx\n", 308 - dp->full_name, 309 par->which_io, info->fix.smem_start); 310 311 return 0;
··· 304 305 dev_set_drvdata(&op->dev, info); 306 307 + printk(KERN_INFO "%pOF: p9100 at %lx:%lx\n", 308 + dp, 309 par->which_io, info->fix.smem_start); 310 311 return 0;
+1 -1
drivers/video/fbdev/pm2fb.c
··· 1732 framebuffer_release(info); 1733 } 1734 1735 - static struct pci_device_id pm2fb_id_table[] = { 1736 { PCI_VENDOR_ID_TI, PCI_DEVICE_ID_TI_TVP4020, 1737 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, 1738 { PCI_VENDOR_ID_3DLABS, PCI_DEVICE_ID_3DLABS_PERMEDIA2,
··· 1732 framebuffer_release(info); 1733 } 1734 1735 + static const struct pci_device_id pm2fb_id_table[] = { 1736 { PCI_VENDOR_ID_TI, PCI_DEVICE_ID_TI_TVP4020, 1737 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, 1738 { PCI_VENDOR_ID_3DLABS, PCI_DEVICE_ID_3DLABS_PERMEDIA2,
+1 -1
drivers/video/fbdev/pm3fb.c
··· 1479 } 1480 } 1481 1482 - static struct pci_device_id pm3fb_id_table[] = { 1483 { PCI_VENDOR_ID_3DLABS, 0x0a, 1484 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, 1485 { 0, }
··· 1479 } 1480 } 1481 1482 + static const struct pci_device_id pm3fb_id_table[] = { 1483 { PCI_VENDOR_ID_3DLABS, 0x0a, 1484 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, 1485 { 0, }
+2 -2
drivers/video/fbdev/pmag-aa-fb.c
··· 67 struct bt431_regs __iomem *bt431; 68 }; 69 70 - static struct fb_var_screeninfo aafb_defined = { 71 .xres = 1280, 72 .yres = 1024, 73 .xres_virtual = 2048, ··· 90 .vmode = FB_VMODE_NONINTERLACED, 91 }; 92 93 - static struct fb_fix_screeninfo aafb_fix = { 94 .id = "PMAG-AA", 95 .smem_len = (2048 * 1024), 96 .type = FB_TYPE_PACKED_PIXELS,
··· 67 struct bt431_regs __iomem *bt431; 68 }; 69 70 + static const struct fb_var_screeninfo aafb_defined = { 71 .xres = 1280, 72 .yres = 1024, 73 .xres_virtual = 2048, ··· 90 .vmode = FB_VMODE_NONINTERLACED, 91 }; 92 93 + static const struct fb_fix_screeninfo aafb_fix = { 94 .id = "PMAG-AA", 95 .smem_len = (2048 * 1024), 96 .type = FB_TYPE_PACKED_PIXELS,
+2 -2
drivers/video/fbdev/pmag-ba-fb.c
··· 43 }; 44 45 46 - static struct fb_var_screeninfo pmagbafb_defined = { 47 .xres = 1024, 48 .yres = 864, 49 .xres_virtual = 1024, ··· 67 .vmode = FB_VMODE_NONINTERLACED, 68 }; 69 70 - static struct fb_fix_screeninfo pmagbafb_fix = { 71 .id = "PMAG-BA", 72 .smem_len = (1024 * 1024), 73 .type = FB_TYPE_PACKED_PIXELS,
··· 43 }; 44 45 46 + static const struct fb_var_screeninfo pmagbafb_defined = { 47 .xres = 1024, 48 .yres = 864, 49 .xres_virtual = 1024, ··· 67 .vmode = FB_VMODE_NONINTERLACED, 68 }; 69 70 + static const struct fb_fix_screeninfo pmagbafb_fix = { 71 .id = "PMAG-BA", 72 .smem_len = (1024 * 1024), 73 .type = FB_TYPE_PACKED_PIXELS,
+2 -2
drivers/video/fbdev/pmagb-b-fb.c
··· 44 }; 45 46 47 - static struct fb_var_screeninfo pmagbbfb_defined = { 48 .bits_per_pixel = 8, 49 .red.length = 8, 50 .green.length = 8, ··· 57 .vmode = FB_VMODE_NONINTERLACED, 58 }; 59 60 - static struct fb_fix_screeninfo pmagbbfb_fix = { 61 .id = "PMAGB-BA", 62 .smem_len = (2048 * 1024), 63 .type = FB_TYPE_PACKED_PIXELS,
··· 44 }; 45 46 47 + static const struct fb_var_screeninfo pmagbbfb_defined = { 48 .bits_per_pixel = 8, 49 .red.length = 8, 50 .green.length = 8, ··· 57 .vmode = FB_VMODE_NONINTERLACED, 58 }; 59 60 + static const struct fb_fix_screeninfo pmagbbfb_fix = { 61 .id = "PMAGB-BA", 62 .smem_len = (2048 * 1024), 63 .type = FB_TYPE_PACKED_PIXELS,
+1 -1
drivers/video/fbdev/ps3fb.c
··· 952 .fb_compat_ioctl = ps3fb_ioctl 953 }; 954 955 - static struct fb_fix_screeninfo ps3fb_fix = { 956 .id = DEVICE_NAME, 957 .type = FB_TYPE_PACKED_PIXELS, 958 .visual = FB_VISUAL_TRUECOLOR,
··· 952 .fb_compat_ioctl = ps3fb_ioctl 953 }; 954 955 + static const struct fb_fix_screeninfo ps3fb_fix = { 956 .id = DEVICE_NAME, 957 .type = FB_TYPE_PACKED_PIXELS, 958 .visual = FB_VISUAL_TRUECOLOR,
+2 -2
drivers/video/fbdev/pvr2fb.c
··· 154 .accel = FB_ACCEL_NONE, 155 }; 156 157 - static struct fb_var_screeninfo pvr2_var = { 158 .xres = 640, 159 .yres = 480, 160 .xres_virtual = 640, ··· 966 pci_release_regions(pdev); 967 } 968 969 - static struct pci_device_id pvr2fb_pci_tbl[] = { 970 { PCI_VENDOR_ID_NEC, PCI_DEVICE_ID_NEC_NEON250, 971 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, 972 { 0, },
··· 154 .accel = FB_ACCEL_NONE, 155 }; 156 157 + static const struct fb_var_screeninfo pvr2_var = { 158 .xres = 640, 159 .yres = 480, 160 .xres_virtual = 640, ··· 966 pci_release_regions(pdev); 967 } 968 969 + static const struct pci_device_id pvr2fb_pci_tbl[] = { 970 { PCI_VENDOR_ID_NEC, PCI_DEVICE_ID_NEC_NEON250, 971 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, 972 { 0, },
+2 -2
drivers/video/fbdev/pxa3xx-gcu.c
··· 626 /* request the IRQ */ 627 irq = platform_get_irq(pdev, 0); 628 if (irq < 0) { 629 - dev_err(dev, "no IRQ defined\n"); 630 - return -ENODEV; 631 } 632 633 ret = devm_request_irq(dev, irq, pxa3xx_gcu_handle_irq,
··· 626 /* request the IRQ */ 627 irq = platform_get_irq(pdev, 0); 628 if (irq < 0) { 629 + dev_err(dev, "no IRQ defined: %d\n", irq); 630 + return irq; 631 } 632 633 ret = devm_request_irq(dev, irq, pxa3xx_gcu_handle_irq,
+1 -1
drivers/video/fbdev/q40fb.c
··· 36 .accel = FB_ACCEL_NONE, 37 }; 38 39 - static struct fb_var_screeninfo q40fb_var = { 40 .xres = 1024, 41 .yres = 512, 42 .xres_virtual = 1024,
··· 36 .accel = FB_ACCEL_NONE, 37 }; 38 39 + static const struct fb_var_screeninfo q40fb_var = { 40 .xres = 1024, 41 .yres = 512, 42 .xres_virtual = 1024,
+1 -1
drivers/video/fbdev/riva/fbdev.c
··· 101 * 102 * ------------------------------------------------------------------------- */ 103 104 - static struct pci_device_id rivafb_pci_tbl[] = { 105 { PCI_VENDOR_ID_NVIDIA_SGS, PCI_DEVICE_ID_NVIDIA_SGS_RIVA128, 106 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, 107 { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_TNT,
··· 101 * 102 * ------------------------------------------------------------------------- */ 103 104 + static const struct pci_device_id rivafb_pci_tbl[] = { 105 { PCI_VENDOR_ID_NVIDIA_SGS, PCI_DEVICE_ID_NVIDIA_SGS_RIVA128, 106 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, 107 { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_TNT,
+1 -1
drivers/video/fbdev/s3fb.c
··· 1483 1484 /* List of boards that we are trying to support */ 1485 1486 - static struct pci_device_id s3_devices[] = { 1487 {PCI_DEVICE(PCI_VENDOR_ID_S3, 0x8810), .driver_data = CHIP_XXX_TRIO}, 1488 {PCI_DEVICE(PCI_VENDOR_ID_S3, 0x8811), .driver_data = CHIP_XXX_TRIO}, 1489 {PCI_DEVICE(PCI_VENDOR_ID_S3, 0x8812), .driver_data = CHIP_M65_AURORA64VP},
··· 1483 1484 /* List of boards that we are trying to support */ 1485 1486 + static const struct pci_device_id s3_devices[] = { 1487 {PCI_DEVICE(PCI_VENDOR_ID_S3, 0x8810), .driver_data = CHIP_XXX_TRIO}, 1488 {PCI_DEVICE(PCI_VENDOR_ID_S3, 0x8811), .driver_data = CHIP_XXX_TRIO}, 1489 {PCI_DEVICE(PCI_VENDOR_ID_S3, 0x8812), .driver_data = CHIP_M65_AURORA64VP},
+1 -1
drivers/video/fbdev/savage/savagefb_driver.c
··· 2429 } 2430 2431 2432 - static struct pci_device_id savagefb_devices[] = { 2433 {PCI_VENDOR_ID_S3, PCI_CHIP_SUPSAV_MX128, 2434 PCI_ANY_ID, PCI_ANY_ID, 0, 0, FB_ACCEL_SUPERSAVAGE}, 2435
··· 2429 } 2430 2431 2432 + static const struct pci_device_id savagefb_devices[] = { 2433 {PCI_VENDOR_ID_S3, PCI_CHIP_SUPSAV_MX128, 2434 PCI_ANY_ID, PCI_ANY_ID, 0, 0, FB_ACCEL_SUPERSAVAGE}, 2435
+3 -12
drivers/video/fbdev/sis/init301.c
··· 6848 if(SiS_Pr->SiS_VGAHDE >= 1280) { 6849 tempch = 20; 6850 tempbx &= ~0x20; 6851 - } else if(SiS_Pr->SiS_VGAHDE >= 1024) { 6852 - tempch = 25; 6853 } else { 6854 tempch = 25; /* OK */ 6855 } ··· 7962 } 7963 } 7964 } else { /* ---- PAL ---- */ 7965 - /* We don't play around with FSCI in PAL mode */ 7966 - if(resindex == 0x04) { 7967 - SiS_SetCH70xxANDOR(SiS_Pr,0x20,0x00,0xEF); /* loop filter off */ 7968 - SiS_SetCH70xxANDOR(SiS_Pr,0x21,0x01,0xFE); /* ACIV on */ 7969 - } else { 7970 - SiS_SetCH70xxANDOR(SiS_Pr,0x20,0x00,0xEF); /* loop filter off */ 7971 - SiS_SetCH70xxANDOR(SiS_Pr,0x21,0x01,0xFE); /* ACIV on */ 7972 - } 7973 } 7974 7975 #endif /* 300 */ ··· 9650 delay = 0x0a; 9651 } else if(IS_SIS740) { 9652 delay = 0x00; 9653 - } else if(SiS_Pr->ChipType < SIS_330) { 9654 - delay = 0x0c; 9655 } else { 9656 delay = 0x0c; 9657 }
··· 6848 if(SiS_Pr->SiS_VGAHDE >= 1280) { 6849 tempch = 20; 6850 tempbx &= ~0x20; 6851 } else { 6852 tempch = 25; /* OK */ 6853 } ··· 7964 } 7965 } 7966 } else { /* ---- PAL ---- */ 7967 + /* We don't play around with FSCI in PAL mode */ 7968 + SiS_SetCH70xxANDOR(SiS_Pr, 0x20, 0x00, 0xEF); /* loop filter off */ 7969 + SiS_SetCH70xxANDOR(SiS_Pr, 0x21, 0x01, 0xFE); /* ACIV on */ 7970 } 7971 7972 #endif /* 300 */ ··· 9657 delay = 0x0a; 9658 } else if(IS_SIS740) { 9659 delay = 0x00; 9660 } else { 9661 delay = 0x0c; 9662 }
+2 -2
drivers/video/fbdev/skeletonfb.c
··· 84 * if we don't use modedb. If we do use modedb see xxxfb_init how to use it 85 * to get a fb_var_screeninfo. Otherwise define a default var as well. 86 */ 87 - static struct fb_fix_screeninfo xxxfb_fix = { 88 .id = "FB's name", 89 .type = FB_TYPE_PACKED_PIXELS, 90 .visual = FB_VISUAL_PSEUDOCOLOR, ··· 866 #define xxxfb_resume NULL 867 #endif /* CONFIG_PM */ 868 869 - static struct pci_device_id xxxfb_id_table[] = { 870 { PCI_VENDOR_ID_XXX, PCI_DEVICE_ID_XXX, 871 PCI_ANY_ID, PCI_ANY_ID, PCI_BASE_CLASS_DISPLAY << 16, 872 PCI_CLASS_MASK, 0 },
··· 84 * if we don't use modedb. If we do use modedb see xxxfb_init how to use it 85 * to get a fb_var_screeninfo. Otherwise define a default var as well. 86 */ 87 + static const struct fb_fix_screeninfo xxxfb_fix = { 88 .id = "FB's name", 89 .type = FB_TYPE_PACKED_PIXELS, 90 .visual = FB_VISUAL_PSEUDOCOLOR, ··· 866 #define xxxfb_resume NULL 867 #endif /* CONFIG_PM */ 868 869 + static const struct pci_device_id xxxfb_id_table[] = { 870 { PCI_VENDOR_ID_XXX, PCI_DEVICE_ID_XXX, 871 PCI_ANY_ID, PCI_ANY_ID, PCI_BASE_CLASS_DISPLAY << 16, 872 PCI_CLASS_MASK, 0 },
+1 -1
drivers/video/fbdev/sm501fb.c
··· 46 static char *fb_mode = "640x480-16@60"; 47 static unsigned long default_bpp = 16; 48 49 - static struct fb_videomode sm501_default_mode = { 50 .refresh = 60, 51 .xres = 640, 52 .yres = 480,
··· 46 static char *fb_mode = "640x480-16@60"; 47 static unsigned long default_bpp = 16; 48 49 + static const struct fb_videomode sm501_default_mode = { 50 .refresh = 60, 51 .xres = 640, 52 .yres = 480,
+9 -8
drivers/video/fbdev/sm712fb.c
··· 33 #include "sm712.h" 34 35 /* 36 - * Private structure 37 - */ 38 struct smtcfb_info { 39 struct pci_dev *pdev; 40 struct fb_info *fb; ··· 785 smtc_scr_info.lfb_height = 0; 786 smtc_scr_info.lfb_depth = 0; 787 788 - pr_debug("sm7xx_vga_setup = %s\n", options); 789 790 for (i = 0; i < ARRAY_SIZE(vesa_mode_table); i++) { 791 if (strstr(options, vesa_mode_table[i].index)) { ··· 798 } 799 } 800 801 - static void sm712_setpalette(int regno, unsigned red, unsigned green, 802 - unsigned blue, struct fb_info *info) 803 { 804 /* set bit 5:4 = 01 (write LCD RAM only) */ 805 smtc_seqw(0x66, (smtc_seqr(0x66) & 0xC3) | 0x10); ··· 896 return 0; 897 } 898 899 - static int smtc_setcolreg(unsigned regno, unsigned red, unsigned green, 900 - unsigned blue, unsigned trans, struct fb_info *info) 901 { 902 struct smtcfb_info *sfb; 903 u32 val; ··· 1478 } 1479 1480 /* can support 32 bpp */ 1481 - if (15 == sfb->fb->var.bits_per_pixel) 1482 sfb->fb->var.bits_per_pixel = 16; 1483 1484 sfb->fb->var.xres_virtual = sfb->fb->var.xres;
··· 33 #include "sm712.h" 34 35 /* 36 + * Private structure 37 + */ 38 struct smtcfb_info { 39 struct pci_dev *pdev; 40 struct fb_info *fb; ··· 785 smtc_scr_info.lfb_height = 0; 786 smtc_scr_info.lfb_depth = 0; 787 788 + pr_debug("%s = %s\n", __func__, options); 789 790 for (i = 0; i < ARRAY_SIZE(vesa_mode_table); i++) { 791 if (strstr(options, vesa_mode_table[i].index)) { ··· 798 } 799 } 800 801 + static void sm712_setpalette(int regno, unsigned int red, unsigned int green, 802 + unsigned int blue, struct fb_info *info) 803 { 804 /* set bit 5:4 = 01 (write LCD RAM only) */ 805 smtc_seqw(0x66, (smtc_seqr(0x66) & 0xC3) | 0x10); ··· 896 return 0; 897 } 898 899 + static int smtc_setcolreg(unsigned int regno, unsigned int red, 900 + unsigned int green, unsigned int blue, 901 + unsigned int trans, struct fb_info *info) 902 { 903 struct smtcfb_info *sfb; 904 u32 val; ··· 1477 } 1478 1479 /* can support 32 bpp */ 1480 + if (sfb->fb->var.bits_per_pixel == 15) 1481 sfb->fb->var.bits_per_pixel = 16; 1482 1483 sfb->fb->var.xres_virtual = sfb->fb->var.xres;
+1 -1
drivers/video/fbdev/smscufx.c
··· 122 FBINFO_VIRTFB | FBINFO_HWACCEL_IMAGEBLIT | FBINFO_HWACCEL_FILLRECT | 123 FBINFO_HWACCEL_COPYAREA | FBINFO_MISC_ALWAYS_SETPAR; 124 125 - static struct usb_device_id id_table[] = { 126 {USB_DEVICE(0x0424, 0x9d00),}, 127 {USB_DEVICE(0x0424, 0x9d01),}, 128 {},
··· 122 FBINFO_VIRTFB | FBINFO_HWACCEL_IMAGEBLIT | FBINFO_HWACCEL_FILLRECT | 123 FBINFO_HWACCEL_COPYAREA | FBINFO_MISC_ALWAYS_SETPAR; 124 125 + static const struct usb_device_id id_table[] = { 126 {USB_DEVICE(0x0424, 0x9d00),}, 127 {USB_DEVICE(0x0424, 0x9d01),}, 128 {},
+5 -5
drivers/video/fbdev/sunxvr1000.c
··· 33 gp->depth = of_getintprop_default(gp->of_node, "depth", 32); 34 35 if (!gp->width || !gp->height) { 36 - printk(KERN_ERR "gfb: Critical properties missing for %s\n", 37 - gp->of_node->full_name); 38 return -EINVAL; 39 } 40 ··· 151 if (err) 152 goto err_unmap_fb; 153 154 - printk("gfb: Found device at %s\n", dp->full_name); 155 156 err = register_framebuffer(info); 157 if (err < 0) { 158 - printk(KERN_ERR "gfb: Could not register framebuffer %s\n", 159 - dp->full_name); 160 goto err_unmap_fb; 161 } 162
··· 33 gp->depth = of_getintprop_default(gp->of_node, "depth", 32); 34 35 if (!gp->width || !gp->height) { 36 + printk(KERN_ERR "gfb: Critical properties missing for %pOF\n", 37 + gp->of_node); 38 return -EINVAL; 39 } 40 ··· 151 if (err) 152 goto err_unmap_fb; 153 154 + printk("gfb: Found device at %pOF\n", dp); 155 156 err = register_framebuffer(info); 157 if (err < 0) { 158 + printk(KERN_ERR "gfb: Could not register framebuffer %pOF\n", 159 + dp); 160 goto err_unmap_fb; 161 } 162
+1 -1
drivers/video/fbdev/sunxvr2500.c
··· 220 return err; 221 } 222 223 - static struct pci_device_id s3d_pci_table[] = { 224 { PCI_DEVICE(PCI_VENDOR_ID_3DLABS, 0x002c), }, 225 { PCI_DEVICE(PCI_VENDOR_ID_3DLABS, 0x002d), }, 226 { PCI_DEVICE(PCI_VENDOR_ID_3DLABS, 0x002e), },
··· 220 return err; 221 } 222 223 + static const struct pci_device_id s3d_pci_table[] = { 224 { PCI_DEVICE(PCI_VENDOR_ID_3DLABS, 0x002c), }, 225 { PCI_DEVICE(PCI_VENDOR_ID_3DLABS, 0x002d), }, 226 { PCI_DEVICE(PCI_VENDOR_ID_3DLABS, 0x002e), },
+1 -1
drivers/video/fbdev/sunxvr500.c
··· 393 return err; 394 } 395 396 - static struct pci_device_id e3d_pci_table[] = { 397 { PCI_DEVICE(PCI_VENDOR_ID_3DLABS, 0x7a0), }, 398 { PCI_DEVICE(0x1091, 0x7a0), }, 399 { PCI_DEVICE(PCI_VENDOR_ID_3DLABS, 0x7a2), },
··· 393 return err; 394 } 395 396 + static const struct pci_device_id e3d_pci_table[] = { 397 { PCI_DEVICE(PCI_VENDOR_ID_3DLABS, 0x7a0), }, 398 { PCI_DEVICE(0x1091, 0x7a0), }, 399 { PCI_DEVICE(PCI_VENDOR_ID_3DLABS, 0x7a2), },
+2 -2
drivers/video/fbdev/tcx.c
··· 467 468 dev_set_drvdata(&op->dev, info); 469 470 - printk(KERN_INFO "%s: TCX at %lx:%lx, %s\n", 471 - dp->full_name, 472 par->which_io, 473 info->fix.smem_start, 474 par->lowdepth ? "8-bit only" : "24-bit depth");
··· 467 468 dev_set_drvdata(&op->dev, info); 469 470 + printk(KERN_INFO "%pOF: TCX at %lx:%lx, %s\n", 471 + dp, 472 par->which_io, 473 info->fix.smem_start, 474 par->lowdepth ? "8-bit only" : "24-bit depth");
+1 -1
drivers/video/fbdev/tdfxfb.c
··· 120 static int tdfxfb_probe(struct pci_dev *pdev, const struct pci_device_id *id); 121 static void tdfxfb_remove(struct pci_dev *pdev); 122 123 - static struct pci_device_id tdfxfb_id_table[] = { 124 { PCI_VENDOR_ID_3DFX, PCI_DEVICE_ID_3DFX_BANSHEE, 125 PCI_ANY_ID, PCI_ANY_ID, PCI_BASE_CLASS_DISPLAY << 16, 126 0xff0000, 0 },
··· 120 static int tdfxfb_probe(struct pci_dev *pdev, const struct pci_device_id *id); 121 static void tdfxfb_remove(struct pci_dev *pdev); 122 123 + static const struct pci_device_id tdfxfb_id_table[] = { 124 { PCI_VENDOR_ID_3DFX, PCI_DEVICE_ID_3DFX_BANSHEE, 125 PCI_ANY_ID, PCI_ANY_ID, PCI_BASE_CLASS_DISPLAY << 16, 126 0xff0000, 0 },
+1 -1
drivers/video/fbdev/tridentfb.c
··· 1737 } 1738 1739 /* List of boards that we are trying to support */ 1740 - static struct pci_device_id trident_devices[] = { 1741 {PCI_VENDOR_ID_TRIDENT, BLADE3D, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, 1742 {PCI_VENDOR_ID_TRIDENT, CYBERBLADEi7, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, 1743 {PCI_VENDOR_ID_TRIDENT, CYBERBLADEi7D, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
··· 1737 } 1738 1739 /* List of boards that we are trying to support */ 1740 + static const struct pci_device_id trident_devices[] = { 1741 {PCI_VENDOR_ID_TRIDENT, BLADE3D, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, 1742 {PCI_VENDOR_ID_TRIDENT, CYBERBLADEi7, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, 1743 {PCI_VENDOR_ID_TRIDENT, CYBERBLADEi7D, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
+2 -3
drivers/video/fbdev/udlfb.c
··· 54 * which is compatible with all known USB 2.0 era graphics chips and firmware, 55 * but allows DisplayLink to increment those for any future incompatible chips 56 */ 57 - static struct usb_device_id id_table[] = { 58 {.idVendor = 0x17e9, 59 .bInterfaceClass = 0xff, 60 .bInterfaceSubClass = 0x00, ··· 1465 return count; 1466 } 1467 1468 - static struct bin_attribute edid_attr = { 1469 .attr.name = "edid", 1470 .attr.mode = 0666, 1471 .size = EDID_LENGTH, ··· 1655 error: 1656 if (dev) { 1657 1658 - kref_put(&dev->kref, dlfb_free); /* ref for framebuffer */ 1659 kref_put(&dev->kref, dlfb_free); /* last ref from kref_init */ 1660 1661 /* dev has been deallocated. Do not dereference */
··· 54 * which is compatible with all known USB 2.0 era graphics chips and firmware, 55 * but allows DisplayLink to increment those for any future incompatible chips 56 */ 57 + static const struct usb_device_id id_table[] = { 58 {.idVendor = 0x17e9, 59 .bInterfaceClass = 0xff, 60 .bInterfaceSubClass = 0x00, ··· 1465 return count; 1466 } 1467 1468 + static const struct bin_attribute edid_attr = { 1469 .attr.name = "edid", 1470 .attr.mode = 0666, 1471 .size = EDID_LENGTH, ··· 1655 error: 1656 if (dev) { 1657 1658 kref_put(&dev->kref, dlfb_free); /* last ref from kref_init */ 1659 1660 /* dev has been deallocated. Do not dereference */
+1 -1
drivers/video/fbdev/uvesafb.c
··· 1666 NULL, 1667 }; 1668 1669 - static struct attribute_group uvesafb_dev_attgrp = { 1670 .name = NULL, 1671 .attrs = uvesafb_dev_attrs, 1672 };
··· 1666 NULL, 1667 }; 1668 1669 + static const struct attribute_group uvesafb_dev_attgrp = { 1670 .name = NULL, 1671 .attrs = uvesafb_dev_attrs, 1672 };
+2 -2
drivers/video/fbdev/vermilion/vermilion.c
··· 55 static struct fb_ops vmlfb_ops; 56 static struct vml_sys *subsys = NULL; 57 static char *vml_default_mode = "1024x768@60"; 58 - static struct fb_videomode defaultmode = { 59 NULL, 60, 1024, 768, 12896, 144, 24, 29, 3, 136, 6, 60 0, FB_VMODE_NONINTERLACED 61 }; ··· 1044 .fb_setcolreg = vmlfb_setcolreg 1045 }; 1046 1047 - static struct pci_device_id vml_ids[] = { 1048 {PCI_DEVICE(PCI_VENDOR_ID_INTEL, VML_DEVICE_VDC)}, 1049 {0} 1050 };
··· 55 static struct fb_ops vmlfb_ops; 56 static struct vml_sys *subsys = NULL; 57 static char *vml_default_mode = "1024x768@60"; 58 + static const struct fb_videomode defaultmode = { 59 NULL, 60, 1024, 768, 12896, 144, 24, 29, 3, 136, 6, 60 0, FB_VMODE_NONINTERLACED 61 }; ··· 1044 .fb_setcolreg = vmlfb_setcolreg 1045 }; 1046 1047 + static const struct pci_device_id vml_ids[] = { 1048 {PCI_DEVICE(PCI_VENDOR_ID_INTEL, VML_DEVICE_VDC)}, 1049 {0} 1050 };
+1 -1
drivers/video/fbdev/via/via-core.c
··· 724 } 725 726 727 - static struct pci_device_id via_pci_table[] = { 728 { PCI_DEVICE(PCI_VENDOR_ID_VIA, UNICHROME_CLE266_DID), 729 .driver_data = UNICHROME_CLE266 }, 730 { PCI_DEVICE(PCI_VENDOR_ID_VIA, UNICHROME_K400_DID),
··· 724 } 725 726 727 + static const struct pci_device_id via_pci_table[] = { 728 { PCI_DEVICE(PCI_VENDOR_ID_VIA, UNICHROME_CLE266_DID), 729 .driver_data = UNICHROME_CLE266 }, 730 { PCI_DEVICE(PCI_VENDOR_ID_VIA, UNICHROME_K400_DID),
+2 -2
drivers/video/fbdev/vt8623fb.c
··· 81 static struct vga_regset vt8623_fetch_count_regs[] = {{0x1C, 0, 7}, {0x1D, 0, 1}, VGA_REGSET_END}; 82 static struct vga_regset vt8623_start_address_regs[] = {{0x0d, 0, 7}, {0x0c, 0, 7}, {0x34, 0, 7}, {0x48, 0, 1}, VGA_REGSET_END}; 83 84 - static struct svga_timing_regs vt8623_timing_regs = { 85 vt8623_h_total_regs, vt8623_h_display_regs, vt8623_h_blank_start_regs, 86 vt8623_h_blank_end_regs, vt8623_h_sync_start_regs, vt8623_h_sync_end_regs, 87 vt8623_v_total_regs, vt8623_v_display_regs, vt8623_v_blank_start_regs, ··· 888 889 /* List of boards that we are trying to support */ 890 891 - static struct pci_device_id vt8623_devices[] = { 892 {PCI_DEVICE(PCI_VENDOR_ID_VIA, 0x3122)}, 893 {0, 0, 0, 0, 0, 0, 0} 894 };
··· 81 static struct vga_regset vt8623_fetch_count_regs[] = {{0x1C, 0, 7}, {0x1D, 0, 1}, VGA_REGSET_END}; 82 static struct vga_regset vt8623_start_address_regs[] = {{0x0d, 0, 7}, {0x0c, 0, 7}, {0x34, 0, 7}, {0x48, 0, 1}, VGA_REGSET_END}; 83 84 + static const struct svga_timing_regs vt8623_timing_regs = { 85 vt8623_h_total_regs, vt8623_h_display_regs, vt8623_h_blank_start_regs, 86 vt8623_h_blank_end_regs, vt8623_h_sync_start_regs, vt8623_h_sync_end_regs, 87 vt8623_v_total_regs, vt8623_v_display_regs, vt8623_v_blank_start_regs, ··· 888 889 /* List of boards that we are trying to support */ 890 891 + static const struct pci_device_id vt8623_devices[] = { 892 {PCI_DEVICE(PCI_VENDOR_ID_VIA, 0x3122)}, 893 {0, 0, 0, 0, 0, 0, 0} 894 };
+31 -31
drivers/video/fbdev/xilinxfb.c
··· 41 42 #define DRIVER_NAME "xilinxfb" 43 44 - 45 /* 46 * Xilinx calls it "TFT LCD Controller" though it can also be used for 47 * the VGA port on the Xilinx ML40x board. This is a hardware display ··· 91 u32 xvirt, yvirt; /* resolution of memory buffer */ 92 93 /* Physical address of framebuffer memory; If non-zero, driver 94 - * will use provided memory address instead of allocating one from 95 - * the consistent pool. */ 96 u32 fb_phys; 97 }; 98 99 /* 100 * Default xilinxfb configuration 101 */ 102 - static struct xilinxfb_platform_data xilinx_fb_default_pdata = { 103 .xres = 640, 104 .yres = 480, 105 .xvirt = 1024, ··· 110 /* 111 * Here are the default fb_fix_screeninfo and fb_var_screeninfo structures 112 */ 113 - static struct fb_fix_screeninfo xilinx_fb_fix = { 114 .id = "Xilinx", 115 .type = FB_TYPE_PACKED_PIXELS, 116 .visual = FB_VISUAL_TRUECOLOR, 117 .accel = FB_ACCEL_NONE 118 }; 119 120 - static struct fb_var_screeninfo xilinx_fb_var = { 121 .bits_per_pixel = BITS_PER_PIXEL, 122 123 .red = { RED_SHIFT, 8, 0 }, ··· 128 .activate = FB_ACTIVATE_NOW 129 }; 130 131 - 132 #define BUS_ACCESS_FLAG 0x1 /* 1 = BUS, 0 = DCR */ 133 #define LITTLE_ENDIAN_ACCESS 0x2 /* LITTLE ENDIAN IO functions */ 134 135 struct xilinxfb_drvdata { 136 - 137 struct fb_info info; /* FB driver info record */ 138 139 phys_addr_t regs_phys; /* phys. address of the control 140 - registers */ 141 void __iomem *regs; /* virt. address of the control 142 - registers */ 143 #ifdef CONFIG_PPC_DCR 144 dcr_host_t dcr_host; 145 unsigned int dcr_len; ··· 148 dma_addr_t fb_phys; /* phys. address of the frame buffer */ 149 int fb_alloced; /* Flag, was the fb memory alloced? */ 150 151 - u8 flags; /* features of the driver */ 152 153 u32 reg_ctrl_default; 154 ··· 165 * which bus its connected and call the appropriate write API. 166 */ 167 static void xilinx_fb_out32(struct xilinxfb_drvdata *drvdata, u32 offset, 168 - u32 val) 169 { 170 if (drvdata->flags & BUS_ACCESS_FLAG) { 171 if (drvdata->flags & LITTLE_ENDIAN_ACCESS) ··· 195 } 196 197 static int 198 - xilinx_fb_setcolreg(unsigned regno, unsigned red, unsigned green, unsigned blue, 199 - unsigned transp, struct fb_info *fbi) 200 { 201 u32 *palette = fbi->pseudo_palette; 202 ··· 205 206 if (fbi->var.grayscale) { 207 /* Convert color to grayscale. 208 - * grayscale = 0.30*R + 0.59*G + 0.11*B */ 209 - red = green = blue = 210 - (red * 77 + green * 151 + blue * 28 + 127) >> 8; 211 } 212 213 /* fbi->fix.visual is always FB_VISUAL_TRUECOLOR */ ··· 243 xilinx_fb_out32(drvdata, REG_CTRL, 0); 244 default: 245 break; 246 - 247 } 248 return 0; /* success */ 249 } 250 251 - static struct fb_ops xilinxfb_ops = 252 - { 253 .owner = THIS_MODULE, 254 .fb_setcolreg = xilinx_fb_setcolreg, 255 .fb_blank = xilinx_fb_blank, ··· 286 } else { 287 drvdata->fb_alloced = 1; 288 drvdata->fb_virt = dma_alloc_coherent(dev, PAGE_ALIGN(fbsize), 289 - &drvdata->fb_phys, GFP_KERNEL); 290 } 291 292 if (!drvdata->fb_virt) { ··· 301 /* Tell the hardware where the frame buffer is */ 302 xilinx_fb_out32(drvdata, REG_FB_ADDR, drvdata->fb_phys); 303 rc = xilinx_fb_in32(drvdata, REG_FB_ADDR); 304 - /* Endianess detection */ 305 if (rc != drvdata->fb_phys) { 306 drvdata->flags |= LITTLE_ENDIAN_ACCESS; 307 xilinx_fb_out32(drvdata, REG_FB_ADDR, drvdata->fb_phys); ··· 311 drvdata->reg_ctrl_default = REG_CTRL_ENABLE; 312 if (pdata->rotate_screen) 313 drvdata->reg_ctrl_default |= REG_CTRL_ROTATE; 314 - xilinx_fb_out32(drvdata, REG_CTRL, 315 - drvdata->reg_ctrl_default); 316 317 /* Fill struct fb_info */ 318 drvdata->info.device = dev; ··· 364 err_cmap: 365 if (drvdata->fb_alloced) 366 dma_free_coherent(dev, PAGE_ALIGN(fbsize), drvdata->fb_virt, 367 - drvdata->fb_phys); 368 else 369 iounmap(drvdata->fb_virt); 370 ··· 435 * Fill the resource structure if its direct BUS interface 436 * otherwise fill the dcr_host structure. 437 */ 438 - if (tft_access) { 439 drvdata->flags |= BUS_ACCESS_FLAG; 440 - } 441 #ifdef CONFIG_PPC_DCR 442 else { 443 int start; 444 start = dcr_resource_start(pdev->dev.of_node, 0); 445 drvdata->dcr_len = dcr_resource_len(pdev->dev.of_node, 0); 446 drvdata->dcr_host = dcr_map(pdev->dev.of_node, start, drvdata->dcr_len); ··· 452 #endif 453 454 prop = of_get_property(pdev->dev.of_node, "phys-size", &size); 455 - if ((prop) && (size >= sizeof(u32)*2)) { 456 pdata.screen_width_mm = prop[0]; 457 pdata.screen_height_mm = prop[1]; 458 } 459 460 prop = of_get_property(pdev->dev.of_node, "resolution", &size); 461 - if ((prop) && (size >= sizeof(u32)*2)) { 462 pdata.xres = prop[0]; 463 pdata.yres = prop[1]; 464 } 465 466 prop = of_get_property(pdev->dev.of_node, "virtual-resolution", &size); 467 - if ((prop) && (size >= sizeof(u32)*2)) { 468 pdata.xvirt = prop[0]; 469 pdata.yvirt = prop[1]; 470 } ··· 482 } 483 484 /* Match table for of_platform binding */ 485 - static struct of_device_id xilinxfb_of_match[] = { 486 { .compatible = "xlnx,xps-tft-1.00.a", }, 487 { .compatible = "xlnx,xps-tft-2.00.a", }, 488 { .compatible = "xlnx,xps-tft-2.01.a", },
··· 41 42 #define DRIVER_NAME "xilinxfb" 43 44 /* 45 * Xilinx calls it "TFT LCD Controller" though it can also be used for 46 * the VGA port on the Xilinx ML40x board. This is a hardware display ··· 92 u32 xvirt, yvirt; /* resolution of memory buffer */ 93 94 /* Physical address of framebuffer memory; If non-zero, driver 95 + * will use provided memory address instead of allocating one from 96 + * the consistent pool. 97 + */ 98 u32 fb_phys; 99 }; 100 101 /* 102 * Default xilinxfb configuration 103 */ 104 + static const struct xilinxfb_platform_data xilinx_fb_default_pdata = { 105 .xres = 640, 106 .yres = 480, 107 .xvirt = 1024, ··· 110 /* 111 * Here are the default fb_fix_screeninfo and fb_var_screeninfo structures 112 */ 113 + static const struct fb_fix_screeninfo xilinx_fb_fix = { 114 .id = "Xilinx", 115 .type = FB_TYPE_PACKED_PIXELS, 116 .visual = FB_VISUAL_TRUECOLOR, 117 .accel = FB_ACCEL_NONE 118 }; 119 120 + static const struct fb_var_screeninfo xilinx_fb_var = { 121 .bits_per_pixel = BITS_PER_PIXEL, 122 123 .red = { RED_SHIFT, 8, 0 }, ··· 128 .activate = FB_ACTIVATE_NOW 129 }; 130 131 #define BUS_ACCESS_FLAG 0x1 /* 1 = BUS, 0 = DCR */ 132 #define LITTLE_ENDIAN_ACCESS 0x2 /* LITTLE ENDIAN IO functions */ 133 134 struct xilinxfb_drvdata { 135 struct fb_info info; /* FB driver info record */ 136 137 phys_addr_t regs_phys; /* phys. address of the control 138 + * registers 139 + */ 140 void __iomem *regs; /* virt. address of the control 141 + * registers 142 + */ 143 #ifdef CONFIG_PPC_DCR 144 dcr_host_t dcr_host; 145 unsigned int dcr_len; ··· 148 dma_addr_t fb_phys; /* phys. address of the frame buffer */ 149 int fb_alloced; /* Flag, was the fb memory alloced? */ 150 151 + u8 flags; /* features of the driver */ 152 153 u32 reg_ctrl_default; 154 ··· 165 * which bus its connected and call the appropriate write API. 166 */ 167 static void xilinx_fb_out32(struct xilinxfb_drvdata *drvdata, u32 offset, 168 + u32 val) 169 { 170 if (drvdata->flags & BUS_ACCESS_FLAG) { 171 if (drvdata->flags & LITTLE_ENDIAN_ACCESS) ··· 195 } 196 197 static int 198 + xilinx_fb_setcolreg(unsigned int regno, unsigned int red, unsigned int green, 199 + unsigned int blue, unsigned int transp, struct fb_info *fbi) 200 { 201 u32 *palette = fbi->pseudo_palette; 202 ··· 205 206 if (fbi->var.grayscale) { 207 /* Convert color to grayscale. 208 + * grayscale = 0.30*R + 0.59*G + 0.11*B 209 + */ 210 + blue = (red * 77 + green * 151 + blue * 28 + 127) >> 8; 211 + green = blue; 212 + red = green; 213 } 214 215 /* fbi->fix.visual is always FB_VISUAL_TRUECOLOR */ ··· 241 xilinx_fb_out32(drvdata, REG_CTRL, 0); 242 default: 243 break; 244 } 245 return 0; /* success */ 246 } 247 248 + static struct fb_ops xilinxfb_ops = { 249 .owner = THIS_MODULE, 250 .fb_setcolreg = xilinx_fb_setcolreg, 251 .fb_blank = xilinx_fb_blank, ··· 286 } else { 287 drvdata->fb_alloced = 1; 288 drvdata->fb_virt = dma_alloc_coherent(dev, PAGE_ALIGN(fbsize), 289 + &drvdata->fb_phys, 290 + GFP_KERNEL); 291 } 292 293 if (!drvdata->fb_virt) { ··· 300 /* Tell the hardware where the frame buffer is */ 301 xilinx_fb_out32(drvdata, REG_FB_ADDR, drvdata->fb_phys); 302 rc = xilinx_fb_in32(drvdata, REG_FB_ADDR); 303 + /* Endianness detection */ 304 if (rc != drvdata->fb_phys) { 305 drvdata->flags |= LITTLE_ENDIAN_ACCESS; 306 xilinx_fb_out32(drvdata, REG_FB_ADDR, drvdata->fb_phys); ··· 310 drvdata->reg_ctrl_default = REG_CTRL_ENABLE; 311 if (pdata->rotate_screen) 312 drvdata->reg_ctrl_default |= REG_CTRL_ROTATE; 313 + xilinx_fb_out32(drvdata, REG_CTRL, drvdata->reg_ctrl_default); 314 315 /* Fill struct fb_info */ 316 drvdata->info.device = dev; ··· 364 err_cmap: 365 if (drvdata->fb_alloced) 366 dma_free_coherent(dev, PAGE_ALIGN(fbsize), drvdata->fb_virt, 367 + drvdata->fb_phys); 368 else 369 iounmap(drvdata->fb_virt); 370 ··· 435 * Fill the resource structure if its direct BUS interface 436 * otherwise fill the dcr_host structure. 437 */ 438 + if (tft_access) 439 drvdata->flags |= BUS_ACCESS_FLAG; 440 #ifdef CONFIG_PPC_DCR 441 else { 442 int start; 443 + 444 start = dcr_resource_start(pdev->dev.of_node, 0); 445 drvdata->dcr_len = dcr_resource_len(pdev->dev.of_node, 0); 446 drvdata->dcr_host = dcr_map(pdev->dev.of_node, start, drvdata->dcr_len); ··· 452 #endif 453 454 prop = of_get_property(pdev->dev.of_node, "phys-size", &size); 455 + if ((prop) && (size >= sizeof(u32) * 2)) { 456 pdata.screen_width_mm = prop[0]; 457 pdata.screen_height_mm = prop[1]; 458 } 459 460 prop = of_get_property(pdev->dev.of_node, "resolution", &size); 461 + if ((prop) && (size >= sizeof(u32) * 2)) { 462 pdata.xres = prop[0]; 463 pdata.yres = prop[1]; 464 } 465 466 prop = of_get_property(pdev->dev.of_node, "virtual-resolution", &size); 467 + if ((prop) && (size >= sizeof(u32) * 2)) { 468 pdata.xvirt = prop[0]; 469 pdata.yvirt = prop[1]; 470 } ··· 482 } 483 484 /* Match table for of_platform binding */ 485 + static const struct of_device_id xilinxfb_of_match[] = { 486 { .compatible = "xlnx,xps-tft-1.00.a", }, 487 { .compatible = "xlnx,xps-tft-2.00.a", }, 488 { .compatible = "xlnx,xps-tft-2.01.a", },
+16 -25
drivers/video/of_display_timing.c
··· 31 32 prop = of_find_property(np, name, &length); 33 if (!prop) { 34 - pr_err("%s: could not find property %s\n", 35 - of_node_full_name(np), name); 36 return -EINVAL; 37 } 38 ··· 43 } else if (cells == 3) { 44 ret = of_property_read_u32_array(np, name, &result->min, cells); 45 } else { 46 - pr_err("%s: illegal timing specification in %s\n", 47 - of_node_full_name(np), name); 48 return -EINVAL; 49 } 50 ··· 103 dt->flags |= DISPLAY_FLAGS_DOUBLECLK; 104 105 if (ret) { 106 - pr_err("%s: error reading timing properties\n", 107 - of_node_full_name(np)); 108 return -EINVAL; 109 } 110 ··· 126 127 timing_np = of_get_child_by_name(np, name); 128 if (!timing_np) { 129 - pr_err("%s: could not find node '%s'\n", 130 - of_node_full_name(np), name); 131 return -ENOENT; 132 } 133 ··· 150 151 timings_np = of_get_child_by_name(np, "display-timings"); 152 if (!timings_np) { 153 - pr_err("%s: could not find display-timings node\n", 154 - of_node_full_name(np)); 155 return NULL; 156 } 157 158 disp = kzalloc(sizeof(*disp), GFP_KERNEL); 159 if (!disp) { 160 - pr_err("%s: could not allocate struct disp'\n", 161 - of_node_full_name(np)); 162 goto dispfail; 163 } 164 ··· 166 entry = of_get_next_child(timings_np, NULL); 167 /* if there is no child, it is useless to go on */ 168 if (!entry) { 169 - pr_err("%s: no timing specifications given\n", 170 - of_node_full_name(np)); 171 goto entryfail; 172 } 173 174 - pr_debug("%s: using %s as default timing\n", 175 - of_node_full_name(np), entry->name); 176 177 native_mode = entry; 178 179 disp->num_timings = of_get_child_count(timings_np); 180 if (disp->num_timings == 0) { 181 /* should never happen, as entry was already found above */ 182 - pr_err("%s: no timings specified\n", of_node_full_name(np)); 183 goto entryfail; 184 } 185 186 disp->timings = kzalloc(sizeof(struct display_timing *) * 187 disp->num_timings, GFP_KERNEL); 188 if (!disp->timings) { 189 - pr_err("%s: could not allocate timings array\n", 190 - of_node_full_name(np)); 191 goto entryfail; 192 } 193 ··· 197 198 dt = kzalloc(sizeof(*dt), GFP_KERNEL); 199 if (!dt) { 200 - pr_err("%s: could not allocate display_timing struct\n", 201 - of_node_full_name(np)); 202 goto timingfail; 203 } 204 ··· 208 * to not encourage wrong devicetrees, fail in case of 209 * an error 210 */ 211 - pr_err("%s: error in timing %d\n", 212 - of_node_full_name(np), disp->num_timings + 1); 213 kfree(dt); 214 goto timingfail; 215 } ··· 227 */ 228 of_node_put(native_mode); 229 230 - pr_debug("%s: got %d timings. Using timing #%d as default\n", 231 - of_node_full_name(np), disp->num_timings, 232 disp->native_mode + 1); 233 234 return disp;
··· 31 32 prop = of_find_property(np, name, &length); 33 if (!prop) { 34 + pr_err("%pOF: could not find property %s\n", np, name); 35 return -EINVAL; 36 } 37 ··· 44 } else if (cells == 3) { 45 ret = of_property_read_u32_array(np, name, &result->min, cells); 46 } else { 47 + pr_err("%pOF: illegal timing specification in %s\n", np, name); 48 return -EINVAL; 49 } 50 ··· 105 dt->flags |= DISPLAY_FLAGS_DOUBLECLK; 106 107 if (ret) { 108 + pr_err("%pOF: error reading timing properties\n", np); 109 return -EINVAL; 110 } 111 ··· 129 130 timing_np = of_get_child_by_name(np, name); 131 if (!timing_np) { 132 + pr_err("%pOF: could not find node '%s'\n", np, name); 133 return -ENOENT; 134 } 135 ··· 154 155 timings_np = of_get_child_by_name(np, "display-timings"); 156 if (!timings_np) { 157 + pr_err("%pOF: could not find display-timings node\n", np); 158 return NULL; 159 } 160 161 disp = kzalloc(sizeof(*disp), GFP_KERNEL); 162 if (!disp) { 163 + pr_err("%pOF: could not allocate struct disp'\n", np); 164 goto dispfail; 165 } 166 ··· 172 entry = of_get_next_child(timings_np, NULL); 173 /* if there is no child, it is useless to go on */ 174 if (!entry) { 175 + pr_err("%pOF: no timing specifications given\n", np); 176 goto entryfail; 177 } 178 179 + pr_debug("%pOF: using %s as default timing\n", np, entry->name); 180 181 native_mode = entry; 182 183 disp->num_timings = of_get_child_count(timings_np); 184 if (disp->num_timings == 0) { 185 /* should never happen, as entry was already found above */ 186 + pr_err("%pOF: no timings specified\n", np); 187 goto entryfail; 188 } 189 190 disp->timings = kzalloc(sizeof(struct display_timing *) * 191 disp->num_timings, GFP_KERNEL); 192 if (!disp->timings) { 193 + pr_err("%pOF: could not allocate timings array\n", np); 194 goto entryfail; 195 } 196 ··· 206 207 dt = kzalloc(sizeof(*dt), GFP_KERNEL); 208 if (!dt) { 209 + pr_err("%pOF: could not allocate display_timing struct\n", 210 + np); 211 goto timingfail; 212 } 213 ··· 217 * to not encourage wrong devicetrees, fail in case of 218 * an error 219 */ 220 + pr_err("%pOF: error in timing %d\n", 221 + np, disp->num_timings + 1); 222 kfree(dt); 223 goto timingfail; 224 } ··· 236 */ 237 of_node_put(native_mode); 238 239 + pr_debug("%pOF: got %d timings. Using timing #%d as default\n", 240 + np, disp->num_timings, 241 disp->native_mode + 1); 242 243 return disp;
+1 -1
drivers/video/of_videomode.c
··· 36 37 disp = of_get_display_timings(np); 38 if (!disp) { 39 - pr_err("%s: no timings specified\n", of_node_full_name(np)); 40 return -EINVAL; 41 } 42
··· 36 37 disp = of_get_display_timings(np); 38 if (!disp) { 39 + pr_err("%pOF: no timings specified\n", np); 40 return -EINVAL; 41 } 42
+1 -9
include/linux/fb.h
··· 400 #endif /* CONFIG_FB_TILEBLITTING */ 401 402 /* FBINFO_* = fb_info.flags bit flags */ 403 - #define FBINFO_MODULE 0x0001 /* Low-level driver is a module */ 404 #define FBINFO_HWACCEL_DISABLED 0x0002 405 /* When FBINFO_HWACCEL_DISABLED is set: 406 * Hardware acceleration is turned off. Software implementations ··· 533 return a; 534 } 535 536 - #ifdef MODULE 537 - #define FBINFO_DEFAULT FBINFO_MODULE 538 - #else 539 - #define FBINFO_DEFAULT 0 540 - #endif 541 - 542 - // This will go away 543 - #define FBINFO_FLAG_MODULE FBINFO_MODULE 544 #define FBINFO_FLAG_DEFAULT FBINFO_DEFAULT 545 546 /* This will go away
··· 400 #endif /* CONFIG_FB_TILEBLITTING */ 401 402 /* FBINFO_* = fb_info.flags bit flags */ 403 + #define FBINFO_DEFAULT 0 404 #define FBINFO_HWACCEL_DISABLED 0x0002 405 /* When FBINFO_HWACCEL_DISABLED is set: 406 * Hardware acceleration is turned off. Software implementations ··· 533 return a; 534 } 535 536 #define FBINFO_FLAG_DEFAULT FBINFO_DEFAULT 537 538 /* This will go away
+12
include/linux/fbcon.h
···
··· 1 + #ifndef _LINUX_FBCON_H 2 + #define _LINUX_FBCON_H 3 + 4 + #ifdef CONFIG_FRAMEBUFFER_CONSOLE 5 + void __init fb_console_init(void); 6 + void __exit fb_console_exit(void); 7 + #else 8 + static inline void fb_console_init(void) {} 9 + static inline void fb_console_exit(void) {} 10 + #endif 11 + 12 + #endif /* _LINUX_FBCON_H */