From: Changyeon Lee Date: Thu, 12 Jan 2017 09:11:45 +0000 (+0900) Subject: added description in tbm_drm_helper header X-Git-Tag: accepted/tizen/3.0/common/20170118.131325~5 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a19d7d99055257f80b940845cd03099c11224e76;p=platform%2Fcore%2Fuifw%2Flibtbm.git added description in tbm_drm_helper header Change-Id: I2235b254e205b59b7fb85124267a3178e7a2fd32 --- diff --git a/src/tbm_drm_helper.h b/src/tbm_drm_helper.h index 0c93a37..3584eeb 100644 --- a/src/tbm_drm_helper.h +++ b/src/tbm_drm_helper.h @@ -32,12 +32,81 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #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 fd from the specific enviroment variable. + * @details + * This function will dup the fd of the given enviroment variable. + 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 by using "TDM_DRM_MASTER_FD" and "TBM_DRM_MASTER_FD". + * @param[in] env The given enviroment variable + * @return fd if success. Otherwise, -1. + * @see #tdm_helper_set_tbm_master_fd() + */ +int tbm_drm_helper_get_master_fd(void); + +/** + * @brief Set the given fd to TBM_DRM_MASTER_FD enviroment variable. + * @details + * In DRM system, a drm-master-fd @b SHOULD be shared between TDM backend and + TBM backend in display server side by using "TDM_DRM_MASTER_FD" + and "TBM_DRM_MASTER_FD". + * @param[in] fd The given fd + * @see #tdm_helper_set_tbm_master_fd() + * @see #tbm_drm_helper_unset_tbm_master_fd() + */ void tbm_drm_helper_set_tbm_master_fd(int fd); + +/** + * @brief Unset the TBM_DRM_MASTER_FD enviroment variable. + * @details + * In DRM system, a drm-master-fd @b SHOULD be shared between TDM backend and + TBM backend in display server side by using "TDM_DRM_MASTER_FD" + and "TBM_DRM_MASTER_FD". + * @param[in] env The given enviroment variable + * @param[in] fd The given fd + * @see #tdm_helper_set_tbm_master_fd() + * @see #tbm_drm_helper_unset_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); #endif /* _TBM_DRM_HELPER_H_ */ diff --git a/src/tbm_drm_helper_server.c b/src/tbm_drm_helper_server.c index b10f88a..75ab082 100644 --- a/src/tbm_drm_helper_server.c +++ b/src/tbm_drm_helper_server.c @@ -238,7 +238,7 @@ tbm_drm_helper_set_tbm_master_fd(int fd) ret = setenv("TBM_DRM_MASTER_FD", (const char*)buf, 1); if (ret) { - TBM_LOG_E("failed to set TIZEN_DRM_MASTER_FD to %d", fd); + TBM_LOG_E("failed to set TIZEN_DRM_MASTER_FD to %d\n", fd); return; } @@ -252,7 +252,7 @@ tbm_drm_helper_unset_tbm_master_fd(void) ret = unsetenv("TBM_DRM_MASTER_FD"); if (ret) { - TBM_LOG_E("failed to unset TBM_DRM_MASTER_FD"); + TBM_LOG_E("failed to unset TBM_DRM_MASTER_FD\n"); return; } }