headless_server : add tbm bufmgr server init/deinit 82/268482/2 accepted/tizen/unified/20211224.035241 submit/tizen/20211223.110052
authordyamy-lee <dyamy.lee@samsung.com>
Thu, 23 Dec 2021 10:36:14 +0000 (19:36 +0900)
committerdyamy-lee <dyamy.lee@samsung.com>
Thu, 23 Dec 2021 10:53:32 +0000 (19:53 +0900)
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);