00001 /* clib/include/able/fb.h 00002 * 00003 * ABLE Framebuffer interface, structures and routines. 00004 * 00005 * Copyright 2008 Simtec Electronics 00006 * 00007 * Permission is hereby granted, free of charge, to any person 00008 * obtaining a copy of this software and associated documentation 00009 * files (the "Software"), to deal in the Software without 00010 * restriction, including without limitation the rights to use, copy, 00011 * modify, merge, publish, distribute, sublicense, and/or sell copies 00012 * of the Software, and to permit persons to whom the Software is 00013 * furnished to do so, subject to the following conditions: 00014 * 00015 * The above copyright notice and this permission notice shall be 00016 * included in all copies or substantial portions of the Software. 00017 * 00018 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 00019 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 00020 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 00021 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 00022 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 00023 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 00024 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 00025 * SOFTWARE. 00026 * 00027 */ 00028 00029 #ifndef _ABLE_CLIB_ABLE_FB_H 00030 #define _ABLE_CLIB_ABLE_FB_H 1 00031 00032 #define IOCTL_FB_SCROLL (44) 00033 #define IOCTL_FB_GETPALETTE (45) 00034 #define IOCTL_FB_SETPALETTE (46) 00035 #define IOCTL_FB_GETINFO (47) 00036 #define IOCTL_FB_GETMODE (48) 00037 #define IOCTL_FB_SETMODE (49) 00043 typedef struct argb_s { 00044 unsigned char a; 00045 unsigned char r; 00046 unsigned char g; 00047 unsigned char b; 00048 } argb_t; 00049 00053 typedef struct { 00054 int number; 00055 int index; 00056 argb_t *palette; 00057 } fb_setpalette_t; 00058 00059 00060 #define FB_SYNC_HOR_HIGH_ACT (1) 00061 #define FB_SYNC_VERT_HIGH_ACT (2) 00062 #define FB_SYNC_EXT (4) 00063 #define FB_SYNC_COMP_HIGH_ACT (8) 00064 #define FB_SYNC_BROADCAST (16) 00065 #define FB_SYNC_ON_GREEN (32) 00067 #define FB_VMODE_NONINTERLACED (0) 00068 #define FB_VMODE_INTERLACED (1) 00069 #define FB_VMODE_DOUBLE (2) 00070 #define FB_VMODE_MASK (255) 00074 struct fb_bitfield { 00075 uint32_t offset; 00076 uint32_t length; 00080 uint32_t msb_right; 00081 }; 00082 00084 typedef struct fb_var_screeninfo { 00085 uint32_t xres; 00086 uint32_t yres; 00087 uint32_t xres_virtual; 00088 uint32_t yres_virtual; 00089 uint32_t xoffset; 00090 uint32_t yoffset; 00092 uint32_t bits_per_pixel; 00098 uint32_t grayscale; 00099 00104 struct fb_bitfield red; 00105 00110 struct fb_bitfield green; 00111 00116 struct fb_bitfield blue; 00117 00122 struct fb_bitfield transp; 00123 00124 uint32_t height; 00125 uint32_t width; 00133 uint32_t pixclock; 00134 00135 uint32_t left_margin; 00136 uint32_t right_margin; 00137 uint32_t upper_margin; 00138 uint32_t lower_margin; 00139 uint32_t hsync_len; 00140 uint32_t vsync_len; 00141 uint32_t sync; 00142 uint32_t vmode; 00143 } fb_var_screeninfo_t; 00144 00150 typedef struct fb_info_s { 00151 const char *name; 00152 struct dev *dev; 00154 unsigned char *video_start; 00155 unsigned long video_scroll; 00156 unsigned long video_size; 00157 unsigned long video_totsize; 00158 unsigned long hw_start; 00159 unsigned long line_len; 00161 struct fb_var_screeninfo *screeninfo; 00168 argb_t cur_palette[256]; 00169 00170 } fb_info_t; 00171 00172 #endif /* _ABLE_CLIB_ABLE_FB_H */