From 08fa548d16c7245c14e44ea392c8f30cab2f9b57 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=E6=9D=9C=E5=9D=A4=E6=98=8E?= Date: Fri, 17 Dec 2010 16:56:30 +0800 Subject: [PATCH] add three buf support of fb; enhance gpu's mmu table size to 256k --- .../rk29/vivante/hal/inc/gc_hal_options.h | 2 +- drivers/video/rk29_fb.c | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/drivers/staging/rk29/vivante/hal/inc/gc_hal_options.h b/drivers/staging/rk29/vivante/hal/inc/gc_hal_options.h index b6f830f62b72..ede2d686e389 100644 --- a/drivers/staging/rk29/vivante/hal/inc/gc_hal_options.h +++ b/drivers/staging/rk29/vivante/hal/inc/gc_hal_options.h @@ -182,7 +182,7 @@ Size of the MMU page table in bytes. Each 4 bytes can hold 4kB worth of virtual data. */ -#define gcdMMU_SIZE (128 << 10) +#define gcdMMU_SIZE (256 << 10) /* gcdSECURE_USER diff --git a/drivers/video/rk29_fb.c b/drivers/video/rk29_fb.c index 262239a072e4..aa7f488213bd 100755 --- a/drivers/video/rk29_fb.c +++ b/drivers/video/rk29_fb.c @@ -53,6 +53,7 @@ #include "./display/screen/screen.h" +#define ANDROID_USE_THREE_BUFS 1 //android use three buffers to accelerate UI display in rgb plane #if 0 #define fbprintk(msg...) printk(msg); @@ -190,6 +191,10 @@ static int win1fb_set_par(struct fb_info *info); static DECLARE_WAIT_QUEUE_HEAD(wq); static int wq_condition = 0; +#if ANDROID_USE_THREE_BUFS +static int new_frame_seted = 1; +#endif + void set_lcd_pin(struct platform_device *pdev, int enable) { struct rk29fb_info *mach_info = pdev->dev.platform_data; @@ -1389,6 +1394,14 @@ static int win1fb_set_par(struct fb_info *info) addr = fix->smem_start + offset; +#if ANDROID_USE_THREE_BUFS + if(0==new_frame_seted) { + wq_condition = 0; + wait_event_interruptible_timeout(wq, wq_condition, HZ/20); + } + new_frame_seted = 0; +#endif + LcdMskReg(inf, SYS_CONFIG, m_W1_ENABLE|m_W1_FORMAT, v_W1_ENABLE(1)|v_W1_FORMAT(format)); xpos += (screen->left_margin + screen->hsync_len); @@ -1459,6 +1472,7 @@ static int win1fb_pan_display(struct fb_var_screeninfo *var, struct fb_info *inf mcu_refresh(inf); +#if !ANDROID_USE_THREE_BUFS // flush end when wq_condition=1 in mcu panel, but not in rgb panel if(SCREEN_MCU == inf->cur_screen->type) { wait_event_interruptible_timeout(wq, wq_condition, HZ/20); @@ -1467,6 +1481,7 @@ static int win1fb_pan_display(struct fb_var_screeninfo *var, struct fb_info *inf wq_condition = 0; wait_event_interruptible_timeout(wq, wq_condition, HZ/20); } +#endif return 0; } @@ -1601,6 +1616,10 @@ static irqreturn_t rk29fb_irq(int irq, void *dev_id) } } +#if ANDROID_USE_THREE_BUFS + new_frame_seted = 1; +#endif + wq_condition = 1; wake_up_interruptible(&wq); -- 2.34.1