From fde99dd23b44d5aee5e85ca0e1a07ba623d5b418 Mon Sep 17 00:00:00 2001 From: SooChan Lim Date: Thu, 7 Apr 2022 18:45:25 +0900 Subject: [PATCH] check the master_fd Display Server(Enlightenment) always use the master_fd, so if the process can get the master_fd from tbm_drm_helper_get_master_fd(), there is no need to get the authentication information. If the process does not have the master_fd, it needs to get the authentication from the master process which is the Display Server(Enlightenment). Change-Id: Ib18113468b133c5335f1f280760383e40977062a --- src/egl/drivers/dri2/platform_tizen.c | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/src/egl/drivers/dri2/platform_tizen.c b/src/egl/drivers/dri2/platform_tizen.c index 83c3b42..acc8ea9 100755 --- a/src/egl/drivers/dri2/platform_tizen.c +++ b/src/egl/drivers/dri2/platform_tizen.c @@ -1633,28 +1633,21 @@ dri2_initialize_tizen(_EGLDisplay *disp) } dri2_dpy->fd = loader_open_device(tbm_bufmgr_device_name); - } else { - if (!tbm_drm_helper_get_auth_info(&dri2_dpy->fd, NULL, NULL)) { - - /* FIXME: tbm_drm_helper_get_auth_info() does not support the case of - * display server for now. this code is fallback routine for - * that Enlightenment Server fails on tbm_drm_helper_get_auth_info. - * When tbm_drm_helper_get_auth_info() supports display server - * case, then remove below routine. - */ -#if 1 + } else if (tbm_drm_helper_get_master_fd() >= 0) { + // display server always has master_fd, + // so tbm_bufmgr_fd is the master_fd if it can get the tbm_master_fd. tbm_bufmgr_device_name = loader_get_device_name_for_fd(tbm_bufmgr_fd); if (tbm_bufmgr_device_name == NULL) { err = "DRI2: failed to get tbm_bufmgr device name"; goto cleanup_device; } dri2_dpy->fd = loader_open_device(tbm_bufmgr_device_name); -#else + } else { + if (!tbm_drm_helper_get_auth_info(&dri2_dpy->fd, NULL, NULL)) { err = "DRI2: failed to get fd from tbm_drm_helper_get_auth_info()"; goto cleanup_device; -#endif } - } + } dri2_dpy->driver_name = loader_get_driver_for_fd(dri2_dpy->fd); if (dri2_dpy->driver_name == NULL) { -- 2.7.4