Frame Buffer内核相关学习笔记

今天在看了一下frame buffer的内核相关的知道,边看边收拾,先贴出来,等问题解决完了,结构PAX270LCD控制器及Sharp的LCD,软硬结合的总结一下。


Frame Buffer and LCD controller


driver/video/console/fbcon.h(framebuffer控制台相关代码)
定义了 struct display{},为底层控制台驱动和帧缓冲驱动提供接口。
接口中u_short inverse与帧缓冲驱动打交道,而 u_char与控制台驱动打交道。
显示对象在屏幕上的移动方式方法(最好是pan+accel copyarea模式,不对成不得已,不用soft copy)
分辨率,高宽,像素
字体,数据
灰度,RGB,透明以及帧缓冲模式
外部接口:extern int fb_console_init(void)
include/linux/notifier.h (用于系统状态改变的提示,比如设备的启停,驱动的加卸载,低太存,黑屏,系统的重新启动,关闭等等内容)
struct notifier_block{}是一个链表结构,数据项分别是priority和notifier_call(struct * notifier_block *self, unsigned long, void *)(回调函数)
int notifier_chain_register(struct notifier_block **list, struct notifier_block *n)
int notifier_chain_unregister(struct notifier_block **nl, struct notifier_block *n)
int notifier_call_chain(struct notifier_block **n, unsigned long val, void *v)
include/linux/fb.h (定义了与framebuffer相关的数据结构与宏)
屏幕相关数据结构struct fb_var_screeninfo{} struct fb_fix_screeninfo{}
显示与滚动模式相关的fb_copyarea/fb_fillrect/fb_image
硬件光标相关控制
fb_event是一个链式结构,其数据为struct fb_info
fb_info这个数据结构中包含了屏幕,显示器,光标,像素,调色板等结构信息。最为重要的是,它包含有FrameBuffer的事件队列和struct fb_ops*结构体).
frame buffer操作数据结构:struct fb_ops{}
fb_register_client( struct notifier_block *nb)
fb_unregister_client( struct notifier_block *nb)
drivers/video/fbmem.c(framebuffer驱动程序实现,实现并向外提供一系列操作方法)
register_framebuffer( struct fb_info * fb_info)
unregister_framebuffer9struct fb_info *fb_info)
include/linux/device.h(总线/设备/驱动相关数据结构定义,主要目的是电源管理,状态管理,接口统一化,结合notifier的机制)
struct bus_type{}总线类型
struct bus_attribute{}总线属性
struct device_driver{}设备驱动
struct driver_attribute{}驱动属性
struct class{} 设备类型
struct class_attribute{}设备类型属性
struct class_device{}
struct class_device_attribute{}
struct class_interface{}
struct device{}
struct device_attribute{}
struct platform_device{}
driver/video/vfb.c(虚拟帧缓冲驱动,可以些为基础进行驱动移植)
First:构造fb_info->fb_var_screeninfo
next: 构造fb_info->fb_fix_screeninfo
next: 定义模块参数用来使用帧缓冲
next: 构造fb_info->fb_ops,用于操作设备
next: 构造device_driver->probe,设备侦测的函数,fb_info在这儿初始化
用vmalloc分配一块内存用来表示显示卡的缓冲区,缓冲区大小等于size+sizeof(struct fb_info), fb_info->par指向fb_info后面的内存开始处。
fb_info->screen_base也指向显存开始地址。
fb_info->fbops指向前面初始化的值。
fb_find_mode用于找到一个有效的显示模式。
fb_info->pseudo_palette->fb_info->par;
fb_info->par设备为空。
fb_alloc_cmap用于初始化colormap
register_framebuffer(struct fb_info*) 找到设备,且设备正确,则注册帧缓冲设备
dev_set_drvdata(struct device*, struct fb_info*)
next: 构造device_driver->remove
next: 构造device_driver
next: 构造platfor_device
next: 构造模块的初始化
next:构造模块的销毁函数
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值