Commit b73deed3 authored by Antonino A. Daplas's avatar Antonino A. Daplas Committed by Linus Torvalds

[PATCH] fbcon: Sanitize fbcon

Do not pass the structure display since fbcon is already keeping the pointer
to the current display.
Signed-off-by: default avatarAntonino Daplas <adaplas@pol.net>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 8416131d
...@@ -234,14 +234,14 @@ static void bit_clear_margins(struct vc_data *vc, struct fb_info *info, ...@@ -234,14 +234,14 @@ static void bit_clear_margins(struct vc_data *vc, struct fb_info *info,
} }
} }
static void bit_cursor(struct vc_data *vc, struct fb_info *info, static void bit_cursor(struct vc_data *vc, struct fb_info *info, int mode,
struct display *p, int mode, int softback_lines, int fg, int bg) int softback_lines, int fg, int bg)
{ {
struct fb_cursor cursor; struct fb_cursor cursor;
struct fbcon_ops *ops = (struct fbcon_ops *) info->fbcon_par; struct fbcon_ops *ops = info->fbcon_par;
unsigned short charmask = vc->vc_hi_font_mask ? 0x1ff : 0xff; unsigned short charmask = vc->vc_hi_font_mask ? 0x1ff : 0xff;
int w = (vc->vc_font.width + 7) >> 3, c; int w = (vc->vc_font.width + 7) >> 3, c;
int y = real_y(p, vc->vc_y); int y = real_y(ops->p, vc->vc_y);
int attribute, use_sw = (vc->vc_cursor_type & 0x10); int attribute, use_sw = (vc->vc_cursor_type & 0x10);
int err = 1; int err = 1;
char *src; char *src;
...@@ -310,7 +310,7 @@ static void bit_cursor(struct vc_data *vc, struct fb_info *info, ...@@ -310,7 +310,7 @@ static void bit_cursor(struct vc_data *vc, struct fb_info *info,
} }
if (cursor.set & FB_CUR_SETSIZE || if (cursor.set & FB_CUR_SETSIZE ||
vc->vc_cursor_type != p->cursor_shape || vc->vc_cursor_type != ops->p->cursor_shape ||
ops->cursor_state.mask == NULL || ops->cursor_state.mask == NULL ||
ops->cursor_reset) { ops->cursor_reset) {
char *mask = kmalloc(w*vc->vc_font.height, GFP_ATOMIC); char *mask = kmalloc(w*vc->vc_font.height, GFP_ATOMIC);
...@@ -323,10 +323,10 @@ static void bit_cursor(struct vc_data *vc, struct fb_info *info, ...@@ -323,10 +323,10 @@ static void bit_cursor(struct vc_data *vc, struct fb_info *info,
kfree(ops->cursor_state.mask); kfree(ops->cursor_state.mask);
ops->cursor_state.mask = mask; ops->cursor_state.mask = mask;
p->cursor_shape = vc->vc_cursor_type; ops->p->cursor_shape = vc->vc_cursor_type;
cursor.set |= FB_CUR_SETSHAPE; cursor.set |= FB_CUR_SETSHAPE;
switch (p->cursor_shape & CUR_HWMASK) { switch (ops->p->cursor_shape & CUR_HWMASK) {
case CUR_NONE: case CUR_NONE:
cur_height = 0; cur_height = 0;
break; break;
......
...@@ -209,13 +209,13 @@ static irqreturn_t fb_vbl_detect(int irq, void *dummy, struct pt_regs *fp) ...@@ -209,13 +209,13 @@ static irqreturn_t fb_vbl_detect(int irq, void *dummy, struct pt_regs *fp)
#endif #endif
#ifdef CONFIG_FRAMEBUFFER_CONSOLE_ROTATION #ifdef CONFIG_FRAMEBUFFER_CONSOLE_ROTATION
static inline void fbcon_set_rotation(struct fb_info *info, struct display *p) static inline void fbcon_set_rotation(struct fb_info *info)
{ {
struct fbcon_ops *ops = info->fbcon_par; struct fbcon_ops *ops = info->fbcon_par;
if (!(info->flags & FBINFO_MISC_TILEBLITTING) && if (!(info->flags & FBINFO_MISC_TILEBLITTING) &&
p->con_rotate < 4) ops->p->con_rotate < 4)
ops->rotate = p->con_rotate; ops->rotate = ops->p->con_rotate;
else else
ops->rotate = 0; ops->rotate = 0;
} }
...@@ -265,7 +265,7 @@ static void fbcon_rotate_all(struct fb_info *info, u32 rotate) ...@@ -265,7 +265,7 @@ static void fbcon_rotate_all(struct fb_info *info, u32 rotate)
fbcon_set_all_vcs(info); fbcon_set_all_vcs(info);
} }
#else #else
static inline void fbcon_set_rotation(struct fb_info *info, struct display *p) static inline void fbcon_set_rotation(struct fb_info *info)
{ {
struct fbcon_ops *ops = info->fbcon_par; struct fbcon_ops *ops = info->fbcon_par;
...@@ -402,7 +402,7 @@ static void fb_flashcursor(void *private) ...@@ -402,7 +402,7 @@ static void fb_flashcursor(void *private)
c = scr_readw((u16 *) vc->vc_pos); c = scr_readw((u16 *) vc->vc_pos);
mode = (!ops->cursor_flash || ops->cursor_state.enable) ? mode = (!ops->cursor_flash || ops->cursor_state.enable) ?
CM_ERASE : CM_DRAW; CM_ERASE : CM_DRAW;
ops->cursor(vc, info, p, mode, softback_lines, get_color(vc, info, c, 1), ops->cursor(vc, info, mode, softback_lines, get_color(vc, info, c, 1),
get_color(vc, info, c, 0)); get_color(vc, info, c, 0));
release_console_sem(); release_console_sem();
} }
...@@ -647,29 +647,27 @@ static void fbcon_prepare_logo(struct vc_data *vc, struct fb_info *info, ...@@ -647,29 +647,27 @@ static void fbcon_prepare_logo(struct vc_data *vc, struct fb_info *info,
} }
#ifdef CONFIG_FB_TILEBLITTING #ifdef CONFIG_FB_TILEBLITTING
static void set_blitting_type(struct vc_data *vc, struct fb_info *info, static void set_blitting_type(struct vc_data *vc, struct fb_info *info)
struct display *p)
{ {
struct fbcon_ops *ops = info->fbcon_par; struct fbcon_ops *ops = info->fbcon_par;
ops->p = (p) ? p : &fb_display[vc->vc_num]; ops->p = &fb_display[vc->vc_num];
if ((info->flags & FBINFO_MISC_TILEBLITTING)) if ((info->flags & FBINFO_MISC_TILEBLITTING))
fbcon_set_tileops(vc, info, p, ops); fbcon_set_tileops(vc, info);
else { else {
fbcon_set_rotation(info, ops->p); fbcon_set_rotation(info);
fbcon_set_bitops(ops); fbcon_set_bitops(ops);
} }
} }
#else #else
static void set_blitting_type(struct vc_data *vc, struct fb_info *info, static void set_blitting_type(struct vc_data *vc, struct fb_info *info)
struct display *p)
{ {
struct fbcon_ops *ops = info->fbcon_par; struct fbcon_ops *ops = info->fbcon_par;
info->flags &= ~FBINFO_MISC_TILEBLITTING; info->flags &= ~FBINFO_MISC_TILEBLITTING;
ops->p = (p) ? p : &fb_display[vc->vc_num]; ops->p = &fb_display[vc->vc_num];
fbcon_set_rotation(info, ops->p); fbcon_set_rotation(info);
fbcon_set_bitops(ops); fbcon_set_bitops(ops);
} }
#endif /* CONFIG_MISC_TILEBLITTING */ #endif /* CONFIG_MISC_TILEBLITTING */
...@@ -697,7 +695,7 @@ static int con2fb_acquire_newinfo(struct vc_data *vc, struct fb_info *info, ...@@ -697,7 +695,7 @@ static int con2fb_acquire_newinfo(struct vc_data *vc, struct fb_info *info,
if (!err) { if (!err) {
memset(ops, 0, sizeof(struct fbcon_ops)); memset(ops, 0, sizeof(struct fbcon_ops));
info->fbcon_par = ops; info->fbcon_par = ops;
set_blitting_type(vc, info, NULL); set_blitting_type(vc, info);
} }
if (err) { if (err) {
...@@ -933,7 +931,7 @@ static const char *fbcon_startup(void) ...@@ -933,7 +931,7 @@ static const char *fbcon_startup(void)
ops->cur_rotate = -1; ops->cur_rotate = -1;
info->fbcon_par = ops; info->fbcon_par = ops;
p->con_rotate = rotate; p->con_rotate = rotate;
set_blitting_type(vc, info, NULL); set_blitting_type(vc, info);
if (info->fix.type != FB_TYPE_TEXT) { if (info->fix.type != FB_TYPE_TEXT) {
if (fbcon_softback_size) { if (fbcon_softback_size) {
...@@ -1093,7 +1091,7 @@ static void fbcon_init(struct vc_data *vc, int init) ...@@ -1093,7 +1091,7 @@ static void fbcon_init(struct vc_data *vc, int init)
ops = info->fbcon_par; ops = info->fbcon_par;
p->con_rotate = rotate; p->con_rotate = rotate;
set_blitting_type(vc, info, NULL); set_blitting_type(vc, info);
cols = vc->vc_cols; cols = vc->vc_cols;
rows = vc->vc_rows; rows = vc->vc_rows;
...@@ -1141,9 +1139,9 @@ static void fbcon_init(struct vc_data *vc, int init) ...@@ -1141,9 +1139,9 @@ static void fbcon_init(struct vc_data *vc, int init)
if (vc == svc && softback_buf) if (vc == svc && softback_buf)
fbcon_update_softback(vc); fbcon_update_softback(vc);
if (ops->rotate_font && ops->rotate_font(info, vc, p)) { if (ops->rotate_font && ops->rotate_font(info, vc)) {
ops->rotate = FB_ROTATE_UR; ops->rotate = FB_ROTATE_UR;
set_blitting_type(vc, info, p); set_blitting_type(vc, info);
} }
} }
...@@ -1243,7 +1241,6 @@ static void fbcon_cursor(struct vc_data *vc, int mode) ...@@ -1243,7 +1241,6 @@ static void fbcon_cursor(struct vc_data *vc, int mode)
{ {
struct fb_info *info = registered_fb[con2fb_map[vc->vc_num]]; struct fb_info *info = registered_fb[con2fb_map[vc->vc_num]];
struct fbcon_ops *ops = info->fbcon_par; struct fbcon_ops *ops = info->fbcon_par;
struct display *p = &fb_display[vc->vc_num];
int y; int y;
int c = scr_readw((u16 *) vc->vc_pos); int c = scr_readw((u16 *) vc->vc_pos);
...@@ -1260,7 +1257,7 @@ static void fbcon_cursor(struct vc_data *vc, int mode) ...@@ -1260,7 +1257,7 @@ static void fbcon_cursor(struct vc_data *vc, int mode)
y = 0; y = 0;
} }
ops->cursor(vc, info, p, mode, y, get_color(vc, info, c, 1), ops->cursor(vc, info, mode, y, get_color(vc, info, c, 1),
get_color(vc, info, c, 0)); get_color(vc, info, c, 0));
vbl_cursor_cnt = CURSOR_DRAW_DELAY; vbl_cursor_cnt = CURSOR_DRAW_DELAY;
} }
...@@ -2111,12 +2108,12 @@ static int fbcon_switch(struct vc_data *vc) ...@@ -2111,12 +2108,12 @@ static int fbcon_switch(struct vc_data *vc)
fbcon_add_cursor_timer(info); fbcon_add_cursor_timer(info);
} }
set_blitting_type(vc, info, p); set_blitting_type(vc, info);
ops->cursor_reset = 1; ops->cursor_reset = 1;
if (ops->rotate_font && ops->rotate_font(info, vc, p)) { if (ops->rotate_font && ops->rotate_font(info, vc)) {
ops->rotate = FB_ROTATE_UR; ops->rotate = FB_ROTATE_UR;
set_blitting_type(vc, info, p); set_blitting_type(vc, info);
} }
vc->vc_can_do_color = (fb_get_color_depth(&info->var, &info->fix)!=1); vc->vc_can_do_color = (fb_get_color_depth(&info->var, &info->fix)!=1);
...@@ -2739,7 +2736,7 @@ static void fbcon_modechanged(struct fb_info *info) ...@@ -2739,7 +2736,7 @@ static void fbcon_modechanged(struct fb_info *info)
return; return;
p = &fb_display[vc->vc_num]; p = &fb_display[vc->vc_num];
set_blitting_type(vc, info, p); set_blitting_type(vc, info);
if (CON_IS_VISIBLE(vc)) { if (CON_IS_VISIBLE(vc)) {
var_to_display(p, &info->var, info); var_to_display(p, &info->var, info);
...@@ -2781,7 +2778,7 @@ static void fbcon_set_all_vcs(struct fb_info *info) ...@@ -2781,7 +2778,7 @@ static void fbcon_set_all_vcs(struct fb_info *info)
continue; continue;
p = &fb_display[vc->vc_num]; p = &fb_display[vc->vc_num];
set_blitting_type(vc, info, p); set_blitting_type(vc, info);
var_to_display(p, &info->var, info); var_to_display(p, &info->var, info);
cols = FBCON_SWAP(ops->rotate, info->var.xres, info->var.yres); cols = FBCON_SWAP(ops->rotate, info->var.xres, info->var.yres);
rows = FBCON_SWAP(ops->rotate, info->var.yres, info->var.xres); rows = FBCON_SWAP(ops->rotate, info->var.yres, info->var.xres);
......
...@@ -62,12 +62,10 @@ struct fbcon_ops { ...@@ -62,12 +62,10 @@ struct fbcon_ops {
int fg, int bg); int fg, int bg);
void (*clear_margins)(struct vc_data *vc, struct fb_info *info, void (*clear_margins)(struct vc_data *vc, struct fb_info *info,
int bottom_only); int bottom_only);
void (*cursor)(struct vc_data *vc, struct fb_info *info, void (*cursor)(struct vc_data *vc, struct fb_info *info, int mode,
struct display *p, int mode, int softback_lines, int softback_lines, int fg, int bg);
int fg, int bg);
int (*update_start)(struct fb_info *info); int (*update_start)(struct fb_info *info);
int (*rotate_font)(struct fb_info *info, struct vc_data *vc, int (*rotate_font)(struct fb_info *info, struct vc_data *vc);
struct display *p);
struct fb_var_screeninfo var; /* copy of the current fb_var_screeninfo */ struct fb_var_screeninfo var; /* copy of the current fb_var_screeninfo */
struct timer_list cursor_timer; /* Cursor timer */ struct timer_list cursor_timer; /* Cursor timer */
struct fb_cursor cursor_state; struct fb_cursor cursor_state;
...@@ -173,8 +171,7 @@ struct fbcon_ops { ...@@ -173,8 +171,7 @@ struct fbcon_ops {
#define SCROLL_PAN_REDRAW 0x005 #define SCROLL_PAN_REDRAW 0x005
#ifdef CONFIG_FB_TILEBLITTING #ifdef CONFIG_FB_TILEBLITTING
extern void fbcon_set_tileops(struct vc_data *vc, struct fb_info *info, extern void fbcon_set_tileops(struct vc_data *vc, struct fb_info *info);
struct display *p, struct fbcon_ops *ops);
#endif #endif
extern void fbcon_set_bitops(struct fbcon_ops *ops); extern void fbcon_set_bitops(struct fbcon_ops *ops);
extern int soft_cursor(struct fb_info *info, struct fb_cursor *cursor); extern int soft_cursor(struct fb_info *info, struct fb_cursor *cursor);
......
...@@ -219,19 +219,18 @@ static void ccw_clear_margins(struct vc_data *vc, struct fb_info *info, ...@@ -219,19 +219,18 @@ static void ccw_clear_margins(struct vc_data *vc, struct fb_info *info,
} }
} }
static void ccw_cursor(struct vc_data *vc, struct fb_info *info, static void ccw_cursor(struct vc_data *vc, struct fb_info *info, int mode,
struct display *p, int mode, int softback_lines, int softback_lines, int fg, int bg)
int fg, int bg)
{ {
struct fb_cursor cursor; struct fb_cursor cursor;
struct fbcon_ops *ops = (struct fbcon_ops *) info->fbcon_par; struct fbcon_ops *ops = info->fbcon_par;
unsigned short charmask = vc->vc_hi_font_mask ? 0x1ff : 0xff; unsigned short charmask = vc->vc_hi_font_mask ? 0x1ff : 0xff;
int w = (vc->vc_font.height + 7) >> 3, c; int w = (vc->vc_font.height + 7) >> 3, c;
int y = real_y(p, vc->vc_y); int y = real_y(ops->p, vc->vc_y);
int attribute, use_sw = (vc->vc_cursor_type & 0x10); int attribute, use_sw = (vc->vc_cursor_type & 0x10);
int err = 1, dx, dy; int err = 1, dx, dy;
char *src; char *src;
u32 vyres = GETVYRES(p->scrollmode, info); u32 vyres = GETVYRES(ops->p->scrollmode, info);
if (!ops->fontbuffer) if (!ops->fontbuffer)
return; return;
...@@ -303,7 +302,7 @@ static void ccw_cursor(struct vc_data *vc, struct fb_info *info, ...@@ -303,7 +302,7 @@ static void ccw_cursor(struct vc_data *vc, struct fb_info *info,
} }
if (cursor.set & FB_CUR_SETSIZE || if (cursor.set & FB_CUR_SETSIZE ||
vc->vc_cursor_type != p->cursor_shape || vc->vc_cursor_type != ops->p->cursor_shape ||
ops->cursor_state.mask == NULL || ops->cursor_state.mask == NULL ||
ops->cursor_reset) { ops->cursor_reset) {
char *tmp, *mask = kmalloc(w*vc->vc_font.width, GFP_ATOMIC); char *tmp, *mask = kmalloc(w*vc->vc_font.width, GFP_ATOMIC);
...@@ -323,10 +322,10 @@ static void ccw_cursor(struct vc_data *vc, struct fb_info *info, ...@@ -323,10 +322,10 @@ static void ccw_cursor(struct vc_data *vc, struct fb_info *info,
kfree(ops->cursor_state.mask); kfree(ops->cursor_state.mask);
ops->cursor_state.mask = mask; ops->cursor_state.mask = mask;
p->cursor_shape = vc->vc_cursor_type; ops->p->cursor_shape = vc->vc_cursor_type;
cursor.set |= FB_CUR_SETSHAPE; cursor.set |= FB_CUR_SETSHAPE;
switch (p->cursor_shape & CUR_HWMASK) { switch (ops->p->cursor_shape & CUR_HWMASK) {
case CUR_NONE: case CUR_NONE:
cur_height = 0; cur_height = 0;
break; break;
......
...@@ -203,19 +203,18 @@ static void cw_clear_margins(struct vc_data *vc, struct fb_info *info, ...@@ -203,19 +203,18 @@ static void cw_clear_margins(struct vc_data *vc, struct fb_info *info,
} }
} }
static void cw_cursor(struct vc_data *vc, struct fb_info *info, static void cw_cursor(struct vc_data *vc, struct fb_info *info, int mode,
struct display *p, int mode, int softback_lines, int softback_lines, int fg, int bg)
int fg, int bg)
{ {
struct fb_cursor cursor; struct fb_cursor cursor;
struct fbcon_ops *ops = (struct fbcon_ops *) info->fbcon_par; struct fbcon_ops *ops = info->fbcon_par;
unsigned short charmask = vc->vc_hi_font_mask ? 0x1ff : 0xff; unsigned short charmask = vc->vc_hi_font_mask ? 0x1ff : 0xff;
int w = (vc->vc_font.height + 7) >> 3, c; int w = (vc->vc_font.height + 7) >> 3, c;
int y = real_y(p, vc->vc_y); int y = real_y(ops->p, vc->vc_y);
int attribute, use_sw = (vc->vc_cursor_type & 0x10); int attribute, use_sw = (vc->vc_cursor_type & 0x10);
int err = 1, dx, dy; int err = 1, dx, dy;
char *src; char *src;
u32 vxres = GETVXRES(p->scrollmode, info); u32 vxres = GETVXRES(ops->p->scrollmode, info);
if (!ops->fontbuffer) if (!ops->fontbuffer)
return; return;
...@@ -287,7 +286,7 @@ static void cw_cursor(struct vc_data *vc, struct fb_info *info, ...@@ -287,7 +286,7 @@ static void cw_cursor(struct vc_data *vc, struct fb_info *info,
} }
if (cursor.set & FB_CUR_SETSIZE || if (cursor.set & FB_CUR_SETSIZE ||
vc->vc_cursor_type != p->cursor_shape || vc->vc_cursor_type != ops->p->cursor_shape ||
ops->cursor_state.mask == NULL || ops->cursor_state.mask == NULL ||
ops->cursor_reset) { ops->cursor_reset) {
char *tmp, *mask = kmalloc(w*vc->vc_font.width, GFP_ATOMIC); char *tmp, *mask = kmalloc(w*vc->vc_font.width, GFP_ATOMIC);
...@@ -307,10 +306,10 @@ static void cw_cursor(struct vc_data *vc, struct fb_info *info, ...@@ -307,10 +306,10 @@ static void cw_cursor(struct vc_data *vc, struct fb_info *info,
kfree(ops->cursor_state.mask); kfree(ops->cursor_state.mask);
ops->cursor_state.mask = mask; ops->cursor_state.mask = mask;
p->cursor_shape = vc->vc_cursor_type; ops->p->cursor_shape = vc->vc_cursor_type;
cursor.set |= FB_CUR_SETSHAPE; cursor.set |= FB_CUR_SETSHAPE;
switch (p->cursor_shape & CUR_HWMASK) { switch (ops->p->cursor_shape & CUR_HWMASK) {
case CUR_NONE: case CUR_NONE:
cur_height = 0; cur_height = 0;
break; break;
......
...@@ -18,8 +18,7 @@ ...@@ -18,8 +18,7 @@
#include "fbcon.h" #include "fbcon.h"
#include "fbcon_rotate.h" #include "fbcon_rotate.h"
static int fbcon_rotate_font(struct fb_info *info, struct vc_data *vc, static int fbcon_rotate_font(struct fb_info *info, struct vc_data *vc)
struct display *p)
{ {
struct fbcon_ops *ops = info->fbcon_par; struct fbcon_ops *ops = info->fbcon_par;
int len, err = 0; int len, err = 0;
...@@ -28,12 +27,12 @@ static int fbcon_rotate_font(struct fb_info *info, struct vc_data *vc, ...@@ -28,12 +27,12 @@ static int fbcon_rotate_font(struct fb_info *info, struct vc_data *vc,
u8 *dst; u8 *dst;
if (vc->vc_font.data == ops->fontdata && if (vc->vc_font.data == ops->fontdata &&
p->con_rotate == ops->cur_rotate) ops->p->con_rotate == ops->cur_rotate)
goto finished; goto finished;
src = ops->fontdata = vc->vc_font.data; src = ops->fontdata = vc->vc_font.data;
ops->cur_rotate = p->con_rotate; ops->cur_rotate = ops->p->con_rotate;
len = (!p->userfont) ? 256 : FNTCHARCNT(src); len = (!ops->p->userfont) ? 256 : FNTCHARCNT(src);
s_cellsize = ((vc->vc_font.width + 7)/8) * s_cellsize = ((vc->vc_font.width + 7)/8) *
vc->vc_font.height; vc->vc_font.height;
d_cellsize = s_cellsize; d_cellsize = s_cellsize;
......
...@@ -249,20 +249,19 @@ static void ud_clear_margins(struct vc_data *vc, struct fb_info *info, ...@@ -249,20 +249,19 @@ static void ud_clear_margins(struct vc_data *vc, struct fb_info *info,
} }
} }
static void ud_cursor(struct vc_data *vc, struct fb_info *info, static void ud_cursor(struct vc_data *vc, struct fb_info *info, int mode,
struct display *p, int mode, int softback_lines, int softback_lines, int fg, int bg)
int fg, int bg)
{ {
struct fb_cursor cursor; struct fb_cursor cursor;
struct fbcon_ops *ops = (struct fbcon_ops *) info->fbcon_par; struct fbcon_ops *ops = info->fbcon_par;
unsigned short charmask = vc->vc_hi_font_mask ? 0x1ff : 0xff; unsigned short charmask = vc->vc_hi_font_mask ? 0x1ff : 0xff;
int w = (vc->vc_font.width + 7) >> 3, c; int w = (vc->vc_font.width + 7) >> 3, c;
int y = real_y(p, vc->vc_y); int y = real_y(ops->p, vc->vc_y);
int attribute, use_sw = (vc->vc_cursor_type & 0x10); int attribute, use_sw = (vc->vc_cursor_type & 0x10);
int err = 1, dx, dy; int err = 1, dx, dy;
char *src; char *src;
u32 vyres = GETVYRES(p->scrollmode, info); u32 vyres = GETVYRES(ops->p->scrollmode, info);
u32 vxres = GETVXRES(p->scrollmode, info); u32 vxres = GETVXRES(ops->p->scrollmode, info);
if (!ops->fontbuffer) if (!ops->fontbuffer)
return; return;
...@@ -334,7 +333,7 @@ static void ud_cursor(struct vc_data *vc, struct fb_info *info, ...@@ -334,7 +333,7 @@ static void ud_cursor(struct vc_data *vc, struct fb_info *info,
} }
if (cursor.set & FB_CUR_SETSIZE || if (cursor.set & FB_CUR_SETSIZE ||
vc->vc_cursor_type != p->cursor_shape || vc->vc_cursor_type != ops->p->cursor_shape ||
ops->cursor_state.mask == NULL || ops->cursor_state.mask == NULL ||
ops->cursor_reset) { ops->cursor_reset) {
char *mask = kmalloc(w*vc->vc_font.height, GFP_ATOMIC); char *mask = kmalloc(w*vc->vc_font.height, GFP_ATOMIC);
...@@ -347,10 +346,10 @@ static void ud_cursor(struct vc_data *vc, struct fb_info *info, ...@@ -347,10 +346,10 @@ static void ud_cursor(struct vc_data *vc, struct fb_info *info,
kfree(ops->cursor_state.mask); kfree(ops->cursor_state.mask);
ops->cursor_state.mask = mask; ops->cursor_state.mask = mask;
p->cursor_shape = vc->vc_cursor_type; ops->p->cursor_shape = vc->vc_cursor_type;
cursor.set |= FB_CUR_SETSHAPE; cursor.set |= FB_CUR_SETSHAPE;
switch (p->cursor_shape & CUR_HWMASK) { switch (ops->p->cursor_shape & CUR_HWMASK) {
case CUR_NONE: case CUR_NONE:
cur_height = 0; cur_height = 0;
break; break;
......
...@@ -80,9 +80,8 @@ static void tile_clear_margins(struct vc_data *vc, struct fb_info *info, ...@@ -80,9 +80,8 @@ static void tile_clear_margins(struct vc_data *vc, struct fb_info *info,
return; return;
} }
static void tile_cursor(struct vc_data *vc, struct fb_info *info, static void tile_cursor(struct vc_data *vc, struct fb_info *info, int mode,
struct display *p, int mode, int softback_lines, int softback_lines, int fg, int bg)
int fg, int bg)
{ {
struct fb_tilecursor cursor; struct fb_tilecursor cursor;
int use_sw = (vc->vc_cursor_type & 0x01); int use_sw = (vc->vc_cursor_type & 0x01);
...@@ -130,10 +129,10 @@ static int tile_update_start(struct fb_info *info) ...@@ -130,10 +129,10 @@ static int tile_update_start(struct fb_info *info)
return err; return err;
} }
void fbcon_set_tileops(struct vc_data *vc, struct fb_info *info, void fbcon_set_tileops(struct vc_data *vc, struct fb_info *info)
struct display *p, struct fbcon_ops *ops)
{ {
struct fb_tilemap map; struct fb_tilemap map;
struct fbcon_ops *ops = info->fbcon_par;
ops->bmove = tile_bmove; ops->bmove = tile_bmove;
ops->clear = tile_clear; ops->clear = tile_clear;
...@@ -142,13 +141,13 @@ void fbcon_set_tileops(struct vc_data *vc, struct fb_info *info, ...@@ -142,13 +141,13 @@ void fbcon_set_tileops(struct vc_data *vc, struct fb_info *info,
ops->cursor = tile_cursor; ops->cursor = tile_cursor;
ops->update_start = tile_update_start; ops->update_start = tile_update_start;
if (p) { if (ops->p) {
map.width = vc->vc_font.width; map.width = vc->vc_font.width;
map.height = vc->vc_font.height; map.height = vc->vc_font.height;
map.depth = 1; map.depth = 1;
map.length = (p->userfont) ? map.length = (ops->p->userfont) ?
FNTCHARCNT(p->fontdata) : 256; FNTCHARCNT(ops->p->fontdata) : 256;
map.data = p->fontdata; map.data = ops->p->fontdata;
info->tileops->fb_settile(info, &map); info->tileops->fb_settile(info, &map);
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment