fix pitch, offset of NV format 70/220570/2
authorChangyeon Lee <cyeon.lee@samsung.com>
Thu, 19 Dec 2019 10:47:31 +0000 (19:47 +0900)
committerChangyeon Lee <cyeon.lee@samsung.com>
Fri, 20 Dec 2019 03:01:45 +0000 (12:01 +0900)
Change-Id: I79f30da720e5765686bd6e19a34f1f7916f95259

src/tbm_bufmgr_dumb.c

index 0bf073f..a962f26 100644 (file)
@@ -491,19 +491,23 @@ tbm_dumb_bufmgr_get_plane_data(tbm_backend_bufmgr_data *bufmgr_data,
        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);
+                       _pitch = SIZE_ALIGN(width, TBM_SURFACE_ALIGNMENT_PITCH_YUV);
                        _size = SIZE_ALIGN(_pitch * 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);
+                       if (plane_idx == 0)
+                               break;
+               }
+               //else if (plane_idx == 1)
+               {
+                       _offset += _size;
+                       _pitch = SIZE_ALIGN(width, TBM_SURFACE_ALIGNMENT_PITCH_YUV);
                        _size = SIZE_ALIGN(_pitch * (height / 2), TBM_SURFACE_ALIGNMENT_PLANE);
                        _bo_idx = 0;
                }
                break;
-
        case TBM_FORMAT_NV16:
        case TBM_FORMAT_NV61:
                bpp = 16;
@@ -519,7 +523,7 @@ tbm_dumb_bufmgr_get_plane_data(tbm_backend_bufmgr_data *bufmgr_data,
                //else if (plane_idx == 1)
                {
                        _offset += _size;
-                       _pitch = SIZE_ALIGN(width, TBM_SURFACE_ALIGNMENT_PITCH_YUV/2);
+                       _pitch = SIZE_ALIGN(width, TBM_SURFACE_ALIGNMENT_PITCH_YUV);
                        _size = SIZE_ALIGN(_pitch * height, TBM_SURFACE_ALIGNMENT_PLANE);
                        _bo_idx = 0;
                }