From c70d74475dd1d0f4604bcb3a10fb1a3cf4e0bdda Mon Sep 17 00:00:00 2001 From: Changyeon Lee Date: Fri, 28 Apr 2017 14:44:48 +0900 Subject: [PATCH] bufmgr: check system info before _bufmgr_init_cache_state Change-Id: If5dc7d36c87dadb6d760f2d17f40d3cddefc16f9 --- src/tbm_bufmgr_exynos.c | 44 ++++++++++++++++++++--------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/src/tbm_bufmgr_exynos.c b/src/tbm_bufmgr_exynos.c index a9803a5..f466e88 100644 --- a/src/tbm_bufmgr_exynos.c +++ b/src/tbm_bufmgr_exynos.c @@ -2199,6 +2199,28 @@ init_tbm_bufmgr_priv(tbm_bufmgr bufmgr, int fd) close(fp); } + /* get the model name from the capi-system-info. + * The alignment_plane and alignment_pitch_rgb is different accoring to the target. + * There will be the stride issue when the right alignment_plane and alignment_pitch_rgb + * is not set to the backend. + */ + char *value = NULL; + if (system_info_get_platform_string("http://tizen.org/system/model_name", &value) != SYSTEM_INFO_ERROR_NONE) { + TBM_EXYNOS_ERROR("Cannot get the \"http://tizen.org/system/model_name\" key value from system-info.\n"); + TBM_EXYNOS_ERROR("May not set the right value on libtbm-exynos backend.\n"); + } else { + if (!strncmp(value, "TW1", 4)) { + g_tbm_surface_alignment_plane = 8; + g_tbm_surface_alignment_pitch_rgb = 8; + g_enable_cache_ctrl = 1; + } else { + g_tbm_surface_alignment_plane = 64; + g_tbm_surface_alignment_pitch_rgb = 64; + } + } + + free(value); + if (!_bufmgr_init_cache_state(bufmgr_exynos)) { TBM_EXYNOS_ERROR("fail to init bufmgr cache state\n"); goto fail_init_cache_state; @@ -2239,28 +2261,6 @@ init_tbm_bufmgr_priv(tbm_bufmgr bufmgr, int fd) goto fail_init_backend; } - /* get the model name from the capi-system-info. - * The alignment_plane and alignment_pitch_rgb is different accoring to the target. - * There will be the stride issue when the right alignment_plane and alignment_pitch_rgb - * is not set to the backend. - */ - char *value = NULL; - if (system_info_get_platform_string("http://tizen.org/system/model_name", &value) != SYSTEM_INFO_ERROR_NONE) { - TBM_EXYNOS_ERROR("Cannot get the \"http://tizen.org/system/model_name\" key value from system-info.\n"); - TBM_EXYNOS_ERROR("May not set the right value on libtbm-exynos backend.\n"); - } else { - if (!strncmp(value, "TW1", 4)) { - g_tbm_surface_alignment_plane = 8; - g_tbm_surface_alignment_pitch_rgb = 8; - g_enable_cache_ctrl = 1; - } else { - g_tbm_surface_alignment_plane = 64; - g_tbm_surface_alignment_pitch_rgb = 64; - } - } - - free(value); - #ifdef DEBUG { char *env; -- 2.34.1