"src/common/tv/wrt_profiler.h",
"src/common/tv/wrt_lib_wrapper.cc",
"src/common/tv/wrt_lib_wrapper.h",
+ "src/common/tv/wrt_thread_booster.cc",
+ "src/common/tv/wrt_thread_booster.h",
"src/renderer/tv/wrt_renderer_client_tv.cc",
"src/renderer/tv/wrt_renderer_client_tv.h",
]
return is_touch_support.value();
}
+bool IsLiteMemoryBoard() {
+ static absl::optional<bool> is_lite_memory_board;
+ if (is_lite_memory_board.has_value())
+ return is_lite_memory_board.value();
+
+ bool lite_memory = false;
+ if (SYSTEM_INFO_ERROR_NONE !=
+ system_info_get_custom_bool(
+ "com.samsung/featureconf/product.lite_memory.support",
+ &lite_memory)) {
+ LOG(ERROR) << "Fail to get system info: product.lite_memory.support";
+ }
+ LOG(INFO) << "lite_memory : " << lite_memory;
+ is_lite_memory_board = lite_memory;
+
+ return is_lite_memory_board.value();
+}
+
#endif
} // namespace wrt
bool IsMouseCursorSupportedModel();
bool IsDisplayRotatorSupported();
bool IsSensorSupported();
+bool IsLiteMemoryBoard();
#endif
} // namespace wrt
#include "wrt/src/common/tv/wrt_lib_wrapper.h"
#if defined(THREAD_BOOSTER_SERVICE)
-#include "services/thread_booster/public/cpp/thread_booster.h"
+#include "wrt/src/common/tv/wrt_thread_booster.h"
#endif
#if defined(TIZEN_PEPPER_EXTENSIONS)
void NativeWebRuntimeDelegateTV::BoostNetworkServiceThread() {
#if defined(THREAD_BOOSTER_SERVICE)
- if (GetCurrentSystemTime() > 120000)
+ if (GetCurrentSystemTime() > (IsLiteMemoryBoard() ? 500000 : 120000))
return;
LOG(INFO) << "boost NetworkService as RR";
- thread_booster::BoostThreadByName("NetworkService",
- thread_booster::MediaType::kAudioVideo,
- thread_booster::BoostingLevel::kRealtime);
+ WRT_thread_booster::GetInstance()->RegisterThreadByName("NetworkService");
#endif
}
#include "tizen_src/ewk/efl_integration/eweb_accessibility_util.h"
#endif
+#if defined(THREAD_BOOSTER_SERVICE)
+#include "wrt/src/common/tv/wrt_thread_booster.h"
+#endif
+
namespace discardable_memory {
class DiscardableSharedMemoryManager;
}
else
VisibilityChangedAsBackground();
+#if defined(THREAD_BOOSTER_SERVICE)
+ if (visible) {
+ WRT_thread_booster::GetInstance()->BoostUpRegisteredThreads();
+ } else {
+ WRT_thread_booster::GetInstance()->BoostDownRegisteredThreads();
+ }
+#endif
+
auto* extension_manager = XWalkExtensionManager::GetInstance();
extension_manager->NotifyWindowEvent("visibility", visibility_state_);
--- /dev/null
+// Copyright (c) 2024 Samsung Electronics Co., Ltd. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "wrt/src/common/tv/wrt_thread_booster.h"
+
+#include "boost-api.h"
+
+#include "base/logging.h"
+#include "base/synchronization/lock.h"
+
+namespace wrt {
+
+const unsigned int current_pid = getpid();
+boost_generic_info_t generic_info;
+base::Lock thread_list_lock;
+
+// static
+WRT_thread_booster* WRT_thread_booster::GetInstance() {
+ static WRT_thread_booster instance;
+ return &instance;
+}
+
+WRT_thread_booster::WRT_thread_booster() {
+ generic_info.parent.framework_type = BOOST_GENERIC;
+ generic_info.event = BOOST_GENERIC_EVENT_START;
+ generic_info.group = BOOST_CGROUP_NORMAL;
+ generic_info.sched = BOOST_API_SCHED_RR;
+ generic_info.boostingTimeMs = 0;
+}
+
+void WRT_thread_booster::RegisterThreadByName(std::string name) {
+ base::AutoLock lock(thread_list_lock);
+ LOG(INFO) << "register thread : " << name;
+ thread_list_.push_back(name);
+}
+
+void WRT_thread_booster::BoostUpRegisteredThreads() {
+ base::AutoLock lock(thread_list_lock);
+ generic_info.event = BOOST_GENERIC_EVENT_START;
+ LOG(INFO) << "boost up registered all thread!";
+ for (auto value : thread_list_) {
+ LOG(INFO) << "register boost up thread : " << value;
+ boost_request_by_thread_name(current_pid, value.c_str(),
+ (const boost_info_t *)&generic_info);
+ }
+}
+
+void WRT_thread_booster::BoostDownRegisteredThreads() {
+ base::AutoLock lock(thread_list_lock);
+ generic_info.event = BOOST_GENERIC_EVENT_STOP;
+ LOG(INFO) << "boost down registered all thread!";
+ for (auto value : thread_list_) {
+ boost_request_by_thread_name(current_pid, value.c_str(),
+ (const boost_info_t *)&generic_info);
+ LOG(INFO) << "register boost down thread : " << value;
+ }
+
+}
+
+} // namespace wrt
--- /dev/null
+// Copyright (c) 2024 Samsung Electronics Co., Ltd. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef COMMON_WRT_THREAD_BOOSTER_H_
+#define COMMON_WRT_THREAD_BOOSTER_H_
+
+#include <list>
+#include <string>
+
+namespace wrt {
+
+class WRT_thread_booster {
+ public:
+ static WRT_thread_booster* GetInstance();
+
+ void RegisterThreadByName(std::string name);
+ void BoostUpRegisteredThreads();
+ void BoostDownRegisteredThreads();
+
+
+ WRT_thread_booster();
+ ~WRT_thread_booster() = default;
+
+ private:
+ std::list<std::string> thread_list_;
+};
+
+} // namespace wrt
+
+#endif // COMMON_WRT_THREAD_BOOSTER_H_
\ No newline at end of file
#endif
#if defined(THREAD_BOOSTER_SERVICE)
-#include "services/thread_booster/public/cpp/thread_booster.h"
+#include "wrt/src/base/platform_info.h"
+#include "wrt/src/common/tv/wrt_thread_booster.h"
#endif
namespace wrt {
}
void BoosRendererThreads() {
- if (GetCurrentSystemTime() > 120000)
+ if (GetCurrentSystemTime() > (IsLiteMemoryBoard() ? 500000 : 120000))
return;
#if defined(THREAD_BOOSTER_SERVICE)
LOG(INFO) << "boost Renderer/GPU threads as RR";
- thread_booster::BoostThreadByName("Chrome_InProcRendererThread",
- thread_booster::MediaType::kAudioVideo,
- thread_booster::BoostingLevel::kRealtime);
-
- thread_booster::BoostThreadByName("Chrome_InProcGpuThread",
- thread_booster::MediaType::kAudioVideo,
- thread_booster::BoostingLevel::kRealtime);
+ WRT_thread_booster::GetInstance()->RegisterThreadByName("Chrome_InProcRe");
+ WRT_thread_booster::GetInstance()->RegisterThreadByName("Chrome_InProcGp");
+ if (IsLiteMemoryBoard()) {
+ LOG(INFO) << "boost Compositor threads as RR (LiteMemory Model)";
+ WRT_thread_booster::GetInstance()->RegisterThreadByName("VizCompositorTh");
+ WRT_thread_booster::GetInstance()->RegisterThreadByName("Compositor");
+ }
#endif
}