summaryrefslogtreecommitdiffstats
path: root/drivers/video/fbmem.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/video/fbmem.c')
-rw-r--r--drivers/video/fbmem.c122
1 files changed, 3 insertions, 119 deletions
diff --git a/drivers/video/fbmem.c b/drivers/video/fbmem.c
index 4bd6e8f7b..152115043 100644
--- a/drivers/video/fbmem.c
+++ b/drivers/video/fbmem.c
@@ -20,7 +20,6 @@
#include <linux/mman.h>
#include <linux/tty.h>
#include <linux/console.h>
-#include <linux/console_struct.h>
#include <linux/init.h>
#include <linux/proc_fs.h>
#ifdef CONFIG_KMOD
@@ -30,15 +29,14 @@
#if defined(__mc68000__) || defined(CONFIG_APUS)
#include <asm/setup.h>
#endif
-#ifdef __powerpc__
+
#include <asm/io.h>
-#endif
#include <asm/uaccess.h>
#include <asm/page.h>
#include <asm/pgtable.h>
#include <linux/fb.h>
-
+#include <video/fbcon.h>
/*
* Frame buffer device initialization and setup routines
@@ -228,36 +226,12 @@ static int num_pref_init_funcs __initdata = 0;
struct fb_info *registered_fb[FB_MAX];
int num_registered_fb = 0;
-int fbcon_softback_size = 32768;
-
-char con2fb_map[MAX_NR_CONSOLES];
+extern int fbcon_softback_size;
static int first_fb_vc = 0;
static int last_fb_vc = MAX_NR_CONSOLES-1;
static int fbcon_is_default = 1;
-static int PROC_CONSOLE(const struct fb_info *info)
-{
- int fgc;
-
- if (info->display_fg != NULL)
- fgc = info->display_fg->vc_num;
- else
- return -1;
-
- if (!current->tty)
- return fgc;
-
- if (current->tty->driver.type != TTY_DRIVER_TYPE_CONSOLE)
- /* XXX Should report error here? */
- return fgc;
-
- if (MINOR(current->tty->device) < 1)
- return fgc;
-
- return MINOR(current->tty->device) - 1;
-}
-
static int fbmem_read_proc(char *buf, char **start, off_t offset,
int len, int *eof, void *private)
{
@@ -321,63 +295,6 @@ fb_write(struct file *file, const char *buf, size_t count, loff_t *ppos)
return copy_size;
}
-
-static int set_all_vcs(int fbidx, struct fb_ops *fb,
- struct fb_var_screeninfo *var, struct fb_info *info)
-{
- int unit, err;
-
- var->activate |= FB_ACTIVATE_TEST;
- err = fb->fb_set_var(var, PROC_CONSOLE(info), info);
- var->activate &= ~FB_ACTIVATE_TEST;
- if (err)
- return err;
- for (unit = 0; unit < MAX_NR_CONSOLES; unit++)
- if (fb_display[unit].conp && con2fb_map[unit] == fbidx)
- fb->fb_set_var(var, unit, info);
- return 0;
-}
-
-static void set_con2fb_map(int unit, int newidx)
-{
- int oldidx = con2fb_map[unit];
- struct fb_info *oldfb, *newfb;
- struct vc_data *conp;
- char *fontdata;
- unsigned short fontwidth, fontheight, fontwidthlog, fontheightlog;
- int userfont;
-
- if (newidx != con2fb_map[unit]) {
- oldfb = registered_fb[oldidx];
- newfb = registered_fb[newidx];
- if (newfb->fbops->fb_open(newfb,0))
- return;
- oldfb->fbops->fb_release(oldfb,0);
- conp = fb_display[unit].conp;
- fontdata = fb_display[unit].fontdata;
- fontwidth = fb_display[unit]._fontwidth;
- fontheight = fb_display[unit]._fontheight;
- fontwidthlog = fb_display[unit]._fontwidthlog;
- fontheightlog = fb_display[unit]._fontheightlog;
- userfont = fb_display[unit].userfont;
- con2fb_map[unit] = newidx;
- fb_display[unit] = *(newfb->disp);
- fb_display[unit].conp = conp;
- fb_display[unit].fontdata = fontdata;
- fb_display[unit]._fontwidth = fontwidth;
- fb_display[unit]._fontheight = fontheight;
- fb_display[unit]._fontwidthlog = fontwidthlog;
- fb_display[unit]._fontheightlog = fontheightlog;
- fb_display[unit].userfont = userfont;
- fb_display[unit].fb_info = newfb;
- if (!newfb->changevar)
- newfb->changevar = oldfb->changevar;
- /* tell console var has changed */
- if (newfb->changevar)
- newfb->changevar(unit);
- }
-}
-
#ifdef CONFIG_KMOD
static void try_to_load(int fb)
{
@@ -674,39 +591,6 @@ fbmem_init(void)
fb_drivers[i].init();
}
-
-int fbmon_valid_timings(u_int pixclock, u_int htotal, u_int vtotal,
- const struct fb_info *fb_info)
-{
-#if 0
- /*
- * long long divisions .... $#%%#$
- */
- unsigned long long hpicos, vpicos;
- const unsigned long long _1e12 = 1000000000000ULL;
- const struct fb_monspecs *monspecs = &fb_info->monspecs;
-
- hpicos = (unsigned long long)htotal*(unsigned long long)pixclock;
- vpicos = (unsigned long long)vtotal*(unsigned long long)hpicos;
- if (!vpicos)
- return 0;
-
- if (monspecs->hfmin == 0)
- return 1;
-
- if (hpicos*monspecs->hfmin > _1e12 || hpicos*monspecs->hfmax < _1e12 ||
- vpicos*monspecs->vfmin > _1e12 || vpicos*monspecs->vfmax < _1e12)
- return 0;
-#endif
- return 1;
-}
-
-int fbmon_dpms(const struct fb_info *fb_info)
-{
- return fb_info->monspecs.dpms;
-}
-
-
/*
* Command line options
*/