uboot-imx RGB24分析
在mx6q_sabrsd.c文件中
函数else if(strcmp(s, "YUV444") == 0)
val = IPU_PIX_FMT_YUV444;
else
val = IPU_PIX_FMT_RGB666;
printf("fixfmt = %s %d\n", s, val); ,其中val=RGB24 di=1 lvsd=fb_videomode
ret = ipuv3_fb_init(&lvds_xga, di, val,
DI_PCLK_LDB, 65000000);
此后进入ipuv3_fb_init这个函数
分析发现ret = ipuv3_fb_init(&lvds_xga, di, val,DI_PCLK_LDB, 65000000);
int ipuv3_fb_init(struct fb_videomode *mode, int di, int interface_pix_fmt(即是val),
ipu_di_clk_parent_t di_clk_parent, int di_clk_val)
{
int ret;
ret = ipu_probe(di, di_clk_parent, di_clk_val);
if (ret)
puts("Error initializing IPU\n");
debug("Framebuffer at 0x%x\n", (unsigned int)lcd_base);
ret = mxcfb_probe(interface_pix_fmt, mode, di);
return ret;
}
interface_pix_fmt==RGB24
struct fb_videomode *mode ==&lvds_xga
di ==1
发现mxcfb_probe这个函数设计到了RGB24==interface_pix_fmt, 的形式
此时我们再进入mxcfb_probe这个函数分析
static int mxcfb_probe(u32 interface_pix_fmt, struct fb_videomode *mode, int di)
{
struct fb_info *fbi;
struct mxcfb_info *mxcfbi;
int ret = 0;
/*
* Initialize FB structures
*/
fbi = mxcfb_init_fbinfo();
if (!fbi) {
ret = -ENOMEM;
goto err0;
}
mxcfbi = (struct mxcfb_info *)fbi->par;
if (!g_dp_in_use) {
mxcfbi->ipu_ch = MEM_BG_SYNC;
mxcfbi->blank = FB_BLANK_UNBLANK;
} else {
mxcfbi->ipu_ch = MEM_DC_SYNC;
mxcfbi->blank = FB_BLANK_POWERDOWN;
}
mxcfbi->ipu_di = di;
ipu_disp_set_global_alpha(mxcfbi->ipu_ch, 1, 0x80);
ipu_disp_set_color_key(mxcfbi->ipu_ch, 0, 0);
strcpy(fbi->fix.id, "DISP3 BG");
g_dp_in_use = 1;
mxcfb_info[mxcfbi->ipu_di] = fbi;
/* Need dummy values until real panel is configured */
fbi->var.xres = 640;
fbi->var.yres = 480;
fbi->var.bits_per_pixel = 16;
发现在这个地方RGB24被赋值给了mxcfbi->ipu_di_pix_fmt,我们再来分析mxcfbi这个函数
mxcfbi->ipu_di_pix_fmt = interface_pix_fmt;//RGB24
fb_videomode_to_var(&fbi->var, mode);
mxcfb_check_var(&fbi->var, fbi);
/* Default Y virtual size is 2x panel size */
fbi->var.yres_virtual = fbi->var.yres * 2;
mxcfb_set_fix(fbi);
/* alocate fb first */
if (mxcfb_map_video_memory(fbi) < 0)
return -ENOMEM;
mxcfb_set_par(fbi);
/* Setting panel_info for lcd */
panel_info.vl_col = fbi->var.xres;
panel_info.vl_row = fbi->var.yres;
panel_info.vl_bpix = LCD_BPP;
lcd_line_length = (panel_info.vl_col * NBITS(panel_info.vl_bpix)) / 8;
debug("MXC IPUV3 configured\n"
"XRES = %d YRES = %d BitsXpixel = %d\n",
panel_info.vl_col,
panel_info.vl_row,
panel_info.vl_bpix);
ipu_dump_registers();
return 0;
err0:
return ret;
}
我们在mxc_ipuv3_fb.c这个文件中发现了mxcfbi的定义
struct mxcfb_info {
int blank;
ipu_channel_t ipu_ch;
int ipu_di;
u32 ipu_di_pix_fmt;
unsigned char overlay;
unsigned char alpha_chan_en;
dma_addr_t alpha_phy_addr0;
dma_addr_t alpha_phy_addr1;
void *alpha_virt_addr0;
void *alpha_virt_addr1;
uint32_t alpha_mem_len;
uint32_t cur_ipu_buf;
uint32_t cur_ipu_alpha_buf;
u32 pseudo_palette[16];
};
struct fb_info {
struct fb_var_screeninfo var; /* Current var */
unsigned long smem_start; /* Start of frame buffer mem */
/* (physical address) */
unsigned int smem_len; /* Length of frame buffer mem */
unsigned int type; /* see FB_TYPE_* */
unsigned int line_length; /* length of a line in bytes */
char *screen_base;
unsigned long screen_size;
int logo_height;
unsigned int logo_size;
};
uboot-imx RGB24分析的更多相关文章
- u-boot源码分析之C语言段
题外话: 最近一直在学习u-boot的源代码,从代码量到代码风格,都让我认识到什么才是真正的程序.以往我所学到的C语言知识和u-boot的源代码相比,实在不值一提.说到底,机器都是0和1控制的.感觉这 ...
- imx6 u-boot.bin 和 u-boot.imx
有些MFG TOOL烧录工具使用了u-boot.imx,而不是原来的u-boot.bin文件进行烧录. 这两个镜像的区别是,u-boot.bin文件编译后,会在u-boot.bin的开头添加一个大小为 ...
- u-boot启动流程分析(2)_板级(board)部分
转自:http://www.wowotech.net/u-boot/boot_flow_2.html 目录: 1. 前言 2. Generic Board 3. _main 4. global dat ...
- [国嵌笔记][030][U-Boot工作流程分析]
uboot工作流程分析 程序入口 1.打开顶层目录的Makefile,找到目标smdk2440_config的命令中的第三项(smdk2440) 2.进入目录board/samsung/smdk244 ...
- 基于335X的UBOOT网口驱动分析
基于335X的UBOOT网口驱动分析 一.软硬件平台资料 1. 开发板:创龙AM3359核心板,网口采用RMII形式 2. UBOOT版本:U-Boot-2016.05,采用FDT和DM. 参考链 ...
- u-boot源码分析
Uboot源码分析 源码以u-boot-1.3.4为基准,主芯片采用at91sam9260,主要介绍uboot执行流程. uboot官网:http://www.denx.de/wiki/U-Boot/ ...
- Xilinx Uboot网卡驱动分析
1.MAC控制器.网卡.PHY.MDIO.mii.gmii.rgmii概念扫盲 网卡在功能上包含OSI模型的两个层,数据链路层和物理层.物理层定义了数据传送与接收所需要的电与光信号.线路状态.时钟基准 ...
- uboot makefile构建分析-续
前言 这篇博文是 uboot makefile构建分析的续篇,继续分析uboot构建u-boot.bin的过程 构建u-boot.bin过程分析 makefile一开始,就是确定链接脚本.在构建ubo ...
- uboot主Makefile分析(t配置和编译过程详解)
1.编译uboot前需要三次make make distcleanmake x210_sd_configmake -j4 make distclean为清楚dist文件. make x210_sd_c ...
- uboot主Makefile分析
VERSION = 1 PATCHLEVEL = 3 SUBLEVEL = 4 EXTRAVERSION = U_BOOT_VERSION = $(VERSION).$(PATCHLEVEL).$(S ...
随机推荐
- [软件工程基础]2017.10.27 第二次 Scrum 会议
决议 周六前项目交接 Milestone 完成 周六集体开发 游心整理物理网站上的实验流程和绪论复习题 石奇川上线静态版实验流程和绪论复习题库 李煦通构思后端如何实现绪论题库,包括和用户记录的关联方式 ...
- 转 如何诊断和解决high version count 10.2.0.4 and 11.2.0.4
转自 http://blog.csdn.net/notbaron/article/details/50927492 在Oracle 10g以上的版本,High version count可谓是一个臭名 ...
- 转 测试linux中expect的timeout参数的作用
http://blog.csdn.net/msdnchina/article/details/50638818
- 098 Validate Binary Search Tree 验证二叉搜索树
给定一个二叉树,判断其是否是一个有效的二叉搜索树.一个二叉搜索树有如下定义: 左子树只包含小于当前节点的数. 右子树只包含大于当前节点的数. 所有子树自身必须也是二叉搜索树.示例 1 ...
- nodejs 生成验证码
此方法需要nodejs 安装canvas 扩展 准备工作 以Linux为例 1.服务器gcc版本需4.8以上 2.安装所需扩展 yum install cairo cairo-devel cairom ...
- 爬虫requests库的基本用法
需要注意的几个点: 1.后面的s是一个虚拟目录 2.url后面不用加问号,发起请求的时候会自动帮你加上问号 get_url = 'http://www.baidu.com/s' 3. url的特性:u ...
- promise从易到难
Chapter 1 // 需求:你要封装一个方法,我给你一个要读取文件的路径,你这个方法能帮我读取文件,并把内容返回给我 const fs = require('fs') const path = r ...
- jQuery源码分析系列(转载来源Aaron.)
声明:非本文原创文章,转载来源原文链接Aaron. 版本截止到2013.8.24 jQuery官方发布最新的的2.0.3为准 附上每一章的源码注释分析 :https://github.com/JsAa ...
- input type=file 选择图片并且实现预览效果
通过<input />标签,给它指定type类型为file,可提供文件上传: accept:可选择上传类型,如:只要传图片,且不限制图片格式,为image/*: multiple:规定是否 ...
- CPU性能的评价
人们通常用benchmark 来衡量CPU的性能,常见的benchmark有dhrystone和coremark. 由于dhrystone 受编译器影响比较大,所以,结果不是很准确,现在大多采用cor ...