summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChangyeon Lee <cyeon.lee@samsung.com>2019-12-19 19:47:31 +0900
committerChangyeon Lee <cyeon.lee@samsung.com>2019-12-20 12:01:45 +0900
commitd532c7e54d8022a13a10cf2d337b75688a011b6d (patch)
tree3c1b7d885e60f501f2429f656cac40bca5d69f14
parentff0aa4f5a5321bbe2bf3e940d03599a33cdd9dab (diff)
downloadlibtbm-dumb-d532c7e54d8022a13a10cf2d337b75688a011b6d.tar.gz
libtbm-dumb-d532c7e54d8022a13a10cf2d337b75688a011b6d.tar.bz2
libtbm-dumb-d532c7e54d8022a13a10cf2d337b75688a011b6d.zip
fix pitch, offset of NV format
Change-Id: I79f30da720e5765686bd6e19a34f1f7916f95259
-rw-r--r--src/tbm_bufmgr_dumb.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/tbm_bufmgr_dumb.c b/src/tbm_bufmgr_dumb.c
index 0bf073f..a962f26 100644
--- a/src/tbm_bufmgr_dumb.c
+++ b/src/tbm_bufmgr_dumb.c
@@ -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;
}