From: huangdesheng Date: Wed, 24 Aug 2011 03:00:20 +0000 (+0800) Subject: modify UI error in camena DC and DV change X-Git-Tag: firefly_0821_release~9767^2~113 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=e1496b2f0fc4439b3d0494b1ce52ee98a52ea402;p=firefly-linux-kernel-4.4.55.git modify UI error in camena DC and DV change --- diff --git a/drivers/video/rk29_fb.c b/drivers/video/rk29_fb.c index d01c6df1991f..f5d8be3261eb 100755 --- a/drivers/video/rk29_fb.c +++ b/drivers/video/rk29_fb.c @@ -270,6 +270,8 @@ static struct wake_lock idlelock; /* only for fb */ static bool has_set_rotate; static u32 last_yuv_phy[2] = {0,0}; #endif +int fb0_first_buff_bits = 32; +int fb0_second_buff_bits = 32; static BLOCKING_NOTIFIER_HEAD(rk29fb_notifier_list); int rk29fb_register_notifier(struct notifier_block *nb) @@ -1439,6 +1441,11 @@ static int fb0_set_par(struct fb_info *info) { case 16: // rgb565 par->format = 1; + if( ypos_virtual == 0) + fb0_first_buff_bits = 16; + else + fb0_second_buff_bits = 16; + //fix->line_length = 2 * xres_virtual; fix->line_length = (inf->fb0_color_deepth ? 4:2) * xres_virtual; //32bit and 16bit change @@ -1452,6 +1459,10 @@ static int fb0_set_par(struct fb_info *info) case 32: // rgb888 default: par->format = 0; + if( ypos_virtual == 0) + fb0_first_buff_bits = 32; + else + fb0_second_buff_bits = 32; fix->line_length = 4 * xres_virtual; #ifdef CONFIG_FB_SCALING_OSD dstoffset = ((ypos_virtual*screen->y_res/var->yres) *screen->x_res + (xpos_virtual*screen->x_res)/var->xres )*4; @@ -1648,6 +1659,17 @@ static int fb0_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg) inf->fb0_color_deepth = arg; break; + case FBIOGET_16OR32: + return inf->fb0_color_deepth; + case FBIOGET_IDLEFBUff_16OR32: + if(info->var.yoffset == 0) + { + return fb0_second_buff_bits; + } + else + { + return fb0_first_buff_bits; + } case FBIOPUT_FBPHYADD: return info->fix.smem_start; case FBIOGET_OVERLAY_STATE: diff --git a/include/linux/fb.h b/include/linux/fb.h index 6181f1baafa7..4463d75862ea 100755 --- a/include/linux/fb.h +++ b/include/linux/fb.h @@ -47,7 +47,8 @@ struct dentry; #define FBIOGET_DISPINFO 0x4618 #define FBIOGET_OVERLAY_STATE 0X4619 #define FBIOGET_SCREEN_STATE 0X4620 - +#define FBIOGET_16OR32 0X4621 +#define FBIOGET_IDLEFBUff_16OR32 0X4622 #define FB_TYPE_PACKED_PIXELS 0 /* Packed Pixels */ #define FB_TYPE_PLANES 1 /* Non interleaved planes */