From: Changyeon Lee Date: Fri, 28 Apr 2017 05:44:48 +0000 (+0900) Subject: bufmgr: check system info before _bufmgr_init_cache_state X-Git-Tag: accepted/tizen/4.0/unified/20170816.013054^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F16%2F127616%2F2;p=platform%2Fadaptation%2Fsamsung_exynos%2Flibtbm-exynos.git bufmgr: check system info before _bufmgr_init_cache_state Change-Id: If5dc7d36c87dadb6d760f2d17f40d3cddefc16f9 --- 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;