Fix to use TPL_BACKEND_WAYLAND_THREAD.
authorJoonbum Ko <joonbum.ko@samsung.com>
Wed, 18 Mar 2020 10:40:59 +0000 (19:40 +0900)
committerXuelian Bai <xuelian.bai@samsung.com>
Thu, 18 Jan 2024 01:29:10 +0000 (09:29 +0800)
 - It is a valid backend only for wayland clients.

Change-Id: Ifea5a5b5bd03074f267c4be02d325ed544840753
Signed-off-by: Joonbum Ko <joonbum.ko@samsung.com>
src/egl/drivers/dri2/platform_tizen.c

index 9e54a85..ab27b19 100755 (executable)
@@ -1423,6 +1423,7 @@ dri2_initialize_tizen(_EGLDisplay *disp)
    _EGLDevice *dev;
    struct dri2_egl_display *dri2_dpy;
    tpl_display_t *tpl_display = NULL;
+   tpl_backend_type_t tpl_backend = TPL_BACKEND_UNKNOWN;
    const char *err;
    int tbm_bufmgr_fd = -1;
    char *tbm_bufmgr_device_name = NULL;
@@ -1448,8 +1449,14 @@ dri2_initialize_tizen(_EGLDisplay *disp)
       dri2_dpy->own_device = 1;
    }
 
-   /* TPL_BACKEND_UNKNOWN type make checking runtime type check */
-   tpl_display = tpl_display_create(TPL_BACKEND_UNKNOWN, disp->PlatformDisplay);
+   /* Can find the backend type of libtpl-egl through PlatformDisplay */
+   tpl_backend = tpl_display_get_backend_type(disp->PlatformDisplay);
+   /* If tpl_backend is a wayland client, thread backend should be used
+    * to use dri2_surf->out_fence_fd. */
+   if (tpl_backend == TPL_BACKEND_WAYLAND)
+      tpl_backend = TPL_BACKEND_WAYLAND_THREAD;
+
+   tpl_display = tpl_display_create(tpl_backend, disp->PlatformDisplay);
    if (!tpl_display) {
       err = "DRI2: failed to create tpl_display";
       goto cleanup_display;