diff options
author | Chanwoo Choi <cw00.choi@samsung.com> | 2024-07-19 17:05:36 +0900 |
---|---|---|
committer | Chanwoo Choi <cw00.choi@samsung.com> | 2024-07-19 17:05:36 +0900 |
commit | f049c07a8599b52eccb98afb222adc2f026f471e (patch) | |
tree | 54829372efa2fd0e265a47d52154881257c17b63 | |
parent | bc3949a563eb8575d9ad5eeffa68fea68ac944a2 (diff) | |
download | power-vim3-f049c07a8599b52eccb98afb222adc2f026f471e.tar.gz power-vim3-f049c07a8599b52eccb98afb222adc2f026f471e.tar.bz2 power-vim3-f049c07a8599b52eccb98afb222adc2f026f471e.zip |
Use hal-rootstrap package for build and change hal_backend_power_funcs memory allocation/freetizen_9.0_m2_releaseaccepted/tizen/unified/dev/20240724.110135accepted/tizen/unified/20240722.104248accepted/tizen/9.0/unified/20241031.000319tizen_9.0tizenaccepted/tizen_unified_devaccepted/tizen_unifiedaccepted/tizen_9.0_unified
hal-roostrap package contains the allowed and maintained files
to build hal-backend package. In order to keep ABI (Application Binary
Interface) compatibility between platfrom and hal image,
must use only hal-rootstrap pacakge for build.
And chagnge the memory allocation/free way of hal_backend_power_funcs
in order to support new 1-platform Multi-HAL Interface approach.
Lastly, remove the deprecated abi_version filed and then
add the major_version and minor_version.
Change-Id: Icf5492043553c30c58614ffb7eae41c9561de746
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
-rw-r--r-- | CMakeLists.txt | 3 | ||||
-rw-r--r-- | packaging/hal-backend-power-vim3.spec | 3 | ||||
-rw-r--r-- | src/hal-backend-power.c | 97 |
3 files changed, 16 insertions, 87 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index f7b4e86..85da319 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,8 +9,7 @@ SET(HAL_LICENSEDIR ${CMAKE_HAL_LICENSEDIR_PREFIX}) INCLUDE(FindPkgConfig) pkg_check_modules(pkgs REQUIRED - hal-api-common - hal-api-power + hal-rootstrap ) FOREACH(flag ${pkgs_CFLAGS}) diff --git a/packaging/hal-backend-power-vim3.spec b/packaging/hal-backend-power-vim3.spec index 5b3a2ed..4625f6b 100644 --- a/packaging/hal-backend-power-vim3.spec +++ b/packaging/hal-backend-power-vim3.spec @@ -16,8 +16,7 @@ Requires(post): security-config Requires(postun): /sbin/ldconfig Requires(postun): /bin/systemctl BuildRequires: cmake -BuildRequires: pkgconfig(hal-api-common) -BuildRequires: pkgconfig(hal-api-power) +BuildRequires: pkgconfig(hal-rootstrap) %description PASS standard hal diff --git a/src/hal-backend-power.c b/src/hal-backend-power.c index 8de87a6..9d19062 100644 --- a/src/hal-backend-power.c +++ b/src/hal-backend-power.c @@ -472,107 +472,38 @@ static int memory_set_fault_around_bytes(char *res_name, static int power_init(void **data) { hal_backend_power_funcs *power_funcs = NULL; - struct pass_resource_cpu *cpu = NULL; - struct pass_resource_bus *bus = NULL; - struct pass_resource_gpu *gpu = NULL; - struct pass_resource_memory *memory = NULL; - int ret; - - /* Allocate memory */ - power_funcs = calloc(1, sizeof(hal_backend_power_funcs)); - if (!power_funcs) - return -ENOMEM; - - cpu = calloc(1, sizeof(struct pass_resource_cpu)); - if (!cpu) { - ret = -ENOMEM; - goto err_funcs; - } - - bus = calloc(1, sizeof(struct pass_resource_bus)); - if (!bus) { - ret = -ENOMEM; - goto err_cpu; - } - - gpu = calloc(1, sizeof(struct pass_resource_gpu)); - if (!gpu) { - ret = -ENOMEM; - goto err_bus; - } - - memory = calloc(1, sizeof(struct pass_resource_memory)); - if (!memory) { - ret = -ENOMEM; - goto err_gpu; - } - /* Initialize each h/w resource */ - cpu->dvfs = cpufreq_dvfs_ops; - cpu->hotplug = cpu_hotplus_ops; - cpu->tmu = tmu_ops; + if (!data) + return -EINVAL; - bus->dvfs = bus_dvfs_ops; - bus->tmu = tmu_ops; + power_funcs = *(hal_backend_power_funcs **)data; - gpu->dvfs = gpu_dvfs_ops; - gpu->tmu = tmu_ops; + power_funcs->cpu->dvfs = cpufreq_dvfs_ops; + power_funcs->cpu->hotplug = cpu_hotplus_ops; + power_funcs->cpu->tmu = tmu_ops; - memory->get_fault_around_bytes = memory_get_fault_around_bytes; - memory->set_fault_around_bytes = memory_set_fault_around_bytes; + power_funcs->bus->dvfs = bus_dvfs_ops; + power_funcs->bus->tmu = tmu_ops; - /* Initialize hal_backend_power_funcs */ - power_funcs->cpu = cpu; - power_funcs->bus = bus; - power_funcs->gpu = gpu; - power_funcs->memory = memory; + power_funcs->gpu->dvfs = gpu_dvfs_ops; + power_funcs->gpu->tmu = tmu_ops; - *data = (void *)power_funcs; + power_funcs->memory->get_fault_around_bytes = memory_get_fault_around_bytes; + power_funcs->memory->set_fault_around_bytes = memory_set_fault_around_bytes; return 0; - -err_gpu: - if (gpu) - free(gpu); -err_bus: - if (bus) - free(bus); -err_cpu: - if (cpu) - free(cpu); -err_funcs: - free(power_funcs); - - return ret; } static int power_exit(void *data) { - hal_backend_power_funcs *funcs; - - if (!data) - return -EINVAL; - - funcs = (hal_backend_power_funcs *)data; - - if (funcs->cpu) - free(funcs->cpu); - if (funcs->bus) - free(funcs->bus); - if (funcs->gpu) - free(funcs->gpu); - if (funcs->memory) - free(funcs->memory); - - free(funcs); - return 0; } hal_backend hal_backend_power_data = { .name = "hal-backend-power-vim3", .vendor = "amlogic", - .abi_version = HAL_ABI_VERSION_TIZEN_6_5, .init = power_init, .exit = power_exit, + .major_version = 1, + .minor_version = 0, }; |