diff options
| author | James Simmons <jsimmons@maxwell.earthlink.net> | 2002-10-16 07:06:36 -0700 |
|---|---|---|
| committer | James Simmons <jsimmons@maxwell.earthlink.net> | 2002-10-16 07:06:36 -0700 |
| commit | 0733e4dd69028d03cfa22cd78fa0016beb7ade51 (patch) | |
| tree | 3faa2072b7aa2a1d5e926d72daeb571ac8e7311f | |
| parent | 32705156ef67653fa7e63821fbdbc8fd3ea57d8d (diff) | |
The last of the console code inside the frmaebuffer layer. I also moved all the graphics related code into the drivers/video directory.
| -rw-r--r-- | Makefile | 2 | ||||
| -rw-r--r-- | drivers/char/Config.in | 3 | ||||
| -rw-r--r-- | drivers/char/Makefile | 2 | ||||
| -rw-r--r-- | drivers/video/Config.in | 3 | ||||
| -rw-r--r-- | drivers/video/Makefile | 3 | ||||
| -rw-r--r-- | drivers/video/agp/Config.help (renamed from drivers/char/agp/Config.help) | 0 | ||||
| -rw-r--r-- | drivers/video/agp/Config.in (renamed from drivers/char/agp/Config.in) | 0 | ||||
| -rw-r--r-- | drivers/video/agp/Makefile (renamed from drivers/char/agp/Makefile) | 0 | ||||
| -rw-r--r-- | drivers/video/agp/agp.c (renamed from drivers/char/agp/agp.c) | 0 | ||||
| -rw-r--r-- | drivers/video/agp/agp.h (renamed from drivers/char/agp/agp.h) | 0 | ||||
| -rw-r--r-- | drivers/video/agp/ali-agp.c (renamed from drivers/char/agp/ali-agp.c) | 0 | ||||
| -rw-r--r-- | drivers/video/agp/amd-agp.c (renamed from drivers/char/agp/amd-agp.c) | 0 | ||||
| -rw-r--r-- | drivers/video/agp/frontend.c (renamed from drivers/char/agp/frontend.c) | 0 | ||||
| -rw-r--r-- | drivers/video/agp/hp-agp.c (renamed from drivers/char/agp/hp-agp.c) | 0 | ||||
| -rw-r--r-- | drivers/video/agp/i460-agp.c (renamed from drivers/char/agp/i460-agp.c) | 0 | ||||
| -rw-r--r-- | drivers/video/agp/i810-agp.c (renamed from drivers/char/agp/i810-agp.c) | 0 | ||||
| -rw-r--r-- | drivers/video/agp/i8x0-agp.c (renamed from drivers/char/agp/i8x0-agp.c) | 0 | ||||
| -rw-r--r-- | drivers/video/agp/k8-agp.c (renamed from drivers/char/agp/k8-agp.c) | 0 | ||||
| -rw-r--r-- | drivers/video/agp/sis-agp.c (renamed from drivers/char/agp/sis-agp.c) | 0 | ||||
| -rw-r--r-- | drivers/video/agp/sworks-agp.c (renamed from drivers/char/agp/sworks-agp.c) | 0 | ||||
| -rw-r--r-- | drivers/video/agp/via-agp.c (renamed from drivers/char/agp/via-agp.c) | 0 | ||||
| -rw-r--r-- | drivers/video/anakinfb.c | 1 | ||||
| -rw-r--r-- | drivers/video/aty/atyfb_base.c | 14 | ||||
| -rw-r--r-- | drivers/video/cfbcopyarea.c | 379 | ||||
| -rw-r--r-- | drivers/video/clps711xfb.c | 11 | ||||
| -rw-r--r-- | drivers/video/console/Config.in | 19 | ||||
| -rw-r--r-- | drivers/video/console/fbcon.c | 25 | ||||
| -rw-r--r-- | drivers/video/dnfb.c | 1 | ||||
| -rw-r--r-- | drivers/video/drm/Config.help (renamed from drivers/char/drm/Config.help) | 0 | ||||
| -rw-r--r-- | drivers/video/drm/Config.in (renamed from drivers/char/drm/Config.in) | 0 | ||||
| -rw-r--r-- | drivers/video/drm/Makefile (renamed from drivers/char/drm/Makefile) | 0 | ||||
| -rw-r--r-- | drivers/video/drm/README.drm (renamed from drivers/char/drm/README.drm) | 0 | ||||
| -rw-r--r-- | drivers/video/drm/ati_pcigart.h (renamed from drivers/char/drm/ati_pcigart.h) | 0 | ||||
| -rw-r--r-- | drivers/video/drm/drm.h (renamed from drivers/char/drm/drm.h) | 0 | ||||
| -rw-r--r-- | drivers/video/drm/drmP.h (renamed from drivers/char/drm/drmP.h) | 0 | ||||
| -rw-r--r-- | drivers/video/drm/drm_agpsupport.h (renamed from drivers/char/drm/drm_agpsupport.h) | 0 | ||||
| -rw-r--r-- | drivers/video/drm/drm_auth.h (renamed from drivers/char/drm/drm_auth.h) | 0 | ||||
| -rw-r--r-- | drivers/video/drm/drm_bufs.h (renamed from drivers/char/drm/drm_bufs.h) | 0 | ||||
| -rw-r--r-- | drivers/video/drm/drm_context.h (renamed from drivers/char/drm/drm_context.h) | 0 | ||||
| -rw-r--r-- | drivers/video/drm/drm_dma.h (renamed from drivers/char/drm/drm_dma.h) | 0 | ||||
| -rw-r--r-- | drivers/video/drm/drm_drawable.h (renamed from drivers/char/drm/drm_drawable.h) | 0 | ||||
| -rw-r--r-- | drivers/video/drm/drm_drv.h (renamed from drivers/char/drm/drm_drv.h) | 0 | ||||
| -rw-r--r-- | drivers/video/drm/drm_fops.h (renamed from drivers/char/drm/drm_fops.h) | 0 | ||||
| -rw-r--r-- | drivers/video/drm/drm_init.h (renamed from drivers/char/drm/drm_init.h) | 0 | ||||
| -rw-r--r-- | drivers/video/drm/drm_ioctl.h (renamed from drivers/char/drm/drm_ioctl.h) | 0 | ||||
| -rw-r--r-- | drivers/video/drm/drm_lists.h (renamed from drivers/char/drm/drm_lists.h) | 0 | ||||
| -rw-r--r-- | drivers/video/drm/drm_lock.h (renamed from drivers/char/drm/drm_lock.h) | 0 | ||||
| -rw-r--r-- | drivers/video/drm/drm_memory.h (renamed from drivers/char/drm/drm_memory.h) | 0 | ||||
| -rw-r--r-- | drivers/video/drm/drm_os_linux.h (renamed from drivers/char/drm/drm_os_linux.h) | 0 | ||||
| -rw-r--r-- | drivers/video/drm/drm_proc.h (renamed from drivers/char/drm/drm_proc.h) | 0 | ||||
| -rw-r--r-- | drivers/video/drm/drm_scatter.h (renamed from drivers/char/drm/drm_scatter.h) | 0 | ||||
| -rw-r--r-- | drivers/video/drm/drm_stub.h (renamed from drivers/char/drm/drm_stub.h) | 0 | ||||
| -rw-r--r-- | drivers/video/drm/drm_vm.h (renamed from drivers/char/drm/drm_vm.h) | 0 | ||||
| -rw-r--r-- | drivers/video/drm/ffb.h (renamed from drivers/char/drm/ffb.h) | 0 | ||||
| -rw-r--r-- | drivers/video/drm/ffb_context.c (renamed from drivers/char/drm/ffb_context.c) | 0 | ||||
| -rw-r--r-- | drivers/video/drm/ffb_drv.c (renamed from drivers/char/drm/ffb_drv.c) | 0 | ||||
| -rw-r--r-- | drivers/video/drm/ffb_drv.h (renamed from drivers/char/drm/ffb_drv.h) | 0 | ||||
| -rw-r--r-- | drivers/video/drm/gamma.h (renamed from drivers/char/drm/gamma.h) | 0 | ||||
| -rw-r--r-- | drivers/video/drm/gamma_dma.c (renamed from drivers/char/drm/gamma_dma.c) | 0 | ||||
| -rw-r--r-- | drivers/video/drm/gamma_drm.h (renamed from drivers/char/drm/gamma_drm.h) | 0 | ||||
| -rw-r--r-- | drivers/video/drm/gamma_drv.c (renamed from drivers/char/drm/gamma_drv.c) | 0 | ||||
| -rw-r--r-- | drivers/video/drm/gamma_drv.h (renamed from drivers/char/drm/gamma_drv.h) | 0 | ||||
| -rw-r--r-- | drivers/video/drm/i810.h (renamed from drivers/char/drm/i810.h) | 0 | ||||
| -rw-r--r-- | drivers/video/drm/i810_dma.c (renamed from drivers/char/drm/i810_dma.c) | 0 | ||||
| -rw-r--r-- | drivers/video/drm/i810_drm.h (renamed from drivers/char/drm/i810_drm.h) | 0 | ||||
| -rw-r--r-- | drivers/video/drm/i810_drv.c (renamed from drivers/char/drm/i810_drv.c) | 0 | ||||
| -rw-r--r-- | drivers/video/drm/i810_drv.h (renamed from drivers/char/drm/i810_drv.h) | 0 | ||||
| -rw-r--r-- | drivers/video/drm/i830.h (renamed from drivers/char/drm/i830.h) | 0 | ||||
| -rw-r--r-- | drivers/video/drm/i830_dma.c (renamed from drivers/char/drm/i830_dma.c) | 0 | ||||
| -rw-r--r-- | drivers/video/drm/i830_drm.h (renamed from drivers/char/drm/i830_drm.h) | 0 | ||||
| -rw-r--r-- | drivers/video/drm/i830_drv.c (renamed from drivers/char/drm/i830_drv.c) | 0 | ||||
| -rw-r--r-- | drivers/video/drm/i830_drv.h (renamed from drivers/char/drm/i830_drv.h) | 0 | ||||
| -rw-r--r-- | drivers/video/drm/mga.h (renamed from drivers/char/drm/mga.h) | 0 | ||||
| -rw-r--r-- | drivers/video/drm/mga_dma.c (renamed from drivers/char/drm/mga_dma.c) | 0 | ||||
| -rw-r--r-- | drivers/video/drm/mga_drm.h (renamed from drivers/char/drm/mga_drm.h) | 0 | ||||
| -rw-r--r-- | drivers/video/drm/mga_drv.c (renamed from drivers/char/drm/mga_drv.c) | 0 | ||||
| -rw-r--r-- | drivers/video/drm/mga_drv.h (renamed from drivers/char/drm/mga_drv.h) | 0 | ||||
| -rw-r--r-- | drivers/video/drm/mga_state.c (renamed from drivers/char/drm/mga_state.c) | 0 | ||||
| -rw-r--r-- | drivers/video/drm/mga_ucode.h (renamed from drivers/char/drm/mga_ucode.h) | 0 | ||||
| -rw-r--r-- | drivers/video/drm/mga_warp.c (renamed from drivers/char/drm/mga_warp.c) | 0 | ||||
| -rw-r--r-- | drivers/video/drm/r128.h (renamed from drivers/char/drm/r128.h) | 0 | ||||
| -rw-r--r-- | drivers/video/drm/r128_cce.c (renamed from drivers/char/drm/r128_cce.c) | 0 | ||||
| -rw-r--r-- | drivers/video/drm/r128_drm.h (renamed from drivers/char/drm/r128_drm.h) | 0 | ||||
| -rw-r--r-- | drivers/video/drm/r128_drv.c (renamed from drivers/char/drm/r128_drv.c) | 0 | ||||
| -rw-r--r-- | drivers/video/drm/r128_drv.h (renamed from drivers/char/drm/r128_drv.h) | 0 | ||||
| -rw-r--r-- | drivers/video/drm/r128_state.c (renamed from drivers/char/drm/r128_state.c) | 0 | ||||
| -rw-r--r-- | drivers/video/drm/radeon.h (renamed from drivers/char/drm/radeon.h) | 0 | ||||
| -rw-r--r-- | drivers/video/drm/radeon_cp.c (renamed from drivers/char/drm/radeon_cp.c) | 0 | ||||
| -rw-r--r-- | drivers/video/drm/radeon_drm.h (renamed from drivers/char/drm/radeon_drm.h) | 0 | ||||
| -rw-r--r-- | drivers/video/drm/radeon_drv.c (renamed from drivers/char/drm/radeon_drv.c) | 0 | ||||
| -rw-r--r-- | drivers/video/drm/radeon_drv.h (renamed from drivers/char/drm/radeon_drv.h) | 0 | ||||
| -rw-r--r-- | drivers/video/drm/radeon_irq.c (renamed from drivers/char/drm/radeon_irq.c) | 0 | ||||
| -rw-r--r-- | drivers/video/drm/radeon_mem.c (renamed from drivers/char/drm/radeon_mem.c) | 0 | ||||
| -rw-r--r-- | drivers/video/drm/radeon_state.c (renamed from drivers/char/drm/radeon_state.c) | 0 | ||||
| -rw-r--r-- | drivers/video/drm/sis.h (renamed from drivers/char/drm/sis.h) | 0 | ||||
| -rw-r--r-- | drivers/video/drm/sis_drm.h (renamed from drivers/char/drm/sis_drm.h) | 0 | ||||
| -rw-r--r-- | drivers/video/drm/sis_drv.c (renamed from drivers/char/drm/sis_drv.c) | 0 | ||||
| -rw-r--r-- | drivers/video/drm/sis_drv.h (renamed from drivers/char/drm/sis_drv.h) | 0 | ||||
| -rw-r--r-- | drivers/video/drm/sis_ds.c (renamed from drivers/char/drm/sis_ds.c) | 0 | ||||
| -rw-r--r-- | drivers/video/drm/sis_ds.h (renamed from drivers/char/drm/sis_ds.h) | 0 | ||||
| -rw-r--r-- | drivers/video/drm/sis_mm.c (renamed from drivers/char/drm/sis_mm.c) | 0 | ||||
| -rw-r--r-- | drivers/video/drm/tdfx.h (renamed from drivers/char/drm/tdfx.h) | 0 | ||||
| -rw-r--r-- | drivers/video/drm/tdfx_drv.c (renamed from drivers/char/drm/tdfx_drv.c) | 0 | ||||
| -rw-r--r-- | drivers/video/fbmem.c | 46 | ||||
| -rw-r--r-- | drivers/video/g364fb.c | 1 | ||||
| -rw-r--r-- | drivers/video/macfb.c | 4 | ||||
| -rw-r--r-- | drivers/video/macmodes.c | 1 | ||||
| -rw-r--r-- | drivers/video/maxinefb.c | 1 | ||||
| -rw-r--r-- | drivers/video/offb.c | 1 | ||||
| -rw-r--r-- | drivers/video/vesafb.c | 4 | ||||
| -rw-r--r-- | drivers/video/vga16fb.c | 30 | ||||
| -rw-r--r-- | include/linux/fb.h | 31 | ||||
| -rw-r--r-- | include/video/fbcon.h | 573 |
113 files changed, 489 insertions, 666 deletions
@@ -670,7 +670,7 @@ CLEAN_FILES += \ vmlinux System.map \ drivers/char/consolemap_deftbl.c drivers/video/console/promcon_tbl.c \ drivers/char/conmakehash \ - drivers/char/drm/*-mod.c \ + drivers/video/drm/*-mod.c \ drivers/char/defkeymap.c drivers/char/qtronixmap.c \ drivers/pci/devlist.h drivers/pci/classlist.h drivers/pci/gen-devlist \ drivers/zorro/devlist.h drivers/zorro/gen-devlist \ diff --git a/drivers/char/Config.in b/drivers/char/Config.in index 84eec6579e76..302e33d70714 100644 --- a/drivers/char/Config.in +++ b/drivers/char/Config.in @@ -184,9 +184,6 @@ if [ "$CONFIG_FTAPE" != "n" ]; then fi endmenu -source drivers/char/agp/Config.in -source drivers/char/drm/Config.in - if [ "$CONFIG_HOTPLUG" = "y" -a "$CONFIG_PCMCIA" != "n" ]; then source drivers/char/pcmcia/Config.in fi diff --git a/drivers/char/Makefile b/drivers/char/Makefile index d0be4dd0e8cb..40bc6c16b7de 100644 --- a/drivers/char/Makefile +++ b/drivers/char/Makefile @@ -100,8 +100,6 @@ obj-$(CONFIG_SH_WDT) += shwdt.o obj-$(CONFIG_EUROTECH_WDT) += eurotechwdt.o obj-$(CONFIG_SOFT_WATCHDOG) += softdog.o obj-$(CONFIG_MWAVE) += mwave/ -obj-$(CONFIG_AGP) += agp/ -obj-$(CONFIG_DRM) += drm/ obj-$(CONFIG_PCMCIA) += pcmcia/ include $(TOPDIR)/Rules.make diff --git a/drivers/video/Config.in b/drivers/video/Config.in index 0e1c8808c985..55c378b7726f 100644 --- a/drivers/video/Config.in +++ b/drivers/video/Config.in @@ -5,6 +5,9 @@ mainmenu_option next_comment comment 'Graphics support' +source drivers/video/agp/Config.in +source drivers/video/drm/Config.in + bool 'Support for frame buffer devices ' CONFIG_FB if [ "$CONFIG_FB" = "y" ]; then diff --git a/drivers/video/Makefile b/drivers/video/Makefile index 0f8739db41f4..90e31cedf634 100644 --- a/drivers/video/Makefile +++ b/drivers/video/Makefile @@ -9,6 +9,9 @@ export-objs := fbmem.o fbcmap.o fbmon.o modedb.o fbgen.o cyber2000fb.o # Each configuration option enables a list of files. +obj-$(CONFIG_AGP) += agp/ +obj-$(CONFIG_DRM) += drm/ + # Add fbmon.o back into obj-$(CONFIG_FB) in 2.5.x obj-$(CONFIG_FB) += fbmem.o fbcmap.o modedb.o fbgen.o # Only include macmodes.o if we have FB support and are PPC diff --git a/drivers/char/agp/Config.help b/drivers/video/agp/Config.help index b6083743dad6..b6083743dad6 100644 --- a/drivers/char/agp/Config.help +++ b/drivers/video/agp/Config.help diff --git a/drivers/char/agp/Config.in b/drivers/video/agp/Config.in index a6c13cb4ae4c..a6c13cb4ae4c 100644 --- a/drivers/char/agp/Config.in +++ b/drivers/video/agp/Config.in diff --git a/drivers/char/agp/Makefile b/drivers/video/agp/Makefile index f0e0fce556ef..f0e0fce556ef 100644 --- a/drivers/char/agp/Makefile +++ b/drivers/video/agp/Makefile diff --git a/drivers/char/agp/agp.c b/drivers/video/agp/agp.c index 818fdd0a6d39..818fdd0a6d39 100644 --- a/drivers/char/agp/agp.c +++ b/drivers/video/agp/agp.c diff --git a/drivers/char/agp/agp.h b/drivers/video/agp/agp.h index f5f8c37ed679..f5f8c37ed679 100644 --- a/drivers/char/agp/agp.h +++ b/drivers/video/agp/agp.h diff --git a/drivers/char/agp/ali-agp.c b/drivers/video/agp/ali-agp.c index e60ca2a30fd3..e60ca2a30fd3 100644 --- a/drivers/char/agp/ali-agp.c +++ b/drivers/video/agp/ali-agp.c diff --git a/drivers/char/agp/amd-agp.c b/drivers/video/agp/amd-agp.c index 9fc81a0011e6..9fc81a0011e6 100644 --- a/drivers/char/agp/amd-agp.c +++ b/drivers/video/agp/amd-agp.c diff --git a/drivers/char/agp/frontend.c b/drivers/video/agp/frontend.c index fe9f31f8ecd9..fe9f31f8ecd9 100644 --- a/drivers/char/agp/frontend.c +++ b/drivers/video/agp/frontend.c diff --git a/drivers/char/agp/hp-agp.c b/drivers/video/agp/hp-agp.c index 6798e967d386..6798e967d386 100644 --- a/drivers/char/agp/hp-agp.c +++ b/drivers/video/agp/hp-agp.c diff --git a/drivers/char/agp/i460-agp.c b/drivers/video/agp/i460-agp.c index e52bd0c716ae..e52bd0c716ae 100644 --- a/drivers/char/agp/i460-agp.c +++ b/drivers/video/agp/i460-agp.c diff --git a/drivers/char/agp/i810-agp.c b/drivers/video/agp/i810-agp.c index 77d721dfad9c..77d721dfad9c 100644 --- a/drivers/char/agp/i810-agp.c +++ b/drivers/video/agp/i810-agp.c diff --git a/drivers/char/agp/i8x0-agp.c b/drivers/video/agp/i8x0-agp.c index 0e379680f204..0e379680f204 100644 --- a/drivers/char/agp/i8x0-agp.c +++ b/drivers/video/agp/i8x0-agp.c diff --git a/drivers/char/agp/k8-agp.c b/drivers/video/agp/k8-agp.c index 931211adf948..931211adf948 100644 --- a/drivers/char/agp/k8-agp.c +++ b/drivers/video/agp/k8-agp.c diff --git a/drivers/char/agp/sis-agp.c b/drivers/video/agp/sis-agp.c index 841c32a40267..841c32a40267 100644 --- a/drivers/char/agp/sis-agp.c +++ b/drivers/video/agp/sis-agp.c diff --git a/drivers/char/agp/sworks-agp.c b/drivers/video/agp/sworks-agp.c index ad9e4c46cc52..ad9e4c46cc52 100644 --- a/drivers/char/agp/sworks-agp.c +++ b/drivers/video/agp/sworks-agp.c diff --git a/drivers/char/agp/via-agp.c b/drivers/video/agp/via-agp.c index 5facf9f64062..5facf9f64062 100644 --- a/drivers/char/agp/via-agp.c +++ b/drivers/video/agp/via-agp.c diff --git a/drivers/video/anakinfb.c b/drivers/video/anakinfb.c index 2d26e5fa435a..f89bee5d7046 100644 --- a/drivers/video/anakinfb.c +++ b/drivers/video/anakinfb.c @@ -78,7 +78,6 @@ anakinfb_init(void) fb_info.fbops = &anakinfb_ops; fb_info.var = anakinfb_var; fb_info.fix = anakinfb_fix; - strcpy(fb_info.fontname, "VGA8x16"); if (!(request_mem_region(VGA_START, VGA_SIZE, "vga"))) return -ENOMEM; if (fb_info.screen_base = ioremap(VGA_START, VGA_SIZE)) { diff --git a/drivers/video/aty/atyfb_base.c b/drivers/video/aty/atyfb_base.c index 0da73eb9aef7..139308a941e2 100644 --- a/drivers/video/aty/atyfb_base.c +++ b/drivers/video/aty/atyfb_base.c @@ -214,7 +214,6 @@ static struct fb_ops atyfb_ops = { .fb_rasterimg = atyfb_rasterimg, }; -static char fontname[40] __initdata = { 0 }; static char curblink __initdata = 1; static char noaccel __initdata = 0; static u32 default_vram __initdata = 0; @@ -1822,7 +1821,6 @@ static int __init aty_init(struct fb_info *info, const char *name) info->node = NODEV; info->fbops = &atyfb_ops; info->pseudo_palette = pseudo_palette; - strcpy(info->fontname, fontname); info->flags = FBINFO_FLAG_DEFAULT; #ifdef CONFIG_PMAC_BACKLIGHT @@ -2415,17 +2413,7 @@ int __init atyfb_setup(char *options) return 0; while ((this_opt = strsep(&options, ",")) != NULL) { - if (!strncmp(this_opt, "font:", 5)) { - char *p; - int i; - - p = this_opt + 5; - for (i = 0; i < sizeof(fontname) - 1; i++) - if (!*p || *p == ' ' || *p == ',') - break; - memcpy(fontname, this_opt + 5, i); - fontname[i] = 0; - } else if (!strncmp(this_opt, "noblink", 7)) { + if (!strncmp(this_opt, "noblink", 7)) { curblink = 0; } else if (!strncmp(this_opt, "noaccel", 7)) { noaccel = 1; diff --git a/drivers/video/cfbcopyarea.c b/drivers/video/cfbcopyarea.c index e3fcc679afb9..3bfa19f2b31c 100644 --- a/drivers/video/cfbcopyarea.c +++ b/drivers/video/cfbcopyarea.c @@ -26,7 +26,6 @@ #include <linux/slab.h> #include <asm/types.h> #include <asm/io.h> -#include <video/fbcon.h> #if BITS_PER_LONG == 32 #define FB_READ fb_readl @@ -36,6 +35,384 @@ #define FB_WRITE fb_writeq #endif +/* + * Oh no Assembly code !!!! Expect more to come as the code gets better. + * Ideally the assembly code shoudl be split off into its own seperate file + */ + +/* Those of a delicate disposition might like to skip the next couple of + * pages. + * + * These functions are drop in replacements for memmove and + * memset(_, 0, _). However their five instances add at least a kilobyte + * to the object file. You have been warned. + * + * Not a great fan of assembler for the sake of it, but I think + * that these routines are at least 10 times faster than their C + * equivalents for large blits, and that's important to the lowest level of + * a graphics driver. Question is whether some scheme with the blitter + * would be faster. I suspect not for simple text system - not much + * asynchrony. + * + * Code is very simple, just gruesome expansion. Basic strategy is to + * increase data moved/cleared at each step to 16 bytes to reduce + * instruction per data move overhead. movem might be faster still + * For more than 15 bytes, we try to align the write direction on a + * longword boundary to get maximum speed. This is even more gruesome. + * Unaligned read/write used requires 68020+ - think this is a problem? + * + * Sorry! + */ + +/* ++roman: I've optimized Robert's original versions in some minor + * aspects, e.g. moveq instead of movel, let gcc choose the registers, + * use movem in some places... + * For other modes than 1 plane, lots of more such assembler functions + * were needed (e.g. the ones using movep or expanding color values). + */ + +#if defined(__mc68000__) +/* + * ++andreas: more optimizations: + * subl #65536,d0 replaced by clrw d0; subql #1,d0 for dbcc + * addal is faster than addaw + * movep is rather expensive compared to ordinary move's + * some functions rewritten in C for clarity, no speed loss + */ + +static __inline__ void *fb_memmove(void *d, const void *s, size_t count) +{ + if (d < s) { + if (count < 16) { + __asm__ __volatile__( + "lsrl #1,%2 ; jcc 1f ; moveb %1@+,%0@+\n\t" + "1: lsrl #1,%2 ; jcc 1f ; movew %1@+,%0@+\n\t" + "1: lsrl #1,%2 ; jcc 1f ; movel %1@+,%0@+\n\t" + "1: lsrl #1,%2 ; jcc 1f ; movel %1@+,%0@+ ; movel %1@+,%0@+\n\t" + "1:" + : "=a" (d), "=a" (s), "=d" (count) + : "0" (d), "1" (s), "2" (count) + ); + } else { + long tmp; + __asm__ __volatile__( + "movel %0,%3\n\t" + "lsrl #1,%3 ; jcc 1f ; moveb %1@+,%0@+ ; subqw #1,%2\n\t" + "lsrl #1,%3 ; jcs 2f\n\t" /* %0 increased=>bit 2 switched*/ + "movew %1@+,%0@+ ; subqw #2,%2 ; jra 2f\n\t" + "1: lsrl #1,%3 ; jcc 2f\n\t" + "movew %1@+,%0@+ ; subqw #2,%2\n\t" + "2: movew %2,%-; lsrl #2,%2 ; jeq 6f\n\t" + "lsrl #1,%2 ; jcc 3f ; movel %1@+,%0@+\n\t" + "3: lsrl #1,%2 ; jcc 4f ; movel %1@+,%0@+ ; movel %1@+,%0@+\n\t" + "4: subql #1,%2 ; jcs 6f\n\t" + "5: movel %1@+,%0@+;movel %1@+,%0@+\n\t" + "movel %1@+,%0@+;movel %1@+,%0@+\n\t" + "dbra %2,5b ; clrw %2; subql #1,%2; jcc 5b\n\t" + "6: movew %+,%2; btst #1,%2 ; jeq 7f ; movew %1@+,%0@+\n\t" + "7: ; btst #0,%2 ; jeq 8f ; moveb %1@+,%0@+\n\t" + "8:" + : "=a" (d), "=a" (s), "=d" (count), "=d" (tmp) + : "0" (d), "1" (s), "2" (count) + ); + } + } else { + if (count < 16) { + __asm__ __volatile__( + "lsrl #1,%2 ; jcc 1f ; moveb %1@-,%0@-\n\t" + "1: lsrl #1,%2 ; jcc 1f ; movew %1@-,%0@-\n\t" + "1: lsrl #1,%2 ; jcc 1f ; movel %1@-,%0@-\n\t" + "1: lsrl #1,%2 ; jcc 1f ; movel %1@-,%0@- ; movel %1@-,%0@-\n\t" + "1:" + : "=a" (d), "=a" (s), "=d" (count) + : "0" ((char *) d + count), "1" ((char *) s + count), "2" (count) + ); + } else { + long tmp; + __asm__ __volatile__( + "movel %0,%3\n\t" + "lsrl #1,%3 ; jcc 1f ; moveb %1@-,%0@- ; subqw #1,%2\n\t" + "lsrl #1,%3 ; jcs 2f\n\t" /* %0 increased=>bit 2 switched*/ + "movew %1@-,%0@- ; subqw #2,%2 ; jra 2f\n\t" + "1: lsrl #1,%3 ; jcc 2f\n\t" + "movew %1@-,%0@- ; subqw #2,%2\n\t" + "2: movew %2,%-; lsrl #2,%2 ; jeq 6f\n\t" + "lsrl #1,%2 ; jcc 3f ; movel %1@-,%0@-\n\t" + "3: lsrl #1,%2 ; jcc 4f ; movel %1@-,%0@- ; movel %1@-,%0@-\n\t" + "4: subql #1,%2 ; jcs 6f\n\t" + "5: movel %1@-,%0@-;movel %1@-,%0@-\n\t" + "movel %1@-,%0@-;movel %1@-,%0@-\n\t" + "dbra %2,5b ; clrw %2; subql #1,%2; jcc 5b\n\t" + "6: movew %+,%2; btst #1,%2 ; jeq 7f ; movew %1@-,%0@-\n\t" + "7: ; btst #0,%2 ; jeq 8f ; moveb %1@-,%0@-\n\t" + "8:" + : "=a" (d), "=a" (s), "=d" (count), "=d" (tmp) + : "0" ((char *) d + count), "1" ((char *) s + count), "2" (count) + ); + } + } + return(0); +} + +/* ++andreas: Simple and fast version of memmove, assumes size is + divisible by 16, suitable for moving the whole screen bitplane */ +static __inline__ void fast_memmove(char *dst, const char *src, size_t size) +{ + if (!size) + return; + if (dst < src) + __asm__ __volatile__ + ("1:" + " moveml %0@+,%/d0/%/d1/%/a0/%/a1\n" + " moveml %/d0/%/d1/%/a0/%/a1,%1@\n" + " addql #8,%1; addql #8,%1\n" + " dbra %2,1b\n" + " clrw %2; subql #1,%2\n" + " jcc 1b" + : "=a" (src), "=a" (dst), "=d" (size) + : "0" (src), "1" (dst), "2" (size / 16 - 1) + : "d0", "d1", "a0", "a1", "memory"); + else + __asm__ __volatile__ + ("1:" + " subql #8,%0; subql #8,%0\n" + " moveml %0@,%/d0/%/d1/%/a0/%/a1\n" + " moveml %/d0/%/d1/%/a0/%/a1,%1@-\n" + " dbra %2,1b\n" + " clrw %2; subql #1,%2\n" + " jcc 1b" + : "=a" (src), "=a" (dst), "=d" (size) + : "0" (src + size), "1" (dst + size), "2" (size / 16 - 1) + : "d0", "d1", "a0", "a1", "memory"); +} + +#elif defined(CONFIG_SUN4) + +/* You may think that I'm crazy and that I should use generic + routines. No, I'm not: sun4's framebuffer crashes if we std + into it, so we cannot use memset. */ + +static __inline__ void *sun4_memset(void *s, char val, size_t count) +{ + int i; + for(i=0; i<count;i++) + ((char *) s) [i] = val; + return s; +} + +/* To be honest, this is slow_memmove :). But sun4 is crappy, so what we can do. */ +static __inline__ void fast_memmove(void *d, const void *s, size_t count) +{ + int i; + if (d<s) { + for (i=0; i<count; i++) + ((char *) d)[i] = ((char *) s)[i]; + } else + for (i=0; i<count; i++) + ((char *) d)[count-i-1] = ((char *) s)[count-i-1]; +} + +static __inline__ void *fb_memmove(char *dst, const char *src, size_t size) +{ + fast_memmove(dst, src, size); + return dst; +} + +#endif /* __mc68000__ */ + +#if defined(__i386__) + +static __inline__ void fast_memmove(void *d, const void *s, size_t count) +{ + int d0, d1, d2, d3; + if (d < s) { +__asm__ __volatile__ ( + "cld\n\t" + "shrl $1,%%ecx\n\t" + "jnc 1f\n\t" + "movsb\n" + "1:\tshrl $1,%%ecx\n\t" + "jnc 2f\n\t" + "movsw\n" + "2:\trep\n\t" + "movsl" + : "=&c" (d0), "=&D" (d1), "=&S" (d2) + :"0"(count),"1"((long)d),"2"((long)s) + :"memory"); + } else { +__asm__ __volatile__ ( + "std\n\t" + "shrl $1,%%ecx\n\t" + "jnc 1f\n\t" + "movb 3(%%esi),%%al\n\t" + "movb %%al,3(%%edi)\n\t" + "decl %%esi\n\t" + "decl %%edi\n" + "1:\tshrl $1,%%ecx\n\t" + "jnc 2f\n\t" + "movw 2(%%esi),%%ax\n\t" + "movw %%ax,2(%%edi)\n\t" + "decl %%esi\n\t" + "decl %%edi\n\t" + "decl %%esi\n\t" + "decl %%edi\n" + "2:\trep\n\t" + "movsl\n\t" + "cld" + : "=&c" (d0), "=&D" (d1), "=&S" (d2), "=&a" (d3) + :"0"(count),"1"(count-4+(long)d),"2"(count-4+(long)s) + :"memory"); + } +} + +static __inline__ void *fb_memmove(char *dst, const char *src, size_t size) +{ + fast_memmove(dst, src, size); + return dst; +} + +#else /* !__i386__ */ + + /* + * Anyone who'd like to write asm functions for other CPUs? + * (Why are these functions better than those from include/asm/string.h?) + */ + +static __inline__ void *fb_memmove(void *d, const void *s, size_t count) +{ + unsigned long dst, src; + + if (d < s) { + dst = (unsigned long) d; + src = (unsigned long) s; + + if ((count < 8) || ((dst ^ src) & 3)) + goto restup; + + if (dst & 1) { + fb_writeb(fb_readb(src++), dst++); + count--; + } + if (dst & 2) { + fb_writew(fb_readw(src), dst); + src += 2; + dst += 2; + count -= 2; + } + while (count > 3) { + fb_writel(fb_readl(src), dst); + src += 4; + dst += 4; + count -= 4; + } + + restup: + while (count--) + fb_writeb(fb_readb(src++), dst++); + } else { + dst = (unsigned long) d + count; + src = (unsigned long) s + count; + + if ((count < 8) || ((dst ^ src) & 3)) + goto restdown; + + if (dst & 1) { + src--; + dst--; + count--; + fb_writeb(fb_readb(src), dst); + } + if (dst & 2) { + src -= 2; + dst -= 2; + count -= 2; + fb_writew(fb_readw(src), dst); + } + while (count > 3) { + src -= 4; + dst -= 4; + count -= 4; + fb_writel(fb_readl(src), dst); + } + + restdown: + while (count--) { + src--; + dst--; + fb_writeb(fb_readb(src), dst); + } + } + return d; +} + +static __inline__ void fast_memmove(char *d, const char *s, size_t count) +{ + unsigned long dst, src; + + if (d < s) { + dst = (unsigned long) d; + src = (unsigned long) s; + + if ((count < 8) || ((dst ^ src) & 3)) + goto restup; + + if (dst & 1) { + fb_writeb(fb_readb(src++), dst++); + count--; + } + if (dst & 2) { + fb_writew(fb_readw(src), dst); + src += 2; + dst += 2; + count -= 2; + } + while (count > 3) { + fb_writel(fb_readl(src), dst); + src += 4; + dst += 4; + count -= 4; + } + + restup: + while (count--) + fb_writeb(fb_readb(src++), dst++); + } else { + dst = (unsigned long) d + count; + src = (unsigned long) s + count; + + if ((count < 8) || ((dst ^ src) & 3)) + goto restdown; + + if (dst & 1) { + src--; + dst--; + count--; + fb_writeb(fb_readb(src), dst); + } + if (dst & 2) { + src -= 2; + dst -= 2; + count -= 2; + fb_writew(fb_readw(src), dst); + } + while (count > 3) { + src -= 4; + dst -= 4; + count -= 4; + fb_writel(fb_readl(src), dst); + } + + restdown: + while (count--) { + src--; + dst--; + fb_writeb(fb_readb(src), dst); + } + } +} + +#endif /* !__i386__ */ + void cfb_copyarea(struct fb_info *p, struct fb_copyarea *area) { int x2, y2, lineincr, shift, shift_right, shift_left, old_dx, diff --git a/drivers/video/clps711xfb.c b/drivers/video/clps711xfb.c index 14a67d332255..0eb85d4e8b46 100644 --- a/drivers/video/clps711xfb.c +++ b/drivers/video/clps711xfb.c @@ -27,8 +27,6 @@ #include <linux/proc_fs.h> #include <linux/delay.h> -#include <video/fbcon.h> - #include <asm/hardware.h> #include <asm/mach-types.h> #include <asm/uaccess.h> @@ -368,20 +366,16 @@ int __init clps711xfb_init(void) { int err = -ENOMEM; - cfb = kmalloc(sizeof(*cfb) + sizeof(struct display), GFP_KERNEL); + cfb = kmalloc(sizeof(*cfb), GFP_KERNEL); if (!cfb) goto out; - memset(cfb, 0, sizeof(*cfb) + sizeof(struct display)); + memset(cfb, 0, sizeof(*cfb)); strcpy(cfb->fix.id, "clps711x"); cfb->currcon = -1; cfb->fbops = &clps7111fb_ops; - cfb->changevar = NULL; - cfb->switch_con = gen_switch; - cfb->updatevar = gen_update_var; cfb->flags = FBINFO_FLAG_DEFAULT; - cfb->disp = (struct display *)(cfb + 1); clps711x_guess_lcd_params(cfb); @@ -422,7 +416,6 @@ int __init clps711xfb_init(void) clps_writeb(clps_readb(PDDR) | EDB_PD3_LCDBL, PDDR); } - gen_set_var(&cfb->var, -1, cfb); err = register_framebuffer(cfb); out: return err; diff --git a/drivers/video/console/Config.in b/drivers/video/console/Config.in index 25d1e8671b56..0cabfe387136 100644 --- a/drivers/video/console/Config.in +++ b/drivers/video/console/Config.in @@ -18,17 +18,15 @@ if [ "$CONFIG_VT" != "n" ]; then # fi fi tristate 'MDA text console (dual-headed) ' CONFIG_MDA_CONSOLE - if [ "$CONFIG_FB" = "y" ]; then - define_bool CONFIG_PCI_CONSOLE y + if [ "$CONFIG_SGI_IP22" = "y" ]; then + tristate 'SGI Newport Console support' CONFIG_SGI_NEWPORT_CONSOLE + if [ "$CONFIG_SGI_NEWPORT_CONSOLE" != "y" ]; then + define_bool CONFIG_DUMMY_CONSOLE y + else + define_bool CONFIG_FONT_8x16 y + fi fi -#if [ "$CONFIG_SGI_IP22" = "y" ]; then -# tristate 'SGI Newport Console support' CONFIG_SGI_NEWPORT_CONSOLE -# if [ "$CONFIG_SGI_NEWPORT_CONSOLE" != "y" ]; then -# define_bool CONFIG_DUMMY_CONSOLE y -# else -# define_bool CONFIG_FONT_8x16 y -#fi - if [ "$CONFIG_ARCH_PARISC" = "y" ]; then + if [ "$CONFIG_PARISC" = "y" ]; then # bool 'IODC console' CONFIG_IODC_CONSOLE bool 'STI console' CONFIG_STI_CONSOLE if [ "$CONFIG_IODC_CONSOLE" = "n" ]; then @@ -50,6 +48,7 @@ if [ "$CONFIG_VT" != "n" ]; then bool 'Framebuffer Console support' CONFIG_FRAMEBUFFER_CONSOLE if [ "$CONFIG_FRAMEBUFFER_CONSOLE" = "y" ]; then define_bool CONFIG_DUMMY_CONSOLE y + define_bool CONFIG_PCI_CONSOLE y bool ' Advanced low level driver options' CONFIG_FBCON_ADVANCED if [ "$CONFIG_FBCON_ADVANCED" = "y" ]; then tristate ' Hardware acceleration support' CONFIG_FBCON_ACCEL diff --git a/drivers/video/console/fbcon.c b/drivers/video/console/fbcon.c index 28cc533e65b8..289391635547 100644 --- a/drivers/video/console/fbcon.c +++ b/drivers/video/console/fbcon.c @@ -243,6 +243,24 @@ static void cursor_timer_handler(unsigned long dev_addr) add_timer(&cursor_timer); } +static int __init fbconsole_setup(char *options) +{ + char *this_opt; + int unit; + + if (!options || !*options) + return 0; + + while ((this_opt = strsep(&options, ",")) != NULL) { + if (!strncmp(this_opt, "font:", 5)) { + for (unit = 0; unit < MAX_NR_CONSOLES; unit++) + strcpy(fb_display[unit].fontname, this_opt+5); + } + } + return 0; +} + +__setup("fbcon=", fbconsole_setup); /** * PROC_CONSOLE - find the attached tty or visible console @@ -653,8 +671,8 @@ static void fbcon_setup(int con, int init, int logo) } if (!p->fontdata) { - if (!info->fontname[0] || - !(font = fbcon_find_font(info->fontname))) + if (!p->fontname[0] || + !(font = fbcon_find_font(p->fontname))) font = fbcon_get_default_font(info->var.xres, info->var.yres); p->_fontwidth = font->width; p->_fontheight = font->height; @@ -1605,7 +1623,6 @@ static int fbcon_switch(struct vc_data *conp) return 1; } - static int fbcon_blank(struct vc_data *conp, int blank) { struct display *p = &fb_display[conp->vc_num]; @@ -1619,10 +1636,12 @@ static int fbcon_blank(struct vc_data *conp, int blank) if (!p->can_soft_blank) { if (blank) { if (info->fix.visual == FB_VISUAL_MONO01) { + /* if (info->screen_base) fb_memset255(info->screen_base, info->var.xres_virtual*info->var.yres_virtual* info->var.bits_per_pixel>>3); + */ } else { unsigned short oldc; u_int height; diff --git a/drivers/video/dnfb.c b/drivers/video/dnfb.c index ca34d2af2faf..2cf67d307758 100644 --- a/drivers/video/dnfb.c +++ b/drivers/video/dnfb.c @@ -233,7 +233,6 @@ unsigned long __init dnfb_init(unsigned long mem_start) { int err; - fb_info.fontname[0] = 0; fb_info.node = NODEV; fb_info.fbops = &dn_fb_ops; fb_info.fix = dnfb_fix; diff --git a/drivers/char/drm/Config.help b/drivers/video/drm/Config.help index 043a032ff99e..043a032ff99e 100644 --- a/drivers/char/drm/Config.help +++ b/drivers/video/drm/Config.help diff --git a/drivers/char/drm/Config.in b/drivers/video/drm/Config.in index 04eb8c6f2782..04eb8c6f2782 100644 --- a/drivers/char/drm/Config.in +++ b/drivers/video/drm/Config.in diff --git a/drivers/char/drm/Makefile b/drivers/video/drm/Makefile index 6a5eb1823335..6a5eb1823335 100644 --- a/drivers/char/drm/Makefile +++ b/drivers/video/drm/Makefile diff --git a/drivers/char/drm/README.drm b/drivers/video/drm/README.drm index 6441e01e587c..6441e01e587c 100644 --- a/drivers/char/drm/README.drm +++ b/drivers/video/drm/README.drm diff --git a/drivers/char/drm/ati_pcigart.h b/drivers/video/drm/ati_pcigart.h index a259edb5633f..a259edb5633f 100644 --- a/drivers/char/drm/ati_pcigart.h +++ b/drivers/video/drm/ati_pcigart.h diff --git a/drivers/char/drm/drm.h b/drivers/video/drm/drm.h index f26d4442820f..f26d4442820f 100644 --- a/drivers/char/drm/drm.h +++ b/drivers/video/drm/drm.h diff --git a/drivers/char/drm/drmP.h b/drivers/video/drm/drmP.h index 3588e4b886bc..3588e4b886bc 100644 --- a/drivers/char/drm/drmP.h +++ b/drivers/video/drm/drmP.h diff --git a/drivers/char/drm/drm_agpsupport.h b/drivers/video/drm/drm_agpsupport.h index ae14e95354c5..ae14e95354c5 100644 --- a/drivers/char/drm/drm_agpsupport.h +++ b/drivers/video/drm/drm_agpsupport.h diff --git a/drivers/char/drm/drm_auth.h b/drivers/video/drm/drm_auth.h index 8fce6dfcac4e..8fce6dfcac4e 100644 --- a/drivers/char/drm/drm_auth.h +++ b/drivers/video/drm/drm_auth.h diff --git a/drivers/char/drm/drm_bufs.h b/drivers/video/drm/drm_bufs.h index 9ce7cfff7926..9ce7cfff7926 100644 --- a/drivers/char/drm/drm_bufs.h +++ b/drivers/video/drm/drm_bufs.h diff --git a/drivers/char/drm/drm_context.h b/drivers/video/drm/drm_context.h index 39267b14b60a..39267b14b60a 100644 --- a/drivers/char/drm/drm_context.h +++ b/drivers/video/drm/drm_context.h diff --git a/drivers/char/drm/drm_dma.h b/drivers/video/drm/drm_dma.h index 1bbed275744e..1bbed275744e 100644 --- a/drivers/char/drm/drm_dma.h +++ b/drivers/video/drm/drm_dma.h diff --git a/drivers/char/drm/drm_drawable.h b/drivers/video/drm/drm_drawable.h index 13e46b9fd050..13e46b9fd050 100644 --- a/drivers/char/drm/drm_drawable.h +++ b/drivers/video/drm/drm_drawable.h diff --git a/drivers/char/drm/drm_drv.h b/drivers/video/drm/drm_drv.h index 3ebe78115313..3ebe78115313 100644 --- a/drivers/char/drm/drm_drv.h +++ b/drivers/video/drm/drm_drv.h diff --git a/drivers/char/drm/drm_fops.h b/drivers/video/drm/drm_fops.h index 3d4bffa524c8..3d4bffa524c8 100644 --- a/drivers/char/drm/drm_fops.h +++ b/drivers/video/drm/drm_fops.h diff --git a/drivers/char/drm/drm_init.h b/drivers/video/drm/drm_init.h index 2d6b6a3c9fbd..2d6b6a3c9fbd 100644 --- a/drivers/char/drm/drm_init.h +++ b/drivers/video/drm/drm_init.h diff --git a/drivers/char/drm/drm_ioctl.h b/drivers/video/drm/drm_ioctl.h index 01604e75086c..01604e75086c 100644 --- a/drivers/char/drm/drm_ioctl.h +++ b/drivers/video/drm/drm_ioctl.h diff --git a/drivers/char/drm/drm_lists.h b/drivers/video/drm/drm_lists.h index 5cd8cd47bcb1..5cd8cd47bcb1 100644 --- a/drivers/char/drm/drm_lists.h +++ b/drivers/video/drm/drm_lists.h diff --git a/drivers/char/drm/drm_lock.h b/drivers/video/drm/drm_lock.h index c887d1f66f91..c887d1f66f91 100644 --- a/drivers/char/drm/drm_lock.h +++ b/drivers/video/drm/drm_lock.h diff --git a/drivers/char/drm/drm_memory.h b/drivers/video/drm/drm_memory.h index 22aab7f49b7c..22aab7f49b7c 100644 --- a/drivers/char/drm/drm_memory.h +++ b/drivers/video/drm/drm_memory.h diff --git a/drivers/char/drm/drm_os_linux.h b/drivers/video/drm/drm_os_linux.h index e9b243562cc4..e9b243562cc4 100644 --- a/drivers/char/drm/drm_os_linux.h +++ b/drivers/video/drm/drm_os_linux.h diff --git a/drivers/char/drm/drm_proc.h b/drivers/video/drm/drm_proc.h index d29db7b7b725..d29db7b7b725 100644 --- a/drivers/char/drm/drm_proc.h +++ b/drivers/video/drm/drm_proc.h diff --git a/drivers/char/drm/drm_scatter.h b/drivers/video/drm/drm_scatter.h index 1aedb4037d9b..1aedb4037d9b 100644 --- a/drivers/char/drm/drm_scatter.h +++ b/drivers/video/drm/drm_scatter.h diff --git a/drivers/char/drm/drm_stub.h b/drivers/video/drm/drm_stub.h index 3c9c69eb56db..3c9c69eb56db 100644 --- a/drivers/char/drm/drm_stub.h +++ b/drivers/video/drm/drm_stub.h diff --git a/drivers/char/drm/drm_vm.h b/drivers/video/drm/drm_vm.h index 52dfd59442f5..52dfd59442f5 100644 --- a/drivers/char/drm/drm_vm.h +++ b/drivers/video/drm/drm_vm.h diff --git a/drivers/char/drm/ffb.h b/drivers/video/drm/ffb.h index 01a676a644f7..01a676a644f7 100644 --- a/drivers/char/drm/ffb.h +++ b/drivers/video/drm/ffb.h diff --git a/drivers/char/drm/ffb_context.c b/drivers/video/drm/ffb_context.c index d45cf9cd1fd0..d45cf9cd1fd0 100644 --- a/drivers/char/drm/ffb_context.c +++ b/drivers/video/drm/ffb_context.c diff --git a/drivers/char/drm/ffb_drv.c b/drivers/video/drm/ffb_drv.c index e73a3e910b93..e73a3e910b93 100644 --- a/drivers/char/drm/ffb_drv.c +++ b/drivers/video/drm/ffb_drv.c diff --git a/drivers/char/drm/ffb_drv.h b/drivers/video/drm/ffb_drv.h index 094bbce09dc8..094bbce09dc8 100644 --- a/drivers/char/drm/ffb_drv.h +++ b/drivers/video/drm/ffb_drv.h diff --git a/drivers/char/drm/gamma.h b/drivers/video/drm/gamma.h index 44d8d5bce406..44d8d5bce406 100644 --- a/drivers/char/drm/gamma.h +++ b/drivers/video/drm/gamma.h diff --git a/drivers/char/drm/gamma_dma.c b/drivers/video/drm/gamma_dma.c index 66bd224b7224..66bd224b7224 100644 --- a/drivers/char/drm/gamma_dma.c +++ b/drivers/video/drm/gamma_dma.c diff --git a/drivers/char/drm/gamma_drm.h b/drivers/video/drm/gamma_drm.h index 0d58b07b50ca..0d58b07b50ca 100644 --- a/drivers/char/drm/gamma_drm.h +++ b/drivers/video/drm/gamma_drm.h diff --git a/drivers/char/drm/gamma_drv.c b/drivers/video/drm/gamma_drv.c index b41526bbc375..b41526bbc375 100644 --- a/drivers/char/drm/gamma_drv.c +++ b/drivers/video/drm/gamma_drv.c diff --git a/drivers/char/drm/gamma_drv.h b/drivers/video/drm/gamma_drv.h index e7d0c89603a1..e7d0c89603a1 100644 --- a/drivers/char/drm/gamma_drv.h +++ b/drivers/video/drm/gamma_drv.h diff --git a/drivers/char/drm/i810.h b/drivers/video/drm/i810.h index ea1e7fe56ac0..ea1e7fe56ac0 100644 --- a/drivers/char/drm/i810.h +++ b/drivers/video/drm/i810.h diff --git a/drivers/char/drm/i810_dma.c b/drivers/video/drm/i810_dma.c index 96b0aabcb86e..96b0aabcb86e 100644 --- a/drivers/char/drm/i810_dma.c +++ b/drivers/video/drm/i810_dma.c diff --git a/drivers/char/drm/i810_drm.h b/drivers/video/drm/i810_drm.h index 6b865d4098d8..6b865d4098d8 100644 --- a/drivers/char/drm/i810_drm.h +++ b/drivers/video/drm/i810_drm.h diff --git a/drivers/char/drm/i810_drv.c b/drivers/video/drm/i810_drv.c index 439d7887a38a..439d7887a38a 100644 --- a/drivers/char/drm/i810_drv.c +++ b/drivers/video/drm/i810_drv.c diff --git a/drivers/char/drm/i810_drv.h b/drivers/video/drm/i810_drv.h index 99165cf81e56..99165cf81e56 100644 --- a/drivers/char/drm/i810_drv.h +++ b/drivers/video/drm/i810_drv.h diff --git a/drivers/char/drm/i830.h b/drivers/video/drm/i830.h index b97521882da2..b97521882da2 100644 --- a/drivers/char/drm/i830.h +++ b/drivers/video/drm/i830.h diff --git a/drivers/char/drm/i830_dma.c b/drivers/video/drm/i830_dma.c index 70884373d5b0..70884373d5b0 100644 --- a/drivers/char/drm/i830_dma.c +++ b/drivers/video/drm/i830_dma.c diff --git a/drivers/char/drm/i830_drm.h b/drivers/video/drm/i830_drm.h index 725ad3692b65..725ad3692b65 100644 --- a/drivers/char/drm/i830_drm.h +++ b/drivers/video/drm/i830_drm.h diff --git a/drivers/char/drm/i830_drv.c b/drivers/video/drm/i830_drv.c index d9a659a44a42..d9a659a44a42 100644 --- a/drivers/char/drm/i830_drv.c +++ b/drivers/video/drm/i830_drv.c diff --git a/drivers/char/drm/i830_drv.h b/drivers/video/drm/i830_drv.h index 527d0ce3d3c4..527d0ce3d3c4 100644 --- a/drivers/char/drm/i830_drv.h +++ b/drivers/video/drm/i830_drv.h diff --git a/drivers/char/drm/mga.h b/drivers/video/drm/mga.h index 5380cb0dca32..5380cb0dca32 100644 --- a/drivers/char/drm/mga.h +++ b/drivers/video/drm/mga.h diff --git a/drivers/char/drm/mga_dma.c b/drivers/video/drm/mga_dma.c index 3c84de63a7f9..3c84de63a7f9 100644 --- a/drivers/char/drm/mga_dma.c +++ b/drivers/video/drm/mga_dma.c diff --git a/drivers/char/drm/mga_drm.h b/drivers/video/drm/mga_drm.h index 8f56beed6560..8f56beed6560 100644 --- a/drivers/char/drm/mga_drm.h +++ b/drivers/video/drm/mga_drm.h diff --git a/drivers/char/drm/mga_drv.c b/drivers/video/drm/mga_drv.c index f0d4935dff8b..f0d4935dff8b 100644 --- a/drivers/char/drm/mga_drv.c +++ b/drivers/video/drm/mga_drv.c diff --git a/drivers/char/drm/mga_drv.h b/drivers/video/drm/mga_drv.h index b5f16ae26117..b5f16ae26117 100644 --- a/drivers/char/drm/mga_drv.h +++ b/drivers/video/drm/mga_drv.h diff --git a/drivers/char/drm/mga_state.c b/drivers/video/drm/mga_state.c index 5e5b594a5f00..5e5b594a5f00 100644 --- a/drivers/char/drm/mga_state.c +++ b/drivers/video/drm/mga_state.c diff --git a/drivers/char/drm/mga_ucode.h b/drivers/video/drm/mga_ucode.h index fa0f82ec9fa0..fa0f82ec9fa0 100644 --- a/drivers/char/drm/mga_ucode.h +++ b/drivers/video/drm/mga_ucode.h diff --git a/drivers/char/drm/mga_warp.c b/drivers/video/drm/mga_warp.c index ea7f53a6199b..ea7f53a6199b 100644 --- a/drivers/char/drm/mga_warp.c +++ b/drivers/video/drm/mga_warp.c diff --git a/drivers/char/drm/r128.h b/drivers/video/drm/r128.h index 472a8014f949..472a8014f949 100644 --- a/drivers/char/drm/r128.h +++ b/drivers/video/drm/r128.h diff --git a/drivers/char/drm/r128_cce.c b/drivers/video/drm/r128_cce.c index 5175885ea1da..5175885ea1da 100644 --- a/drivers/char/drm/r128_cce.c +++ b/drivers/video/drm/r128_cce.c diff --git a/drivers/char/drm/r128_drm.h b/drivers/video/drm/r128_drm.h index a8d230088800..a8d230088800 100644 --- a/drivers/char/drm/r128_drm.h +++ b/drivers/video/drm/r128_drm.h diff --git a/drivers/char/drm/r128_drv.c b/drivers/video/drm/r128_drv.c index e2e426907d22..e2e426907d22 100644 --- a/drivers/char/drm/r128_drv.c +++ b/drivers/video/drm/r128_drv.c diff --git a/drivers/char/drm/r128_drv.h b/drivers/video/drm/r128_drv.h index aeb73e08d4b6..aeb73e08d4b6 100644 --- a/drivers/char/drm/r128_drv.h +++ b/drivers/video/drm/r128_drv.h diff --git a/drivers/char/drm/r128_state.c b/drivers/video/drm/r128_state.c index 6ae5863919e9..6ae5863919e9 100644 --- a/drivers/char/drm/r128_state.c +++ b/drivers/video/drm/r128_state.c diff --git a/drivers/char/drm/radeon.h b/drivers/video/drm/radeon.h index 59b9ebe7fcfc..59b9ebe7fcfc 100644 --- a/drivers/char/drm/radeon.h +++ b/drivers/video/drm/radeon.h diff --git a/drivers/char/drm/radeon_cp.c b/drivers/video/drm/radeon_cp.c index c0fb63ef1812..c0fb63ef1812 100644 --- a/drivers/char/drm/radeon_cp.c +++ b/drivers/video/drm/radeon_cp.c diff --git a/drivers/char/drm/radeon_drm.h b/drivers/video/drm/radeon_drm.h index 7c45898af8dd..7c45898af8dd 100644 --- a/drivers/char/drm/radeon_drm.h +++ b/drivers/video/drm/radeon_drm.h diff --git a/drivers/char/drm/radeon_drv.c b/drivers/video/drm/radeon_drv.c index df85936087cc..df85936087cc 100644 --- a/drivers/char/drm/radeon_drv.c +++ b/drivers/video/drm/radeon_drv.c diff --git a/drivers/char/drm/radeon_drv.h b/drivers/video/drm/radeon_drv.h index 40c4d9fe5157..40c4d9fe5157 100644 --- a/drivers/char/drm/radeon_drv.h +++ b/drivers/video/drm/radeon_drv.h diff --git a/drivers/char/drm/radeon_irq.c b/drivers/video/drm/radeon_irq.c index 54702bee63ac..54702bee63ac 100644 --- a/drivers/char/drm/radeon_irq.c +++ b/drivers/video/drm/radeon_irq.c diff --git a/drivers/char/drm/radeon_mem.c b/drivers/video/drm/radeon_mem.c index 5c07c1afe1d1..5c07c1afe1d1 100644 --- a/drivers/char/drm/radeon_mem.c +++ b/drivers/video/drm/radeon_mem.c diff --git a/drivers/char/drm/radeon_state.c b/drivers/video/drm/radeon_state.c index 179a22027741..179a22027741 100644 --- a/drivers/char/drm/radeon_state.c +++ b/drivers/video/drm/radeon_state.c diff --git a/drivers/char/drm/sis.h b/drivers/video/drm/sis.h index 0bf3dfa96cd3..0bf3dfa96cd3 100644 --- a/drivers/char/drm/sis.h +++ b/drivers/video/drm/sis.h diff --git a/drivers/char/drm/sis_drm.h b/drivers/video/drm/sis_drm.h index 8aaee2240960..8aaee2240960 100644 --- a/drivers/char/drm/sis_drm.h +++ b/drivers/video/drm/sis_drm.h diff --git a/drivers/char/drm/sis_drv.c b/drivers/video/drm/sis_drv.c index 0c917bd4e41b..0c917bd4e41b 100644 --- a/drivers/char/drm/sis_drv.c +++ b/drivers/video/drm/sis_drv.c diff --git a/drivers/char/drm/sis_drv.h b/drivers/video/drm/sis_drv.h index 844e38b0770b..844e38b0770b 100644 --- a/drivers/char/drm/sis_drv.h +++ b/drivers/video/drm/sis_drv.h diff --git a/drivers/char/drm/sis_ds.c b/drivers/video/drm/sis_ds.c index 95880a482d79..95880a482d79 100644 --- a/drivers/char/drm/sis_ds.c +++ b/drivers/video/drm/sis_ds.c diff --git a/drivers/char/drm/sis_ds.h b/drivers/video/drm/sis_ds.h index c3367dba78d5..c3367dba78d5 100644 --- a/drivers/char/drm/sis_ds.h +++ b/drivers/video/drm/sis_ds.h diff --git a/drivers/char/drm/sis_mm.c b/drivers/video/drm/sis_mm.c index 81832769dfd7..81832769dfd7 100644 --- a/drivers/char/drm/sis_mm.c +++ b/drivers/video/drm/sis_mm.c diff --git a/drivers/char/drm/tdfx.h b/drivers/video/drm/tdfx.h index 40aba8fb28ae..40aba8fb28ae 100644 --- a/drivers/char/drm/tdfx.h +++ b/drivers/video/drm/tdfx.h diff --git a/drivers/char/drm/tdfx_drv.c b/drivers/video/drm/tdfx_drv.c index 8b7901889bb0..8b7901889bb0 100644 --- a/drivers/char/drm/tdfx_drv.c +++ b/drivers/video/drm/tdfx_drv.c diff --git a/drivers/video/fbmem.c b/drivers/video/fbmem.c index c3217085ee32..5be058af1548 100644 --- a/drivers/video/fbmem.c +++ b/drivers/video/fbmem.c @@ -24,7 +24,6 @@ #include <linux/mm.h> #include <linux/mman.h> #include <linux/tty.h> -#include <linux/console.h> #include <linux/init.h> #include <linux/proc_fs.h> #ifdef CONFIG_KMOD @@ -42,7 +41,10 @@ #include <asm/pgtable.h> #include <linux/fb.h> +#ifdef CONFIG_VT +#include <linux/console.h> #include <video/fbcon.h> +#endif /* * Frame buffer device initialization and setup routines @@ -356,11 +358,14 @@ static int num_pref_init_funcs __initdata = 0; struct fb_info *registered_fb[FB_MAX]; int num_registered_fb; + +#ifdef CONFIG_FRAMEBUFFER_CONSOLE extern int fbcon_softback_size; static int first_fb_vc; static int last_fb_vc = MAX_NR_CONSOLES-1; static int fbcon_is_default = 1; +#endif #ifdef CONFIG_FB_OF static int ofonly __initdata = 0; @@ -468,7 +473,9 @@ fb_ioctl(struct inode *inode, struct file *file, unsigned int cmd, struct fb_ops *fb = info->fbops; struct fb_var_screeninfo var; struct fb_fix_screeninfo fix; +#ifdef CONFIG_FRAMEBUFFER_CONSOLE struct fb_con2fbmap con2fb; +#endif struct fb_cmap cmap; int i; @@ -481,13 +488,13 @@ fb_ioctl(struct inode *inode, struct file *file, unsigned int cmd, case FBIOPUT_VSCREENINFO: if (copy_from_user(&var, (void *) arg, sizeof(var))) return -EFAULT; - if (var.activate & FB_ACTIVATE_ALL) { +#ifdef CONFIG_FRAMEBUFFER_CONSOLE + if (var.activate & FB_ACTIVATE_ALL) i = set_all_vcs(fbidx, fb, &var, info); - if (i) return i; - } else { + else +#endif i = fb_set_var(&var, info); - if (i) return i; - } + if (i) return i; if (copy_to_user((void *) arg, &var, sizeof(var))) return -EFAULT; return 0; @@ -511,7 +518,7 @@ fb_ioctl(struct inode *inode, struct file *file, unsigned int cmd, if (copy_to_user((void *) arg, &var, sizeof(var))) return -EFAULT; return i; -#ifdef CONFIG_VT +#ifdef CONFIG_FRAMEBUFFER_CONSOLE case FBIOGET_CON2FBMAP: if (copy_from_user(&con2fb, (void *)arg, sizeof(con2fb))) return -EFAULT; @@ -540,7 +547,7 @@ fb_ioctl(struct inode *inode, struct file *file, unsigned int cmd, for (i = 0; i < MAX_NR_CONSOLES; i++) set_con2fb_map(i, con2fb.framebuffer); return 0; -#endif +#endif /* CONFIG_FRAMEBUFFER_CONSOLE */ case FBIOBLANK: if (fb->fb_blank == NULL) return -EINVAL; @@ -737,10 +744,13 @@ static devfs_handle_t devfs_handle; int register_framebuffer(struct fb_info *fb_info) { - int i, j; - char name_buf[8]; static int fb_ever_opened[FB_MAX]; +#ifdef CONFIG_FRAMEBUFFER_CONSOLE static int first = 1; + int j; +#endif + char name_buf[8]; + int i; if (num_registered_fb == FB_MAX) return -ENXIO; @@ -753,6 +763,7 @@ register_framebuffer(struct fb_info *fb_info) registered_fb[i] = fb_info; if (!fb_ever_opened[i]) { struct module *owner = fb_info->fbops->owner; +#ifdef CONFIG_FRAMEBUFFER_CONSOLE /* * We assume initial frame buffer devices can be opened this * many times @@ -775,6 +786,15 @@ register_framebuffer(struct fb_info *fb_info) first = 0; take_over_console(&fb_con, first_fb_vc, last_fb_vc, fbcon_is_default); } +#else + if (owner) { + __MOD_INC_USE_COUNT(owner); + if (fb_info->fbops->fb_open && fb_info->fbops->fb_open(fb_info,0)) + __MOD_DEC_USE_COUNT(owner); + } + fb_ever_opened[i] = 1; + } +#endif sprintf (name_buf, "%d", i); fb_info->devfs_handle = devfs_register (devfs_handle, name_buf, DEVFS_FL_DEFAULT, @@ -801,9 +821,11 @@ unregister_framebuffer(struct fb_info *fb_info) int i, j; i = GET_FB_IDX(fb_info->node); +#ifdef CONFIG_FRAMEBUFFER_CONSOLE for (j = 0; j < MAX_NR_CONSOLES; j++) if (con2fb_map[j] == i) return -EBUSY; +#endif if (!registered_fb[i]) return -EINVAL; devfs_unregister (fb_info->devfs_handle); @@ -873,7 +895,8 @@ int __init video_setup(char *options) if (!options || !*options) return 0; - + +#ifdef CONFIG_FRAMEBUFFER_CONSOLE if (!strncmp(options, "scrollback:", 11)) { options += 11; if (*options) { @@ -910,6 +933,7 @@ int __init video_setup(char *options) last_fb_vc = simple_strtoul(options, &options, 10) - 1; fbcon_is_default = 0; } +#endif #ifdef CONFIG_FB_OF if (!strcmp(options, "ofonly")) { diff --git a/drivers/video/g364fb.c b/drivers/video/g364fb.c index fc7cdd3af470..e410bf0fa485 100644 --- a/drivers/video/g364fb.c +++ b/drivers/video/g364fb.c @@ -240,7 +240,6 @@ int __init g364fb_init(void) fb_info.fix = fb_fix; fb_info.flags = FBINFO_FLAG_DEFAULT; - fb_info.fontname[0] = '\0'; fb_alloc_cmap(&fb_info.cmap, 255, 0); if (register_framebuffer(&fb_info) < 0) diff --git a/drivers/video/macfb.c b/drivers/video/macfb.c index 9211ff1ac10e..9483951392dc 100644 --- a/drivers/video/macfb.c +++ b/drivers/video/macfb.c @@ -595,8 +595,6 @@ void __init macfb_setup(char *options, int *ints) { char *this_opt; - fb_info.fontname[0] = '\0'; - if (!options || !*options) return; @@ -605,8 +603,6 @@ void __init macfb_setup(char *options, int *ints) if (! strcmp(this_opt, "inverse")) inverse=1; - else if (!strncmp(this_opt, "font:", 5)) - strcpy(fb_info.fontname, this_opt+5); /* This means "turn on experimental CLUT code" */ else if (!strcmp(this_opt, "vidtest")) vidtest=1; diff --git a/drivers/video/macmodes.c b/drivers/video/macmodes.c index ee713a98a79d..15855248717e 100644 --- a/drivers/video/macmodes.c +++ b/drivers/video/macmodes.c @@ -20,7 +20,6 @@ #include <linux/fb.h> #include <linux/string.h> -#include <video/fbcon.h> #include <video/macmodes.h> /* diff --git a/drivers/video/maxinefb.c b/drivers/video/maxinefb.c index 1f16a8c8affb..eb94dc68611f 100644 --- a/drivers/video/maxinefb.c +++ b/drivers/video/maxinefb.c @@ -34,7 +34,6 @@ #include <linux/delay.h> #include <linux/init.h> #include <linux/fb.h> -#include <video/fbcon.h> #include "maxinefb.h" /* bootinfo.h defines the machine type values, needed when checking */ diff --git a/drivers/video/offb.c b/drivers/video/offb.c index 70fac775a7b2..3ddd97cd6a1a 100644 --- a/drivers/video/offb.c +++ b/drivers/video/offb.c @@ -528,7 +528,6 @@ static void __init offb_init_fb(const char *name, const char *full_name, info->screen_base = ioremap(address, fix->smem_len); info->par = par; info->pseudo_palette = (void *) (info + 1); - info->fontname[0] = '\0'; info->flags = FBINFO_FLAG_DEFAULT; fb_alloc_cmap(&info->cmap, 256, 0); diff --git a/drivers/video/vesafb.c b/drivers/video/vesafb.c index ea9426dfcc5a..b08e37e7fb6c 100644 --- a/drivers/video/vesafb.c +++ b/drivers/video/vesafb.c @@ -181,8 +181,6 @@ int __init vesafb_setup(char *options) { char *this_opt; - fb_info.fontname[0] = '\0'; - if (!options || !*options) return 0; @@ -203,8 +201,6 @@ int __init vesafb_setup(char *options) pmi_setpal=1; else if (! strcmp(this_opt, "mtrr")) mtrr=1; - else if (!strncmp(this_opt, "font:", 5)) - strcpy(fb_info.fontname, this_opt+5); } return 0; } diff --git a/drivers/video/vga16fb.c b/drivers/video/vga16fb.c index 0d1529f45650..62b802aa26bc 100644 --- a/drivers/video/vga16fb.c +++ b/drivers/video/vga16fb.c @@ -18,18 +18,10 @@ #include <linux/slab.h> #include <linux/delay.h> #include <linux/fb.h> -#include <linux/console.h> -#include <linux/selection.h> #include <linux/ioport.h> #include <linux/init.h> #include <asm/io.h> - -#include <video/fbcon.h> -#include <video/fbcon-vga-planes.h> -#include <video/fbcon-vga.h> -#include <video/fbcon-cfb4.h> -#include <video/fbcon-cfb8.h> #include "vga.h" #define GRAPHICS_ADDR_REG 0x3ce /* Graphics address register. */ @@ -1058,8 +1050,6 @@ static struct fb_ops vga16fb_ops = { .fb_set_var = vga16fb_set_var, .fb_check_var = vga16fb_check_var, .fb_set_par = vga16fb_set_par, - .fb_get_cmap = gen_get_cmap, - .fb_set_cmap = gen_set_cmap, .fb_setcolreg = vga16fb_setcolreg, .fb_pan_display = vga16fb_pan_display, .fb_blank = vga16fb_blank, @@ -1070,16 +1060,11 @@ int vga16fb_setup(char *options) { char *this_opt; - vga16fb.fontname[0] = '\0'; - if (!options || !*options) return 0; while ((this_opt = strsep(&options, ",")) != NULL) { if (!*this_opt) continue; - - if (!strncmp(this_opt, "font:", 5)) - strcpy(vga16fb.fontname, this_opt+5); } return 0; } @@ -1109,24 +1094,14 @@ int __init vga16fb_init(void) vga16fb_defined.green.length = i; vga16fb_defined.blue.length = i; - /* XXX share VGA I/O region with vgacon and others */ - - disp.var = vga16fb_defined; - /* name should not depend on EGA/VGA */ - strcpy(vga16fb.modename, "VGA16 VGA"); - vga16fb.changevar = NULL; + strcpy(vga16fb_fix.id, "VGA16 VGA"); vga16fb.node = NODEV; vga16fb.fbops = &vga16fb_ops; vga16fb.var = vga16fb_defined; vga16fb.fix = vga16fb_fix; vga16fb.par = &vga16_par; - vga16fb.disp = &disp; - vga16fb.currcon = -1; - vga16fb.switch_con = gen_switch; - vga16fb.updatevar=&vga16fb_update_var; vga16fb.flags=FBINFO_FLAG_DEFAULT; - vga16fb_set_disp(-1, &vga16fb); if (register_framebuffer(&vga16fb) < 0) { iounmap(vga16fb.screen_base); @@ -1134,8 +1109,7 @@ int __init vga16fb_init(void) } printk(KERN_INFO "fb%d: %s frame buffer device\n", - GET_FB_IDX(vga16fb.node), vga16fb.modename); - + GET_FB_IDX(vga16fb.node), vga16fb.fix.id); return 0; } diff --git a/include/linux/fb.h b/include/linux/fb.h index d6ba52c1e461..b049028f6891 100644 --- a/include/linux/fb.h +++ b/include/linux/fb.h @@ -18,6 +18,7 @@ #define FBIOGETCMAP 0x4604 #define FBIOPUTCMAP 0x4605 #define FBIOPAN_DISPLAY 0x4606 +#define FBIO_CURSOR _IOWR('F', 0x08, struct fbcursor) /* 0x4607-0x460B are defined below */ /* #define FBIOGET_MONITORSPEC 0x460C */ /* #define FBIOPUT_MONITORSPEC 0x460D */ @@ -258,6 +259,32 @@ struct fb_vblank { __u32 reserved[4]; /* reserved for future compatibility */ }; +/* + * hardware cursor control + */ + +#define FB_CUR_SETCUR 0x01 +#define FB_CUR_SETPOS 0x02 +#define FB_CUR_SETHOT 0x04 +#define FB_CUR_SETCMAP 0x08 +#define FB_CUR_SETSHAPE 0x10 +#define FB_CUR_SETALL 0x1F + +struct fbcurpos { + __u16 x, y; +}; + +struct fbcursor { + __u16 set; /* what to set */ + __u16 enable; /* cursor on/off */ + struct fbcurpos pos; /* cursor position */ + struct fbcurpos hot; /* cursor hot spot */ + struct fb_cmap cmap; /* color map info */ + struct fbcurpos size; /* cursor bit map size */ + char *image; /* cursor image bits */ + char *mask; /* cursor mask bits */ +}; + /* Internal HW accel */ #define ROP_COPY 0 #define ROP_XOR 1 @@ -324,6 +351,8 @@ struct fb_ops { int (*fb_check_var)(struct fb_var_screeninfo *var, struct fb_info *info); /* set the video mode according to par */ int (*fb_set_par)(struct fb_info *info); + /* cursor control */ + int (*fb_cursor)(struct fb_info *info, struct fbcursor *cursor); /* set color register */ int (*fb_setcolreg)(unsigned regno, unsigned red, unsigned green, unsigned blue, unsigned transp, struct fb_info *info); @@ -358,12 +387,12 @@ struct fb_info { struct fb_var_screeninfo var; /* Current var */ struct fb_fix_screeninfo fix; /* Current fix */ struct fb_monspecs monspecs; /* Current Monitor specs */ + struct fbcursor cursor; /* Current cursor */ struct fb_cmap cmap; /* Current cmap */ struct fb_ops *fbops; char *screen_base; /* Virtual address */ struct vc_data *display_fg; /* Console visible on this display */ int currcon; /* Current VC. */ - char fontname[40]; /* default font name */ devfs_handle_t devfs_handle; /* Devfs handle for new name */ devfs_handle_t devfs_lhandle; /* Devfs handle for compat. symlink */ void *pseudo_palette; /* Fake palette of 16 colors and diff --git a/include/video/fbcon.h b/include/video/fbcon.h index 10ca672e0d65..1583517ce306 100644 --- a/include/video/fbcon.h +++ b/include/video/fbcon.h @@ -73,7 +73,8 @@ struct display { int bgcol; u_long next_line; /* offset to one line below */ u_long next_plane; /* offset to next plane */ - u_char *fontdata; /* Font associated to this display */ + char fontname[40]; /* Font associated to this display */ + u_char *fontdata; unsigned short _fontheightlog; unsigned short _fontwidthlog; unsigned short _fontheight; @@ -85,10 +86,9 @@ struct display { unsigned short charmask; /* 0xff or 0x1ff */ }; -/* drivers/video/fbcon.c */ +/* drivers/video/console/fbcon.c */ extern struct display fb_display[MAX_NR_CONSOLES]; extern char con2fb_map[MAX_NR_CONSOLES]; -extern int PROC_CONSOLE(const struct fb_info *info); extern void set_con2fb_map(int unit, int newidx); extern int set_all_vcs(int fbidx, struct fb_ops *fb, struct fb_var_screeninfo *var, struct fb_info *info); @@ -184,571 +184,4 @@ extern int set_all_vcs(int fbidx, struct fb_ops *fb, extern void fbcon_redraw_clear(struct vc_data *, struct display *, int, int, int, int); extern void fbcon_redraw_bmove(struct display *, int, int, int, int, int, int); - -/* ================================================================= */ -/* Utility Assembler Functions */ -/* ================================================================= */ - - -#if defined(__mc68000__) - -/* ====================================================================== */ - -/* Those of a delicate disposition might like to skip the next couple of - * pages. - * - * These functions are drop in replacements for memmove and - * memset(_, 0, _). However their five instances add at least a kilobyte - * to the object file. You have been warned. - * - * Not a great fan of assembler for the sake of it, but I think - * that these routines are at least 10 times faster than their C - * equivalents for large blits, and that's important to the lowest level of - * a graphics driver. Question is whether some scheme with the blitter - * would be faster. I suspect not for simple text system - not much - * asynchrony. - * - * Code is very simple, just gruesome expansion. Basic strategy is to - * increase data moved/cleared at each step to 16 bytes to reduce - * instruction per data move overhead. movem might be faster still - * For more than 15 bytes, we try to align the write direction on a - * longword boundary to get maximum speed. This is even more gruesome. - * Unaligned read/write used requires 68020+ - think this is a problem? - * - * Sorry! - */ - - -/* ++roman: I've optimized Robert's original versions in some minor - * aspects, e.g. moveq instead of movel, let gcc choose the registers, - * use movem in some places... - * For other modes than 1 plane, lots of more such assembler functions - * were needed (e.g. the ones using movep or expanding color values). - */ - -/* ++andreas: more optimizations: - subl #65536,d0 replaced by clrw d0; subql #1,d0 for dbcc - addal is faster than addaw - movep is rather expensive compared to ordinary move's - some functions rewritten in C for clarity, no speed loss */ - -static __inline__ void *fb_memclear_small(void *s, size_t count) -{ - if (!count) - return(0); - - __asm__ __volatile__( - "lsrl #1,%1 ; jcc 1f ; moveb %2,%0@-\n\t" - "1: lsrl #1,%1 ; jcc 1f ; movew %2,%0@-\n\t" - "1: lsrl #1,%1 ; jcc 1f ; movel %2,%0@-\n\t" - "1: lsrl #1,%1 ; jcc 1f ; movel %2,%0@- ; movel %2,%0@-\n\t" - "1:" - : "=a" (s), "=d" (count) - : "d" (0), "0" ((char *)s+count), "1" (count) - ); - __asm__ __volatile__( - "subql #1,%1 ; jcs 3f\n\t" - "movel %2,%%d4; movel %2,%%d5; movel %2,%%d6\n\t" - "2: moveml %2/%%d4/%%d5/%%d6,%0@-\n\t" - "dbra %1,2b\n\t" - "3:" - : "=a" (s), "=d" (count) - : "d" (0), "0" (s), "1" (count) - : "d4", "d5", "d6" - ); - - return(0); -} - - -static __inline__ void *fb_memclear(void *s, size_t count) -{ - if (!count) - return(0); - - if (count < 16) { - __asm__ __volatile__( - "lsrl #1,%1 ; jcc 1f ; clrb %0@+\n\t" - "1: lsrl #1,%1 ; jcc 1f ; clrw %0@+\n\t" - "1: lsrl #1,%1 ; jcc 1f ; clrl %0@+\n\t" - "1: lsrl #1,%1 ; jcc 1f ; clrl %0@+ ; clrl %0@+\n\t" - "1:" - : "=a" (s), "=d" (count) - : "0" (s), "1" (count) - ); - } else { - long tmp; - __asm__ __volatile__( - "movel %1,%2\n\t" - "lsrl #1,%2 ; jcc 1f ; clrb %0@+ ; subqw #1,%1\n\t" - "lsrl #1,%2 ; jcs 2f\n\t" /* %0 increased=>bit 2 switched*/ - "clrw %0@+ ; subqw #2,%1 ; jra 2f\n\t" - "1: lsrl #1,%2 ; jcc 2f\n\t" - "clrw %0@+ ; subqw #2,%1\n\t" - "2: movew %1,%2; lsrl #2,%1 ; jeq 6f\n\t" - "lsrl #1,%1 ; jcc 3f ; clrl %0@+\n\t" - "3: lsrl #1,%1 ; jcc 4f ; clrl %0@+ ; clrl %0@+\n\t" - "4: subql #1,%1 ; jcs 6f\n\t" - "5: clrl %0@+; clrl %0@+ ; clrl %0@+ ; clrl %0@+\n\t" - "dbra %1,5b ; clrw %1; subql #1,%1; jcc 5b\n\t" - "6: movew %2,%1; btst #1,%1 ; jeq 7f ; clrw %0@+\n\t" - "7: ; btst #0,%1 ; jeq 8f ; clrb %0@+\n\t" - "8:" - : "=a" (s), "=d" (count), "=d" (tmp) - : "0" (s), "1" (count) - ); - } - - return(0); -} - - -static __inline__ void *fb_memset255(void *s, size_t count) -{ - if (!count) - return(0); - - __asm__ __volatile__( - "lsrl #1,%1 ; jcc 1f ; moveb %2,%0@-\n\t" - "1: lsrl #1,%1 ; jcc 1f ; movew %2,%0@-\n\t" - "1: lsrl #1,%1 ; jcc 1f ; movel %2,%0@-\n\t" - "1: lsrl #1,%1 ; jcc 1f ; movel %2,%0@- ; movel %2,%0@-\n\t" - "1:" - : "=a" (s), "=d" (count) - : "d" (-1), "0" ((char *)s+count), "1" (count) - ); - __asm__ __volatile__( - "subql #1,%1 ; jcs 3f\n\t" - "movel %2,%%d4; movel %2,%%d5; movel %2,%%d6\n\t" - "2: moveml %2/%%d4/%%d5/%%d6,%0@-\n\t" - "dbra %1,2b\n\t" - "3:" - : "=a" (s), "=d" (count) - : "d" (-1), "0" (s), "1" (count) - : "d4", "d5", "d6" - ); - - return(0); -} - - -static __inline__ void *fb_memmove(void *d, const void *s, size_t count) -{ - if (d < s) { - if (count < 16) { - __asm__ __volatile__( - "lsrl #1,%2 ; jcc 1f ; moveb %1@+,%0@+\n\t" - "1: lsrl #1,%2 ; jcc 1f ; movew %1@+,%0@+\n\t" - "1: lsrl #1,%2 ; jcc 1f ; movel %1@+,%0@+\n\t" - "1: lsrl #1,%2 ; jcc 1f ; movel %1@+,%0@+ ; movel %1@+,%0@+\n\t" - "1:" - : "=a" (d), "=a" (s), "=d" (count) - : "0" (d), "1" (s), "2" (count) - ); - } else { - long tmp; - __asm__ __volatile__( - "movel %0,%3\n\t" - "lsrl #1,%3 ; jcc 1f ; moveb %1@+,%0@+ ; subqw #1,%2\n\t" - "lsrl #1,%3 ; jcs 2f\n\t" /* %0 increased=>bit 2 switched*/ - "movew %1@+,%0@+ ; subqw #2,%2 ; jra 2f\n\t" - "1: lsrl #1,%3 ; jcc 2f\n\t" - "movew %1@+,%0@+ ; subqw #2,%2\n\t" - "2: movew %2,%-; lsrl #2,%2 ; jeq 6f\n\t" - "lsrl #1,%2 ; jcc 3f ; movel %1@+,%0@+\n\t" - "3: lsrl #1,%2 ; jcc 4f ; movel %1@+,%0@+ ; movel %1@+,%0@+\n\t" - "4: subql #1,%2 ; jcs 6f\n\t" - "5: movel %1@+,%0@+;movel %1@+,%0@+\n\t" - "movel %1@+,%0@+;movel %1@+,%0@+\n\t" - "dbra %2,5b ; clrw %2; subql #1,%2; jcc 5b\n\t" - "6: movew %+,%2; btst #1,%2 ; jeq 7f ; movew %1@+,%0@+\n\t" - "7: ; btst #0,%2 ; jeq 8f ; moveb %1@+,%0@+\n\t" - "8:" - : "=a" (d), "=a" (s), "=d" (count), "=d" (tmp) - : "0" (d), "1" (s), "2" (count) - ); - } - } else { - if (count < 16) { - __asm__ __volatile__( - "lsrl #1,%2 ; jcc 1f ; moveb %1@-,%0@-\n\t" - "1: lsrl #1,%2 ; jcc 1f ; movew %1@-,%0@-\n\t" - "1: lsrl #1,%2 ; jcc 1f ; movel %1@-,%0@-\n\t" - "1: lsrl #1,%2 ; jcc 1f ; movel %1@-,%0@- ; movel %1@-,%0@-\n\t" - "1:" - : "=a" (d), "=a" (s), "=d" (count) - : "0" ((char *) d + count), "1" ((char *) s + count), "2" (count) - ); - } else { - long tmp; - __asm__ __volatile__( - "movel %0,%3\n\t" - "lsrl #1,%3 ; jcc 1f ; moveb %1@-,%0@- ; subqw #1,%2\n\t" - "lsrl #1,%3 ; jcs 2f\n\t" /* %0 increased=>bit 2 switched*/ - "movew %1@-,%0@- ; subqw #2,%2 ; jra 2f\n\t" - "1: lsrl #1,%3 ; jcc 2f\n\t" - "movew %1@-,%0@- ; subqw #2,%2\n\t" - "2: movew %2,%-; lsrl #2,%2 ; jeq 6f\n\t" - "lsrl #1,%2 ; jcc 3f ; movel %1@-,%0@-\n\t" - "3: lsrl #1,%2 ; jcc 4f ; movel %1@-,%0@- ; movel %1@-,%0@-\n\t" - "4: subql #1,%2 ; jcs 6f\n\t" - "5: movel %1@-,%0@-;movel %1@-,%0@-\n\t" - "movel %1@-,%0@-;movel %1@-,%0@-\n\t" - "dbra %2,5b ; clrw %2; subql #1,%2; jcc 5b\n\t" - "6: movew %+,%2; btst #1,%2 ; jeq 7f ; movew %1@-,%0@-\n\t" - "7: ; btst #0,%2 ; jeq 8f ; moveb %1@-,%0@-\n\t" - "8:" - : "=a" (d), "=a" (s), "=d" (count), "=d" (tmp) - : "0" ((char *) d + count), "1" ((char *) s + count), "2" (count) - ); - } - } - - return(0); -} - - -/* ++andreas: Simple and fast version of memmove, assumes size is - divisible by 16, suitable for moving the whole screen bitplane */ -static __inline__ void fast_memmove(char *dst, const char *src, size_t size) -{ - if (!size) - return; - if (dst < src) - __asm__ __volatile__ - ("1:" - " moveml %0@+,%/d0/%/d1/%/a0/%/a1\n" - " moveml %/d0/%/d1/%/a0/%/a1,%1@\n" - " addql #8,%1; addql #8,%1\n" - " dbra %2,1b\n" - " clrw %2; subql #1,%2\n" - " jcc 1b" - : "=a" (src), "=a" (dst), "=d" (size) - : "0" (src), "1" (dst), "2" (size / 16 - 1) - : "d0", "d1", "a0", "a1", "memory"); - else - __asm__ __volatile__ - ("1:" - " subql #8,%0; subql #8,%0\n" - " moveml %0@,%/d0/%/d1/%/a0/%/a1\n" - " moveml %/d0/%/d1/%/a0/%/a1,%1@-\n" - " dbra %2,1b\n" - " clrw %2; subql #1,%2\n" - " jcc 1b" - : "=a" (src), "=a" (dst), "=d" (size) - : "0" (src + size), "1" (dst + size), "2" (size / 16 - 1) - : "d0", "d1", "a0", "a1", "memory"); -} - -#elif defined(CONFIG_SUN4) - -/* You may think that I'm crazy and that I should use generic - routines. No, I'm not: sun4's framebuffer crashes if we std - into it, so we cannot use memset. */ - -static __inline__ void *sun4_memset(void *s, char val, size_t count) -{ - int i; - for(i=0; i<count;i++) - ((char *) s) [i] = val; - return s; -} - -static __inline__ void *fb_memset255(void *s, size_t count) -{ - return sun4_memset(s, 255, count); -} - -static __inline__ void *fb_memclear(void *s, size_t count) -{ - return sun4_memset(s, 0, count); -} - -static __inline__ void *fb_memclear_small(void *s, size_t count) -{ - return sun4_memset(s, 0, count); -} - -/* To be honest, this is slow_memmove :). But sun4 is crappy, so what we can do. */ -static __inline__ void fast_memmove(void *d, const void *s, size_t count) -{ - int i; - if (d<s) { - for (i=0; i<count; i++) - ((char *) d)[i] = ((char *) s)[i]; - } else - for (i=0; i<count; i++) - ((char *) d)[count-i-1] = ((char *) s)[count-i-1]; -} - -static __inline__ void *fb_memmove(char *dst, const char *src, size_t size) -{ - fast_memmove(dst, src, size); - return dst; -} - -#else - -static __inline__ void *fb_memclear_small(void *s, size_t count) -{ - char *xs = (char *) s; - - while (count--) - fb_writeb(0, xs++); - - return s; -} - -static __inline__ void *fb_memclear(void *s, size_t count) -{ - unsigned long xs = (unsigned long) s; - - if (count < 8) - goto rest; - - if (xs & 1) { - fb_writeb(0, xs++); - count--; - } - if (xs & 2) { - fb_writew(0, xs); - xs += 2; - count -= 2; - } - while (count > 3) { - fb_writel(0, xs); - xs += 4; - count -= 4; - } -rest: - while (count--) - fb_writeb(0, xs++); - - return s; -} - -static __inline__ void *fb_memset255(void *s, size_t count) -{ - unsigned long xs = (unsigned long) s; - - if (count < 8) - goto rest; - - if (xs & 1) { - fb_writeb(0xff, xs++); - count--; - } - if (xs & 2) { - fb_writew(0xffff, xs); - xs += 2; - count -= 2; - } - while (count > 3) { - fb_writel(0xffffffff, xs); - xs += 4; - count -= 4; - } -rest: - while (count--) - fb_writeb(0xff, xs++); - - return s; -} - -#if defined(__i386__) - -static __inline__ void fast_memmove(void *d, const void *s, size_t count) -{ - int d0, d1, d2, d3; - if (d < s) { -__asm__ __volatile__ ( - "cld\n\t" - "shrl $1,%%ecx\n\t" - "jnc 1f\n\t" - "movsb\n" - "1:\tshrl $1,%%ecx\n\t" - "jnc 2f\n\t" - "movsw\n" - "2:\trep\n\t" - "movsl" - : "=&c" (d0), "=&D" (d1), "=&S" (d2) - :"0"(count),"1"((long)d),"2"((long)s) - :"memory"); - } else { -__asm__ __volatile__ ( - "std\n\t" - "shrl $1,%%ecx\n\t" - "jnc 1f\n\t" - "movb 3(%%esi),%%al\n\t" - "movb %%al,3(%%edi)\n\t" - "decl %%esi\n\t" - "decl %%edi\n" - "1:\tshrl $1,%%ecx\n\t" - "jnc 2f\n\t" - "movw 2(%%esi),%%ax\n\t" - "movw %%ax,2(%%edi)\n\t" - "decl %%esi\n\t" - "decl %%edi\n\t" - "decl %%esi\n\t" - "decl %%edi\n" - "2:\trep\n\t" - "movsl\n\t" - "cld" - : "=&c" (d0), "=&D" (d1), "=&S" (d2), "=&a" (d3) - :"0"(count),"1"(count-4+(long)d),"2"(count-4+(long)s) - :"memory"); - } -} - -static __inline__ void *fb_memmove(char *dst, const char *src, size_t size) -{ - fast_memmove(dst, src, size); - return dst; -} - -#else /* !__i386__ */ - - /* - * Anyone who'd like to write asm functions for other CPUs? - * (Why are these functions better than those from include/asm/string.h?) - */ - -static __inline__ void *fb_memmove(void *d, const void *s, size_t count) -{ - unsigned long dst, src; - - if (d < s) { - dst = (unsigned long) d; - src = (unsigned long) s; - - if ((count < 8) || ((dst ^ src) & 3)) - goto restup; - - if (dst & 1) { - fb_writeb(fb_readb(src++), dst++); - count--; - } - if (dst & 2) { - fb_writew(fb_readw(src), dst); - src += 2; - dst += 2; - count -= 2; - } - while (count > 3) { - fb_writel(fb_readl(src), dst); - src += 4; - dst += 4; - count -= 4; - } - - restup: - while (count--) - fb_writeb(fb_readb(src++), dst++); - } else { - dst = (unsigned long) d + count; - src = (unsigned long) s + count; - - if ((count < 8) || ((dst ^ src) & 3)) - goto restdown; - - if (dst & 1) { - src--; - dst--; - count--; - fb_writeb(fb_readb(src), dst); - } - if (dst & 2) { - src -= 2; - dst -= 2; - count -= 2; - fb_writew(fb_readw(src), dst); - } - while (count > 3) { - src -= 4; - dst -= 4; - count -= 4; - fb_writel(fb_readl(src), dst); - } - - restdown: - while (count--) { - src--; - dst--; - fb_writeb(fb_readb(src), dst); - } - } - - return d; -} - -static __inline__ void fast_memmove(char *d, const char *s, size_t count) -{ - unsigned long dst, src; - - if (d < s) { - dst = (unsigned long) d; - src = (unsigned long) s; - - if ((count < 8) || ((dst ^ src) & 3)) - goto restup; - - if (dst & 1) { - fb_writeb(fb_readb(src++), dst++); - count--; - } - if (dst & 2) { - fb_writew(fb_readw(src), dst); - src += 2; - dst += 2; - count -= 2; - } - while (count > 3) { - fb_writel(fb_readl(src), dst); - src += 4; - dst += 4; - count -= 4; - } - - restup: - while (count--) - fb_writeb(fb_readb(src++), dst++); - } else { - dst = (unsigned long) d + count; - src = (unsigned long) s + count; - - if ((count < 8) || ((dst ^ src) & 3)) - goto restdown; - - if (dst & 1) { - src--; - dst--; - count--; - fb_writeb(fb_readb(src), dst); - } - if (dst & 2) { - src -= 2; - dst -= 2; - count -= 2; - fb_writew(fb_readw(src), dst); - } - while (count > 3) { - src -= 4; - dst -= 4; - count -= 4; - fb_writel(fb_readl(src), dst); - } - - restdown: - while (count--) { - src--; - dst--; - fb_writeb(fb_readb(src), dst); - } - } -} - -#endif /* !__i386__ */ - -#endif /* !__mc68000__ */ - #endif /* _VIDEO_FBCON_H */ |
