From: yxj Date: Fri, 7 Sep 2012 11:25:32 +0000 (+0800) Subject: rkfb:fix bug for paltform which have two lcdc int dual display mode,like rk3066 X-Git-Tag: firefly_0821_release~8698 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=2170d0ae8693eb7202b2a7e9ce6429f5fcaf6ce6;p=firefly-linux-kernel-4.4.55.git rkfb:fix bug for paltform which have two lcdc int dual display mode,like rk3066 --- diff --git a/drivers/video/rockchip/rk_fb.c b/drivers/video/rockchip/rk_fb.c index 8fede7217931..6a428b3a2866 100644 --- a/drivers/video/rockchip/rk_fb.c +++ b/drivers/video/rockchip/rk_fb.c @@ -204,7 +204,7 @@ static int rk_pan_display(struct fb_var_screeninfo *var, struct fb_info *info) { if(inf->num_fb >= 2) { - info2 = inf->fb[2]; + info2 = inf->fb[inf->num_fb>>1]; dev_drv1 = (struct rk_lcdc_device_driver * )info2->par; par2 = dev_drv1->layer_par[layer_id]; par2->y_offset = par->y_offset; @@ -368,7 +368,7 @@ static int rk_fb_set_par(struct fb_info *info) { if(inf->num_fb >= 2) { - info2 = inf->fb[2]; + info2 = inf->fb[inf->num_fb>>1]; dev_drv1 = (struct rk_lcdc_device_driver * )info2->par; } } @@ -671,6 +671,13 @@ int rk_fb_switch_screen(rk_screen *screen ,int enable ,int lcdc_id) } } + else + { + if(enable) + { + memcpy(dev_drv->cur_screen,screen,sizeof(rk_screen )); + } + } layer_id = dev_drv->fb_get_layer(dev_drv,info->fix.id); @@ -744,7 +751,6 @@ int rk_fb_disp_scale(u8 scale_x, u8 scale_y,u8 lcdc_id) char name[6]; int i; - printk("%s>>scale_x:%x>>scale_y:%d\n",__func__,scale_x,scale_y); sprintf(name, "lcdc%d",lcdc_id); for(i = 0; i < inf->num_lcdc; i++) { @@ -822,7 +828,7 @@ static int rk_request_fb_buffer(struct fb_info *fbi,int fb_id) fbi->fix.mmio_len = res->end - res->start + 1; #endif break; - case 2: + case 3: #if !defined(CONFIG_THREE_FB_BUFFER) res = platform_get_resource_byname(g_fb_pdev, IORESOURCE_MEM, "fb2 buf"); if (res == NULL)