Change management of internal yuv buffers. 91/124191/1
authorMun, Gwan-gyeong <kk.moon@samsung.com>
Mon, 10 Apr 2017 11:59:21 +0000 (20:59 +0900)
committerMun, Gwan-gyeong <kk.moon@samsung.com>
Mon, 10 Apr 2017 11:59:43 +0000 (20:59 +0900)
AS-IS: maintain only one buffer and internal yuv buffers are distinguished by
       offset.
TO-BE: maintain seperated buffers for internal yuv buffers.

Change-Id: I85fb726511d0d56f39bb9d39be09111e834bbe96
Signed-off-by: Mun, Gwan-gyeong <kk.moon@samsung.com>
src/tbm_bufmgr_vc4.c

index 7d00d01..ddb26ca 100644 (file)
@@ -1972,19 +1972,19 @@ tbm_vc4_surface_get_plane_data(int width, int height,
                }
                /*else if(plane_idx == 1)*/
                {
-                       _offset += _size;
+                       _offset = 0;
                        _pitch = SIZE_ALIGN(width / 2, TBM_SURFACE_ALIGNMENT_PITCH_YUV / 2);
                        _size = SIZE_ALIGN(_pitch * (height / 2), TBM_SURFACE_ALIGNMENT_PLANE);
-                       _bo_idx = 0;
+                       _bo_idx = 1;
                        if (plane_idx == 1)
                                break;
                }
                /*else if (plane_idx == 2)*/
                {
-                       _offset += _size;
+                       _offset = 0;
                        _pitch = SIZE_ALIGN(width / 2, TBM_SURFACE_ALIGNMENT_PITCH_YUV / 2);
                        _size = SIZE_ALIGN(_pitch * (height / 2), TBM_SURFACE_ALIGNMENT_PLANE);
-                       _bo_idx = 0;
+                       _bo_idx = 2;
                }
                break;
        case TBM_FORMAT_YUV422: