rk fb: remove xvir align that have moved to hwc
authorzwl <zwl@rock-chips.com>
Fri, 30 May 2014 02:01:57 +0000 (10:01 +0800)
committerzwl <zwl@rock-chips.com>
Fri, 30 May 2014 02:01:57 +0000 (10:01 +0800)
drivers/video/rockchip/rk_fb.c

index 2d3becf570e18bee7af7e9dd25df0e29c8cea8a7..ebe35825421499f1c9319123e007ba89b30441c5 100755 (executable)
@@ -650,12 +650,8 @@ static int rk_fb_close(struct fb_info *info, int user)
                info->var.yres_virtual = info->var.yres;
 #if defined(CONFIG_LOGO_LINUX_BMP)
                info->var.bits_per_pixel = 32;
-               info->var.xres_virtual = ALIGN_64BYTE_ODD_TIMES(info->var.xres,
-                                          ALIGN_PIXEL_64BYTE_RGB8888);
 #else
                info->var.bits_per_pixel = 16;
-               info->var.xres_virtual = ALIGN_64BYTE_ODD_TIMES(info->var.xres,
-                                          ALIGN_PIXEL_64BYTE_RGB565);
 #endif
 
                info->fix.line_length =
@@ -1075,20 +1071,8 @@ static int rk_fb_pan_display(struct fb_var_screeninfo *var,
                                                           extend_info->fix.id);
                extend_win = extend_dev_drv->win[extend_win_id];
        }
+
        pixel_width = rk_fb_pixel_width(win->format);
-       /* align as 64 bytes(16*4) in an odd number of times */
-       if ((win->format == ARGB888) || (win->format == ABGR888)
-           || (win->format == XBGR888)) {
-               var->xres_virtual = ALIGN_64BYTE_ODD_TIMES(var->xres,
-                                          ALIGN_PIXEL_64BYTE_RGB8888);
-               xvir = var->xres_virtual;
-       } else if (win->format == RGB565) {
-               var->xres_virtual = ALIGN_64BYTE_ODD_TIMES(var->xres,
-                                          ALIGN_PIXEL_64BYTE_RGB565);
-               xvir = var->xres_virtual;
-       } else {
-               xvir = var->xres_virtual;
-       }
        vir_width_bit = pixel_width * xvir;
        /* pixel_width = byte_num * 8 */
        stride_32bit_1 = ALIGN_N_TIMES(vir_width_bit, 32) / 8;
@@ -2209,7 +2193,9 @@ static int rk_fb_check_var(struct fb_var_screeninfo *var, struct fb_info *info)
 
        if ((0 == var->xres_virtual) || (0 == var->yres_virtual) ||
            (0 == var->xres) || (0 == var->yres) || (var->xres < 16) ||
-           ((16 != var->bits_per_pixel) && (32 != var->bits_per_pixel))) {
+           ((16 != var->bits_per_pixel) &&
+           (32 != var->bits_per_pixel) &&
+           (24 != var->bits_per_pixel))) {
                dev_err(info->dev, "%s check var fail 1:\n"
                        "xres_vir:%d>>yres_vir:%d\n"
                        "xres:%d>>yres:%d\n"
@@ -2444,19 +2430,6 @@ static int rk_fb_set_par(struct fb_info *info)
 
        fb_data_fmt = rk_fb_data_fmt(data_format, var->bits_per_pixel);
        pixel_width = rk_fb_pixel_width(fb_data_fmt);
-       /* align as 64 bytes(16*4) in an odd number of times */
-       if ((fb_data_fmt == ARGB888) || (fb_data_fmt == ABGR888)
-           || (fb_data_fmt == XBGR888)) {
-               var->xres_virtual = ALIGN_64BYTE_ODD_TIMES(var->xres,
-                                               ALIGN_PIXEL_64BYTE_RGB8888);
-               xvir = var->xres_virtual;
-       } else if (fb_data_fmt == RGB565) {
-               var->xres_virtual = ALIGN_64BYTE_ODD_TIMES(var->xres,
-                                               ALIGN_PIXEL_64BYTE_RGB565);
-               xvir = var->xres_virtual;
-       } else {
-               xvir = var->xres_virtual;
-       }
        vir_width_bit = pixel_width * xvir;
        /* pixel_width = byte_num * 8 */
        stride_32bit_1 = ALIGN_N_TIMES(vir_width_bit, 32) / 8;
@@ -3351,12 +3324,8 @@ int rk_fb_register(struct rk_lcdc_driver *dev_drv,
                    (fbi->var.xres << 8) + (fbi->var.yres << 20);
 #if defined(CONFIG_LOGO_LINUX_BMP)
                fbi->var.bits_per_pixel = 32;
-               fbi->var.xres_virtual = ALIGN_64BYTE_ODD_TIMES(fbi->var.xres,
-                                               ALIGN_PIXEL_64BYTE_RGB8888);
 #else
                fbi->var.bits_per_pixel = 16;
-               fbi->var.xres_virtual = ALIGN_64BYTE_ODD_TIMES(fbi->var.xres,
-                                               ALIGN_PIXEL_64BYTE_RGB565);
 #endif
                fbi->fix.line_length =
                    (fbi->var.xres_virtual) * (fbi->var.bits_per_pixel >> 3);