LCD 每隔10分钟 自动熄灭 --打开Framebuffer console的时候
2013-06-02 22:31
369 查看
之前移植LCD的时候,一切正常,但是当尝试把log输出到lcd的时候,总是会出现10分钟黑屏,无论如何都唤不醒
通过打log,最终定位到s3c_fb_blank这个函数。
问题就出在
writel(WINxMAP_MAP | WINxMAP_MAP_COLOUR(0x00),//liujia disable the black screen
sfb->regs + sfb->variant.winmap + (index * 4));
发现执行到这里,LCD就黑屏了。
查数据手册发现:
这个寄存器的意思是,当MAPCOLEN_F使能的时候,他会把LCD显示成MAPCOLOR设置成颜色,关闭LCD的DMA功能,然后Framebuffer就不能刷新LCD了。
这也许就是FB_BLANK_NORMAL,这个的功能吧,把LCD一直刷成某个颜色。
参考http://blog.csdn.net/zanget/article/details/6569743这个 大侠的博客,
加入dump_stack
log:
找到了调用关系
console_callback--->do_blank_screen--->fb_blank--->s3c_fb_blank.
按照http://blog.csdn.net/zanget/article/details/6569743修改方法
将vt.c 179行
static int blankinterval = 10*60;
修改为
static int blankinterval = 0;
这样就不会出现黑屏的现象了。
通过打log,最终定位到s3c_fb_blank这个函数。
static int s3c_fb_blank(int blank_mode, struct fb_info *info) { struct s3c_fb_win *win = info->par; struct s3c_fb *sfb = win->parent; unsigned int index = win->index; u32 wincon; printk("lj:s3c_fb_blank:blank mode:%d\n",blank_mode); dev_dbg(sfb->dev, "blank mode %d\n", blank_mode); pm_runtime_get_sync(sfb->dev); wincon = readl(sfb->regs + sfb->variant.wincon + (index * 4)); switch (blank_mode) { case FB_BLANK_POWERDOWN: wincon &= ~WINCONx_ENWIN; sfb->enabled &= ~(1 << index); /* fall through to FB_BLANK_NORMAL */ case FB_BLANK_NORMAL: /* disable the DMA and display 0x0 (black) */ shadow_protect_win(win, 1); dump_stack(); writel(WINxMAP_MAP | WINxMAP_MAP_COLOUR(0x00),//liujia disable the black screen sfb->regs + sfb->variant.winmap + (index * 4)); shadow_protect_win(win, 0); break; case FB_BLANK_UNBLANK: shadow_protect_win(win, 1); writel(0x0, sfb->regs + sfb->variant.winmap + (index * 4)); shadow_protect_win(win, 0); wincon |= WINCONx_ENWIN; sfb->enabled |= (1 << index); break; case FB_BLANK_VSYNC_SUSPEND: case FB_BLANK_HSYNC_SUSPEND: default: pm_runtime_put_sync(sfb->dev); return 1; } shadow_protect_win(win, 1); writel(wincon, sfb->regs + sfb->variant.wincon + (index * 4)); shadow_protect_win(win, 0); /* Check the enabled state to see if we need to be running the * main LCD interface, as if there are no active windows then * it is highly likely that we also do not need to output * anything. */ /* We could do something like the following code, but the current * system of using framebuffer events means that we cannot make * the distinction between just window 0 being inactive and all * the windows being down. * * s3c_fb_enable(sfb, sfb->enabled ? 1 : 0); */ /* we're stuck with this until we can do something about overriding * the power control using the blanking event for a single fb. */ if (index == sfb->pdata->default_win) { shadow_protect_win(win, 1); s3c_fb_enable(sfb, blank_mode != FB_BLANK_POWERDOWN ? 1 : 0); shadow_protect_win(win, 0); } pm_runtime_put_sync(sfb->dev); return 0; }
问题就出在
writel(WINxMAP_MAP | WINxMAP_MAP_COLOUR(0x00),//liujia disable the black screen
sfb->regs + sfb->variant.winmap + (index * 4));
发现执行到这里,LCD就黑屏了。
查数据手册发现:
这个寄存器的意思是,当MAPCOLEN_F使能的时候,他会把LCD显示成MAPCOLOR设置成颜色,关闭LCD的DMA功能,然后Framebuffer就不能刷新LCD了。
这也许就是FB_BLANK_NORMAL,这个的功能吧,把LCD一直刷成某个颜色。
参考http://blog.csdn.net/zanget/article/details/6569743这个 大侠的博客,
加入dump_stack
case FB_BLANK_NORMAL: /* disable the DMA and display 0x0 (black) */ shadow_protect_win(win, 1); dump_stack(); writel(WINxMAP_MAP | WINxMAP_MAP_COLOUR(0x00),//liujia disable the black screen sfb->regs + sfb->variant.winmap + (index * 4)); shadow_protect_win(win, 0); break;
log:
<7>[ 61.285759] lj:s3c_fb_blank:blank mode:1 <7>[ 61.285772] lj:shadow_protect_win:1 <7>[ 61.285816] [<80013120>] (unwind_backtrace+0x0/0xec) from [<801af0b8>] (s3c_fb_blank+0x84/0x180) <7>[ 61.285835] [<801af0b8>] (s3c_fb_blank+0x84/0x180) from [<801a2bcc>] (fb_blank+0x3c/0x68) <7>[ 61.285852] [<801a2bcc>] (fb_blank+0x3c/0x68) from [<801a9690>] (fbcon_blank+0x118/0x260) <7>[ 61.285875] [<801a9690>] (fbcon_blank+0x118/0x260) from [<801c7594>] (do_blank_screen+0x1b8/0x258) <7>[ 61.285892] [<801c7594>] (do_blank_screen+0x1b8/0x258) from [<801c884c>] (console_callback+0xe4/0x114) <7>[ 61.285909] [<801c884c>] (console_callback+0xe4/0x114) from [<8002e12c>] (process_one_work+0x1e8/0x318) <7>[ 61.285927] [<8002e12c>] (process_one_work+0x1e8/0x318) from [<800301c0>] (worker_thread+0x1b4/0x2b4) <7>[ 61.285947] [<800301c0>] (worker_thread+0x1b4/0x2b4) from [<80033438>] (kthread+0x88/0x94) <7>[ 61.285969] [<80033438>] (kthread+0x88/0x94) from [<8000ec20>] (kernel_thread_exit+0x0/0x8) <7>[ 61.285979] lj:shadow_protect_win:0 <7>[ 61.285984] lj:shadow_protect_win:1 <7>[ 61.285990] lj:shadow_protect_win:0 <7>[ 61.285995] lj:shadow_protect_win:1 <7>[ 61.286001] lj:s3c_fb_set_par <7>[ 61.286005] lj:shadow_protect_win:0
找到了调用关系
console_callback--->do_blank_screen--->fb_blank--->s3c_fb_blank.
按照http://blog.csdn.net/zanget/article/details/6569743修改方法
将vt.c 179行
static int blankinterval = 10*60;
修改为
static int blankinterval = 0;
这样就不会出现黑屏的现象了。
相关文章推荐
- LCD 每隔10分钟 自动熄灭 --打开Framebuffer console的时候
- LCD 每隔10分钟 自动熄灭 --打开Framebuffer console的时候【转】
- LCD frame buffer 白屏 (熄灭)
- Gentoo - Enable framebuffer console (没有安装X,KDE的时候)
- 我想在打开网页的时候自动运行这个代码啊
- perl 打开和输出gz压缩文件【更新perl打开的时候自动判断是否压缩文件的模块】
- 使用Servlet实现文件下载的时候,避免浏览器自动打开文件
- 打开/dev/fb0时“No such device”错误解决方法:激活 VESA FrameBuffer 驱动程序
- 打开EXCEL的时候总是自动弹出VS2008的安装程序解决办法
- 打开authoring console的时候始终出现"不能找到需要的管理包:system.library"
- android2.3.04 lcd framebuffer porting
- 更改MyEclipse默认工作空间,myeclipse打开的时候总是自动打开,以前还有选择哪个工作空间的
- 打开word的时候输入法自动换成了微软输入法?
- 为什么我每次打开visual studio 2005 的时候里面的asp文件都会自动打开???
- 使用Servlet实现文件下载的时候,避免浏览器自动打开文件
- 取消LCD自动熄灭
- 让记事本每次打开的时候自动记录当前时间
- Linux Framebuffer 驱动框架之一概念介绍及LCD硬件原理
- RecyclerView 在几个分页fragment中切换时会出现滑动,和一打开recyclerview的时候就自动滑到到底部
- Linux Framebuffer 驱动框架之一概念介绍及LCD硬件原理【转】