android 显示(display)模块驱动详解(1)
来源:互联网 发布:什么游戏好玩不用网络 编辑:程序博客网 时间:2024/06/03 22:55
1. LK logo的显示有两种方法
For LK display (boot loader) logo, there are two methods:
a) Read the splash image data from splash.h file.
b) Get the splash image data from Splash Partition.
Solution Statement:
For a), please see the below source codes:
bootable/bootloader/lk/platform/msm_shared/include/splash.h
bootable/bootloader/lk/dev/fbcon/fbcon.c
When fbimg is NULL, LK display data getsfrom imageBuffer_rgb888 arrays.
2. 企鹅界面对应splash.img的生成
device\qcom\common\display\logo\logo_gen.py,生成splash.img的步骤:
The steps to generate a splash.img:
(1) sudo apt-get install python-imaging
(2) python ./logo_gen.pysnapdragon.png
这样就可在当前目录下生成splash.img,图片要求png格式,且且色深为8-bit的RGB或者RGBA格式。
# limit:# the logo png file's format must be:# a Truecolour with alpha: each pixel consists of four samples,# only allow 8-bit depeths: red, green, blue, and alpha.# b Truecolour: each pixel consists of three samples,# only allow 8-bit depeths: red, green, and blue. # description:# struct logo_header {# unsigned char[8]; // "SPLASH!!"# unsigned width; // logo's width,little endian# unsigned height; // logo'sheight, little endian# unsigned char reserved[512-16];# }; # the logo Image layout:# logo_header + BGR RAW Data
参考http://blog.csdn.net/loongembedded/article/details/52153796
参考http://blog.csdn.net/sgmenghuo/article/details/44303107
3. splash.img烧写到分区中
有两种办法:
(1) 用高通烧录工具QFIL在烧录系统的时候一起烧录
(2) 用fastboot烧录:fastboot flash splash splash.img
fastboot相关源代码\system\core\fastboot
4. 从分区中读出splash信息并显示
\bootable\bootloader\lk\app\aboot\aboot.c
aboot_init()--->target_display_init()--->gcdb_display_init()--->msm_display_init()--->display_image_on_screen()
void display_image_on_screen(){ structfbimage default_fbimg, *fbimg; boolflag = true; fbcon_clear(); fbimg= fetch_image_from_partition(); if(!fbimg){ flag= false; fbimg= &default_fbimg; fbimg->header.width= SPLASH_IMAGE_HEIGHT; fbimg->header.height= SPLASH_IMAGE_WIDTH;#if DISPLAY_TYPE_MIPI fbimg->image= (unsigned char *)imageBuffer_rgb888;#else fbimg->image= (unsigned char *)imageBuffer;#endif } fbcon_putImage(fbimg,flag);}
上面先从splash分区中读取logo信息,如果没有,则读取imageBuffer_rgb888[]数组的内容显示。
在msm_display_init()调用display_image_on_screen()之前先调用了fbcon_setup(&(panel->fb))来设置记录了显示屏分辨率、显示地址等信息的全局指针config。
4.1 fbcon_clear()
void fbcon_clear(void){ unsignedcount = config->width * config->height; memset(config->base,BGCOLOR, count * ((config->bpp) / 8));}
这里的config->base的值由#define MIPI_FB_ADDR 0x83200000定义,config全局变量的值主要有fbcon_setup()赋值。
4.2 fetch_image_from_partition()
调用splash_screen_mmc()从splash分区中读取logo信息
struct fbimage* splash_screen_mmc(){ intindex = INVALID_PTN; unsignedlong long ptn = 0; structfbcon_config *fb_display = NULL; structfbimage *logo = &logo_header; index= partition_get_index("splash");//获取splash分区的索引 if(index == 0) { dprintf(CRITICAL,"ERROR: splash Partition table not found\n"); returnNULL; } ptn= partition_get_offset(index);//通过索引获取到偏移地址指针 if(ptn == 0) { dprintf(CRITICAL,"ERROR: splash Partition invalid\n"); returnNULL; } if(mmc_read(ptn, (unsigned int *) logo, sizeof(logo->header))) {//先读取header dprintf(CRITICAL,"ERROR: Cannot read splash image header\n"); returnNULL; } if(splash_screen_check_header(logo)) {//check header dprintf(CRITICAL,"ERROR: Splash image header invalid\n"); returnNULL; } fb_display= fbcon_display();//获取全局指针config if(fb_display) { if((logo->header.width != fb_display->width) || (logo->header.height !=fb_display->height)) { dprintf(CRITICAL,"Logo config doesn't match with fb config. Fall back defaultlogo\n"); returnNULL; } uint8_t*base = (uint8_t *) fb_display->base; if(mmc_read(ptn + sizeof(logo->header), base, ((((logo->header.width* logo->header.height * fb_display->bpp/8) + 511) >> 9) <<9))) { fbcon_clear(); dprintf(CRITICAL,"ERROR: Cannot read splash image from partition\n"); returnNULL; } logo->image= base; } returnlogo;//返回读取到的数据}
转自:https://tieba.baidu.com/p/4755744372
- android 显示(display)模块驱动详解(1)
- Android GSM驱动模块(rild)初始化
- display-开发板上四位七段数码管的显示模块
- s3c6410硬件DISPLAY CONTROLLER(显示控制器)
- 显示和隐藏(display属性)
- 显示控件组(Display Widgets)
- 显示和隐藏(display属性)
- 实例详解WinCE中Display驱动开发
- 显示驱动教程(1)
- FL2440驱动添加(1):hello world 驱动模块添加
- blackberrypi模块spi驱动分析(1)
- Linux驱动学习(模块1)
- Android GSM驱动模块(rild)详细分析(二)
- Android GSM驱动模块(rild)详细分析(三)
- Android GSM驱动模块(rild)详细分析
- Android GSM驱动模块(rild)详细分析
- Android开发之GSM驱动模块详细分析(一)
- Android GSM驱动模块详细分析(二)request流程
- Find Largest Value in Each Tree Row问题及解法
- qduoj LC的涂色游戏(快速幂)
- GCC 编译选项
- javascript dom编程艺术笔记
- 同一张表两次查询结果集合并
- android 显示(display)模块驱动详解(1)
- gdb core 调试
- HDU 6153 A Secret(KMP)
- Android内存优化杂谈
- 图片处理-图片在计算机的显示
- c++queue容器介绍
- 读者写者的 死锁问题 初探
- Struts2的访问路径三:使用通配符配置访问路径二
- Android 多商品订单评价(类似淘宝)