tbm_module: remove the static variable 58/260358/1
authorSooChan Lim <sc1.lim@samsung.com>
Thu, 24 Jun 2021 01:05:51 +0000 (10:05 +0900)
committerSooChan Lim <sc1.lim@samsung.com>
Thu, 24 Jun 2021 01:05:51 +0000 (10:05 +0900)
assign the checking variable of the surface_data to tbm_module structure

Change-Id: Ied5a89e68b63ed799d707a4dd2f94b3737e56486

src/tbm_module.c
src/tbm_module.h

index 652713d..2f38521 100644 (file)
@@ -650,18 +650,16 @@ tbm_module_support_surface_data(tbm_module *module)
        tbm_error_e error = TBM_ERROR_NONE;
        tbm_surface_data *surface_data = NULL;
 
-       static int tbm_module_check_support_surface_data = 0;
-
        TBM_RETURN_VAL_IF_FAIL(module, 0);
 
        // check once support_surface_data or not.
-       if (tbm_module_check_support_surface_data) {
+       if (module->check_surface_data) {
                // return the value which already set.
                return module->support_surface_data;
        }
 
        // check this only once
-       tbm_module_check_support_surface_data = 1;
+       module->check_surface_data = 1;
 
        if (module->type != TBM_MODULE_TYPE_HAL_TBM)
                goto done;
index a87adcb..65db355 100644 (file)
@@ -53,6 +53,7 @@ typedef enum _tbm_module_type {
 typedef struct _tbm_module {
        tbm_module_type type;
        int support_surface_data;
+       int check_surface_data;
 
        void *module_data;                         /* backend module */
        tbm_bufmgr_backend   backend;              /* bufmgr backend (will be DEPRECATED) */