video/rockchip: rga2: correct BGRA stride
[firefly-linux-kernel-4.4.55.git] / drivers / video / rockchip / rga2 / rga2_mmu_info.c
index c22419f211e41ec3ec6ced01fddc6161ae83506a..5aef238540e488f653d8feadcb95ef500942f5b8 100644 (file)
@@ -180,7 +180,8 @@ static int rga2_buf_size_cal(unsigned long yrgb_addr, unsigned long uv_addr, uns
             pageCount = (size_yrgb + PAGE_SIZE - 1) >> PAGE_SHIFT;\r
             break;\r
         case RGA2_FORMAT_BGRA_8888 :\r
-            size_yrgb = w*h*4;\r
+            stride = (w * 4 + 3) & (~3);
+            size_yrgb = stride * h;
             start = yrgb_addr >> PAGE_SHIFT;\r
             pageCount = (size_yrgb + PAGE_SIZE - 1) >> PAGE_SHIFT;\r
             break;\r