diff options
author | Boram Park <boram1288.park@samsung.com> | 2017-09-15 16:40:31 +0900 |
---|---|---|
committer | Boram Park <boram1288.park@samsung.com> | 2017-09-18 18:41:52 +0900 |
commit | a21fb42f03b3f2b8b6d006cd1ede3b40da2acaaf (patch) | |
tree | e73092f66971c66b2f2f09854e7901c9ad2055ac /src/tdm_drm.c | |
parent | 45fbeab7c9d5b357ae6384ed0efeb7bdf3ae0545 (diff) | |
download | libtdm-drm-a21fb42f03b3f2b8b6d006cd1ede3b40da2acaaf.tar.gz libtdm-drm-a21fb42f03b3f2b8b6d006cd1ede3b40da2acaaf.tar.bz2 libtdm-drm-a21fb42f03b3f2b8b6d006cd1ede3b40da2acaaf.zip |
not using enviroment variable to get drm fd
Change-Id: Ibeb0a9bdd16374592275b919c04d6b04eb11f4e9
Diffstat (limited to 'src/tdm_drm.c')
-rw-r--r-- | src/tdm_drm.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/src/tdm_drm.c b/src/tdm_drm.c index 9c08cf3..102c7b8 100644 --- a/src/tdm_drm.c +++ b/src/tdm_drm.c @@ -8,6 +8,7 @@ #include "tdm_drm.h" #include <tdm_helper.h> +#include <tbm_drm_helper.h> #define ENABLE_PP @@ -327,20 +328,21 @@ tdm_drm_init(tdm_display *dpy, tdm_error *error) drm_data->dpy = dpy; /* The drm master fd can be opened by a tbm backend module in - * tbm_bufmgr_init() time. In this case, we just get it from - * TBM_DRM_MASTER_FD enviroment. + * tbm_bufmgr_init() time. In this case, we just get it from tbm. */ - drm_data->drm_fd = tdm_helper_get_fd("TBM_DRM_MASTER_FD"); - if (drm_data->drm_fd < 0) + drm_data->drm_fd = tbm_drm_helper_get_master_fd(); + if (drm_data->drm_fd < 0) { drm_data->drm_fd = _tdm_drm_open_drm(); - if (drm_data->drm_fd < 0) { - ret = TDM_ERROR_OPERATION_FAILED; - goto failed; + if (drm_data->drm_fd < 0) { + ret = TDM_ERROR_OPERATION_FAILED; + goto failed; + } + + tbm_drm_helper_set_tbm_master_fd(drm_data->drm_fd); } - /* To share the drm master fd with other modules in display server side. */ - tdm_helper_set_fd("TDM_DRM_MASTER_FD", drm_data->drm_fd); + TDM_INFO("master fd: %d", drm_data->drm_fd); #ifdef HAVE_UDEV _tdm_drm_udev_init(drm_data); |