correct plane's offset 10/120610/1
authorBoram Park <boram1288.park@samsung.com>
Thu, 23 Mar 2017 09:20:10 +0000 (18:20 +0900)
committerBoram Park <boram1288.park@samsung.com>
Thu, 23 Mar 2017 09:20:55 +0000 (18:20 +0900)
Change-Id: If5ee84530b1785d40eaec8fbd833ef2036ed753b

src/tbm_bufmgr_sprd.c

index ab15e62..2de5855 100644 (file)
@@ -1539,14 +1539,19 @@ tbm_sprd_surface_get_plane_data(int width, int height,
        case TBM_FORMAT_NV12:
        case TBM_FORMAT_NV21:
                bpp = 12;
-               if (plane_idx == 0) {
+//             if (plane_idx == 0)
+               {
                        _offset = 0;
                        _pitch = SIZE_ALIGN(width , TBM_SURFACE_ALIGNMENT_PITCH_YUV);
                        _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;
+                       if (plane_idx == 0)
+                               break;
+               }
+//             else if (plane_idx == 1)
+               {
+                       _offset = _size;
                        _pitch = SIZE_ALIGN(width , TBM_SURFACE_ALIGNMENT_PITCH_YUV / 2);
                        _align_height = SIZE_ALIGN(height / 2, TBM_SURFACE_ALIGNMENT_PITCH_YUV);
                        _size = SIZE_ALIGN(_pitch * _align_height, TBM_SURFACE_ALIGNMENT_PLANE);