#define FB_TYPE_PACKED_PIXELS 0 /* Packed Pixels 填充的像素 */
#define FB_TYPE_PLANES 1 /* Non interleaved planes 非交错平面 */
#define FB_TYPE_INTERLEAVED_PLANES 2 /* Interleaved planes 交错的平面 */
#define FB_TYPE_TEXT 3 /* Text/attributes 文本/属性 */
#define FB_TYPE_VGA_PLANES 4 /* EGA/VGA planes EGA/VGA 平面 */
色域偏移的解释:所有的偏移量都来自于右边,在一个"像素"值里面,实际上是'bits_per_pixel'
的宽度(也就是说:你可以使用该偏移量作为 << 的右参数).一个像素之后是一个位流,并且
作为未被修改而被写到视频内存中
对于伪色彩来说:对于所有的颜色部分,偏移量和长度应该是相同的.偏移量指定了
在一个像素值里的调色板索引的最低有效位的位置.长度指明了可用的调色板入口的
数量.
#define FB_VMODE_NONINTERLACED 0 /* non interlaced 非交错模式 */
#define FB_VMODE_INTERLACED 1 /* interlaced 交错模式 */
#define FB_VMODE_DOUBLE 2 /* double scan 双扫描模式 */
#define FB_VMODE_ODD_FLD_FIRST 4 /* interlaced: top line first 交错的:顶行优先 */
struct fb_vblank {
__u32 flags; /* FB_VBLANK flags FB_VBLANK标志 */
__u32 count; /* counter of retraces since boot 启动之后追溯的次数 */
__u32 vcount; /* current scanline position 当前扫描行位置 */
__u32 hcount; /* current scandot position 当前扫描点位置 */
__u32 reserved[4]; /* reserved for future compatibility 保留 */
};
/* Internal HW accel 内部硬件加速 */
#define ROP_COPY 0
#define ROP_XOR 1
//复制区域
struct fb_copyarea {
__u32 dx;
__u32 dy;
__u32 width;
__u32 height;
__u32 sx;
__u32 sy;
};
//回执矩形
struct fb_fillrect {
__u32 dx; /* screen-relative 屏幕相关 */
__u32 dy;
__u32 width;
__u32 height;
__u32 color;
__u32 rop;
};
struct fb_image {
__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 *data; /* Pointer to image data 指向图像数据的指针 */
struct fb_cmap cmap; /* color map info 颜色映射信息 */
};
struct fb_monspecs {
struct fb_chroma chroma;
struct fb_videomode *modedb; /* mode database 模式数据库 */
__u8 manufacturer[4]; /* Manufacturer 制造商 */
__u8 monitor[14]; /* Monitor String 监视字符串 */
__u8 serial_no[14]; /* Serial Number 序列号 */
__u8 ascii[14]; /* ? */
__u32 modedb_len; /* mode database length 模式数据库长度 */
__u32 model; /* Monitor Model 监视模型 */
__u32 serial; /* Serial Number - Integer 序列号-整数 */
__u32 year; /* Year manufactured 制造年*/
__u32 week; /* Week Manufactured 制造周 */
__u32 hfmin; /* hfreq lower limit (Hz) hfreq最低限制*/
__u32 hfmax; /* hfreq upper limit (Hz) hfreq最高限制*/
__u32 dclkmin; /* pixelclock lower limit (Hz) pixelclock最低限制*/
__u32 dclkmax; /* pixelclock upper limit (Hz) pixelclock最高限制*/
__u16 input; /* display type - see FB_DISP_* 显示类型 - 查看FB_DISP_* */
__u16 dpms; /* DPMS support - see FB_DPMS_ DPMS支持-查看FB_DPMS_ */
__u16 signal; /* Signal Type - see FB_SIGNAL_* 信号类型 - 查看FB_SIGNAL_* */
__u16 vfmin; /* vfreq lower limit (Hz) vfreq最低限制 */
__u16 vfmax; /* vfreq upper limit (Hz) vfreq最高限制 */
__u16 gamma; /* Gamma - in fractions of 100 100的分数 */
__u16 gtf : 1; /* supports GTF 支持 GTF */
__u16 misc; /* Misc flags - see FB_MISC_* Misc标识 - 查看FB_MISC_* */
__u8 version; /* EDID version... EDID版本 */
__u8 revision; /* ...and revision 修订版本 */
__u8 max_x; /* Maximum horizontal size (cm) 最大水平大小 */
__u8 max_y; /* Maximum vertical size (cm) 最大垂直大小 */
};
struct fb_pixmap {
u8 *addr; /* pointer to memory 指向内存的指针 */
u32 size; /* size of buffer in bytes 缓冲的字节数大小 */
u32 offset; /* current offset to buffer 当前到buffer的偏移量 */
u32 buf_align; /* byte alignment of each bitmap 每一个位图的字节对齐 */
u32 scan_align; /* alignment per scanline 每一个扫描行的对齐 */
u32 access_align; /* alignment per read/write (bits) 每一个读写位的对齐 */
u32 flags; /* see FB_PIXMAP_* 查看FB_PIXMAP_* */
u32 blit_x; /* supported bit block dimensions (1-32) 支持位块尺寸(1-32) */
u32 blit_y; /* Format: blit_x = 1 << (width - 1) */
/* blit_y = 1 << (height - 1) */
/* if 0, will be set to 0xffffffff (all) 如果是0,则被设置为0xffffffff */
/* access methods 访问方法 */
void (*writeio)(struct fb_info *info, void __iomem *dst, void *src, unsigned int size);
void (*readio) (struct fb_info *info, void *dst, void __iomem *src, unsigned int size);
};
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
* 对于拥有陌生的非线性布局的framebuffer来说,不能使用普通的内存
* 映射访问来工作
*/
ssize_t (*fb_read)(struct fb_info *info, char __user *buf,
size_t count, loff_t *ppos);
ssize_t (*fb_write)(struct fb_info *info, const char __user *buf,
size_t count, loff_t *ppos);
/* checks var and eventually tweaks it to something supported,
* DO NOT MODIFY PAR */
// 检查var并且事件性的调整到可支持状态.不要修改PAR
int (*fb_check_var)(struct fb_var_screeninfo *var, struct fb_info *info);
/* set the video mode according to info->var */
// 通过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);
/* set color registers in batch */
// 批处理设置颜色寄存器
int (*fb_setcmap)(struct fb_cmap *cmap, struct fb_info *info);
/* blank display */
// 空显示
int (*fb_blank)(int blank, struct fb_info *info);
/* pan display */
// pan 显示
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 */
// 等待blit空闲,可选
int (*fb_sync)(struct fb_info *info);
/* perform fb specific ioctl (optional) */
// 运行fb指定的ioctl(可选)
int (*fb_ioctl)(struct fb_info *info, unsigned int cmd,
unsigned long arg);
/* Handle 32bit compat ioctl (optional) */
// 处理32位兼容的ioctl
int (*fb_compat_ioctl)(struct fb_info *info, unsigned cmd,
unsigned long arg);
/* perform fb specific mmap */
// 运行fb指定的mmap
int (*fb_mmap)(struct fb_info *info, struct vm_area_struct *vma);
/* get capability given var */
// 获取给定的var的能力
void (*fb_get_caps)(struct fb_info *info, struct fb_blit_caps *caps,
struct fb_var_screeninfo *var);
/* teardown any resources to do with this framebuffer */
// 卸载与该framebuffer相关的任何资源
void (*fb_destroy)(struct fb_info *info);
};
#ifdef CONFIG_FB_TILEBLITTING
#define FB_TILE_CURSOR_NONE 0
#define FB_TILE_CURSOR_UNDERLINE 1
#define FB_TILE_CURSOR_LOWER_THIRD 2
#define FB_TILE_CURSOR_LOWER_HALF 3
#define FB_TILE_CURSOR_TWO_THIRDS 4
#define FB_TILE_CURSOR_BLOCK 5
struct fb_tilemap {
__u32 width; /* width of each tile in pixels 像素的宽度 */
__u32 height; /* height of each tile in scanlines 扫描行的高度 */
__u32 depth; /* color depth of each tile 颜色深度 */
__u32 length; /* number of tiles in the map 在映射中的数量 */
const __u8 *data; /* actual tile map: a bitmap array, packed
to the nearest byte 实际映射:一个位图数组,被打包到最近的位 */
};
struct fb_tilerect {
__u32 sx; /* origin in the x-axis 在x轴中原点*/
__u32 sy; /* origin in the y-axis 在y轴中的原点*/
__u32 width; /* number of tiles in the x-axis 在x-axis 中的数量 */
__u32 height; /* number of tiles in the y-axis 在y-axis中的数量 */
__u32 index; /* what tile to use: index to tile map 使用哪一个tile:到tile映射的索引 */
__u32 fg; /* foreground color 前景色 */
__u32 bg; /* background color 后景色 */
__u32 rop; /* raster operation 光栅操作 */
};
struct fb_tilearea {
__u32 sx; /* source origin in the x-axis 在X轴的源原点 */
__u32 sy; /* source origin in the y-axis 在y轴的源原点 */
__u32 dx; /* destination origin in the x-axis 在x轴的目的原点 */
__u32 dy; /* destination origin in the y-axis 在y轴的目的原点 */
__u32 width; /* number of tiles in the x-axis 在x轴中的tiles的数量 */
__u32 height; /* number of tiles in the y-axis 在y轴中的tiles的数量 */
};
struct fb_tileblit {
__u32 sx; /* origin in the x-axis 在x轴的原点 */
__u32 sy; /* origin in the y-axis 在y轴的原点*/
__u32 width; /* number of tiles in the x-axis 在x轴上的tiles的数量 */
__u32 height; /* number of tiles in the y-axis 在y轴上的tiles的数量 */
__u32 fg; /* foreground color 前景色*/
__u32 bg; /* background color 后景色*/
__u32 length; /* number of tiles to draw 要绘制的tiles的数量 */
__u32 *indices; /* array of indices to tile map 到tile映射的指数数组 */
};
struct fb_tilecursor {
__u32 sx; /* cursor position in the x-axis 在x轴的光标位置*/
__u32 sy; /* cursor position in the y-axis 在y轴的光标位置 */
__u32 mode; /* 0 = erase, 1 = draw 0 = 擦除,1=绘制*/
__u32 shape; /* see FB_TILE_CURSOR_* 查看FB_TILE_CURSOR_* */
__u32 fg; /* foreground color 前景色*/
__u32 bg; /* background color 后景色*/
};
struct fb_tile_ops {
/* set tile characteristics 设置tile的特征*/
void (*fb_settile)(struct fb_info *info, struct fb_tilemap *map);
/* all dimensions from hereon are in terms of tiles */
// 从现在起,所有尺寸都在tiles方面
/* move a rectangular region of tiles from one area to another*/
// 移动一个矩形区域从一个地方到另外一个地方
void (*fb_tilecopy)(struct fb_info *info, struct fb_tilearea *area);
/* fill a rectangular region with a tile */
// 使用一个tile填充一个矩形区域
void (*fb_tilefill)(struct fb_info *info, struct fb_tilerect *rect);
/* copy an array of tiles */
// 复制一个tile数组
void (*fb_tileblit)(struct fb_info *info, struct fb_tileblit *blit);
/* cursor */
// 光标
void (*fb_tilecursor)(struct fb_info *info,
struct fb_tilecursor *cursor);
/* get maximum length of the tile map */
// 获取tile映射的最大长度
int (*fb_get_tilemax)(struct fb_info *info);
};
#endif /* CONFIG_FB_TILEBLITTING */
/* FBINFO_* = fb_info.flags bit flags FBINFO_* = fb_info.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 */
/* 当FBINFO_HWACCEL_DISABLED被设置的时候:
* 硬件加速被关掉.所需功能的软件实现(copyarea(),fillrect()和imageblit())
* 接管.加速引擎应该位域静态状态
*
/* hints 提示*/
#define FBINFO_VIRTFB 0x0004 /* FB is System RAM, not device. FB是系统RAM,不是设备*/
#define FBINFO_PARTIAL_PAN_OK 0x0040 /* otw use pan only for double-buffering otw使用pan仅仅用于双缓冲 */
#define FBINFO_READS_FAST 0x0080 /* soft-copy faster than rendering 软拷贝快于渲染 */
struct fb_info {
int node;
int flags;
struct mutex lock; /* Lock for open/release/ioctl funcs 用于open/release/ioctl函数的锁 */
struct mutex mm_lock; /* Lock for fb_mmap and smem_* fields 用于fb_mmap和smem_* 域的锁 */
struct fb_var_screeninfo var; /* Current var 可变参数*/
struct fb_fix_screeninfo fix; /* Current fix 固定参数 */
struct fb_monspecs monspecs; /* Current Monitor specs 显示器标准 */
struct work_struct queue; /* Framebuffer event queue 帧缓冲事件队列 */
struct fb_pixmap pixmap; /* Image hardware mapper 图像硬件mapper */
struct fb_pixmap sprite; /* Cursor hardware mapper 光标硬件mapper */
struct fb_cmap cmap; /* Current cmap 目前的颜色表 */
struct list_head modelist; /* mode list 模式列表 */
struct fb_videomode *mode; /* current mode 当前的video模式 */
#ifdef CONFIG_FB_BACKLIGHT
/* assigned backlight device 对应的背光设备*/
/* set before framebuffer registration,
remove after unregister 在framebuffer注册之前被设置,在注销之后移走 */
struct backlight_device *bl_dev;
/* Backlight level curve 背光调整 */
struct mutex bl_curve_mutex;
u8 bl_curve[FB_BACKLIGHT_LEVELS];
#endif
#ifdef CONFIG_FB_DEFERRED_IO
struct delayed_work deferred_work;
struct fb_deferred_io *fbdefio;
#endif
struct fb_ops *fbops; // 帧缓冲操作
struct device *device; /* This is the parent 辐射被*/
struct device *dev; /* This is this fb device fb设备 */
int class_flag; /* private sysfs flags 私有sysfs标识 */
#ifdef CONFIG_FB_TILEBLITTING
struct fb_tile_ops *tileops; /* Tile Blitting 图块blitting */
#endif
char __iomem *screen_base; /* Virtual address 虚拟基地址 */
unsigned long screen_size; /* Amount of ioremapped VRAM or 0 ioremapped的虚拟内存大小 或者是 0*/
void *pseudo_palette; /* Fake palette of 16 colors 伪16色颜色表 */
#define FBINFO_STATE_RUNNING 0
#define FBINFO_STATE_SUSPENDED 1
u32 state; /* Hardware state i.e suspend 硬件状态,如挂起 */
void *fbcon_par; /* fbcon use-only private area fbcon仅仅用于私有区域*/
/* From here on everything is device dependent 从这里开始所有的事物都是设备依赖的 */
void *par;
/* we need the PCI or similiar aperture base/size not
smem_start/size as smem_start may just be an object
allocated inside the aperture so may not actually overlap */
resource_size_t aperture_base;
resource_size_t aperture_size;
};
fb.h注释
最新推荐文章于 2024-07-18 23:25:18 发布