{
u32 panel_size[2];
//struct rk29fb_inf *inf = dev_get_drvdata(info->device);
- if(inf->fb1->var.rotate == 270) {
+ if((inf->fb1->var.rotate &0x1ff ) == 270) {
panel_size[0] = inf->cur_screen->y_res; //inf->cur_screen->y_res; change for hdmi video size
panel_size[1] = inf->cur_screen->x_res;
} else {
struct hdmi *hdmi = get_hdmi_struct(0);
#endif
- if((var->rotate / 90 == 1 )||(var->rotate / 90== 3)) {
+ if((var->rotate & 0x1ff) == 90 ||(var->rotate &0x1ff)== 270) {
#ifdef CONFIG_FB_ROTATE_VIDEO
xlcd = screen->y_res;
ylcd = screen->x_res;
return -EINVAL;
}
- if((var->rotate / 90 == 1 )||(var->rotate / 90== 3))
+ if((var->rotate & 0x1ff ) == 90 ||(var->rotate & 0x1ff ) == 270)
{
yres = var->xres;
}
fbprintk(">>>>>> %s : %s\n", __FILE__, __FUNCTION__);
CHK_SUSPEND(inf);
- if((var->rotate / 90 == 1 )||(var->rotate / 90== 3))
+ if((var->rotate & 0x1ff ) == 90 || (var->rotate & 0x1ff ) == 270)
{
#ifdef CONFIG_FB_ROTATE_VIDEO
xpos = (var->nonstd>>20) & 0xfff; //visiable pos in panel
ipp_req.dst0.fmt = 3;
#ifdef CONFIG_FB_MIRROR_X_Y
- if(((var->rotate /90 != 0)&&(var->rotate %90 != 0)) ||(var->rotate == (X_MIRROR + Y_MIRROR)) )
+ if((var->rotate & 0x1ff)!=0 &&(var->rotate&(X_MIRROR|Y_MIRROR))!= 0 )
{
ipp_req.dst0.YrgbMst = inf->fb0->fix.mmio_start + screen->x_res*screen->y_res*4;
ipp_req.dst0.CbrMst = inf->fb0->fix.mmio_start + screen->x_res*screen->y_res*5;
}
ipp_req.dst_vir_w = (ipp_req.dst0.w + 15) & (~15);
ipp_req.timeout = 100;
- if(var->rotate / 90== 1)
+ if((var->rotate & 0x1ff) == 90)
ipp_req.flag = IPP_ROT_90;
- else if (var->rotate / 90 == 2)
+ else if ((var->rotate & 0x1ff) == 180)
ipp_req.flag = IPP_ROT_180;
- else if(var->rotate / 90 == 3)
+ else if((var->rotate & 0x1ff) == 270)
ipp_req.flag = IPP_ROT_270;
- else if((var->rotate == X_MIRROR) || (var->rotate == (X_MIRROR + Y_MIRROR)))
+ else if((var->rotate & X_MIRROR) == X_MIRROR )
ipp_req.flag = IPP_ROT_X_FLIP;
- else if(var->rotate == Y_MIRROR)
+ else if((var->rotate & Y_MIRROR) == Y_MIRROR)
ipp_req.flag = IPP_ROT_Y_FLIP;
//ipp_do_blit(&ipp_req);
ipp_blit_sync(&ipp_req);
yuv_phy[0] = ipp_req.dst0.YrgbMst;
yuv_phy[1] = ipp_req.dst0.CbrMst;
- if(((var->rotate /90 != 0)&&(var->rotate %90 != 0)) ||(var->rotate == (X_MIRROR + Y_MIRROR)))
+ if((var->rotate & 0x1ff)!=0 &&(var->rotate&(X_MIRROR|Y_MIRROR))!= 0 )
{
memset(&ipp_req,0,sizeof(struct rk29_ipp_req));
- if(var->rotate % 90== X_MIRROR)
+ if((var->rotate & X_MIRROR) == X_MIRROR)
ipp_req.flag = IPP_ROT_X_FLIP;
- else if((var->rotate %90 == Y_MIRROR) || (var->rotate == (X_MIRROR + Y_MIRROR)))
+ else if((var->rotate & Y_MIRROR) == Y_MIRROR)
ipp_req.flag = IPP_ROT_Y_FLIP;
+ else
+ printk(">>>>>> %d rotate is not support!\n",var->rotate);
if(var->xres > screen->x_res)
{
case FB1_IOCTL_GET_PANEL_SIZE: //get panel size
{
u32 panel_size[2];
- if((var->rotate == 270)||(var->rotate == 90)) {
+ if((var->rotate & 0x1ff) == 270 ||(var->rotate & 0x1ff) == 90) {
panel_size[0] = inf->panel1_info.y_res; //inf->cur_screen->y_res; change for hdmi video size
panel_size[1] = inf->panel1_info.x_res;
} else {
ipp_req.dst0.fmt = 3;
#ifdef CONFIG_FB_MIRROR_X_Y
- if(((var->rotate /90 != 0)&&(var->rotate %90 != 0)) ||(var->rotate == (X_MIRROR + Y_MIRROR)) )
+ if((var->rotate & 0x1ff)!=0 &&(var->rotate&(X_MIRROR|Y_MIRROR))!= 0 )
{
ipp_req.dst0.YrgbMst = inf->fb0->fix.mmio_start + screen->x_res*screen->y_res*4;
ipp_req.dst0.CbrMst = inf->fb0->fix.mmio_start + screen->x_res*screen->y_res*5;
}
ipp_req.dst_vir_w = (ipp_req.dst0.w + 15) & (~15);
ipp_req.timeout = 100;
- if(var->rotate / 90== 1)
+ if((var->rotate & 0x1ff) == 90)
ipp_req.flag = IPP_ROT_90;
- else if (var->rotate / 90 == 2)
+ else if ((var->rotate & 0x1ff) == 180)
ipp_req.flag = IPP_ROT_180;
- else if(var->rotate / 90 == 3)
+ else if((var->rotate & 0x1ff) == 270)
ipp_req.flag = IPP_ROT_270;
- else if((var->rotate == X_MIRROR) || (var->rotate == (X_MIRROR + Y_MIRROR)))
+ else if((var->rotate & X_MIRROR) == X_MIRROR )
ipp_req.flag = IPP_ROT_X_FLIP;
- else if(var->rotate == Y_MIRROR)
+ else if((var->rotate & Y_MIRROR) == Y_MIRROR)
ipp_req.flag = IPP_ROT_Y_FLIP;
//ipp_do_blit(&ipp_req);
ipp_blit_sync(&ipp_req);
yuv_phy[0] = ipp_req.dst0.YrgbMst;
yuv_phy[1] = ipp_req.dst0.CbrMst;
- if(((var->rotate /90 != 0)&&(var->rotate %90 != 0)) ||(var->rotate == (X_MIRROR + Y_MIRROR)))
+ if((var->rotate & 0x1ff)!=0 &&(var->rotate&(X_MIRROR|Y_MIRROR))!= 0 )
{
memset(&ipp_req,0,sizeof(struct rk29_ipp_req));
- if(var->rotate % 90== X_MIRROR)
+ if((var->rotate & X_MIRROR) == X_MIRROR)
ipp_req.flag = IPP_ROT_X_FLIP;
- else if((var->rotate %90 == Y_MIRROR) || (var->rotate == (X_MIRROR + Y_MIRROR)))
+ else if((var->rotate & Y_MIRROR) == Y_MIRROR)
ipp_req.flag = IPP_ROT_Y_FLIP;
+ else
+ printk(">>>>>> %d rotate is not support!\n",var->rotate);
if(var->xres > screen->x_res)
{
//zyc add
has_set_rotate = true;
#ifdef CONFIG_FB_MIRROR_X_Y
- if((arg == 0 || arg %90 ==0 || arg%90 ==1 ||arg %90 ==2 || arg %90 ==3)&&(arg<=360))
+ if( ((arg&0x1ff)%90) == 0 && ( arg&(~0xfff))==0 )
{
- if(arg==(X_MIRROR + Y_MIRROR))
- var->rotate = 180;
- else if(arg==(90 + X_MIRROR + Y_MIRROR))
- var->rotate = 270;
- else if(arg==(270 + X_MIRROR + Y_MIRROR))
- var->rotate = 90;
- else if(arg==(180 + X_MIRROR + Y_MIRROR))
- var->rotate = 0;
+ if( (arg&( X_MIRROR | Y_MIRROR ) )== (X_MIRROR | Y_MIRROR) )
+ var->rotate = ROTATE_180;
+ else if((arg&( ROTATE_90 | X_MIRROR | Y_MIRROR ) )== ( ROTATE_90 | X_MIRROR | Y_MIRROR))
+ var->rotate = ROTATE_270;
+ else if((arg&( ROTATE_180 | X_MIRROR | Y_MIRROR ) )== ( ROTATE_180 | X_MIRROR | Y_MIRROR))
+ var->rotate = ROTATE_90;
+ else if((arg&( ROTATE_270 | X_MIRROR | Y_MIRROR ) )== ( ROTATE_270 | X_MIRROR | Y_MIRROR))
+ var->rotate = ROTATE_0;
else
#else
- if(arg == 0 || arg==180 || arg == 90 || arg==270)
+ if(arg == ROTATE_0 || arg==ROTATE_90 || arg == ROTATE_180 || arg==ROTATE_270)
{
#endif
var->rotate = arg;