use one bo for YUV420 format 87/248887/1
authorChangyeon Lee <cyeon.lee@samsung.com>
Thu, 3 Dec 2020 04:56:28 +0000 (13:56 +0900)
committerChangyeon Lee <cyeon.lee@samsung.com>
Thu, 3 Dec 2020 04:56:28 +0000 (13:56 +0900)
mesa doesn't need to 3 bos of YUV420 format

Change-Id: I563313058d1847bf9796457e53e73e93a33f8ae7

src/tbm_bufmgr_vc4.c

index c8a436ef8495dce81510ce933641dc6be73e85c4..ae304522dfad275de16ddbb933373b588d7110c4 100644 (file)
@@ -1266,19 +1266,19 @@ tbm_vc4_bufmgr_get_plane_data(tbm_backend_bufmgr_data *bufmgr_data,
                }
                /*else if(plane_idx == 1)*/
                {
-                       _offset = 0;
+                       _offset += _size;
                        _pitch = SIZE_ALIGN(width / 2, TBM_SURFACE_ALIGNMENT_PITCH_YUV / 2);
                        _size = SIZE_ALIGN(_pitch * (height / 2), TBM_SURFACE_ALIGNMENT_PLANE);
-                       _bo_idx = 1;
+                       _bo_idx = 0;
                        if (plane_idx == 1)
                                break;
                }
                /*else if (plane_idx == 2)*/
                {
-                       _offset = 0;
+                       _offset += _size;
                        _pitch = SIZE_ALIGN(width / 2, TBM_SURFACE_ALIGNMENT_PITCH_YUV / 2);
                        _size = SIZE_ALIGN(_pitch * (height / 2), TBM_SURFACE_ALIGNMENT_PLANE);
-                       _bo_idx = 2;
+                       _bo_idx = 0;
                }
                break;
        case TBM_FORMAT_YUV422: