diff options
author | Changyeon Lee <cyeon.lee@samsung.com> | 2015-07-10 14:23:25 +0900 |
---|---|---|
committer | jinhyung.jo <jinhyung.jo@samsung.com> | 2015-07-13 21:06:01 +0900 |
commit | 4d71bfe0312bdb41ebbe9772eb15d0662a083413 (patch) | |
tree | bef3ba0448413a1c427fb38876025ff5ca9a0882 | |
parent | 6ffb75270b16e63aeedd92bb4b9c5349468f5529 (diff) | |
download | libtbm-vigs-4d71bfe0312bdb41ebbe9772eb15d0662a083413.tar.gz libtbm-vigs-4d71bfe0312bdb41ebbe9772eb15d0662a083413.tar.bz2 libtbm-vigs-4d71bfe0312bdb41ebbe9772eb15d0662a083413.zip |
Add function for supporting tbm surface multiple bosubmit/tizen/20150714.075906accepted/tizen/wearable/20150715.003304accepted/tizen/tv/20150715.003255accepted/tizen/mobile/20150715.003248
Change-Id: Id054e0f4d5b05f9d43d902bdebab86e36459bedb
Signed-off-by: Changyeon Lee <cyeon.lee@samsung.com>
-rwxr-xr-x[-rw-r--r--] | src/tbm_bufmgr_emulator.c | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/src/tbm_bufmgr_emulator.c b/src/tbm_bufmgr_emulator.c index e8b111f..a9c28c7 100644..100755 --- a/src/tbm_bufmgr_emulator.c +++ b/src/tbm_bufmgr_emulator.c @@ -285,11 +285,12 @@ static int tbm_bufmgr_emulator_bo_get_global_key(tbm_bo bo) return sfc->gem.name; } -static int tbm_bufmgr_emulator_surface_get_plane_data(tbm_surface_h surface, int width, int height, tbm_format format, int plane_idx, uint32_t *size, uint32_t *offset, uint32_t *pitch) +static int tbm_bufmgr_emulator_surface_get_plane_data(tbm_surface_h surface, int width, int height, tbm_format format, int plane_idx, uint32_t *size, uint32_t *offset, uint32_t *pitch, int *bo_idx) { *size = 0; *offset = 0; *pitch = 0; + *bo_idx = 0; switch(format) { case TBM_FORMAT_XRGB8888: @@ -297,16 +298,19 @@ static int tbm_bufmgr_emulator_surface_get_plane_data(tbm_surface_h surface, int *size = width * height * 4; *offset = 0; *pitch = width * 4; + *bo_idx = 0; return 1; case TBM_FORMAT_NV21: if (plane_idx == 0) { *size = width * height; *offset = 0; *pitch = width; + *bo_idx = 0; } else if (plane_idx == 1) { *size = width * (height >> 1); *offset = width * height; *pitch = width; + *bo_idx = 0; } else { return 0; } @@ -316,10 +320,12 @@ static int tbm_bufmgr_emulator_surface_get_plane_data(tbm_surface_h surface, int *size = width * height; *offset = 0; *pitch = width; + *bo_idx = 0; } else if (plane_idx == 1) { *size = width * height; *offset = width * height; *pitch = width; + *bo_idx = 0; } else { return 0; } @@ -329,14 +335,17 @@ static int tbm_bufmgr_emulator_surface_get_plane_data(tbm_surface_h surface, int *size = width * height; *offset = 0; *pitch = width; + *bo_idx = 0; } else if (plane_idx == 1) { *size = (width * height) >> 2; *offset = width * height; *pitch = width >> 1 ; + *bo_idx = 0; } else if (plane_idx == 2) { *size = (width * height) >> 2; *offset = (width * height) + (width * height >> 2); *pitch = width >> 1; + *bo_idx = 0; } else { return 0; } @@ -371,6 +380,27 @@ static int tbm_bufmgr_emulator_surface_get_size(tbm_surface_h surface, int width return (width * height * bpp) >> 3; } +static int tbm_bufmgr_emulator_surface_get_num_bos (tbm_format format) +{ + int num = 0; + + switch(format) { + case TBM_FORMAT_XRGB8888: + case TBM_FORMAT_ARGB8888: + /* NV21 : Y/CrCb 4:2:0 */ + /* YUV420 : YUV 4:2:0 */ + case TBM_FORMAT_NV21: + case TBM_FORMAT_YUV420: + /* NV61 : Y/CrCb 4:2:2 */ + case TBM_FORMAT_NV61: + num = 1; + break; + default: + return 0; + } + return num; +} + static int tbm_bufmgr_emulator_surface_supported_format(uint32_t **formats, uint32_t *num) { uint32_t *color_formats; @@ -447,6 +477,7 @@ int tbm_bufmgr_emulator_init(tbm_bufmgr bufmgr, int fd) backend->surface_get_plane_data = tbm_bufmgr_emulator_surface_get_plane_data; backend->surface_get_size = tbm_bufmgr_emulator_surface_get_size; backend->surface_supported_format = tbm_bufmgr_emulator_surface_supported_format; + backend->surface_get_num_bos = tbm_bufmgr_emulator_surface_get_num_bos; if (!tbm_backend_init(bufmgr, backend)) { TBM_EMULATOR_LOG_ERROR("tbm_backend_init failed"); |