From: Chanwoo Choi Date: Mon, 21 Aug 2023 10:12:32 +0000 (+0900) Subject: plugin-api: common: Add SYSCOMMON_PLUGIN_MODULE_DEVICED_DISPLAY plugin module X-Git-Tag: accepted/tizen/unified/20230825.044252~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7412ea8bcc98594f6424e4e77154c184e3734c7f;p=platform%2Fcore%2Fsystem%2Flibsyscommon.git plugin-api: common: Add SYSCOMMON_PLUGIN_MODULE_DEVICED_DISPLAY plugin module Add SYSCOMMON_PLUGIN_MODULE_DEVICED_DISPLAY for display plugin module. [Detailed description] 1. Newly added SYSCOMMON_PLUGIN_MODULE_DEVICED_DISPLAY plugin module - module : SYSCOMMON_PLUGIN_MODULE_DEVICED_DISPLAY - library_name : "/usr/lib/system/plugin/libplugin-backend-deviced-display.so" - library_name_64bit : "/usr/lib64/system/plugin/libplugin-backend-deviced-display.so" - symbol_name : "system_plugin_backend_deviced_display_data" 2. Newly added SYSCOMMON_PLUGIN_MODULE_DEVICED_DISPLAY plugin api - int syscommon_plugin_deviced_display_get_backend(void) : Load deviced display plugin-backend from above library_name/library_name_64bit path - int syscommon_plugin_deviced_display_put_backend(void); : Unload Deviced display plugin-backend Change-Id: I51ea96d56046d09b10d449c1455c97575837fdee Signed-off-by: Chanwoo Choi --- diff --git a/src/plugin-api/common/include/syscommon-plugin-common.h b/src/plugin-api/common/include/syscommon-plugin-common.h index 8caccbb..13b35d7 100644 --- a/src/plugin-api/common/include/syscommon-plugin-common.h +++ b/src/plugin-api/common/include/syscommon-plugin-common.h @@ -36,6 +36,7 @@ enum syscommon_plugin_module { SYSCOMMON_PLUGIN_MODULE_RESOURCED_MEMORY_LMK, SYSCOMMON_PLUGIN_MODULE_DEVICED_BATTERY, SYSCOMMON_PLUGIN_MODULE_DEVICED_INPUT, + SYSCOMMON_PLUGIN_MODULE_DEVICED_DISPLAY, SYSCOMMON_PLUGIN_MODULE_END, }; diff --git a/src/plugin-api/common/src/syscommon-plugin-api-list.h b/src/plugin-api/common/src/syscommon-plugin-api-list.h index cf92695..29562d1 100644 --- a/src/plugin-api/common/src/syscommon-plugin-api-list.h +++ b/src/plugin-api/common/src/syscommon-plugin-api-list.h @@ -54,6 +54,12 @@ static struct plugin_abi_version_match abi_version_match_data[SYSCOMMON_PLUGIN_M .backend_min_abi_version = SYSCOMMON_PLUGIN_ABI_VERSION_TIZEN_8_0, }, }, + [SYSCOMMON_PLUGIN_MODULE_DEVICED_DISPLAY] = { + [0] = { + .platform_abi_version = SYSCOMMON_PLUGIN_ABI_VERSION_TIZEN_8_0, + .backend_min_abi_version = SYSCOMMON_PLUGIN_ABI_VERSION_TIZEN_8_0, + }, + }, }; static struct __plugin_module_info g_plugin_module_info[] = { @@ -93,6 +99,18 @@ static struct __plugin_module_info g_plugin_module_info[] = { .num_abi_versions = ARRAY_SIZE(abi_version_match_data[SYSCOMMON_PLUGIN_MODULE_DEVICED_INPUT]), .abi_versions = abi_version_match_data[SYSCOMMON_PLUGIN_MODULE_DEVICED_INPUT], }, + [SYSCOMMON_PLUGIN_MODULE_DEVICED_DISPLAY] = { + .group = PLUGIN_GROUP_DEVICED, + .module = SYSCOMMON_PLUGIN_MODULE_DEVICED_DISPLAY, + .license = PLUGIN_LICENSE_APACHE_2_0, + .module_name = "SYSCOMMON_PLUGIN_MODULE_DEVICED_DISPLAY", + .backend_module_name = "deviced-display", + .library_name = "/usr/lib/system/plugin/libplugin-backend-deviced-display.so", + .library_name_64bit = "/usr/lib64/system/plugin/libplugin-backend-deviced-display.so", + .symbol_name = "system_plugin_backend_deviced_display_data", + .num_abi_versions = ARRAY_SIZE(abi_version_match_data[SYSCOMMON_PLUGIN_MODULE_DEVICED_DISPLAY]), + .abi_versions = abi_version_match_data[SYSCOMMON_PLUGIN_MODULE_DEVICED_DISPLAY], + }, }; #endif /* __PLUGIN_API_LIST_H__ */ diff --git a/src/plugin-api/deviced/include/syscommon-plugin-deviced-display-interface.h b/src/plugin-api/deviced/include/syscommon-plugin-deviced-display-interface.h index 7f09817..aec7526 100644 --- a/src/plugin-api/deviced/include/syscommon-plugin-deviced-display-interface.h +++ b/src/plugin-api/deviced/include/syscommon-plugin-deviced-display-interface.h @@ -127,6 +127,10 @@ enum syscommon_deviced_display_capability { #define DEVICED_DISPLAY_SCREEN_TIMEOUT_INFINITE ((~0) >> 1) +typedef struct _syscommon_plugin_backend_deviced_display_funcs { + /* NONE */ +} syscommon_plugin_backend_deviced_display_funcs; + #ifdef __cplusplus } #endif diff --git a/src/plugin-api/deviced/include/syscommon-plugin-deviced-display.h b/src/plugin-api/deviced/include/syscommon-plugin-deviced-display.h index bd6c437..1e7a034 100644 --- a/src/plugin-api/deviced/include/syscommon-plugin-deviced-display.h +++ b/src/plugin-api/deviced/include/syscommon-plugin-deviced-display.h @@ -29,8 +29,20 @@ extern "C" { #endif -#include -#include +#include "syscommon-plugin-deviced-common-interface.h" +#include "syscommon-plugin-deviced-display-interface.h" + +/** + * @brief Get the backend data of deviced-display module + * @return @c 0 on success, otherwise a negative error value + */ +int syscommon_plugin_deviced_display_get_backend(void); + +/** + * @brief Put the backend data of deviced-display module + * @return @c 0 on success, otherwise a negative error value + */ +int syscommon_plugin_deviced_display_put_backend(void); #ifdef __cplusplus } diff --git a/src/plugin-api/deviced/src/syscommon-plugin-deviced-display.c b/src/plugin-api/deviced/src/syscommon-plugin-deviced-display.c index f07bd13..ba04d4e 100644 --- a/src/plugin-api/deviced/src/syscommon-plugin-deviced-display.c +++ b/src/plugin-api/deviced/src/syscommon-plugin-deviced-display.c @@ -21,3 +21,59 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ +#include + +#include "syscommon-plugin-common.h" + +#include "common.h" +#include "syscommon-plugin-deviced-display.h" +#include "syscommon-plugin-deviced-display-interface.h" + +#ifndef EXPORT +#define EXPORT __attribute__((visibility("default"))) +#endif + +static syscommon_plugin_backend_deviced_display_funcs *g_display_funcs = NULL; + +EXPORT +int syscommon_plugin_deviced_display_get_backend(void) +{ + int ret = 0; + + if (g_display_funcs) + return 0; + + ret = syscommon_plugin_common_get_backend( + SYSCOMMON_PLUGIN_MODULE_DEVICED_DISPLAY, + (void **)&g_display_funcs); + if (ret < 0) { + _E("Failed to get deviced_display backend: %d", ret); + return ret; + } + + _I("Success to get deviced_display backend: %d", ret); + + return 0; +} + +EXPORT +int syscommon_plugin_deviced_display_put_backend(void) +{ + int ret = 0; + + if (!g_display_funcs) + return 0; + + ret = syscommon_plugin_common_put_backend( + SYSCOMMON_PLUGIN_MODULE_DEVICED_DISPLAY, + (void *)g_display_funcs); + if (ret < 0) { + _E("Failed to put deviced_display backend: %d", ret); + return ret; + } + g_display_funcs = NULL; + + _I("Success to put deviced_display backend: %d", ret); + + return 0; +}