}
static void
-_tbm_bufmgr_copy_module_data(tbm_bufmgr bufmgr, tbm_module *module, int reset)
+_tbm_bufmgr_copy_module_data(tbm_bufmgr bufmgr, tbm_module *module)
{
- if (!reset) {
- bufmgr->module_data = module->module_data;
- bufmgr->backend = module->backend;
-
- bufmgr->backend_module_data = module->backend_module_data;
- bufmgr->bufmgr_data = module->bufmgr_data;
- bufmgr->bufmgr_func = module->bufmgr_func;
- bufmgr->bo_func = module->bo_func;
-
- bufmgr->use_hal_tbm = module->use_hal_tbm;
- bufmgr->auth_wl_socket_created = module->auth_wl_socket_created;
- bufmgr->auth_fd = module->auth_fd;
- bufmgr->hal_backend = module->hal_backend;
- bufmgr->hal_bufmgr = module->hal_bufmgr;
- } else {
- bufmgr->module_data = NULL;
- bufmgr->backend = NULL;
-
- bufmgr->backend_module_data = NULL;
- bufmgr->bufmgr_data = NULL;
- bufmgr->bufmgr_func = NULL;
- bufmgr->bo_func = NULL;
-
- bufmgr->use_hal_tbm = 0;
- bufmgr->auth_wl_socket_created = 0;
- bufmgr->auth_fd = -1;
- bufmgr->hal_backend = NULL;
- bufmgr->hal_bufmgr = NULL;
- }
+ bufmgr->module_data = module->module_data;
+ bufmgr->backend = module->backend;
+
+ bufmgr->backend_module_data = module->backend_module_data;
+ bufmgr->bufmgr_data = module->bufmgr_data;
+ bufmgr->bufmgr_func = module->bufmgr_func;
+ bufmgr->bo_func = module->bo_func;
+
+ bufmgr->use_hal_tbm = module->use_hal_tbm;
+ bufmgr->auth_wl_socket_created = module->auth_wl_socket_created;
+ bufmgr->auth_fd = module->auth_fd;
+ bufmgr->hal_backend = module->hal_backend;
+ bufmgr->hal_bufmgr = module->hal_bufmgr;
}
+static void
+_tbm_bufmgr_reset_modlue_data(tbm_bufmgr bufmgr)
+{
+ bufmgr->module_data = NULL;
+ bufmgr->backend = NULL;
+
+ bufmgr->backend_module_data = NULL;
+ bufmgr->bufmgr_data = NULL;
+ bufmgr->bufmgr_func = NULL;
+ bufmgr->bo_func = NULL;
+
+ bufmgr->use_hal_tbm = 0;
+ bufmgr->auth_wl_socket_created = 0;
+ bufmgr->auth_fd = -1;
+ bufmgr->hal_backend = NULL;
+ bufmgr->hal_bufmgr = NULL;
+}
/* LCOV_EXCL_STOP */
}
// TODO: this is temporary. it will be removed after finishing refactoring the tbm_module.
- _tbm_bufmgr_copy_module_data(gBufMgr, gBufMgr->module, 0);
+ _tbm_bufmgr_copy_module_data(gBufMgr, gBufMgr->module);
/* check the essential capabilities of tbm_module */
gBufMgr->capabilities = tbm_module_bufmgr_get_capabilities(gBufMgr->module, &error);
tbm_module_unload(bufmgr->module);
// TODO: this is temporary. it will be removed after finishing refactoring the tbm_module.
- _tbm_bufmgr_copy_module_data(bufmgr, bufmgr->module, 1);
+ _tbm_bufmgr_reset_modlue_data(bufmgr);
if (bufmgr->fd > 0)
close(bufmgr->fd);