#ifndef _TBM_DRM_HELPER_H_
#define _TBM_DRM_HELPER_H_
+/**
+ * @brief Initialize authentication server in display server.
+ * @details
+ * In DRM system, client sholud get authenticated fd from display server for using drm.
+ Tbm provides wayland protocol and helper function for passing and authenticating
+ fd from display server.
+ * @param[in] wl_display wayland display
+ * @param[in] fd fd of drm_master
+ * @param[in] device_name name of drm device
+ * @param[in] flags flags
+ * @see #tbm_drm_helper_wl_auth_server_deinit()
+ */
int tbm_drm_helper_wl_auth_server_init(void *wl_display, int fd, const char *device_name, uint32_t flags);
+
+/**
+ * @brief Deinitialize authentication server in display server
+ * @details
+ * In DRM system, client sholud get authenticated fd from display server for using drm.
+ Tbm provides wayland protocol and helper function for passing and authenticating
+ fd from display server.
+ * @see #tdm_helper_set_tbm_master_fd()
+ * @see #tbm_drm_helper_unset_tbm_master_fd()
+ */
void tbm_drm_helper_wl_auth_server_deinit(void);
-int tbm_drm_helper_get_master_fd(void);
+
+/**
+ * @brief Get a drm master fd.
+ * @details
+ * This function will dup the drm master fd.
+ The Caller SHOULD close the fd.
+ In DRM system, a drm master fd SHOULD be shared between TDM backend and
+ TBM backend in display server side.
+ * @return fd if success. Otherwise, -1.
+ * @see #tbm_drm_helper_set_tbm_master_fd()
+ * @see #tbm_drm_helper_unset_tbm_master_fd()
+ */
+int tbm_drm_helper_get_master_fd(void);
+
+/**
+ * @brief Set a drm master fd with the given fd.
+ * @details
+ * In DRM system, a drm master fd @b SHOULD be shared between TDM backend and
+ TBM backend in display server side.
+ * @param[in] fd The given fd
+ * @see #tbm_drm_helper_get_master_fd()
+ * @see #tbm_drm_helper_unset_tbm_master_fd()
+ */
void tbm_drm_helper_set_tbm_master_fd(int fd);
+
+/**
+ * @brief Unset a drm master fd.
+ * @see #tbm_drm_helper_get_master_fd()
+ * @see #tbm_drm_helper_set_tbm_master_fd()
+ */
void tbm_drm_helper_unset_tbm_master_fd(void);
+/**
+ * @brief Get infomation of drm authentication.
+ * @details
+ * In DRM system, client sholud get authenticated fd from display server for using drm.
+ Tbm provides wayland protocol and helper function for passing and authenticating
+ fd from display server.
+ * @param[out] fd The authenticated fd
+ * @param[out] device The device name
+ * @param[out] capabilities The capabilities of device
+ * @see #tdm_helper_set_tbm_master_fd()
+ * @see #tbm_drm_helper_unset_tbm_master_fd()
+ */
int tbm_drm_helper_get_auth_info(int *auth_fd, char **device, uint32_t *capabilities);
+/**
+ * @brief Set drm fd with the given fd.
+ * @details
+ * Some client want to get drm fd used tbm_backend.
+ if tbm_backend allow that client use drm_fd, it SHOULD be set.
+ * @param[in] fd The given fd
+ * @see #tbm_drm_helper_get_fd()
+ */
+void tbm_drm_helper_set_fd(int fd);
+
+/**
+ * @brief Unset drm fd.
+ * @details
+ * Some client want to get drm fd used tbm_backend.
+ if tbm_backend allow that client use drm_fd, it SHOULD be set.
+ * @param[in] fd The given fd
+ * @see #tbm_drm_helper_get_fd()
+ */
+void tbm_drm_helper_unset_fd(void);
+
+/**
+ * @brief Get drm fd.
+ * @details
+ * Some client want to get drm fd used tbm_backend.
+ client can get drm fd from this fucntion.
+ The Caller SHOULD close the fd.
+ * @return fd if success. Otherwise, -1.
+ * @see #tdm_helper_set_tbm_master_fd()
+ * @see #tbm_drm_helper_unset_tbm_master_fd()
+ */
+int tbm_drm_helper_get_fd(void);
+
#endif /* _TBM_DRM_HELPER_H_ */