The tbm_bufmgr_server_init is called by the display server.
This api will be used instead of setting the TBM_DISPLAY_SERVER env variable.
Change-Id: I94e3b338dc08b2f7b8482b623738b5728f24b426
gBufMgr->fd = fd;
+ /* set the display_server flag before loading the backend module */
+ if (server) {
+ TBM_LOG_I("The tbm_bufmgr(%p) is used by display server. Need to bind the native_display.\n", gBufMgr);
+ gBufMgr->display_server = 1;
+ }
+
/* load bufmgr priv from env */
if (!_tbm_load_module(gBufMgr, gBufMgr->fd)) {
_tbm_set_last_result(TBM_BO_ERROR_LOAD_MODULE_FAILED);
return 1;
}
+tbm_bufmgr
+tbm_bufmgr_server_init(void)
+{
+ tbm_bufmgr bufmgr;
+
+ bufmgr = _tbm_bufmgr_init(-1, 1);
+
+ return bufmgr;
+}
+
int tbm_bufmgr_get_fd_limit(void)
{
struct rlimit lim;
*/
int tbm_bufmgr_bind_native_display(tbm_bufmgr bufmgr, void *native_display);
+/**
+ * @brief Initializes the buffer manager at the display server.
+ * @details use this api to initialize the tbm_bufmgr at the display server.
+ * @since_tizen 5.0
+ */
+tbm_bufmgr tbm_bufmgr_server_init(void);
+
/**
* @brief Print out the information of tbm_bos.
* @since_tizen 3.0
{
const char *value;
- value = (const char*)getenv("TBM_DISPLAY_SERVER");
- if (!value)
+ if (gBufMgr == NULL) {
+ TBM_LOG_E("error: no gBufMgr.\n");
return 0;
+ }
- return 1;
+ /* TODO: TBM_DISPLAY_SERVER will be removed */
+ value = (const char*)getenv("TBM_DISPLAY_SERVER");
+
+ if (value || gBufMgr->display_server)
+ return 1;
+
+ return 0;
}
/* LCOV_EXCL_STOP */
#define DEBUG
#ifdef DEBUG
extern int bDebug;
+extern tbm_bufmgr gBufMgr;
#define TBM_DBG(...) { if (bDebug&0x1) TBM_LOG_D(__VA_ARGS__); }
#define TBM_DBG_LOCK(...) { if (bDebug&0x2) TBM_LOG_D(__VA_ARGS__); }
struct list_head debug_key_list; /* list of debug data key list belonging to bufmgr */
void *module_data;
tbm_bufmgr_backend backend; /* bufmgr backend */
+ int display_server; /* used by display server */
};
/**