Commit de7519da authored by James Simmons's avatar James Simmons

Bug fixes!!

parent ae2fad86
......@@ -228,7 +228,7 @@ config FONT_8x8
config FONT_8x16
bool "VGA 8x16 font" if FBCON_FONTS
depends on FB && SGI_NEWPORT_CONSOLE=y
depends on FB || SGI_NEWPORT_CONSOLE=y
default y if !SPARC32 && !SPARC64 && !FBCON_FONTS
help
This is the "high resolution" font for the VGA frame buffer (the one
......
......@@ -232,9 +232,9 @@ static void fbcon_vbl_detect(int irq, void *dummy, struct pt_regs *fp)
static void cursor_timer_handler(unsigned long dev_addr);
static struct timer_list cursor_timer = {
function: cursor_timer_handler
};
static struct timer_list cursor_timer =
TIMER_INITIALIZER(cursor_timer_handler, 0, 0);
static void cursor_timer_handler(unsigned long dev_addr)
{
......@@ -1534,6 +1534,8 @@ static int fbcon_switch(struct vc_data *vc)
scrollback_max = 0;
scrollback_current = 0;
update_var(unit, info);
if (p->dispsw->clear_margins && vt_cons[unit]->vc_mode == KD_TEXT)
p->dispsw->clear_margins(vc, p, 0);
if (logo_shown == -2) {
......
......@@ -61,31 +61,6 @@ int cfb_cursor(struct fb_info *info, struct fbcursor *cursor)
return 0;
}
int fb_pan_display(struct fb_var_screeninfo *var, struct fb_info *info)
{
int xoffset = var->xoffset;
int yoffset = var->yoffset;
int err;
if (xoffset < 0 || yoffset < 0 ||
xoffset + info->var.xres > info->var.xres_virtual ||
yoffset + info->var.yres > info->var.yres_virtual)
return -EINVAL;
if (info->fbops->fb_pan_display) {
if ((err = info->fbops->fb_pan_display(var, info)))
return err;
else
return -EINVAL;
}
info->var.xoffset = var->xoffset;
info->var.yoffset = var->yoffset;
if (var->vmode & FB_VMODE_YWRAP)
info->var.vmode |= FB_VMODE_YWRAP;
else
info->var.vmode &= ~FB_VMODE_YWRAP;
return 0;
}
int fb_blank(int blank, struct fb_info *info)
{
struct fb_cmap cmap;
......@@ -116,7 +91,6 @@ int fb_blank(int blank, struct fb_info *info)
/* generic frame buffer operations */
EXPORT_SYMBOL(cfb_cursor);
EXPORT_SYMBOL(fb_pan_display);
EXPORT_SYMBOL(fb_blank);
MODULE_LICENSE("GPL");
......@@ -464,6 +464,31 @@ static void try_to_load(int fb)
}
#endif /* CONFIG_KMOD */
int fb_pan_display(struct fb_var_screeninfo *var, struct fb_info *info)
{
int xoffset = var->xoffset;
int yoffset = var->yoffset;
int err;
if (xoffset < 0 || yoffset < 0 ||
xoffset + info->var.xres > info->var.xres_virtual ||
yoffset + info->var.yres > info->var.yres_virtual)
return -EINVAL;
if (info->fbops->fb_pan_display) {
if ((err = info->fbops->fb_pan_display(var, info)))
return err;
else
return -EINVAL;
}
info->var.xoffset = var->xoffset;
info->var.yoffset = var->yoffset;
if (var->vmode & FB_VMODE_YWRAP)
info->var.vmode |= FB_VMODE_YWRAP;
else
info->var.vmode &= ~FB_VMODE_YWRAP;
return 0;
}
int fb_set_var(struct fb_var_screeninfo *var, struct fb_info *info)
{
int err;
......@@ -483,8 +508,7 @@ int fb_set_var(struct fb_var_screeninfo *var, struct fb_info *info)
if (info->fbops->fb_set_par)
info->fbops->fb_set_par(info);
if (info->fbops->fb_pan_display)
info->fbops->fb_pan_display(&info->var, info);
fb_pan_display(&info->var, info);
fb_set_cmap(&info->cmap, 1, info);
}
......@@ -534,9 +558,7 @@ fb_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
case FBIOPAN_DISPLAY:
if (copy_from_user(&var, (void *) arg, sizeof(var)))
return -EFAULT;
if (fb->fb_pan_display == NULL)
return (var.xoffset || var.yoffset) ? -EINVAL : 0;
if ((i=fb->fb_pan_display(&var, info)))
if ((i = fb_pan_display(&var, info)))
return i;
if (copy_to_user((void *) arg, &var, sizeof(var)))
return -EFAULT;
......
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