tbm_module: remove bufmgr variable at tbm_module 06/259706/1
authorSooChan Lim <sc1.lim@samsung.com>
Fri, 11 Jun 2021 00:45:40 +0000 (09:45 +0900)
committerSooChan Lim <sc1.lim@samsung.com>
Fri, 11 Jun 2021 00:50:04 +0000 (09:50 +0900)
The tbm_modlue does not have a dependency of tbm_bufmgr anymore.
Remove all tbm_bufmgr variables at tbm_module.

Change-Id: Ia8be69be53aaaac2985e820b368d265fa32f7149

src/tbm_bufmgr.c
src/tbm_bufmgr_int.h
src/tbm_module.c

index ec13191..226ea25 100644 (file)
@@ -268,7 +268,7 @@ _tbm_bufmgr_init(int fd, int server)
        }
 
        /* load bufmgr priv from env */
-       gBufMgr->module = tbm_module_load(gBufMgr, gBufMgr->fd);
+       gBufMgr->module = tbm_module_load(gBufMgr->fd);
        if (!gBufMgr->module) {
                TBM_ERR("error : Fail to load bufmgr backend\n");
                _tbm_set_last_result(TBM_ERROR_INVALID_OPERATION);
@@ -822,7 +822,7 @@ tbm_bufmgr_bind_native_display(tbm_bufmgr bufmgr, void *native_display)
 
                        // TODO: this duplication will be removed after refactoring tbm_module
                        bufmgr->module->auth_wl_socket_created = 1;
-                       bufmgr->module->bufmgr->auth_fd = fd;
+                       bufmgr->module->auth_fd = fd;
                }
        } else if (bufmgr->backend_module_data) {
                if (!bufmgr->bufmgr_func->bufmgr_bind_native_display) {
index fe9bc61..70957f8 100644 (file)
@@ -179,7 +179,6 @@ typedef enum _tbm_module_type {
 
 typedef struct _tbm_module {
        tbm_module_type type;
-       tbm_bufmgr bufmgr;
 
        void *module_data;                         /* backend module */
        tbm_bufmgr_backend   backend;              /* bufmgr backend (will be DEPRECATED) */
@@ -355,7 +354,7 @@ tbm_bo tbm_bo_alloc_with_surface(tbm_bufmgr bufmgr, int width, int height, int f
 tbm_bo tbm_bo_alloc_with_bo_data(tbm_bufmgr bufmgr, tbm_backend_bo_data *bo_data, int flags);
 
 /* tbm_module functions */
-tbm_module *tbm_module_load(tbm_bufmgr bufmgr, int fd);
+tbm_module *tbm_module_load(int fd);
 void        tbm_module_unload(tbm_module *module);
 
 int         tbm_module_bufmgr_get_capabilities(tbm_module *module);
index 2644f82..ae8e848 100644 (file)
@@ -345,7 +345,7 @@ err:
 /* LCOV_EXCL_STOP */
 
 tbm_module *
-tbm_module_load(tbm_bufmgr bufmgr, int fd)
+tbm_module_load(int fd)
 {
        tbm_module *module;
        struct dirent **namelist;
@@ -356,7 +356,6 @@ tbm_module_load(tbm_bufmgr bufmgr, int fd)
                TBM_ERR("fail to allocate the memory");
                return NULL;
        }
-       module->bufmgr = bufmgr;
 
        /* try to load the hal-tbm backend module */
        ret = _tbm_backend_load_hal_tbm(module);
@@ -379,7 +378,7 @@ tbm_module_load(tbm_bufmgr bufmgr, int fd)
                return module;
        }
 
-       /* load bufmgr priv from configured path */
+       /* load backend_module from configured path */
        n = scandir(BUFMGR_MODULE_DIR, &namelist, 0, alphasort);
        if (n < 0) {
                TBM_ERR("no files : %s\n", BUFMGR_MODULE_DIR);
@@ -455,8 +454,6 @@ tbm_module_unload(tbm_module *module)
                break;
        }
 
-       module->bufmgr = NULL;
-
        free(module);
 }
 
@@ -482,7 +479,7 @@ tbm_module_bufmgr_get_capabilities(tbm_module *module)
        }
 
        if (error != TBM_ERROR_NONE) {
-               TBM_ERR("fail to get capabilities of bufmgr");
+               TBM_ERR("fail to get capabilities of tbm_module_bufmgr");
                return 0;
        }