Upgrade version to 1.3.268 accepted/tizen_unified accepted/tizen_unified_dev accepted/tizen_unified_toolchain accepted/tizen_unified_x tizen accepted/tizen/unified/20240219.160420 accepted/tizen/unified/dev/20240620.011154 accepted/tizen/unified/toolchain/20240311.065918 accepted/tizen/unified/x/20240220.150044
authorXuelian Bai <xuelian.bai@samsung.com>
Fri, 1 Sep 2023 06:25:10 +0000 (14:25 +0800)
committerXuelian Bai <xuelian.bai@samsung.com>
Tue, 30 Jan 2024 05:40:46 +0000 (13:40 +0800)
1. Add dlog for Tizen
2. Fix memory leak issue for generic list

Change-Id: Id1d95430af27e11bf76c83e3933475bf8eb6886d

loader/CMakeLists.txt
loader/loader.c
loader/log.c
packaging/vulkan-loader.spec

index c6366ee..7359177 100644 (file)
@@ -350,6 +350,11 @@ else()
                           PROPERTIES SOVERSION "1"
                           VERSION ${VULKAN_LOADER_VERSION})
     target_link_libraries(vulkan PRIVATE ${CMAKE_DL_LIBS} m Threads::Threads)
+    option(TIZEN_PLATFORM "If build for Tizen platform")
+    if (TIZEN_PLATFORM)
+        add_definitions(-DTIZEN_PLATFORM)
+        target_link_libraries(vulkan PRIVATE dlog)
+    endif()
 
     if (LOADER_ENABLE_ADDRESS_SANITIZER)
         target_compile_options(vulkan PUBLIC -fsanitize=address)
index 1a5f938..9eb6bc6 100644 (file)
@@ -714,8 +714,7 @@ VkResult loader_init_generic_list(const struct loader_instance *inst, struct loa
 }
 
 void loader_destroy_generic_list(const struct loader_instance *inst, struct loader_generic_list *list) {
-    if (list->count !=0)
-        loader_instance_heap_free(inst, list->list);
+    loader_instance_heap_free(inst, list->list);
     list->count = 0;
     list->capacity = 0;
     list->list = NULL;
index 2474317..2a4ab06 100644 (file)
 #include "loader_environment.h"
 #include "settings.h"
 #include "vk_loader_platform.h"
+#ifdef TIZEN_PLATFORM
+#include <dlog/dlog.h>
+#define LOG_TAG "VK_LOADER"
+#endif
 
 uint32_t g_loader_debug = 0;
 
@@ -230,6 +234,19 @@ void loader_log(const struct loader_instance *inst, VkFlags msg_type, int32_t ms
     OutputDebugString(msg);
     OutputDebugString("\n");
 #endif
+
+#ifdef TIZEN_PLATFORM
+       if ((msg_type & VULKAN_LOADER_ERROR_BIT) != 0) {
+        dlog_print(DLOG_ERROR, LOG_TAG, "%s %s\n", cmd_line_msg, msg);
+    } else if ((msg_type & VULKAN_LOADER_WARN_BIT) != 0) {
+        dlog_print(DLOG_WARN, LOG_TAG, "%s %s\n", cmd_line_msg, msg);
+    } else if ((msg_type & VULKAN_LOADER_INFO_BIT) != 0) {
+        dlog_print(DLOG_INFO, LOG_TAG, "%s %s\n", cmd_line_msg, msg);
+    } else if ((msg_type & VULKAN_LOADER_DEBUG_BIT) != 0) {
+        dlog_print(DLOG_DEBUG, LOG_TAG, "%s %s\n", cmd_line_msg, msg);
+    }
+#endif
+
 }
 
 void loader_log_asm_function_not_supported(const struct loader_instance *inst, VkFlags msg_type, int32_t msg_code,
index 27393bc..d1ab647 100644 (file)
@@ -1,5 +1,5 @@
 Name:      vulkan-loader
-Version:    1.3.240
+Version:    1.3.268
 Release:    0
 Summary:    Vulkan ICD loader
 Group:      Graphics & UI Framework/GL
@@ -14,6 +14,7 @@ BuildRequires:  pkgconfig(wayland-client)
 BuildRequires:  pkgconfig(wayland-cursor)
 BuildRequires:  pkgconfig(wayland-server)
 BuildRequires:  pkgconfig(wayland-egl)
+BuildRequires:  pkgconfig(dlog)
 
 %define BUILD_TYPE Debug
 
@@ -34,7 +35,7 @@ developing applications that use %{name}.
 %build
 cp %{SOURCE1001} .
 export CFLAGS="$CFLAGS -w"
-cmake -DCMAKE_BUILD_TYPE=%{BUILD_TYPE} -DBUILD_TESTS=OFF \
+cmake -DCMAKE_BUILD_TYPE=%{BUILD_TYPE} -DBUILD_TESTS=OFF -DTIZEN_PLATFORM=ON \
       -DBUILD_WSI_XLIB_SUPPORT=OFF -DBUILD_WSI_XCB_SUPPORT=OFF -DBUILD_WSI_WAYLAND_SUPPORT=ON \
       -DCMAKE_INSTALL_LIBDIR=%{_libdir} -DCMAKE_INSTALL_INCLUDEDIR=%{_includedir} -DCMAKE_INSTALL_DATADIR=%{_datadir}
 make
@@ -65,4 +66,4 @@ mkdir -p %{buildroot}%{_sysconfdir}/vulkan/{explicit,implicit}_layer.d/ \
 %files devel
 %{_libdir}/pkgconfig/vulkan.pc
 %{_libdir}/*.so
-
+%{_libdir}/cmake/*