Commit fd8f1848 authored by James Simmons's avatar James Simmons Committed by James Simmons

[FBCON] Cursor handling clean up. I nuked several static variables.

parent 251b237b
This diff is collapsed.
......@@ -29,14 +29,11 @@ struct display {
/* Filled in by the low-level console driver */
struct fb_info *fb_info; /* frame buffer for this console */
int vrows; /* number of virtual rows */
unsigned short cursor_x; /* current cursor position */
unsigned short cursor_y;
char fontname[40]; /* Font associated to this display */
u_char *fontdata;
int userfont; /* != 0 if fontdata kmalloc()ed */
u_short scrollmode; /* Scroll Method */
short yscroll; /* Hardware scrolling */
unsigned char fgshift, bgshift;
};
/* drivers/video/console/fbcon.c */
......@@ -48,23 +45,23 @@ extern void set_con2fb_map(int unit, int newidx);
*/
/* Color */
#define attr_fgcol(p,s) \
(((s) >> ((p)->fgshift)) & 0x0f)
#define attr_bgcol(p,s) \
(((s) >> ((p)->bgshift)) & 0x0f)
#define attr_bgcol_ec(p,conp) \
((conp) ? (((conp)->vc_video_erase_char >> ((p)->bgshift)) & 0x0f) : 0)
#define attr_fgcol_ec(p,vc) \
((vc) ? (((vc)->vc_video_erase_char >> ((p)->fgshift)) & 0x0f) : 0)
#define attr_fgcol(fgshift,s) \
(((s) >> (fgshift)) & 0x0f)
#define attr_bgcol(bgshift,s) \
(((s) >> (bgshift)) & 0x0f)
#define attr_bgcol_ec(bgshift,vc) \
((vc) ? (((vc)->vc_video_erase_char >> (bgshift)) & 0x0f) : 0)
#define attr_fgcol_ec(fgshift,vc) \
((vc) ? (((vc)->vc_video_erase_char >> (fgshift)) & 0x0f) : 0)
/* Monochrome */
#define attr_bold(p,s) \
#define attr_bold(s) \
((s) & 0x200)
#define attr_reverse(p,s) \
(((s) & 0x800) ^ ((p)->inverse ? 0x800 : 0))
#define attr_underline(p,s) \
#define attr_reverse(s, inverse) \
(((s) & 0x800) ^ (inverse ? 0x800 : 0))
#define attr_underline(s) \
((s) & 0x400)
#define attr_blink(p,s) \
#define attr_blink(s) \
((s) & 0x8000)
/*
......
......@@ -19,12 +19,11 @@
int soft_cursor(struct fb_info *info, struct fb_cursor *cursor)
{
static u8 src[64];
struct fb_image image;
unsigned int i, size, s_pitch, d_pitch;
unsigned dsize = ((cursor->image.width + 7)/8) * cursor->image.height;
unsigned int scan_align = info->pixmap.scan_align - 1;
unsigned int buf_align = info->pixmap.buf_align - 1;
unsigned int i, size, s_pitch, d_pitch;
static u8 src[64];
u8 *dst;
s_pitch = (cursor->image.width + 7)/8;
......@@ -32,7 +31,7 @@ int soft_cursor(struct fb_info *info, struct fb_cursor *cursor)
size = d_pitch * cursor->image.height + buf_align;
size &= ~buf_align;
dst = info->pixmap.addr + fb_get_buffer_offset(info, size);
image.data = dst;
info->cursor.image.data = dst;
if (cursor->enable) {
switch (cursor->rop) {
......@@ -58,15 +57,15 @@ int soft_cursor(struct fb_info *info, struct fb_cursor *cursor)
cursor->image.height);
}
image.bg_color = cursor->image.bg_color;
image.fg_color = cursor->image.fg_color;
image.dx = cursor->image.dx;
image.dy = cursor->image.dy;
image.width = cursor->image.width;
image.height = cursor->image.height;
image.depth = cursor->image.depth;
info->cursor.image.bg_color = cursor->image.bg_color;
info->cursor.image.fg_color = cursor->image.fg_color;
info->cursor.image.dx = cursor->image.dx;
info->cursor.image.dy = cursor->image.dy;
info->cursor.image.width = cursor->image.width;
info->cursor.image.height = cursor->image.height;
info->cursor.image.depth = cursor->image.depth;
info->fbops->fb_imageblit(info, &image);
info->fbops->fb_imageblit(info, &info->cursor.image);
return 0;
}
......
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