android 显示(display)模块驱动详解(1)

高通MSM8909+Android5.1.1启动流程---lk log(splash.img)的生成、烧录和显示


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

  • 1
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Android系统架构及其驱动研究】   1.1 Android系统架构 .....................................03   1.2 Android代码结构 .....................................04   1.3 Android专用驱动 .....................................05   1.4 Linux设备驱动Android上的使用分析 ....06   1.5 Android比起Linux的七点优势 ..................10 【Android底层驱动概述】   2.1 Android底层驱动的详细内容 ...................11   2.2 字符设备和块设备 ....................................13   2.3 Linux下的VFS ...........................................14    【Android 驱动类别】   3.1 Android专用驱动 Ashmem、binder、logger .............17   3.2 设备驱动 .................................................................17 【Android 驱动实例】   4.1 Android Led控制实验 ..............................................22   4.2 基于PXA310上的Android手机的驱动开发 ...............31   4.3 Android内核驱动——Alarm .....................................34 【Android 驱动实例】   5.1 CameraSerivce服务的注册流程 ...........................47   5.2 ramdisk driver 驱动实现的源码 ..........................61 【其他】   6.1 提交BUG ..............................................................74   6.2 关于eoe Android .................................................74   6.3 eoe携手支付宝移动应用开发者沙龙 ...................74   6.4 eoe Android移动互联高峰论坛在深圳举行 ..........74

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值