diff options
| author | James Simmons <jsimmons@maxwell.earthlink.net> | 2002-10-20 20:15:32 -0700 |
|---|---|---|
| committer | James Simmons <jsimmons@maxwell.earthlink.net> | 2002-10-20 20:15:32 -0700 |
| commit | 1569953aca38691dc3f34936b9db5cb304080b21 (patch) | |
| tree | 04ab930d08843cb7fb60d67cf0f1f966bfd6a8d6 /include | |
| parent | 8ead5a2fa9e37f0ff46f6d23ee2cb8b51556ee6f (diff) | |
| parent | 79f4dd102c74a68806ac4ff2fd846ef342918c97 (diff) | |
Merge maxwell.earthlink.net:/usr/src/linus-2.5
into maxwell.earthlink.net:/usr/src/fbdev-2.5
Diffstat (limited to 'include')
| -rw-r--r-- | include/linux/fb.h | 142 | ||||
| -rw-r--r-- | include/linux/sisfb.h | 58 | ||||
| -rw-r--r-- | include/video/fbcon-cfb16.h | 34 | ||||
| -rw-r--r-- | include/video/fbcon-cfb2.h | 32 | ||||
| -rw-r--r-- | include/video/fbcon-cfb24.h | 34 | ||||
| -rw-r--r-- | include/video/fbcon-cfb32.h | 34 | ||||
| -rw-r--r-- | include/video/fbcon-cfb4.h | 32 | ||||
| -rw-r--r-- | include/video/fbcon-cfb8.h | 34 | ||||
| -rw-r--r-- | include/video/fbcon-mac.h | 32 | ||||
| -rw-r--r-- | include/video/fbcon-vga-planes.h | 1 | ||||
| -rw-r--r-- | include/video/fbcon.h | 619 |
11 files changed, 156 insertions, 896 deletions
diff --git a/include/linux/fb.h b/include/linux/fb.h index d1782a6bd008..165128ccb130 100644 --- a/include/linux/fb.h +++ b/include/linux/fb.h @@ -3,6 +3,7 @@ #include <linux/tty.h> #include <asm/types.h> +#include <asm/io.h> /* Definitions of frame buffers */ @@ -17,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 */ @@ -220,6 +222,11 @@ struct fb_cmap { __u16 *transp; /* transparency, can be NULL */ }; +struct fb_index { + __u32 len; /* number of entries */ + __u32 *entry; /* "pseudopalette" color index entries */ +}; + struct fb_con2fbmap { __u32 console; __u32 framebuffer; @@ -257,6 +264,38 @@ 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_SETDEST 0x20 +#define FB_CUR_SETSIZE 0x40 +#define FB_CUR_SETALL 0xFF + +struct fbcurpos { + __u16 x, y; +}; + +struct fbcursor { + __u16 set; /* what to set */ + __u16 enable; /* cursor on/off */ + __u8 rop; /* bitop operation */ + __u8 depth; /* color depth of image */ + struct fbcurpos pos; /* cursor position */ + struct fbcurpos hot; /* cursor hot spot */ + struct fbcurpos size; /* cursor bit map size */ + struct fb_cmap cmap; /* color map info */ + struct fb_index *index; + char *image; /* cursor image bits */ + char *mask; /* cursor mask bits */ + char *dest; /* destination */ +}; + /* Internal HW accel */ #define ROP_COPY 0 #define ROP_XOR 1 @@ -264,10 +303,10 @@ struct fb_vblank { struct fb_copyarea { __u32 sx; /* screen-relative */ __u32 sy; - __u32 width; - __u32 height; __u32 dx; __u32 dy; + __u32 width; + __u32 height; }; struct fb_fillrect { @@ -280,13 +319,13 @@ struct fb_fillrect { }; struct fb_image { + __u32 dx; /* Where to place image */ + __u32 dy; __u32 width; /* Size of image */ __u32 height; - __u16 dx; /* Where to place image */ - __u16 dy; __u32 fg_color; /* Only used when a mono bitmap */ __u32 bg_color; - __u8 depth; /* Dpeth of the image */ + __u8 depth; /* Depth of the image */ char *data; /* Pointer to image data */ }; @@ -316,15 +355,9 @@ struct fb_ops { struct module *owner; int (*fb_open)(struct fb_info *info, int user); int (*fb_release)(struct fb_info *info, int user); - /* set settable parameters */ - int (*fb_set_var)(struct fb_var_screeninfo *var, int con, - struct fb_info *info); - /* get colormap */ - int (*fb_get_cmap)(struct fb_cmap *cmap, int kspc, int con, - struct fb_info *info); - /* set colormap */ - int (*fb_set_cmap)(struct fb_cmap *cmap, int kspc, int con, - struct fb_info *info); + /* For framebuffers with strange non linear layouts */ + ssize_t (*fb_read)(struct file *file, char *buf, size_t count, loff_t *ppos); + ssize_t (*fb_write)(struct file *file, const char *buf, size_t count, loff_t *ppos); /* checks var and creates a par based on it */ int (*fb_check_var)(struct fb_var_screeninfo *var, struct fb_info *info); /* set the video mode according to par */ @@ -335,18 +368,22 @@ struct fb_ops { /* blank display */ int (*fb_blank)(int blank, struct fb_info *info); /* pan display */ - int (*fb_pan_display)(struct fb_var_screeninfo *var, int con, struct fb_info *info); + int (*fb_pan_display)(struct fb_var_screeninfo *var, struct fb_info *info); /* draws a rectangle */ void (*fb_fillrect)(struct fb_info *info, struct fb_fillrect *rect); /* Copy data from area to another */ void (*fb_copyarea)(struct fb_info *info, struct fb_copyarea *region); /* Draws a image to the display */ void (*fb_imageblit)(struct fb_info *info, struct fb_image *image); + /* Draws cursor */ + int (*fb_cursor)(struct fb_info *info, struct fbcursor *cursor); /* perform polling on fb device */ int (*fb_poll)(struct fb_info *info, poll_table *wait); + /* wait for blit idle, optional */ + void (*fb_sync)(struct fb_info *info); /* perform fb specific ioctl (optional) */ int (*fb_ioctl)(struct inode *inode, struct file *file, unsigned int cmd, - unsigned long arg, int con, struct fb_info *info); + unsigned long arg, struct fb_info *info); /* perform fb specific mmap */ int (*fb_mmap)(struct fb_info *info, struct file *file, struct vm_area_struct *vma); /* switch to/from raster image mode */ @@ -354,7 +391,6 @@ struct fb_ops { }; struct fb_info { - char modename[40]; /* default video mode */ kdev_t node; int flags; int open; /* Has this been open already ? */ @@ -362,20 +398,14 @@ 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 display *disp; /* initial display variable */ 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 */ - int (*changevar)(int); /* tell console var has changed */ - int (*switch_con)(int, struct fb_info*); - /* tell fb to switch consoles */ - int (*updatevar)(int, struct fb_info*); - /* tell fb to update the vars */ void *pseudo_palette; /* Fake palette of 16 colors and the cursor's color for non palette mode */ @@ -389,31 +419,53 @@ struct fb_info { #define FBINFO_FLAG_DEFAULT 0 #endif - /* - * `Generic' versions of the frame buffer device operations - */ +#if defined(__sparc__) -extern int gen_set_var(struct fb_var_screeninfo *var, int con, - struct fb_info *info); -extern int gen_get_cmap(struct fb_cmap *cmap, int kspc, int con, - struct fb_info *info); -extern int gen_set_cmap(struct fb_cmap *cmap, int kspc, int con, - struct fb_info *info); -extern int fb_pan_display(struct fb_var_screeninfo *var, int con, - struct fb_info *info); -extern void cfb_fillrect(struct fb_info *info, struct fb_fillrect *rect); -extern void cfb_copyarea(struct fb_info *info, struct fb_copyarea *region); -extern void cfb_imageblit(struct fb_info *info, struct fb_image *image); +/* We map all of our framebuffers such that big-endian accesses + * are what we want, so the following is sufficient. + */ + +#define fb_readb sbus_readb +#define fb_readw sbus_readw +#define fb_readl sbus_readl +#define fb_writeb sbus_writeb +#define fb_writew sbus_writew +#define fb_writel sbus_writel +#define fb_memset sbus_memset_io + +#elif defined(__i386__) || defined(__alpha__) || defined(__x86_64__) + +#define fb_readb __raw_readb +#define fb_readw __raw_readw +#define fb_readl __raw_readl +#define fb_writeb __raw_writeb +#define fb_writew __raw_writew +#define fb_writel __raw_writel +#define fb_memset memset_io + +#else + +#define fb_readb(addr) (*(volatile u8 *) (addr)) +#define fb_readw(addr) (*(volatile u16 *) (addr)) +#define fb_readl(addr) (*(volatile u32 *) (addr)) +#define fb_writeb(b,addr) (*(volatile u8 *) (addr) = (b)) +#define fb_writew(b,addr) (*(volatile u16 *) (addr) = (b)) +#define fb_writel(b,addr) (*(volatile u32 *) (addr) = (b)) +#define fb_memset memset + +#endif /* - * Helper functions + * `Generic' versions of the frame buffer device operations */ -extern void do_install_cmap(int con, struct fb_info *info); -extern int gen_update_var(int con, struct fb_info *info); +extern int fb_set_var(struct fb_var_screeninfo *var, struct fb_info *info); +extern int fb_pan_display(struct fb_var_screeninfo *var, struct fb_info *info); extern int fb_blank(int blank, struct fb_info *info); -extern int gen_switch(int con, struct fb_info *info); -extern void gen_set_disp(int con, struct fb_info *info); +extern int cfb_cursor(struct fb_info *info, struct fbcursor *cursor); +extern void cfb_fillrect(struct fb_info *info, struct fb_fillrect *rect); +extern void cfb_copyarea(struct fb_info *info, struct fb_copyarea *area); +extern void cfb_imageblit(struct fb_info *info, struct fb_image *image); /* drivers/video/fbmem.c */ extern int register_framebuffer(struct fb_info *fb_info); @@ -431,10 +483,6 @@ extern int fbmon_dpms(const struct fb_info *fb_info); extern int fb_alloc_cmap(struct fb_cmap *cmap, int len, int transp); extern void fb_copy_cmap(struct fb_cmap *from, struct fb_cmap *to, int fsfromto); -extern int fb_get_cmap(struct fb_cmap *cmap, int kspc, - int (*getcolreg)(u_int, u_int *, u_int *, u_int *, - u_int *, struct fb_info *), - struct fb_info *fb_info); extern int fb_set_cmap(struct fb_cmap *cmap, int kspc, struct fb_info *fb_info); extern struct fb_cmap *fb_default_cmap(int len); extern void fb_invert_cmaps(void); diff --git a/include/linux/sisfb.h b/include/linux/sisfb.h index 4d12567013ba..f45257643986 100644 --- a/include/linux/sisfb.h +++ b/include/linux/sisfb.h @@ -1,6 +1,11 @@ #ifndef _LINUX_SISFB #define _LINUX_SISFB +#include <linux/spinlock.h> + +#include <asm/ioctl.h> +#include <asm/types.h> + #define DISPTYPE_CRT1 0x00000008L #define DISPTYPE_CRT2 0x00000004L #define DISPTYPE_LCD 0x00000002L @@ -20,6 +25,7 @@ #define HASVB_303 0x40 #define HASVB_CHRONTEL 0x80 +/* TW: *Never* change the order of the following enum */ typedef enum _SIS_CHIP_TYPE { SIS_VGALegacy = 0, SIS_300, @@ -32,10 +38,17 @@ typedef enum _SIS_CHIP_TYPE { SIS_315PRO, SIS_640, SIS_740, - SIS_330, + SIS_650, + SIS_330, MAX_SIS_CHIP } SIS_CHIP_TYPE; +typedef enum _VGA_ENGINE { + UNKNOWN_VGA = 0, + SIS_300_VGA, + SIS_315_VGA, +} VGA_ENGINE; + typedef enum _TVTYPE { TVMODE_NTSC = 0, TVMODE_PAL, @@ -81,21 +94,25 @@ struct ap_data { }; struct video_info { - int chip_id; + int chip_id; unsigned int video_size; unsigned long video_base; - char *video_vbase; + char * video_vbase; unsigned long mmio_base; - char *mmio_vbase; + char * mmio_vbase; unsigned long vga_base; + unsigned long mtrr; + unsigned long heapstart; int video_bpp; + int video_cmap_len; int video_width; int video_height; int video_vwidth; int video_vheight; int org_x; int org_y; + int video_linelength; unsigned int refresh_rate; unsigned long disp_state; @@ -106,9 +123,42 @@ struct video_info { SIS_CHIP_TYPE chip; unsigned char revision_id; + unsigned short DstColor; /* TW: For 2d acceleration */ + unsigned long SiS310_AccelDepth; + unsigned long CommandReg; + + spinlock_t lockaccel; + char reserved[256]; }; + +/* TW: Addtional IOCTL for communication sisfb <> X driver */ +/* If changing this, vgatypes.h must also be changed (for X driver) */ + +/* TW: ioctl for identifying and giving some info (esp. memory heap start) */ +#define SISFB_GET_INFO _IOR('n',0xF8,sizeof(__u32)) + +/* TW: Structure argument for SISFB_GET_INFO ioctl */ +typedef struct _SISFB_INFO sisfb_info, *psisfb_info; + +struct _SISFB_INFO { + unsigned long sisfb_id; /* for identifying sisfb */ +#ifndef SISFB_ID +#define SISFB_ID 0x53495346 /* Identify myself with 'SISF' */ +#endif + int chip_id; /* PCI ID of detected chip */ + int memory; /* video memory in KB which sisfb manages */ + int heapstart; /* heap start (= sisfb "mem" argument) in KB */ + unsigned char fbvidmode; /* current sisfb mode */ + + unsigned char sisfb_version; + unsigned char sisfb_revision; + unsigned char sisfb_patchlevel; + + char reserved[253]; /* for future use */ +}; + #ifdef __KERNEL__ extern struct video_info ivideo; diff --git a/include/video/fbcon-cfb16.h b/include/video/fbcon-cfb16.h deleted file mode 100644 index 3ccc7d7cd535..000000000000 --- a/include/video/fbcon-cfb16.h +++ /dev/null @@ -1,34 +0,0 @@ -/* - * FBcon low-level driver for 16 bpp packed pixel (cfb16) - */ - -#ifndef _VIDEO_FBCON_CFB16_H -#define _VIDEO_FBCON_CFB16_H - -#include <linux/config.h> - -#ifdef MODULE -#if defined(CONFIG_FBCON_CFB16) || defined(CONFIG_FBCON_CFB16_MODULE) -#define FBCON_HAS_CFB16 -#endif -#else -#if defined(CONFIG_FBCON_CFB16) -#define FBCON_HAS_CFB16 -#endif -#endif - -extern struct display_switch fbcon_cfb16; -extern void fbcon_cfb16_setup(struct display *p); -extern void fbcon_cfb16_bmove(struct display *p, int sy, int sx, int dy, - int dx, int height, int width); -extern void fbcon_cfb16_clear(struct vc_data *conp, struct display *p, int sy, - int sx, int height, int width); -extern void fbcon_cfb16_putc(struct vc_data *conp, struct display *p, int c, - int yy, int xx); -extern void fbcon_cfb16_putcs(struct vc_data *conp, struct display *p, - const unsigned short *s, int count, int yy, int xx); -extern void fbcon_cfb16_revc(struct display *p, int xx, int yy); -extern void fbcon_cfb16_clear_margins(struct vc_data *conp, struct display *p, - int bottom_only); - -#endif /* _VIDEO_FBCON_CFB16_H */ diff --git a/include/video/fbcon-cfb2.h b/include/video/fbcon-cfb2.h deleted file mode 100644 index 5ba68a5f0a4f..000000000000 --- a/include/video/fbcon-cfb2.h +++ /dev/null @@ -1,32 +0,0 @@ -/* - * FBcon low-level driver for 2 bpp packed pixel (cfb2) - */ - -#ifndef _VIDEO_FBCON_CFB2_H -#define _VIDEO_FBCON_CFB2_H - -#include <linux/config.h> - -#ifdef MODULE -#if defined(CONFIG_FBCON_CFB2) || defined(CONFIG_FBCON_CFB2_MODULE) -#define FBCON_HAS_CFB2 -#endif -#else -#if defined(CONFIG_FBCON_CFB2) -#define FBCON_HAS_CFB2 -#endif -#endif - -extern struct display_switch fbcon_cfb2; -extern void fbcon_cfb2_setup(struct display *p); -extern void fbcon_cfb2_bmove(struct display *p, int sy, int sx, int dy, int dx, - int height, int width); -extern void fbcon_cfb2_clear(struct vc_data *conp, struct display *p, int sy, - int sx, int height, int width); -extern void fbcon_cfb2_putc(struct vc_data *conp, struct display *p, int c, - int yy, int xx); -extern void fbcon_cfb2_putcs(struct vc_data *conp, struct display *p, - const unsigned short *s, int count, int yy, int xx); -extern void fbcon_cfb2_revc(struct display *p, int xx, int yy); - -#endif /* _VIDEO_FBCON_CFB2_H */ diff --git a/include/video/fbcon-cfb24.h b/include/video/fbcon-cfb24.h deleted file mode 100644 index 77442e22d2af..000000000000 --- a/include/video/fbcon-cfb24.h +++ /dev/null @@ -1,34 +0,0 @@ -/* - * FBcon low-level driver for 24 bpp packed pixel (cfb24) - */ - -#ifndef _VIDEO_FBCON_CFB24_H -#define _VIDEO_FBCON_CFB24_H - -#include <linux/config.h> - -#ifdef MODULE -#if defined(CONFIG_FBCON_CFB24) || defined(CONFIG_FBCON_CFB24_MODULE) -#define FBCON_HAS_CFB24 -#endif -#else -#if defined(CONFIG_FBCON_CFB24) -#define FBCON_HAS_CFB24 -#endif -#endif - -extern struct display_switch fbcon_cfb24; -extern void fbcon_cfb24_setup(struct display *p); -extern void fbcon_cfb24_bmove(struct display *p, int sy, int sx, int dy, - int dx, int height, int width); -extern void fbcon_cfb24_clear(struct vc_data *conp, struct display *p, int sy, - int sx, int height, int width); -extern void fbcon_cfb24_putc(struct vc_data *conp, struct display *p, int c, - int yy, int xx); -extern void fbcon_cfb24_putcs(struct vc_data *conp, struct display *p, - const unsigned short *s, int count, int yy, int xx); -extern void fbcon_cfb24_revc(struct display *p, int xx, int yy); -extern void fbcon_cfb24_clear_margins(struct vc_data *conp, struct display *p, - int bottom_only); - -#endif /* _VIDEO_FBCON_CFB24_H */ diff --git a/include/video/fbcon-cfb32.h b/include/video/fbcon-cfb32.h deleted file mode 100644 index abac3baa2f37..000000000000 --- a/include/video/fbcon-cfb32.h +++ /dev/null @@ -1,34 +0,0 @@ -/* - * FBcon low-level driver for 32 bpp packed pixel (cfb32) - */ - -#ifndef _VIDEO_FBCON_CFB32_H -#define _VIDEO_FBCON_CFB32_H - -#include <linux/config.h> - -#ifdef MODULE -#if defined(CONFIG_FBCON_CFB32) || defined(CONFIG_FBCON_CFB32_MODULE) -#define FBCON_HAS_CFB32 -#endif -#else -#if defined(CONFIG_FBCON_CFB32) -#define FBCON_HAS_CFB32 -#endif -#endif - -extern struct display_switch fbcon_cfb32; -extern void fbcon_cfb32_setup(struct display *p); -extern void fbcon_cfb32_bmove(struct display *p, int sy, int sx, int dy, - int dx, int height, int width); -extern void fbcon_cfb32_clear(struct vc_data *conp, struct display *p, int sy, - int sx, int height, int width); -extern void fbcon_cfb32_putc(struct vc_data *conp, struct display *p, int c, - int yy, int xx); -extern void fbcon_cfb32_putcs(struct vc_data *conp, struct display *p, - const unsigned short *s, int count, int yy, int xx); -extern void fbcon_cfb32_revc(struct display *p, int xx, int yy); -extern void fbcon_cfb32_clear_margins(struct vc_data *conp, struct display *p, - int bottom_only); - -#endif /* _VIDEO_FBCON_CFB32_H */ diff --git a/include/video/fbcon-cfb4.h b/include/video/fbcon-cfb4.h deleted file mode 100644 index 963befe5ca1e..000000000000 --- a/include/video/fbcon-cfb4.h +++ /dev/null @@ -1,32 +0,0 @@ -/* - * FBcon low-level driver for 4 bpp packed pixel (cfb4) - */ - -#ifndef _VIDEO_FBCON_CFB4_H -#define _VIDEO_FBCON_CFB4_H - -#include <linux/config.h> - -#ifdef MODULE -#if defined(CONFIG_FBCON_CFB4) || defined(CONFIG_FBCON_CFB4_MODULE) -#define FBCON_HAS_CFB4 -#endif -#else -#if defined(CONFIG_FBCON_CFB4) -#define FBCON_HAS_CFB4 -#endif -#endif - -extern struct display_switch fbcon_cfb4; -extern void fbcon_cfb4_setup(struct display *p); -extern void fbcon_cfb4_bmove(struct display *p, int sy, int sx, int dy, int dx, - int height, int width); -extern void fbcon_cfb4_clear(struct vc_data *conp, struct display *p, int sy, - int sx, int height, int width); -extern void fbcon_cfb4_putc(struct vc_data *conp, struct display *p, int c, - int yy, int xx); -extern void fbcon_cfb4_putcs(struct vc_data *conp, struct display *p, - const unsigned short *s, int count, int yy, int xx); -extern void fbcon_cfb4_revc(struct display *p, int xx, int yy); - -#endif /* _VIDEO_FBCON_CFB4_H */ diff --git a/include/video/fbcon-cfb8.h b/include/video/fbcon-cfb8.h deleted file mode 100644 index 96189d0acd27..000000000000 --- a/include/video/fbcon-cfb8.h +++ /dev/null @@ -1,34 +0,0 @@ -/* - * FBcon low-level driver for 8 bpp packed pixel (cfb8) - */ - -#ifndef _VIDEO_FBCON_CFB8_H -#define _VIDEO_FBCON_CFB8_H - -#include <linux/config.h> - -#ifdef MODULE -#if defined(CONFIG_FBCON_CFB8) || defined(CONFIG_FBCON_CFB8_MODULE) -#define FBCON_HAS_CFB8 -#endif -#else -#if defined(CONFIG_FBCON_CFB8) -#define FBCON_HAS_CFB8 -#endif -#endif - -extern struct display_switch fbcon_cfb8; -extern void fbcon_cfb8_setup(struct display *p); -extern void fbcon_cfb8_bmove(struct display *p, int sy, int sx, int dy, int dx, - int height, int width); -extern void fbcon_cfb8_clear(struct vc_data *conp, struct display *p, int sy, - int sx, int height, int width); -extern void fbcon_cfb8_putc(struct vc_data *conp, struct display *p, int c, - int yy, int xx); -extern void fbcon_cfb8_putcs(struct vc_data *conp, struct display *p, - const unsigned short *s, int count, int yy, int xx); -extern void fbcon_cfb8_revc(struct display *p, int xx, int yy); -extern void fbcon_cfb8_clear_margins(struct vc_data *conp, struct display *p, - int bottom_only); - -#endif /* _VIDEO_FBCON_CFB8_H */ diff --git a/include/video/fbcon-mac.h b/include/video/fbcon-mac.h deleted file mode 100644 index b275ff91b824..000000000000 --- a/include/video/fbcon-mac.h +++ /dev/null @@ -1,32 +0,0 @@ -/* - * FBcon low-level driver for Mac variable bpp packed pixels (mac) - */ - -#ifndef _VIDEO_FBCON_MAC_H -#define _VIDEO_FBCON_MAC_H - -#include <linux/config.h> - -#ifdef MODULE -#if defined(CONFIG_FBCON_MAC) || defined(CONFIG_FBCON_MAC_MODULE) -#define FBCON_HAS_MAC -#endif -#else -#if defined(CONFIG_FBCON_MAC) -#define FBCON_HAS_MAC -#endif -#endif - -extern struct display_switch fbcon_mac; -extern void fbcon_mac_setup(struct display *p); -extern void fbcon_mac_bmove(struct display *p, int sy, int sx, int dy, int dx, - int height, int width); -extern void fbcon_mac_clear(struct vc_data *conp, struct display *p, int sy, - int sx, int height, int width); -extern void fbcon_mac_putc(struct vc_data *conp, struct display *p, int c, - int yy, int xx); -extern void fbcon_mac_putcs(struct vc_data *conp, struct display *p, - const unsigned short *s, int count, int yy, int xx); -extern void fbcon_mac_revc(struct display *p, int xx, int yy); - -#endif /* _VIDEO_FBCON_MAC_H */ diff --git a/include/video/fbcon-vga-planes.h b/include/video/fbcon-vga-planes.h index 31578d41c58f..e9e0f3c4d7fa 100644 --- a/include/video/fbcon-vga-planes.h +++ b/include/video/fbcon-vga-planes.h @@ -18,6 +18,7 @@ #endif extern struct display_switch fbcon_vga_planes; +extern struct display_switch fbcon_vga8_planes; extern struct display_switch fbcon_ega_planes; extern void fbcon_vga_planes_setup(struct display *p); extern void fbcon_vga_planes_bmove(struct display *p, int sy, int sx, int dy, int dx, diff --git a/include/video/fbcon.h b/include/video/fbcon.h index c28fea0c10c3..e8b66df0ed67 100644 --- a/include/video/fbcon.h +++ b/include/video/fbcon.h @@ -18,6 +18,7 @@ #include <asm/io.h> +struct display; /* * `switch' for the Low Level Operations @@ -35,7 +36,7 @@ struct display_switch { void (*putcs)(struct vc_data *conp, struct display *p, const unsigned short *s, int count, int yy, int xx); void (*revc)(struct display *p, int xx, int yy); - void (*cursor)(struct display *p, int mode, int xx, int yy); + void (*cursor)(struct display *p, int flags, int xx, int yy); int (*set_font)(struct display *p, int width, int height); void (*clear_margins)(struct vc_data *conp, struct display *p, int bottom_only); @@ -51,10 +52,6 @@ extern struct display_switch fbcon_dummy; struct display { /* Filled in by the frame buffer device */ - - struct fb_var_screeninfo var; /* variable infos. yoffset and vmode */ - /* are updated by fbcon.c */ - struct fb_cmap cmap; /* colormap */ u_short can_soft_blank; /* zero if no hardware blanking */ u_short inverse; /* != 0 text black on white as default */ struct display_switch *dispsw; /* low level operations */ @@ -72,11 +69,13 @@ struct display { int vrows; /* number of virtual rows */ unsigned short cursor_x; /* current cursor position */ unsigned short cursor_y; + unsigned long cursor_pos; int fgcol; /* text colors */ 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; @@ -88,10 +87,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,612 +182,7 @@ extern int set_all_vcs(int fbidx, struct fb_ops *fb, /* Namespace consistency */ #define SCROLL_YNOPARTIAL __SCROLL_YNOPARTIAL - -#if defined(__sparc__) - -/* We map all of our framebuffers such that big-endian accesses - * are what we want, so the following is sufficient. - */ - -#define fb_readb sbus_readb -#define fb_readw sbus_readw -#define fb_readl sbus_readl -#define fb_writeb sbus_writeb -#define fb_writew sbus_writew -#define fb_writel sbus_writel -#define fb_memset sbus_memset_io - -#elif defined(__i386__) || defined(__alpha__) || defined(__x86_64__) - -#define fb_readb __raw_readb -#define fb_readw __raw_readw -#define fb_readl __raw_readl -#define fb_writeb __raw_writeb -#define fb_writew __raw_writew -#define fb_writel __raw_writel -#define fb_memset memset_io - -#else - -#define fb_readb(addr) (*(volatile u8 *) (addr)) -#define fb_readw(addr) (*(volatile u16 *) (addr)) -#define fb_readl(addr) (*(volatile u32 *) (addr)) -#define fb_writeb(b,addr) (*(volatile u8 *) (addr) = (b)) -#define fb_writew(b,addr) (*(volatile u16 *) (addr) = (b)) -#define fb_writel(b,addr) (*(volatile u32 *) (addr) = (b)) -#define fb_memset memset - -#endif - - 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 */ |
