[PATCH] fb.h cleanup

From: James A Simmons (jsimmons@acsu.buffalo.edu)
Date: Sun Jan 09 2000 - 13:26:02 EST


Please test this patch. It's against a pre-2.3.39-2. Once you are happy
with it Geert can you send it to linus. Thank you.

Codito, ergo sum - "I code, therefore I am"
James Simmons (o_
fbdev/gfx developer (o_ (o_ //\
http://www.linux-fbdev.org (/)_ (/)_ V_/_
http://linuxgfx.sourceforge.net

diff -urN linux-2.3.39-2/include/linux/fb.h linux/include/linux/fb.h
--- linux-2.3.39-2/include/linux/fb.h Sun Jan 9 11:03:01 2000
+++ linux/include/linux/fb.h Sun Jan 9 13:21:49 2000
@@ -1,29 +1,36 @@
 #ifndef _LINUX_FB_H
 #define _LINUX_FB_H
 
-#include <linux/tty.h>
 #include <asm/types.h>
+#include <linux/tty.h>
+#include <linux/ioctl.h>
 
 /* Definitions of frame buffers */
 
 #define FB_MAJOR 29
 #define FB_MAX 32 /* sufficient for now */
 
-/* ioctls
- 0x46 is 'F' */
-#define FBIOGET_VSCREENINFO 0x4600
-#define FBIOPUT_VSCREENINFO 0x4601
-#define FBIOGET_FSCREENINFO 0x4602
-#define FBIOGETCMAP 0x4604
-#define FBIOPUTCMAP 0x4605
-#define FBIOPAN_DISPLAY 0x4606
-/* 0x4607-0x460B are defined below */
-/* #define FBIOGET_MONITORSPEC 0x460C */
-/* #define FBIOPUT_MONITORSPEC 0x460D */
-/* #define FBIOSWITCH_MONIBIT 0x460E */
-#define FBIOGET_CON2FBMAP 0x460F
-#define FBIOPUT_CON2FBMAP 0x4610
-#define FBIOBLANK 0x4611 /* arg: 0 or vesa level + 1 */
+#define FB_IOC_MAGIC 'F'
+#define FB_IOC_MAXNR 255
+
+/* ioctls */
+#define FBIOGET_VSCREENINFO _IOWR(FB_IOC_MAGIC, 0, struct fb_var_screeninfo)
+#define FBIOPUT_VSCREENINFO _IOWR(FB_IOC_MAGIC, 1, struct fb_var_screeninfo)
+#define FBIOGET_FSCREENINFO _IOR(FB_IOC_MAGIC, 2, struct fb_fix_screeninfo)
+#define FBIOGETCMAP _IOR(FB_IOC_MAGIC, 4, struct fb_cmap)
+#define FBIOPUTCMAP _IOW(FB_IOC_MAGIC, 5, struct fb_cmap)
+#define FBIOPAN_DISPLAY _IOWR(FB_IOC_MAGIC, 6, struct fb_var_screeninfo)
+#define FBIOGET_FCURSORINFO _IOR(FB_IOC_MAGIC, 7, struct fb_fix_cursorinfo)
+#define FBIOGET_VCURSORINFO _IOR(FB_IOC_MAGIC, 8, struct fb_var_cursorinfo)
+#define FBIOPUT_VCURSORINFO _IOW(FB_IOC_MAGIC, 9, struct fb_var_cursorinfo)
+#define FBIOGET_CURSORSTATE _IOR(FB_IOC_MAGIC, 10, struct fb_cursorstate)
+#define FBIOPUT_CURSORSTATE _IOW(FB_IOC_MAGIC, 11, struct fb_cursorstate)
+/* #define FBIOGET_MONITORSPEC _IOR(FB_IOC_MAGIC, 12, struct fb_monspecs) */
+/* #define FBIOPUT_MONITORSPEC _IOW(FB_IOC_MAGIC, 13, struct fb_monspecs) */
+/* #define FBIOSWITCH_MONIBIT _IOW(FB_IOC_MAGIC, 14, int) */
+#define FBIOGET_CON2FBMAP _IOWR(FB_IOC_MAGIC, 15, struct fb_con2fbmap)
+#define FBIOPUT_CON2FBMAP _IOW(FB_IOC_MAGIC, 16, struct fb_con2fbmap)
+#define FBIOBLANK _IOW(FB_IOC_MAGIC, 17, int) /* arg: 0 or vesa level + 1 */
 
 #define FB_TYPE_PACKED_PIXELS 0 /* Packed Pixels */
 #define FB_TYPE_PLANES 1 /* Non interleaved planes */
@@ -197,6 +204,12 @@
         __u32 framebuffer;
 };
 
+/* VESA Blanking Levels */
+#define VESA_NO_BLANKING 0
+#define VESA_VSYNC_SUSPEND 1
+#define VESA_HSYNC_SUSPEND 2
+#define VESA_POWERDOWN 3
+
 struct fb_monspecs {
         __u32 hfmin; /* hfreq lower limit (Hz) */
         __u32 hfmax; /* hfreq upper limit (Hz) */
@@ -205,6 +218,48 @@
         unsigned dpms : 1; /* supports DPMS */
 };
 
+#if 1 /* Preliminary */
+
+ /*
+ * Hardware Cursor
+ */
+
+struct fb_fix_cursorinfo {
+ __u16 crsr_width; /* width and height of the cursor in */
+ __u16 crsr_height; /* pixels (zero if no cursor) */
+ __u16 crsr_xsize; /* cursor size in display pixels */
+ __u16 crsr_ysize;
+ __u16 crsr_color1; /* colormap entry for cursor color1 */
+ __u16 crsr_color2; /* colormap entry for cursor color2 */
+};
+
+struct fb_var_cursorinfo {
+ __u16 width;
+ __u16 height;
+ __u16 xspot;
+ __u16 yspot;
+ __u8 data[1]; /* field with [height][width] */
+};
+
+struct fb_cursorstate {
+ __s16 xoffset;
+ __s16 yoffset;
+ __u16 mode;
+};
+
+#define FB_CURSOR_OFF 0
+#define FB_CURSOR_ON 1
+#define FB_CURSOR_FLASH 2
+
+#endif /* Preliminary */
+
+#if 1
+
+#define FBCMD_GET_CURRENTPAR 0xDEAD0005
+#define FBCMD_SET_CURRENTPAR 0xDEAD8005
+
+#endif
+
 #ifdef __KERNEL__
 
 #if 1 /* to go away in 2.4.0 */
@@ -261,9 +316,14 @@
    char modename[40]; /* default video mode */
    kdev_t node;
    int flags;
+ int chip_type; /* Seperate similar cards apart */
 #define FBINFO_FLAG_MODULE 1 /* Low-level driver is a module */
+ struct fb_var_screeninfo var; /* Current var */
+ struct fb_fix_screeninfo fix; /* Current fix */
+ struct fb_monspecs monspecs; /* Current Monitor specs */
    struct fb_ops *fbops;
- struct fb_monspecs monspecs;
+ char *screen_base; /* Virtual address */
+ u32 pseudo_palette[17]; /* Fake palette for non palette mode */
    struct display *disp; /* initial display variable */
    struct vc_data *display_fg; /* Console visible on this display */
    char fontname[40]; /* default font name */
@@ -275,8 +335,8 @@
    void (*blank)(int, struct fb_info*); /* tell fb to (un)blank the screen */
                                         /* arg = 0: unblank */
                                         /* arg > 0: VESA level (arg-1) */
-
    /* From here on everything is device dependent */
+ void *par;
 };
 
 #ifdef MODULE
@@ -383,13 +443,6 @@
 extern struct fb_cmap *fb_default_cmap(int len);
 extern void fb_invert_cmaps(void);
 
-/* VESA Blanking Levels */
-#define VESA_NO_BLANKING 0
-#define VESA_VSYNC_SUSPEND 1
-#define VESA_HSYNC_SUSPEND 2
-#define VESA_POWERDOWN 3
-
-
 struct fb_videomode {
     const char *name; /* optional */
     u32 refresh; /* optional */
@@ -414,55 +467,5 @@
                                unsigned int default_bpp);
 
 #endif /* __KERNEL__ */
-
-#if 1
-
-#define FBCMD_GET_CURRENTPAR 0xDEAD0005
-#define FBCMD_SET_CURRENTPAR 0xDEAD8005
-
-#endif
-
-
-#if 1 /* Preliminary */
-
- /*
- * Hardware Cursor
- */
-
-#define FBIOGET_FCURSORINFO 0x4607
-#define FBIOGET_VCURSORINFO 0x4608
-#define FBIOPUT_VCURSORINFO 0x4609
-#define FBIOGET_CURSORSTATE 0x460A
-#define FBIOPUT_CURSORSTATE 0x460B
-
-
-struct fb_fix_cursorinfo {
- __u16 crsr_width; /* width and height of the cursor in */
- __u16 crsr_height; /* pixels (zero if no cursor) */
- __u16 crsr_xsize; /* cursor size in display pixels */
- __u16 crsr_ysize;
- __u16 crsr_color1; /* colormap entry for cursor color1 */
- __u16 crsr_color2; /* colormap entry for cursor color2 */
-};
-
-struct fb_var_cursorinfo {
- __u16 width;
- __u16 height;
- __u16 xspot;
- __u16 yspot;
- __u8 data[1]; /* field with [height][width] */
-};
-
-struct fb_cursorstate {
- __s16 xoffset;
- __s16 yoffset;
- __u16 mode;
-};
-
-#define FB_CURSOR_OFF 0
-#define FB_CURSOR_ON 1
-#define FB_CURSOR_FLASH 2
-
-#endif /* Preliminary */
 
 #endif /* _LINUX_FB_H */

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sat Jan 15 2000 - 21:00:14 EST