summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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;
}