memory_flusher: Add flusher version check 33/315833/2
authorTaeHyeon Jeong <thyeon.jeong@samsung.com>
Wed, 7 Aug 2024 08:26:08 +0000 (17:26 +0900)
committerSooChan Lim <sc1.lim@samsung.com>
Wed, 21 Aug 2024 06:19:59 +0000 (06:19 +0000)
Change-Id: If33ac0dc8f0d6ec9edf9b6acdeb50a3e5a6494c1

include/libds-tizen/memory_flusher.h
src/memory_flusher/memory_flusher.c

index 0b72425..7a9ec2a 100644 (file)
@@ -42,6 +42,10 @@ void
 ds_tizen_memory_flusher_info_send_free_flush(
     struct ds_tizen_memory_flusher_info *info);
 
+bool
+ds_tizen_memory_flusher_info_supported_free_flush(
+    struct ds_tizen_memory_flusher_info *info);
+
 #ifdef __cplusplus
 }
 #endif
index 499e05d..5222687 100644 (file)
@@ -139,9 +139,22 @@ WL_EXPORT void
 ds_tizen_memory_flusher_info_send_free_flush(
     struct ds_tizen_memory_flusher_info *info)
 {
+    if (ds_tizen_memory_flusher_info_supported_free_flush(info))
+        return;
+
     tizen_surface_shm_flusher_send_free_flush(info->resource);
 }
 
+WL_EXPORT bool
+ds_tizen_memory_flusher_info_supported_free_flush(
+        struct ds_tizen_memory_flusher_info *info)
+{
+    if (wl_resource_get_version(info->resource) < TIZEN_SURFACE_SHM_FLUSHER_FREE_FLUSH_SINCE_VERSION)
+        return false;
+
+    return true;
+}
+
 static struct ds_tizen_memory_flusher_info *
 tizen_memory_flusher_client_find_info(struct ds_tizen_memory_flusher_client *client,
     struct ds_surface *surface)