return bo_handle;
}
-#if 0
static int
_new_calc_plane_nv12(int width, int height)
{
height) >> 1) + S5P_FIMV_D_ALIGN_PLANE_SIZE,
TBM_SURFACE_ALIGNMENT_PLANE_NV12);
}
-#endif
static tbm_bufmgr_capability
tbm_exynos_bufmgr_get_capabilities(tbm_backend_bufmgr_data *bufmgr_data, tbm_error_e *error)
*/
case TBM_FORMAT_NV12:
bpp = 12;
- /*if (plane_idx == 0)*/
- {
- _offset = 0;
- _pitch = SIZE_ALIGN(width, TBM_SURFACE_ALIGNMENT_PITCH_YUV);
- _size = SIZE_ALIGN((SIZE_ALIGN(width, 16) * SIZE_ALIGN(height, 16) * 3) / 2, 512);
- _bo_idx = 0;
- if (plane_idx == 0)
- break;
- }
- /*else if (plane_idx == 1)*/
- {
+ _bo_idx = 0;
+ if (plane_idx == 0) {
_offset = 0;
_pitch = SIZE_ALIGN(width, TBM_SURFACE_ALIGNMENT_PITCH_YUV);
- _size = SIZE_ALIGN((SIZE_ALIGN(width, 16) * SIZE_ALIGN(height, 16) * 3) / 2, 512);
- _bo_idx = 1;
+ _size = MAX(_calc_yplane_nv12(width, height),
+ _new_calc_yplane_nv12(width, height));
+ } else if (plane_idx == 1) {
+ _offset = MAX(_calc_yplane_nv12(width, height),
+ _new_calc_yplane_nv12(width, height));
+ _pitch = SIZE_ALIGN(width, TBM_SURFACE_ALIGNMENT_PITCH_YUV / 2);
+ _size = MAX(_calc_uvplane_nv12(width, height),
+ _new_calc_uvplane_nv12(width, height));
}
break;
case TBM_FORMAT_NV21:
bpp = 12;
- /*if (plane_idx == 0)*/
- {
+ _bo_idx = 0;
+ _pitch = SIZE_ALIGN(width, TBM_SURFACE_ALIGNMENT_PITCH_YUV);
+ if (plane_idx == 0) {
_offset = 0;
- _pitch = SIZE_ALIGN(width, TBM_SURFACE_ALIGNMENT_PITCH_YUV);
_size = SIZE_ALIGN(_pitch * height, TBM_SURFACE_ALIGNMENT_PLANE);
- _bo_idx = 0;
- if (plane_idx == 0)
- break;
- }
- /*else if (plane_idx == 1)*/
- {
- _offset += _size;
+ } else if (plane_idx == 1) {
+ _offset = SIZE_ALIGN(_pitch * height, TBM_SURFACE_ALIGNMENT_PLANE);
_pitch = SIZE_ALIGN(width, TBM_SURFACE_ALIGNMENT_PITCH_YUV / 2);
_size = SIZE_ALIGN(_pitch * (height / 2), TBM_SURFACE_ALIGNMENT_PLANE);
- _bo_idx = 0;
}
break;