set TDM_DRM_MASTER_FD 53/65553/1
authorBoram Park <boram1288.park@samsung.com>
Tue, 22 Mar 2016 09:12:37 +0000 (18:12 +0900)
committerBoram Park <boram1288.park@samsung.com>
Mon, 11 Apr 2016 10:43:22 +0000 (19:43 +0900)
Change-Id: Ife913a77a5bc8047ed572270948bc8b654450b5b

src/tdm_sprd.c

index 5e0b468..75b0c97 100755 (executable)
@@ -205,6 +205,12 @@ tdm_sprd_init(tdm_display *dpy, tdm_error *error)
        sprd_data->dpy = dpy;
        sprd_data->drm_fd = -1;
 
+       /* 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.
+        *
+        */
+       sprd_data->drm_fd = tdm_helper_get_fd("TBM_DRM_MASTER_FD");
        if (sprd_data->drm_fd < 0)
                sprd_data->drm_fd = _tdm_sprd_open_drm();
 
@@ -213,6 +219,9 @@ tdm_sprd_init(tdm_display *dpy, tdm_error *error)
                goto failed_l;
        }
 
+       /* To share the drm master fd with other modules in display server side. */
+       tdm_helper_set_fd("TDM_DRM_MASTER_FD", sprd_data->drm_fd);
+
 #if 0
        if (drmSetClientCap(sprd_data->drm_fd, DRM_CLIENT_CAP_UNIVERSAL_PLANES, 1) < 0)
                TDM_WRN("Set DRM_CLIENT_CAP_UNIVERSAL_PLANES failed_l");