diff options
author | Antonino A. Daplas <adaplas@gmail.com> | 2006-01-09 23:52:56 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-01-10 11:01:42 -0500 |
commit | b73deed32d08740bdbf5f4aab43d988e4d135d95 (patch) | |
tree | 75d78d58fc1a20f6387d1e152bce148398a93836 /drivers/video/console/fbcon.c | |
parent | 8416131ded5e491ecc2947d1ffaedf64725bb7a3 (diff) |
[PATCH] fbcon: Sanitize fbcon
Do not pass the structure display since fbcon is already keeping the pointer
to the current display.
Signed-off-by: Antonino Daplas <adaplas@pol.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/video/console/fbcon.c')
-rw-r--r-- | drivers/video/console/fbcon.c | 49 |
1 files changed, 23 insertions, 26 deletions
diff --git a/drivers/video/console/fbcon.c b/drivers/video/console/fbcon.c index 50e4c4eb491f..42ea3af8a9ad 100644 --- a/drivers/video/console/fbcon.c +++ b/drivers/video/console/fbcon.c | |||
@@ -209,13 +209,13 @@ static irqreturn_t fb_vbl_detect(int irq, void *dummy, struct pt_regs *fp) | |||
209 | #endif | 209 | #endif |
210 | 210 | ||
211 | #ifdef CONFIG_FRAMEBUFFER_CONSOLE_ROTATION | 211 | #ifdef CONFIG_FRAMEBUFFER_CONSOLE_ROTATION |
212 | static inline void fbcon_set_rotation(struct fb_info *info, struct display *p) | 212 | static inline void fbcon_set_rotation(struct fb_info *info) |
213 | { | 213 | { |
214 | struct fbcon_ops *ops = info->fbcon_par; | 214 | struct fbcon_ops *ops = info->fbcon_par; |
215 | 215 | ||
216 | if (!(info->flags & FBINFO_MISC_TILEBLITTING) && | 216 | if (!(info->flags & FBINFO_MISC_TILEBLITTING) && |
217 | p->con_rotate < 4) | 217 | ops->p->con_rotate < 4) |
218 | ops->rotate = p->con_rotate; | 218 | ops->rotate = ops->p->con_rotate; |
219 | else | 219 | else |
220 | ops->rotate = 0; | 220 | ops->rotate = 0; |
221 | } | 221 | } |
@@ -265,7 +265,7 @@ static void fbcon_rotate_all(struct fb_info *info, u32 rotate) | |||
265 | fbcon_set_all_vcs(info); | 265 | fbcon_set_all_vcs(info); |
266 | } | 266 | } |
267 | #else | 267 | #else |
268 | static inline void fbcon_set_rotation(struct fb_info *info, struct display *p) | 268 | static inline void fbcon_set_rotation(struct fb_info *info) |
269 | { | 269 | { |
270 | struct fbcon_ops *ops = info->fbcon_par; | 270 | struct fbcon_ops *ops = info->fbcon_par; |
271 | 271 | ||
@@ -402,7 +402,7 @@ static void fb_flashcursor(void *private) | |||
402 | c = scr_readw((u16 *) vc->vc_pos); | 402 | c = scr_readw((u16 *) vc->vc_pos); |
403 | mode = (!ops->cursor_flash || ops->cursor_state.enable) ? | 403 | mode = (!ops->cursor_flash || ops->cursor_state.enable) ? |
404 | CM_ERASE : CM_DRAW; | 404 | CM_ERASE : CM_DRAW; |
405 | ops->cursor(vc, info, p, mode, softback_lines, get_color(vc, info, c, 1), | 405 | ops->cursor(vc, info, mode, softback_lines, get_color(vc, info, c, 1), |
406 | get_color(vc, info, c, 0)); | 406 | get_color(vc, info, c, 0)); |
407 | release_console_sem(); | 407 | release_console_sem(); |
408 | } | 408 | } |
@@ -647,29 +647,27 @@ static void fbcon_prepare_logo(struct vc_data *vc, struct fb_info *info, | |||
647 | } | 647 | } |
648 | 648 | ||
649 | #ifdef CONFIG_FB_TILEBLITTING | 649 | #ifdef CONFIG_FB_TILEBLITTING |
650 | static void set_blitting_type(struct vc_data *vc, struct fb_info *info, | 650 | static void set_blitting_type(struct vc_data *vc, struct fb_info *info) |
651 | struct display *p) | ||
652 | { | 651 | { |
653 | struct fbcon_ops *ops = info->fbcon_par; | 652 | struct fbcon_ops *ops = info->fbcon_par; |
654 | 653 | ||
655 | ops->p = (p) ? p : &fb_display[vc->vc_num]; | 654 | ops->p = &fb_display[vc->vc_num]; |
656 | 655 | ||
657 | if ((info->flags & FBINFO_MISC_TILEBLITTING)) | 656 | if ((info->flags & FBINFO_MISC_TILEBLITTING)) |
658 | fbcon_set_tileops(vc, info, p, ops); | 657 | fbcon_set_tileops(vc, info); |
659 | else { | 658 | else { |
660 | fbcon_set_rotation(info, ops->p); | 659 | fbcon_set_rotation(info); |
661 | fbcon_set_bitops(ops); | 660 | fbcon_set_bitops(ops); |
662 | } | 661 | } |
663 | } | 662 | } |
664 | #else | 663 | #else |
665 | static void set_blitting_type(struct vc_data *vc, struct fb_info *info, | 664 | static void set_blitting_type(struct vc_data *vc, struct fb_info *info) |
666 | struct display *p) | ||
667 | { | 665 | { |
668 | struct fbcon_ops *ops = info->fbcon_par; | 666 | struct fbcon_ops *ops = info->fbcon_par; |
669 | 667 | ||
670 | info->flags &= ~FBINFO_MISC_TILEBLITTING; | 668 | info->flags &= ~FBINFO_MISC_TILEBLITTING; |
671 | ops->p = (p) ? p : &fb_display[vc->vc_num]; | 669 | ops->p = &fb_display[vc->vc_num]; |
672 | fbcon_set_rotation(info, ops->p); | 670 | fbcon_set_rotation(info); |
673 | fbcon_set_bitops(ops); | 671 | fbcon_set_bitops(ops); |
674 | } | 672 | } |
675 | #endif /* CONFIG_MISC_TILEBLITTING */ | 673 | #endif /* CONFIG_MISC_TILEBLITTING */ |
@@ -697,7 +695,7 @@ static int con2fb_acquire_newinfo(struct vc_data *vc, struct fb_info *info, | |||
697 | if (!err) { | 695 | if (!err) { |
698 | memset(ops, 0, sizeof(struct fbcon_ops)); | 696 | memset(ops, 0, sizeof(struct fbcon_ops)); |
699 | info->fbcon_par = ops; | 697 | info->fbcon_par = ops; |
700 | set_blitting_type(vc, info, NULL); | 698 | set_blitting_type(vc, info); |
701 | } | 699 | } |
702 | 700 | ||
703 | if (err) { | 701 | if (err) { |
@@ -933,7 +931,7 @@ static const char *fbcon_startup(void) | |||
933 | ops->cur_rotate = -1; | 931 | ops->cur_rotate = -1; |
934 | info->fbcon_par = ops; | 932 | info->fbcon_par = ops; |
935 | p->con_rotate = rotate; | 933 | p->con_rotate = rotate; |
936 | set_blitting_type(vc, info, NULL); | 934 | set_blitting_type(vc, info); |
937 | 935 | ||
938 | if (info->fix.type != FB_TYPE_TEXT) { | 936 | if (info->fix.type != FB_TYPE_TEXT) { |
939 | if (fbcon_softback_size) { | 937 | if (fbcon_softback_size) { |
@@ -1093,7 +1091,7 @@ static void fbcon_init(struct vc_data *vc, int init) | |||
1093 | 1091 | ||
1094 | ops = info->fbcon_par; | 1092 | ops = info->fbcon_par; |
1095 | p->con_rotate = rotate; | 1093 | p->con_rotate = rotate; |
1096 | set_blitting_type(vc, info, NULL); | 1094 | set_blitting_type(vc, info); |
1097 | 1095 | ||
1098 | cols = vc->vc_cols; | 1096 | cols = vc->vc_cols; |
1099 | rows = vc->vc_rows; | 1097 | rows = vc->vc_rows; |
@@ -1141,9 +1139,9 @@ static void fbcon_init(struct vc_data *vc, int init) | |||
1141 | if (vc == svc && softback_buf) | 1139 | if (vc == svc && softback_buf) |
1142 | fbcon_update_softback(vc); | 1140 | fbcon_update_softback(vc); |
1143 | 1141 | ||
1144 | if (ops->rotate_font && ops->rotate_font(info, vc, p)) { | 1142 | if (ops->rotate_font && ops->rotate_font(info, vc)) { |
1145 | ops->rotate = FB_ROTATE_UR; | 1143 | ops->rotate = FB_ROTATE_UR; |
1146 | set_blitting_type(vc, info, p); | 1144 | set_blitting_type(vc, info); |
1147 | } | 1145 | } |
1148 | 1146 | ||
1149 | } | 1147 | } |
@@ -1243,7 +1241,6 @@ static void fbcon_cursor(struct vc_data *vc, int mode) | |||
1243 | { | 1241 | { |
1244 | struct fb_info *info = registered_fb[con2fb_map[vc->vc_num]]; | 1242 | struct fb_info *info = registered_fb[con2fb_map[vc->vc_num]]; |
1245 | struct fbcon_ops *ops = info->fbcon_par; | 1243 | struct fbcon_ops *ops = info->fbcon_par; |
1246 | struct display *p = &fb_display[vc->vc_num]; | ||
1247 | int y; | 1244 | int y; |
1248 | int c = scr_readw((u16 *) vc->vc_pos); | 1245 | int c = scr_readw((u16 *) vc->vc_pos); |
1249 | 1246 | ||
@@ -1260,7 +1257,7 @@ static void fbcon_cursor(struct vc_data *vc, int mode) | |||
1260 | y = 0; | 1257 | y = 0; |
1261 | } | 1258 | } |
1262 | 1259 | ||
1263 | ops->cursor(vc, info, p, mode, y, get_color(vc, info, c, 1), | 1260 | ops->cursor(vc, info, mode, y, get_color(vc, info, c, 1), |
1264 | get_color(vc, info, c, 0)); | 1261 | get_color(vc, info, c, 0)); |
1265 | vbl_cursor_cnt = CURSOR_DRAW_DELAY; | 1262 | vbl_cursor_cnt = CURSOR_DRAW_DELAY; |
1266 | } | 1263 | } |
@@ -2111,12 +2108,12 @@ static int fbcon_switch(struct vc_data *vc) | |||
2111 | fbcon_add_cursor_timer(info); | 2108 | fbcon_add_cursor_timer(info); |
2112 | } | 2109 | } |
2113 | 2110 | ||
2114 | set_blitting_type(vc, info, p); | 2111 | set_blitting_type(vc, info); |
2115 | ops->cursor_reset = 1; | 2112 | ops->cursor_reset = 1; |
2116 | 2113 | ||
2117 | if (ops->rotate_font && ops->rotate_font(info, vc, p)) { | 2114 | if (ops->rotate_font && ops->rotate_font(info, vc)) { |
2118 | ops->rotate = FB_ROTATE_UR; | 2115 | ops->rotate = FB_ROTATE_UR; |
2119 | set_blitting_type(vc, info, p); | 2116 | set_blitting_type(vc, info); |
2120 | } | 2117 | } |
2121 | 2118 | ||
2122 | vc->vc_can_do_color = (fb_get_color_depth(&info->var, &info->fix)!=1); | 2119 | 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 | return; | 2736 | return; |
2740 | 2737 | ||
2741 | p = &fb_display[vc->vc_num]; | 2738 | p = &fb_display[vc->vc_num]; |
2742 | set_blitting_type(vc, info, p); | 2739 | set_blitting_type(vc, info); |
2743 | 2740 | ||
2744 | if (CON_IS_VISIBLE(vc)) { | 2741 | if (CON_IS_VISIBLE(vc)) { |
2745 | var_to_display(p, &info->var, info); | 2742 | var_to_display(p, &info->var, info); |
@@ -2781,7 +2778,7 @@ static void fbcon_set_all_vcs(struct fb_info *info) | |||
2781 | continue; | 2778 | continue; |
2782 | 2779 | ||
2783 | p = &fb_display[vc->vc_num]; | 2780 | p = &fb_display[vc->vc_num]; |
2784 | set_blitting_type(vc, info, p); | 2781 | set_blitting_type(vc, info); |
2785 | var_to_display(p, &info->var, info); | 2782 | var_to_display(p, &info->var, info); |
2786 | cols = FBCON_SWAP(ops->rotate, info->var.xres, info->var.yres); | 2783 | cols = FBCON_SWAP(ops->rotate, info->var.xres, info->var.yres); |
2787 | rows = FBCON_SWAP(ops->rotate, info->var.yres, info->var.xres); | 2784 | rows = FBCON_SWAP(ops->rotate, info->var.yres, info->var.xres); |