diff options
author | Boram Park <boram1288.park@samsung.com> | 2016-03-22 17:45:53 +0900 |
---|---|---|
committer | Boram Park <boram1288.park@samsung.com> | 2016-04-11 19:39:48 +0900 |
commit | e53e1cc924ab64dc9b3276c697935252af073507 (patch) | |
tree | c8911bcb14cb2cafb60c1441f5bb2e182dd04617 | |
parent | ed572e6c10dd9489833bf40706a99d88185eea7f (diff) | |
download | libtdm-drm-e53e1cc924ab64dc9b3276c697935252af073507.tar.gz libtdm-drm-e53e1cc924ab64dc9b3276c697935252af073507.tar.bz2 libtdm-drm-e53e1cc924ab64dc9b3276c697935252af073507.zip |
set TDM_DRM_MASTER_FD
Change-Id: I1c0dd6d661bc176db372f1cd98e108821c1c62b0
-rw-r--r-- | src/tdm_drm.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/tdm_drm.c b/src/tdm_drm.c index ab2ee53..c0059a6 100644 --- a/src/tdm_drm.c +++ b/src/tdm_drm.c @@ -223,12 +223,23 @@ tdm_drm_init(tdm_display *dpy, tdm_error *error) drm_data->dpy = dpy; - drm_data->drm_fd = _tdm_drm_open_drm(); + /* 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. + * + */ + drm_data->drm_fd = tdm_helper_get_fd("TBM_DRM_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; } + /* 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); + #if LIBDRM_MAJOR_VERSION >= 2 && LIBDRM_MINOR_VERSION >= 4 && LIBDRM_MICRO_VERSION >= 47 if (drmSetClientCap(drm_data->drm_fd, DRM_CLIENT_CAP_UNIVERSAL_PLANES, 1) < 0) { TDM_WRN("Set DRM_CLIENT_CAP_UNIVERSAL_PLANES failed"); |