summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorXuelian <xuelian.bai@samsung.com>2020-03-05 00:35:24 +0800
committerXuelian Bai <xuelian.bai@samsung.com>2023-02-21 14:32:47 +0800
commit36f16da7728cce997fa6b39e7370e00e1b084aa8 (patch)
tree5dc7395f8d305a90b6730f5c0121315f79a90029 /src
parentf3a568bb8e55bc6bd2582f777206b0be434dd7c9 (diff)
downloadmesa-36f16da7728cce997fa6b39e7370e00e1b084aa8.tar.gz
mesa-36f16da7728cce997fa6b39e7370e00e1b084aa8.tar.bz2
mesa-36f16da7728cce997fa6b39e7370e00e1b084aa8.zip
Fix "close object **" error in vc4_bo_free on RPI3
When running case dEQP-GLES2.functional.prerequisite.read_pixels for deqp-gles2, there will be an error "close object **". This error is caused by invalid fd, so we call tbm_drm_helper_get_auth_info in dri2_initialize_tizen. Change-Id: I959b404daa33c629ea72c38bfe7838e643eb603d Signed-Off-by: Xuelian Bai <xuelian.bai@samsung.com>
Diffstat (limited to 'src')
-rwxr-xr-xsrc/egl/drivers/dri2/platform_tizen.c47
1 files changed, 35 insertions, 12 deletions
diff --git a/src/egl/drivers/dri2/platform_tizen.c b/src/egl/drivers/dri2/platform_tizen.c
index bde969369a5..acc549a7d4b 100755
--- a/src/egl/drivers/dri2/platform_tizen.c
+++ b/src/egl/drivers/dri2/platform_tizen.c
@@ -1425,6 +1425,7 @@ dri2_initialize_tizen(_EGLDisplay *disp)
tpl_display_t *tpl_display = NULL;
const char *err;
int tbm_bufmgr_fd = -1;
+ char *tbm_bufmgr_device_name = NULL;
int hw_accel = (getenv("LIBGL_ALWAYS_SOFTWARE") == NULL);
loader_set_logger(_eglLog);
@@ -1486,18 +1487,39 @@ dri2_initialize_tizen(_EGLDisplay *disp)
}
drmFreeDevices(devices, num_devices);
#endif
- dri2_dpy->fd = loader_get_user_preferred_fd(tbm_bufmgr_fd,
- &dri2_dpy->is_different_gpu);
- //dri2_dpy->is_different_gpu = (dri2_dpy->fd == tbm_bufmgr_fd);
-
- if (dri2_dpy->is_different_gpu) {
- free(dri2_dpy->device_name);
- dri2_dpy->device_name = loader_get_device_name_for_fd(dri2_dpy->fd);
- if (!dri2_dpy->device_name) {
- err = "DRI2: failed to get device name for requested GPU";
- goto cleanup_device;
- }
- }
+
+ if (drmGetNodeTypeFromFd(tbm_bufmgr_fd) == DRM_NODE_RENDER) {
+
+ 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 {
+ 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
+ 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
+ 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) {
err = "DRI2: failed to get driver name";
@@ -1548,6 +1570,7 @@ dri2_initialize_tizen(_EGLDisplay *disp)
if(dri2_dpy->fd != tbm_bufmgr_fd) {
close(dri2_dpy->fd);
}
+ close(tbm_bufmgr_fd);
tbm_bufmgr_fd = -1;
dri2_dpy->fd = -1;