fb.h
来自「Linux Kernel 2.6.9 for OMAP1710」· C头文件 代码 · 共 812 行 · 第 1/2 页
H
812 行
struct fb_cmap_user { __u32 start; /* First entry */ __u32 len; /* Number of entries */ __u16 __user *red; /* Red values */ __u16 __user *green; __u16 __user *blue; __u16 __user *transp; /* transparency, can be NULL */};struct fb_image_user { __u32 dx; /* Where to place image */ __u32 dy; __u32 width; /* Size of image */ __u32 height; __u32 fg_color; /* Only used when a mono bitmap */ __u32 bg_color; __u8 depth; /* Depth of the image */ const char __user *data; /* Pointer to image data */ struct fb_cmap_user cmap; /* color map info */};struct fb_cursor_user { __u16 set; /* what to set */ __u16 enable; /* cursor on/off */ __u16 rop; /* bitop operation */ const char __user *mask; /* cursor mask bits */ struct fbcurpos hot; /* cursor hot spot */ struct fb_image_user image; /* Cursor image */};/* * Register/unregister for framebuffer events *//* The resolution of the passed in fb_info about to change */ #define FB_EVENT_MODE_CHANGE 0x01/* The display on this fb_info is beeing suspended, no access to the * framebuffer is allowed any more after that call returns */#define FB_EVENT_SUSPEND 0x02/* The display on this fb_info was resumed, you can restore the display * if you own it */#define FB_EVENT_RESUME 0x03/* An entry from the modelist was removed */#define FB_EVENT_MODE_DELETE 0x04/* A driver registered itself */#define FB_EVENT_FB_REGISTERED 0x05/* get console to framebuffer mapping */#define FB_EVENT_GET_CONSOLE_MAP 0x06/* set console to framebuffer mapping */#define FB_EVENT_SET_CONSOLE_MAP 0x07struct fb_event { struct fb_info *info; void *data;};extern int fb_register_client(struct notifier_block *nb);extern int fb_unregister_client(struct notifier_block *nb);/* * Pixmap structure definition * * The purpose of this structure is to translate data * from the hardware independent format of fbdev to what * format the hardware needs. */#define FB_PIXMAP_DEFAULT 1 /* used internally by fbcon */#define FB_PIXMAP_SYSTEM 2 /* memory is in system RAM */#define FB_PIXMAP_IO 4 /* memory is iomapped */#define FB_PIXMAP_SYNC 256 /* set if GPU can DMA */struct fb_pixmap { u8 *addr; /* pointer to memory */ u32 size; /* size of buffer in bytes */ u32 offset; /* current offset to buffer */ u32 buf_align; /* byte alignment of each bitmap */ u32 scan_align; /* alignment per scanline */ u32 access_align; /* alignment per read/write */ u32 flags; /* see FB_PIXMAP_* */ /* access methods */ void (*outbuf)(struct fb_info *info, u8 *addr, u8 *src, unsigned int size); u8 (*inbuf) (struct fb_info *info, u8 *addr);};/* * Frame buffer operations * * LOCKING NOTE: those functions must _ALL_ be called with the console * semaphore held, this is the only suitable locking mecanism we have * in 2.6. Some may be called at interrupt time at this point though. */struct fb_ops { /* open/release and usage marking */ struct module *owner; int (*fb_open)(struct fb_info *info, int user); int (*fb_release)(struct fb_info *info, int user); /* For framebuffers with strange non linear layouts or that do not * work with normal memory mapped access */ ssize_t (*fb_read)(struct file *file, char __user *buf, size_t count, loff_t *ppos); ssize_t (*fb_write)(struct file *file, const char __user *buf, size_t count, loff_t *ppos); /* checks var and eventually tweaks it to something supported, * DO NOT MODIFY PAR */ int (*fb_check_var)(struct fb_var_screeninfo *var, struct fb_info *info); /* set the video mode according to info->var */ int (*fb_set_par)(struct fb_info *info); /* set color register */ int (*fb_setcolreg)(unsigned regno, unsigned red, unsigned green, unsigned blue, unsigned transp, struct fb_info *info); /* blank display */ int (*fb_blank)(int blank, struct fb_info *info); /* pan display */ int (*fb_pan_display)(struct fb_var_screeninfo *var, struct fb_info *info); /* Draws a rectangle */ void (*fb_fillrect) (struct fb_info *info, const struct fb_fillrect *rect); /* Copy data from area to another */ void (*fb_copyarea) (struct fb_info *info, const struct fb_copyarea *region); /* Draws a image to the display */ void (*fb_imageblit) (struct fb_info *info, const struct fb_image *image); /* Draws cursor */ int (*fb_cursor) (struct fb_info *info, struct fb_cursor *cursor); /* Rotates the display */ void (*fb_rotate)(struct fb_info *info, int angle); /* wait for blit idle, optional */ int (*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, struct fb_info *info); /* perform fb specific mmap */ int (*fb_mmap)(struct fb_info *info, struct file *file, struct vm_area_struct *vma);};/* FBINFO_* = fb_info.flags bit flags */#define FBINFO_MODULE 0x0001 /* Low-level driver is a module */#define FBINFO_HWACCEL_DISABLED 0x0002 /* When FBINFO_HWACCEL_DISABLED is set: * Hardware acceleration is turned off. Software implementations * of required functions (copyarea(), fillrect(), and imageblit()) * takes over; acceleration engine should be in a quiescent state *//* hints */#define FBINFO_PARTIAL_PAN_OK 0x0040 /* otw use pan only for double-buffering */#define FBINFO_READS_FAST 0x0080 /* soft-copy faster than rendering *//* hardware supported ops *//* semantics: when a bit is set, it indicates that the operation is * accelerated by hardware. * required functions will still work even if the bit is not set. * optional functions may not even exist if the flag bit is not set. */#define FBINFO_HWACCEL_NONE 0x0000#define FBINFO_HWACCEL_COPYAREA 0x0100 /* required */#define FBINFO_HWACCEL_FILLRECT 0x0200 /* required */#define FBINFO_HWACCEL_IMAGEBLIT 0x0400 /* required */#define FBINFO_HWACCEL_ROTATE 0x0800 /* optional */#define FBINFO_HWACCEL_XPAN 0x1000 /* optional */#define FBINFO_HWACCEL_YPAN 0x2000 /* optional */#define FBINFO_HWACCEL_YWRAP 0x4000 /* optional */#define FBINFO_MISC_MODECHANGEUSER 0x10000 /* mode change request from userspace */#define FBINFO_MISC_MODESWITCH 0x20000 /* mode switch */#define FBINFO_MISC_MODESWITCHLATE 0x40000 /* init hardware later */struct fb_info { int node; int flags; struct fb_var_screeninfo var; /* Current var */ struct fb_fix_screeninfo fix; /* Current fix */ struct fb_monspecs monspecs; /* Current Monitor specs */ struct fb_cursor cursor; /* Current cursor */ struct work_struct queue; /* Framebuffer event queue */ struct timer_list cursor_timer; /* Cursor timer */ struct fb_pixmap pixmap; /* Image hardware mapper */ struct fb_pixmap sprite; /* Cursor hardware mapper */ struct fb_cmap cmap; /* Current cmap */ struct list_head modelist; /* mode list */ struct fb_ops *fbops; char __iomem *screen_base; /* Virtual address */ unsigned long screen_size; /* Amount of ioremapped VRAM or 0 */ int currcon; /* Current VC. */ void *pseudo_palette; /* Fake palette of 16 colors */ #define FBINFO_STATE_RUNNING 0#define FBINFO_STATE_SUSPENDED 1 u32 state; /* Hardware state i.e suspend */ /* From here on everything is device dependent */ void *par; };#ifdef MODULE#define FBINFO_DEFAULT FBINFO_MODULE#else#define FBINFO_DEFAULT 0#endif// This will go away#define FBINFO_FLAG_MODULE FBINFO_MODULE#define FBINFO_FLAG_DEFAULT FBINFO_DEFAULT/* This will go away * fbset currently hacks in FB_ACCELF_TEXT into var.accel_flags * when it wants to turn the acceleration engine on. This is * really a separate operation, and should be modified via sysfs. * But for now, we leave it broken with the following define */#define STUPID_ACCELF_TEXT_SHIT// This will go away#if defined(__sparc__)/* We map all of our framebuffers such that big-endian accesses * are what we want, so the following is sufficient. */// This will go away#define fb_readb sbus_readb#define fb_readw sbus_readw#define fb_readl sbus_readl#define fb_readq sbus_readq#define fb_writeb sbus_writeb#define fb_writew sbus_writew#define fb_writel sbus_writel#define fb_writeq sbus_writeq#define fb_memset sbus_memset_io#elif defined(__i386__) || defined(__alpha__) || defined(__x86_64__) || defined(__hppa__) || (defined(__sh__) && !defined(__SH5__)) || defined(__powerpc__)#define fb_readb __raw_readb#define fb_readw __raw_readw#define fb_readl __raw_readl#define fb_readq __raw_readq#define fb_writeb __raw_writeb#define fb_writew __raw_writew#define fb_writel __raw_writel#define fb_writeq __raw_writeq#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_readq(addr) (*(volatile u64 *) (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_writeq(b,addr) (*(volatile u64 *) (addr) = (b))#define fb_memset memset#endif /* * `Generic' versions of the frame buffer device operations */extern int fb_set_var(struct fb_info *info, struct fb_var_screeninfo *var); extern int fb_pan_display(struct fb_info *info, struct fb_var_screeninfo *var); extern int fb_blank(struct fb_info *info, int blank);extern int soft_cursor(struct fb_info *info, struct fb_cursor *cursor);extern void cfb_fillrect(struct fb_info *info, const struct fb_fillrect *rect); extern void cfb_copyarea(struct fb_info *info, const struct fb_copyarea *area); extern void cfb_imageblit(struct fb_info *info, const struct fb_image *image);/* drivers/video/fbmem.c */extern int register_framebuffer(struct fb_info *fb_info);extern int unregister_framebuffer(struct fb_info *fb_info);extern int fb_prepare_logo(struct fb_info *fb_info);extern int fb_show_logo(struct fb_info *fb_info);extern char* fb_get_buffer_offset(struct fb_info *info, struct fb_pixmap *buf, u32 size);extern void fb_iomove_buf_unaligned(struct fb_info *info, struct fb_pixmap *buf, u8 *dst, u32 d_pitch, u8 *src, u32 idx, u32 height, u32 shift_high, u32 shift_low, u32 mod);extern void fb_iomove_buf_aligned(struct fb_info *info, struct fb_pixmap *buf, u8 *dst, u32 d_pitch, u8 *src, u32 s_pitch, u32 height);extern void fb_sysmove_buf_unaligned(struct fb_info *info, struct fb_pixmap *buf, u8 *dst, u32 d_pitch, u8 *src, u32 idx, u32 height, u32 shift_high, u32 shift_low, u32 mod);extern void fb_sysmove_buf_aligned(struct fb_info *info, struct fb_pixmap *buf, u8 *dst, u32 d_pitch, u8 *src, u32 s_pitch, u32 height);extern void fb_load_cursor_image(struct fb_info *);extern void fb_set_suspend(struct fb_info *info, int state);extern int fb_get_color_depth(struct fb_info *info);extern int fb_get_options(char *name, char **option);extern struct fb_info *registered_fb[FB_MAX];extern int num_registered_fb;/* drivers/video/fbsysfs.c */extern struct fb_info *framebuffer_alloc(size_t size, struct device *dev);extern void framebuffer_release(struct fb_info *info);/* drivers/video/fbmon.c */#define FB_MAXTIMINGS 0#define FB_VSYNCTIMINGS 1#define FB_HSYNCTIMINGS 2#define FB_DCLKTIMINGS 3#define FB_IGNOREMON 0x100#define FB_MODE_IS_UNKNOWN 0#define FB_MODE_IS_DETAILED 1#define FB_MODE_IS_STANDARD 2#define FB_MODE_IS_VESA 4#define FB_MODE_IS_CALCULATED 8#define FB_MODE_IS_FIRST 16#define FB_MODE_IS_FROM_VAR 32extern int fbmon_valid_timings(u_int pixclock, u_int htotal, u_int vtotal, const struct fb_info *fb_info);extern int fbmon_dpms(const struct fb_info *fb_info);extern int fb_get_mode(int flags, u32 val, struct fb_var_screeninfo *var, struct fb_info *info);extern int fb_validate_mode(const struct fb_var_screeninfo *var, struct fb_info *info);extern int fb_parse_edid(unsigned char *edid, struct fb_var_screeninfo *var);extern int fb_get_monitor_limits(unsigned char *edid, struct fb_monspecs *specs);extern void fb_edid_to_monspecs(unsigned char *edid, struct fb_monspecs *specs);extern int fb_get_monitor_limits(unsigned char *edid, struct fb_monspecs *specs);extern struct fb_videomode *fb_create_modedb(unsigned char *edid, int *dbsize);extern void fb_destroy_modedb(struct fb_videomode *modedb);/* drivers/video/modedb.c */#define VESA_MODEDB_SIZE 34extern const struct fb_videomode vesa_modes[];extern void fb_var_to_videomode(struct fb_videomode *mode, struct fb_var_screeninfo *var);extern void fb_videomode_to_var(struct fb_var_screeninfo *var, struct fb_videomode *mode);extern int fb_mode_is_equal(struct fb_videomode *mode1, struct fb_videomode *mode2);extern int fb_add_videomode(struct fb_videomode *mode, struct list_head *head);extern void fb_delete_videomode(struct fb_videomode *mode, struct list_head *head);extern struct fb_videomode *fb_match_mode(struct fb_var_screeninfo *var, struct list_head *head);extern struct fb_videomode *fb_find_best_mode(struct fb_var_screeninfo *var, struct list_head *head);extern void fb_destroy_modelist(struct list_head *head);extern void fb_videomode_to_modelist(struct fb_videomode *modedb, int num, struct list_head *head);/* drivers/video/fbcmap.c */extern int fb_alloc_cmap(struct fb_cmap *cmap, int len, int transp);extern void fb_dealloc_cmap(struct fb_cmap *cmap);extern int fb_copy_cmap(struct fb_cmap *from, struct fb_cmap *to);extern int fb_cmap_to_user(struct fb_cmap *from, struct fb_cmap_user *to);extern int fb_set_cmap(struct fb_cmap *cmap, struct fb_info *fb_info);extern int fb_set_user_cmap(struct fb_cmap_user *cmap, struct fb_info *fb_info);extern struct fb_cmap *fb_default_cmap(int len);extern void fb_invert_cmaps(void);struct fb_videomode { const char *name; /* optional */ u32 refresh; /* optional */ u32 xres; u32 yres; u32 pixclock; u32 left_margin; u32 right_margin; u32 upper_margin; u32 lower_margin; u32 hsync_len; u32 vsync_len; u32 sync; u32 vmode; u32 flag;};struct fb_modelist { struct list_head list; struct fb_videomode mode;};extern int fb_find_mode(struct fb_var_screeninfo *var, struct fb_info *info, const char *mode_option, const struct fb_videomode *db, unsigned int dbsize, const struct fb_videomode *default_mode, unsigned int default_bpp);#endif /* __KERNEL__ */#endif /* _LINUX_FB_H */
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?