From: ddl Date: Wed, 27 Jul 2011 03:24:16 +0000 (+0800) Subject: fb:support 180 degree rotate X-Git-Tag: firefly_0821_release~10076 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=4afedcecde70deffd88ed7ad8d90e2b8d992836c;p=firefly-linux-kernel-4.4.55.git fb:support 180 degree rotate --- diff --git a/drivers/video/rk29_fb.c b/drivers/video/rk29_fb.c index a2eb88e28c53..baad242a3bd5 100644 --- a/drivers/video/rk29_fb.c +++ b/drivers/video/rk29_fb.c @@ -1828,7 +1828,7 @@ static int fb1_set_par(struct fb_info *info) printk("LCDC not support rotate!\n"); return -EINVAL; #endif - }else{ + } else{ xpos = (xpos * screen->x_res) / inf->panel1_info.x_res; ypos = (ypos * screen->y_res) / inf->panel1_info.y_res; xsize = (xsize * screen->x_res) / inf->panel1_info.x_res; @@ -1924,7 +1924,11 @@ static int fb1_set_par(struct fb_info *info) yuv_phy[1] = last_yuv_phy[1]; yuv_phy[0] += par->y_offset; yuv_phy[1] += par->c_offset; + #if 0 if((var->rotate == 90) ||(var->rotate == 270)) + #else + if(var->rotate%360 != 0) + #endif { dstoffset = (dstoffset+1)%2; ipp_req.src0.fmt = 3; @@ -1941,8 +1945,8 @@ static int fb1_set_par(struct fb_info *info) ipp_req.dst0.CbrMst = inf->fb0->fix.mmio_start + screen->x_res*screen->y_res*(2*dstoffset+1); // if(var->xres > screen->x_res) // { - ipp_req.dst0.w = screen->x_res; - ipp_req.dst0.h = screen->y_res; + ipp_req.dst0.w = var->xres; + ipp_req.dst0.h = var->yres; // } else { // ipp_req.dst0.w = var->yres; // ipp_req.dst0.h = var->xres; @@ -1952,9 +1956,10 @@ static int fb1_set_par(struct fb_info *info) ipp_req.timeout = 100; if(var->rotate == 90) ipp_req.flag = IPP_ROT_90; + else if (var->rotate == 180) + ipp_req.flag = IPP_ROT_180; else if(var->rotate == 270) ipp_req.flag = IPP_ROT_270; - //ipp_do_blit(&ipp_req); ipp_blit_sync(&ipp_req); fbprintk("yaddr=0x%x,uvaddr=0x%x\n",ipp_req.dst0.YrgbMst,ipp_req.dst0.CbrMst); @@ -2123,7 +2128,11 @@ static int fb1_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg) yuv_phy[0] += par->y_offset; yuv_phy[1] += par->c_offset; - if((var->rotate == 270)||(var->rotate == 90)) + #if 0 + if((var->rotate == 90) ||(var->rotate == 270)) + #else + if(var->rotate%360 != 0) + #endif { #ifdef CONFIG_FB_ROTATE_VIDEO dstoffset = (dstoffset+1)%2; @@ -2140,8 +2149,8 @@ static int fb1_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg) ipp_req.dst0.CbrMst = inf->fb0->fix.mmio_start + screen->x_res*screen->y_res*(2*dstoffset+1); // if(var->xres > screen->x_res) // { - ipp_req.dst0.w = screen->x_res; - ipp_req.dst0.h = screen->y_res; + ipp_req.dst0.w = var->xres; + ipp_req.dst0.h = var->yres; // } else { // ipp_req.dst0.w = var->yres; // ipp_req.dst0.h = var->xres; @@ -2151,6 +2160,8 @@ static int fb1_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg) ipp_req.timeout = 100; if(var->rotate == 90) ipp_req.flag = IPP_ROT_90; + else if(var->rotate == 180) + ipp_req.flag = IPP_ROT_180; else if(var->rotate == 270) ipp_req.flag = IPP_ROT_270; //ipp_do_blit(&ipp_req);