summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYunhee Seo <yuni.seo@samsung.com>2024-04-22 10:42:49 +0900
committerYunhee Seo <yuni.seo@samsung.com>2024-04-22 10:42:49 +0900
commit2b9f809d516eb839fb37ebacef9f24b287d80ce3 (patch)
treebc21e9babb547aafc7048fce47c8bdd444feb23d
parent5e81ed18e90a969a35ea7f6d463cf7079b33a33f (diff)
downloaddevice-rpi-2b9f809d516eb839fb37ebacef9f24b287d80ce3.tar.gz
device-rpi-2b9f809d516eb839fb37ebacef9f24b287d80ce3.tar.bz2
device-rpi-2b9f809d516eb839fb37ebacef9f24b287d80ce3.zip
memory: Apply HAL ABI versioning
While applying HAL ABI versioning, hal_backend_[module]_funcs is allocated from hal-api-[module] side. Thus, allocation is moved to hal-api-device-memory side. Also, wrong module name is fixed and hal interface inclusion path is changed. "memory" -> "device-memory" Change-Id: Ibc48399e2ead7ffcd8aa5f2e1169ba699682eb16 Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
-rw-r--r--hw/memory/memory.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/hw/memory/memory.c b/hw/memory/memory.c
index 0184775..07bd686 100644
--- a/hw/memory/memory.c
+++ b/hw/memory/memory.c
@@ -18,7 +18,7 @@
#include <stdlib.h>
#include <errno.h>
-#include <hal/hal-memory-interface.h>
+#include <hal/hal-device-memory-interface.h>
#include <hal/hal-common-interface.h>
#include </hal/include/device/hal-backend-common.h>
@@ -27,12 +27,12 @@
#define GEM_INFO_PATH1 "/sys/kernel/debug/dri/1/gem_info"
#define BYTES_PER_KBYTE 1024
-static int memory_get_gpu_info(const int pid, struct gpu_info *info)
+static int memory_get_gpu_info(const int pid, hal_device_memory_gpu_info_s *info)
{
return -ENODEV;
}
-static int memory_get_gem_info(const int pid, struct gem_info *info)
+static int memory_get_gem_info(const int pid, hal_device_memory_gem_info_s *info)
{
FILE *fp;
char line[1024];
@@ -89,16 +89,19 @@ static int memory_get_gem_info(const int pid, struct gem_info *info)
static int memory_init(void **data)
{
- hal_backend_memory_funcs *memory_funcs;
+ hal_backend_device_memory_funcs *device_memory_funcs;
- memory_funcs = calloc(1, sizeof(hal_backend_memory_funcs));
- if (!memory_funcs)
- return -ENOMEM;
+ if (!data) {
+ _E("Invalid parameter");
+ return -EINVAL;
+ }
- memory_funcs->get_gpu_info = memory_get_gpu_info;
- memory_funcs->get_gem_info = memory_get_gem_info;
+ device_memory_funcs = *(hal_backend_device_memory_funcs **) data;
+ if (!device_memory_funcs)
+ return -EINVAL;
- *data = (void *)memory_funcs;
+ device_memory_funcs->get_gpu_info = memory_get_gpu_info;
+ device_memory_funcs->get_gem_info = memory_get_gem_info;
return 0;
}