rk fb: fix the error vir_stride in hdmi fb if rotate
authorzwl <zwl@rock-chips.com>
Mon, 16 Jun 2014 08:20:44 +0000 (16:20 +0800)
committerzwl <zwl@rock-chips.com>
Mon, 16 Jun 2014 08:21:03 +0000 (16:21 +0800)
drivers/video/rockchip/rk_fb.c

index 804a3dfcd19507850ca27457f29a5607707109bd..ed1cd3c66dec29d2dc33b54bfd78dca4b6ebb29a 100755 (executable)
@@ -1542,9 +1542,14 @@ static void rk_fb_update_reg(struct rk_lcdc_driver *dev_drv,
                }
 
                if (ext_win->area[0].xact < ext_win->area[0].yact) {
+                       int pixel_width, vir_width_bit, stride;
                        ext_win->area[0].xact = win->area[0].yact;
                        ext_win->area[0].yact = win->area[0].xact;
                        ext_win->area[0].xvir = win->area[0].yact;
+                       pixel_width = rk_fb_pixel_width(ext_win->format);
+                       vir_width_bit = pixel_width * ext_win->area[0].xvir;
+                       stride = ALIGN_N_TIMES(vir_width_bit, 32) / 8;
+                       ext_win->area[0].y_vir_stride = stride >> 2;
                }
 #if defined(CONFIG_FB_ROTATE) || !defined(CONFIG_THREE_FB_BUFFER)
                rk_fb_win_rotate(ext_win, win);