tbm_surface: align height of NV12 format when calculate size 82/81882/1 accepted/tizen/mobile/20160804.081542 submit/tizen/20160803.115336
authorChangyeon Lee <cyeon.lee@samsung.com>
Fri, 29 Jul 2016 04:33:17 +0000 (13:33 +0900)
committerChangyeon Lee <cyeon.lee@samsung.com>
Fri, 29 Jul 2016 04:35:01 +0000 (13:35 +0900)
sprd hw codec need to size with align height

Change-Id: I83092fc97409f882c3ddb498c0be22bca692e617

src/tbm_bufmgr_sprd.c

index abea509..da5c9e5 100644 (file)
@@ -1634,6 +1634,7 @@ tbm_sprd_surface_get_plane_data(int width, int height,
        int _pitch = 0;
        int _size = 0;
        int _bo_idx = 0;
+       int _align_height = 0;
 
        switch (format) {
                /* 16 bpp RGB */
@@ -1711,12 +1712,14 @@ tbm_sprd_surface_get_plane_data(int width, int height,
                if (plane_idx == 0) {
                        _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;
                } else if ( plane_idx == 1 ) {
                        _offset = width * height;
                        _pitch = SIZE_ALIGN( width , 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;