1) related header files
Include/Linux/FB. h some key struct and macros; Drivers/Video/fbmem. c implements interfaces for device initialization, uninstallation, and file operations; Drivers/Video/xxxfb. c. Add a specific device driver file by yourself;
2) Key struct
Struct fb_var_screeninfo {} modifiable controller parameters; struct fb_fix_screeninfo {} Fixed controller parameters; unchangeable; struct fb_bitfield {} display the buffer organization mode in each pixel; struct fb_cmap {} describes device-independent color ing information; struct fb_info {includes struct fb_var_screeninfo var; struct fb_fix_screeninfo fix; struct fb_ops * fbops} the most critical data struct; each framebuffer device must correspond to an fb_info structure;
The abstraction of the underlying operations of struct fb_ops {} is different from that of file_operations. For the framebuffer device file_operations, The fb_info structure is also called;
3) Source Code call relationship
Drivers/Video/xxxfb. c => Drivers/Video/fbmem. C: The drivers/Video/xxxfb. c file is registered with fbmem. C to generate the/dev/FB * file;
Call relationship between the upper layer and the bottom layer: struct file_operations => struct fb_ops => struct fb_info
For example, the source code Drivers/Video/s3c2410fb. c
1)module_init(s3c2410fb_init);
2)platform_driver_register(&s3c2410fb_driver);
3)static struct platform_driver s3c2410fb_driver = { .probe = s3c2410fb_probe,
4) return s3c24xxfb_probe(pdev, DRV_S3C2410);
5) fbinfo-> fbops = & s3c2410fb_ops; (the final fb_ops operation fb_info structure called );
Certificate ------------------------------------------------------------------------------------------------------------------------------------------------
Implementation source files related to OMAP:
1) Drivers/Video/omap2/omapfb/omapfb-main.c