headless_server : add tbm bufmgr server init/deinit 85/268485/2 accepted/tizen/6.5/unified/20211224.144613 submit/tizen_6.5/20211223.110040
authordyamy-lee <dyamy.lee@samsung.com>
Thu, 23 Dec 2021 10:36:14 +0000 (19:36 +0900)
committerDaYe Lee <dyamy.lee@samsung.com>
Thu, 23 Dec 2021 10:52:26 +0000 (10:52 +0000)
For using tbm buffer, it needs tbm_bufmgr_server_init.
THis is missed when it is integrated with doctor

Change-Id: I97a6a63a5ccfe3cbc348cb432312b6d19cdc59d6

src/headless_server.c

index 14ce747..d4e2de5 100644 (file)
@@ -28,6 +28,7 @@
 #include <signal.h>
 
 #include <pepper.h>
+#include <tbm_bufmgr.h>
 #include <headless_server.h>
 
 int use_output = 1;
@@ -62,6 +63,7 @@ int main(int argc, char *argv[])
        const char *socket_name = NULL;
        pepper_compositor_t *compositor = NULL;
        pepper_bool_t ret;
+       tbm_bufmgr bufmgr = NULL;
 
        /* set STDOUT/STDERR bufferless */
        setvbuf(stdout, NULL, _IONBF, 0);
@@ -103,6 +105,12 @@ int main(int argc, char *argv[])
                ret = headless_output_init(compositor);
                PEPPER_CHECK(ret, goto end, "headless_output_init() failed.\n");
        }
+       else {
+               bufmgr = tbm_bufmgr_server_init();
+               PEPPER_CHECK(bufmgr, goto end, "Failed to init tbm buffer manager !\n");
+               ret = tbm_bufmgr_bind_native_display(bufmgr, (void *)pepper_compositor_get_display(compositor));
+               PEPPER_CHECK(ret, goto end, "Failed to bind native display with tbm buffer manager !\n");
+       }
 
        /* Init Shell */
        ret = headless_shell_init(compositor);
@@ -120,6 +128,11 @@ end:
        headless_input_deinit(compositor);
        if(use_output)
                headless_output_deinit(compositor);
+       if (bufmgr)
+       {
+               tbm_bufmgr_deinit(bufmgr);
+               bufmgr = NULL;
+       }
        headless_debug_deinit(compositor);
        pepper_compositor_destroy(compositor);