*/
int tbm_drm_helper_get_fd(void);
+/**
+ * @brief Check render fd.
+ * @details
+ * Check drm fd is render node
+ * @param[in] fd The given fd
+ */
+int tbm_drm_helper_is_render_node(int fd);
+
#ifdef __cplusplus
}
#endif
return TBM_ERROR_INVALID_OPERATION;
}
- // make the wayland server socket for sending the authenticated drm_fd to wayland clients.
- if (!tbm_drm_helper_wl_auth_server_init(native_display, fd, NULL, 0)) {
- TBM_ERR("error: tbm_drm_helper_wl_auth_server_init failed\n", module, native_display);
- close(fd);
- return TBM_ERROR_INVALID_OPERATION;
- }
- TBM_INFO("tbm creates a wayland socket for authentication of drm_fd.");
+ if (tbm_drm_helper_is_render_node(fd)) {
+ TBM_INFO("tbm_module has render node.");
+ error = TBM_ERROR_NONE;
+ } else {
+ // make the wayland server socket for sending the authenticated drm_fd to wayland clients.
+ if (!tbm_drm_helper_wl_auth_server_init(native_display, fd, NULL, 0)) {
+ TBM_ERR("error: tbm_drm_helper_wl_auth_server_init failed\n", module, native_display);
+ close(fd);
+ return TBM_ERROR_INVALID_OPERATION;
+ }
+ TBM_INFO("tbm creates a wayland socket for authentication of drm_fd.");
- module->auth_wl_socket_created = 1;
- module->auth_fd = fd;
+ module->auth_wl_socket_created = 1;
+ module->auth_fd = fd;
+ }
} else {
TBM_INFO("tbm_module has no drm device.");
error = TBM_ERROR_NONE;