display: Apply HAL ABI versioning 28/308128/3
authorYunhee Seo <yuni.seo@samsung.com>
Mon, 18 Mar 2024 09:07:27 +0000 (18:07 +0900)
committerYunhee Seo <yuni.seo@samsung.com>
Thu, 4 Apr 2024 01:47:40 +0000 (10:47 +0900)
To support OS upgrade feature, hal-backend and hal-api module needs HAL ABI versioning.
So, major/minor version is added to hal_backend structure.
While applying HAL ABI versioning, hal_backend_[module]_funcs is allocated from hal-api-[module] side.
Thus, allocation is moved to hal-api-device-display side.

Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
Change-Id: I6c77e6cee028ea987f9fa43c2869913b464b1e9a

hw/display/display.c

index ede269abf2c765ebc28cac3a67d27dfe23be0ae6..f6576fab76889cf7ca160e50f87269994e5743d4 100644 (file)
@@ -102,16 +102,19 @@ static int display_init(void **data)
 {
        hal_backend_device_display_funcs *device_display_funcs;
 
-       device_display_funcs = calloc(1, sizeof(hal_backend_device_display_funcs));
+       if (!data) {
+               _E("Invalid parameter");
+               return -EINVAL;
+       }
+
+       device_display_funcs = *(hal_backend_device_display_funcs **) data;
        if (!device_display_funcs)
-               return -ENOMEM;
+               return -EINVAL;
 
        device_display_funcs->get_max_brightness = display_get_max_brightness;
        device_display_funcs->get_brightness = display_get_brightness;
        device_display_funcs->set_brightness = display_set_brightness;
 
-       *data = (void *)device_display_funcs;
-
        return 0;
 }
 
@@ -130,4 +133,6 @@ hal_backend EXPORT hal_backend_device_display_data = {
        .abi_version = HAL_ABI_VERSION_TIZEN_7_0,
        .init = display_init,
        .exit = display_exit,
+       .major_version = 1,
+       .minor_version = 0,
 };