TBM_RETURN_VAL_IF_FAIL(bufmgr, TBM_ERROR_INVALID_PARAMETER);
TBM_RETURN_VAL_IF_FAIL(func, TBM_ERROR_INVALID_PARAMETER);
- bufmgr->bufmgr_func = func;
+ // The tbm_bufmgr from backend module is actually tbm_module memory in libtbm.
+ // libtbm initializes module init with this tbm_module which is casted with tbm_bufmgr.
+ tbm_module *module = (tbm_module *)bufmgr;
+ module->bufmgr_func = func;
return TBM_ERROR_NONE;
}
TBM_RETURN_VAL_IF_FAIL(bufmgr, TBM_ERROR_INVALID_PARAMETER);
TBM_RETURN_VAL_IF_FAIL(func, TBM_ERROR_INVALID_PARAMETER);
- bufmgr->bo_func = func;
+ // The tbm_bufmgr from backend module is actually tbm_module memory in libtbm.
+ // libtbm initializes module init with this tbm_module which is casted with tbm_bufmgr.
+ tbm_module *module = (tbm_module *)bufmgr;
+ module->bo_func = func;
return TBM_ERROR_NONE;
}