From 65a58ce9be7a47b4db83b3ecff9a29cc15a2927c Mon Sep 17 00:00:00 2001 From: =?utf8?q?=E9=99=88=E6=81=92=E6=98=8E?= Date: Tue, 28 Dec 2010 03:41:12 -0800 Subject: [PATCH] rk29: rk29_fb: fix bug on blocking display --- drivers/video/rk29_fb.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/drivers/video/rk29_fb.c b/drivers/video/rk29_fb.c index 3d3634d54b55..9a50d54916e7 100755 --- a/drivers/video/rk29_fb.c +++ b/drivers/video/rk29_fb.c @@ -113,7 +113,6 @@ struct win0_par { u32 ysize; u32 format; - struct rw_semaphore sem; wait_queue_head_t wait; struct win_set mirror; struct win_set displ; @@ -1632,6 +1631,7 @@ static int fb1_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg) // enable win0 after the win0 par is seted par->addr_seted = 1; if(par->par_seted) { + unsigned long flags; if (par->mirror.c_offset) { ret = wait_event_interruptible_timeout(par->wait, (0 == par->mirror.c_offset), HZ/20); @@ -1639,13 +1639,14 @@ static int fb1_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg) break; } - down_write(&par->sem); + local_irq_save(flags); LcdMskReg(inf, SYS_CONFIG, m_W0_ENABLE, v_W0_ENABLE(1)); - mcu_refresh(inf); par->mirror.y_offset = yuv_phy[0]; par->mirror.c_offset = yuv_phy[1]; + local_irq_restore(flags); + + mcu_refresh(inf); //printk("0x%.8x 0x%.8x mirror\n", par->mirror.y_offset, par->mirror.c_offset); - up_write(&par->sem); } } break; @@ -1776,7 +1777,6 @@ static irqreturn_t rk29fb_irq(int irq, void *dev_id) #endif if(waitqueue_active(&par->wait)) { - down_write(&par->sem); if (par->mirror.c_offset == 0) printk("error: no new buffer to display\n"); @@ -1789,8 +1789,6 @@ static irqreturn_t rk29fb_irq(int irq, void *dev_id) //printk("0x%.8x 0x%.8x displaying\n", par->displ.y_offset, par->displ.c_offset); //printk("0x%.8x 0x%.8x done\n", par->done.y_offset, par->done.c_offset); - - up_write(&par->sem); wake_up_interruptible(&par->wait); } @@ -2117,7 +2115,6 @@ static int __init rk29fb_probe (struct platform_device *pdev) memset(par, 0, sizeof(struct win0_par)); - init_rwsem(&par->sem); init_waitqueue_head(&par->wait); /* Init all lcdc and lcd before register_framebuffer. */ -- 2.34.1