From 0b1d127b5e13733697836328babc1179b1bd6657 Mon Sep 17 00:00:00 2001 From: SooChan Lim Date: Thu, 24 Jun 2021 10:05:51 +0900 Subject: [PATCH] tbm_module: remove the static variable assign the checking variable of the surface_data to tbm_module structure Change-Id: Ied5a89e68b63ed799d707a4dd2f94b3737e56486 --- src/tbm_module.c | 6 ++---- src/tbm_module.h | 1 + 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/tbm_module.c b/src/tbm_module.c index 652713d..2f38521 100644 --- a/src/tbm_module.c +++ b/src/tbm_module.c @@ -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; diff --git a/src/tbm_module.h b/src/tbm_module.h index a87adcb..65db355 100644 --- a/src/tbm_module.h +++ b/src/tbm_module.h @@ -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) */ -- 2.7.4