apply align 16 to height when calculate size in YUV format 34/166634/1
authorChangyeon Lee <cyeon.lee@samsung.com>
Thu, 11 Jan 2018 06:33:14 +0000 (15:33 +0900)
committerChangyeon Lee <cyeon.lee@samsung.com>
Thu, 11 Jan 2018 06:33:51 +0000 (15:33 +0900)
Change-Id: I4be15cca80f318c196598cac6dfce1c62882d81e

src/tbm_bufmgr_sprd.c

index 2de5855..63b7844 100644 (file)
@@ -1606,7 +1606,8 @@ tbm_sprd_surface_get_plane_data(int width, int height,
                {
                        _offset = 0;
                        _pitch = SIZE_ALIGN(width, TBM_SURFACE_ALIGNMENT_PITCH_YUV);
-                       _size = SIZE_ALIGN(_pitch * height, TBM_SURFACE_ALIGNMENT_PLANE);
+                       _align_height = SIZE_ALIGN(height, TBM_SURFACE_ALIGNMENT_PITCH_YUV);
+                       _size = SIZE_ALIGN(_pitch * _align_height, TBM_SURFACE_ALIGNMENT_PLANE);
                        _bo_idx = 0;
                        if (plane_idx == 0)
                                break;
@@ -1615,7 +1616,8 @@ tbm_sprd_surface_get_plane_data(int width, int height,
                {
                        _offset += _size;
                        _pitch = SIZE_ALIGN(width / 2, TBM_SURFACE_ALIGNMENT_PITCH_YUV / 2);
-                       _size = SIZE_ALIGN(_pitch * (height / 2), TBM_SURFACE_ALIGNMENT_PLANE);
+                       _align_height = SIZE_ALIGN(height / 2, TBM_SURFACE_ALIGNMENT_PITCH_YUV);
+                       _size = SIZE_ALIGN(_pitch * _align_height, TBM_SURFACE_ALIGNMENT_PLANE);
                        _bo_idx = 0;
                        if (plane_idx == 1)
                                break;
@@ -1624,7 +1626,8 @@ tbm_sprd_surface_get_plane_data(int width, int height,
                {
                        _offset += _size;
                        _pitch = SIZE_ALIGN(width / 2, TBM_SURFACE_ALIGNMENT_PITCH_YUV / 2);
-                       _size = SIZE_ALIGN(_pitch * (height / 2), TBM_SURFACE_ALIGNMENT_PLANE);
+                       _align_height = SIZE_ALIGN(height / 2, TBM_SURFACE_ALIGNMENT_PITCH_YUV);
+                       _size = SIZE_ALIGN(_pitch * _align_height, TBM_SURFACE_ALIGNMENT_PLANE);
                        _bo_idx = 0;
                }
                break;