bufmgr: check system info before _bufmgr_init_cache_state 16/127616/2 accepted/tizen/4.0/unified/20170816.013054 accepted/tizen/4.0/unified/20170828.224111 accepted/tizen/unified/20170429.024002 submit/tizen/20170428.061545 submit/tizen_4.0/20170811.094300 submit/tizen_4.0/20170828.110001 tizen_4.0.m1_release
authorChangyeon Lee <cyeon.lee@samsung.com>
Fri, 28 Apr 2017 05:44:48 +0000 (14:44 +0900)
committerChangyeon Lee <cyeon.lee@samsung.com>
Fri, 28 Apr 2017 05:46:11 +0000 (14:46 +0900)
Change-Id: If5dc7d36c87dadb6d760f2d17f40d3cddefc16f9

src/tbm_bufmgr_exynos.c

index a9803a5..f466e88 100644 (file)
@@ -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;