summaryrefslogtreecommitdiff
path: root/src/lib/ecore_wl2/ecore_wl2_buffer.c
diff options
context:
space:
mode:
authorDerek Foreman <derekf@osg.samsung.com>2017-11-15 11:47:35 -0600
committerDerek Foreman <derekf@osg.samsung.com>2017-11-15 11:54:37 -0600
commitfcdbc07fe34d3b030d5e0136c003a38dbdb036e6 (patch)
tree6528e38b14aa8ff0fb1bdc76fdf04dd68033f79d /src/lib/ecore_wl2/ecore_wl2_buffer.c
parent23f5b411766ddd394c72a6b66143977c94b0878b (diff)
ecore_wl2: Don't open rendernode if we're not going to use it
We should only open this when actually testing dmabuf. Otherwise we're just wasting time and adding an opportunity to fail shm init over unrelated issues.
Diffstat (limited to 'src/lib/ecore_wl2/ecore_wl2_buffer.c')
-rw-r--r--src/lib/ecore_wl2/ecore_wl2_buffer.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/lib/ecore_wl2/ecore_wl2_buffer.c b/src/lib/ecore_wl2/ecore_wl2_buffer.c
index 60e4312153..22ecc5c29d 100644
--- a/src/lib/ecore_wl2/ecore_wl2_buffer.c
+++ b/src/lib/ecore_wl2/ecore_wl2_buffer.c
@@ -400,7 +400,7 @@ _wl_shm_buffer_manager_setup(int fd EINA_UNUSED)
400EAPI Eina_Bool 400EAPI Eina_Bool
401ecore_wl2_buffer_init(Ecore_Wl2_Display *ewd, Ecore_Wl2_Buffer_Type types) 401ecore_wl2_buffer_init(Ecore_Wl2_Display *ewd, Ecore_Wl2_Buffer_Type types)
402{ 402{
403 int fd; 403 int fd = -1;
404 Eina_Bool dmabuf = ewd->wl.dmabuf && (types & ECORE_WL2_BUFFER_DMABUF); 404 Eina_Bool dmabuf = ewd->wl.dmabuf && (types & ECORE_WL2_BUFFER_DMABUF);
405 Eina_Bool shm = ewd->wl.shm && (types & ECORE_WL2_BUFFER_SHM); 405 Eina_Bool shm = ewd->wl.shm && (types & ECORE_WL2_BUFFER_SHM);
406 Eina_Bool success = EINA_FALSE; 406 Eina_Bool success = EINA_FALSE;
@@ -414,15 +414,15 @@ ecore_wl2_buffer_init(Ecore_Wl2_Display *ewd, Ecore_Wl2_Buffer_Type types)
414 buffer_manager = calloc(1, sizeof(Buffer_Manager)); 414 buffer_manager = calloc(1, sizeof(Buffer_Manager));
415 if (!buffer_manager) goto err_alloc; 415 if (!buffer_manager) goto err_alloc;
416 416
417 fd = open("/dev/dri/renderD128", O_RDWR | O_CLOEXEC); 417 if (!getenv("EVAS_WAYLAND_SHM_DISABLE_DMABUF") && dmabuf)
418 if (fd < 0) goto err_drm;
419
420 if (!getenv("EVAS_WAYLAND_SHM_DISABLE_DMABUF"))
421 { 418 {
422 success = dmabuf && _intel_buffer_manager_setup(fd); 419 fd = open("/dev/dri/renderD128", O_RDWR | O_CLOEXEC);
423 if (!success) success = dmabuf && _exynos_buffer_manager_setup(fd); 420 if (fd < 0) goto err_drm;
421
422 success = _intel_buffer_manager_setup(fd);
423 if (!success) success = _exynos_buffer_manager_setup(fd);
424 } 424 }
425 if (!success) success = shm && _wl_shm_buffer_manager_setup(fd); 425 if (!success) success = shm && _wl_shm_buffer_manager_setup(0);
426 if (!success) goto err_bm; 426 if (!success) goto err_bm;
427 427
428 drm_fd = fd; 428 drm_fd = fd;
@@ -430,7 +430,7 @@ ecore_wl2_buffer_init(Ecore_Wl2_Display *ewd, Ecore_Wl2_Buffer_Type types)
430 return EINA_TRUE; 430 return EINA_TRUE;
431 431
432err_bm: 432err_bm:
433 close(fd); 433 if (fd >= 0) close(fd);
434err_drm: 434err_drm:
435 free(buffer_manager); 435 free(buffer_manager);
436 buffer_manager = NULL; 436 buffer_manager = NULL;