s3c2410fb_map_video_memory
来源:互联网 发布:代源码百度云 编辑:程序博客网 时间:2024/05/09 09:35
s3c2410fb_map_video_memory
/*
* s3c2410fb_map_video_memory():
* Allocates the DRAM memory for the frame buffer. This buffer is
* remapped into a non-cached, non-buffered, memory region to
* allow palette and pixel writes to occur without flushing the
* cache. On
* access to the video memory should occur at the new region.
*/
static int __init s3c2410fb_map_video_memory(struct s3c2410fb_info *fbi)
{
dprintk("map_video_memory(fbi=%p)\n", fbi);
fbi->map_size = PAGE_ALIGN(fbi->fb->fix.smem_len + PAGE_SIZE); /*分配总数对齐*/
fbi->map_cpu = dma_alloc_writecombine(fbi->dev, fbi->map_size,
&fbi->map_dma, GFP_KERNEL); /*分配DMA地址*/
fbi->map_size = fbi->fb->fix.smem_len;
if (fbi->map_cpu) {
/* prevent initial garbage on screen */
dprintk("map_video_memory: clear %p:%08x\n",
fbi->map_cpu, fbi->map_size);
memset(fbi->map_cpu, 0xf0, fbi->map_size);
fbi->screen_dma = fbi->map_dma;
fbi->fb->screen_base = fbi->map_cpu;
fbi->fb->fix.smem_start = fbi->screen_dma;
dprintk("map_video_memory: dma=%08x cpu=%p size=%08x\n",
fbi->map_dma, fbi->map_cpu, fbi->fb->fix.smem_len);
}
return fbi->map_cpu ? 0 : -ENOMEM;
}
这个函数分配完frame buffer地址后,设置好相关参数就返回了.
- s3c2410fb_map_video_memory
- 不应忽视的一些HTML优化技巧
- 表格“高度”“宽度”“颜色”
- 我分析Flex的未来
- 透析设计模式中的 策略模式
- sencha 2.0 基于HTML5的sessionstorage的使用
- s3c2410fb_map_video_memory
- daemon函数实现原理
- HDU Today&&http://acm.hdu.edu.cn/showproblem.php?pid=2112
- android IPC及原理简介
- 重载 overload
- 《软件测试与持续质量改进(第三版)》 读书心得
- 用命令提示符创建一个在windows非法的文件夹
- openCv学习笔记(一)——数字图形的基础和结构
- Android进程间通信(IPC)机制Binder介绍