From 3ee8623e5ee97be34686620459063217ea95f936 Mon Sep 17 00:00:00 2001 From: Klein-CK Date: Sun, 25 Aug 2024 15:54:00 +0800 Subject: [PATCH] Optimized the NDK interface specification of DisplaySoloist. Signed-off-by: Klein-CK Change-Id: Ia48c33187d1b8bc3fbe6742b588a706b79e1b3c3 --- .../hyper_graphic_manager/native_display_soloist.h | 1 + .../core/native_display_soloist/native_display_soloist.cpp | 6 ++++++ .../src/pipeline/rs_render_display_sync.cpp | 5 +++++ 3 files changed, 12 insertions(+) diff --git a/interfaces/inner_api/hyper_graphic_manager/native_display_soloist.h b/interfaces/inner_api/hyper_graphic_manager/native_display_soloist.h index a71593b4eb..7a62c1168b 100644 --- a/interfaces/inner_api/hyper_graphic_manager/native_display_soloist.h +++ b/interfaces/inner_api/hyper_graphic_manager/native_display_soloist.h @@ -37,6 +37,7 @@ */ #include +#include #ifdef __cplusplus extern "C" { #endif diff --git a/rosen/modules/hyper_graphic_manager/core/native_display_soloist/native_display_soloist.cpp b/rosen/modules/hyper_graphic_manager/core/native_display_soloist/native_display_soloist.cpp index 42b1ef9f13..28f24b22e5 100644 --- a/rosen/modules/hyper_graphic_manager/core/native_display_soloist/native_display_soloist.cpp +++ b/rosen/modules/hyper_graphic_manager/core/native_display_soloist/native_display_soloist.cpp @@ -32,6 +32,7 @@ OH_DisplaySoloist* OH_DisplaySoloist_Create(bool useExclusiveThread) soloistManager.InsertUseExclusiveThreadFlag(soloistId->GetId(), useExclusiveThread); OH_DisplaySoloist* displaySoloist = new OH_DisplaySoloist({ soloistId }); + HGM_LOGI("[DisplaySoloist] Create DisplaySoloist SoloistId: %{public}d", soloistId->GetId()); return displaySoloist; } @@ -50,6 +51,7 @@ int32_t OH_DisplaySoloist_Destroy(OH_DisplaySoloist* displaySoloist) SoloistIdType soloistId = displaySoloist->soloistId_->GetId(); RSDisplaySoloistManager& soloistManager = RSDisplaySoloistManager::GetInstance(); soloistManager.RemoveSoloist(soloistId); + HGM_LOGI("[DisplaySoloist] Destroy DisplaySoloist SoloistId: %{public}d", soloistId); delete displaySoloist; displaySoloist = nullptr; @@ -73,6 +75,7 @@ int32_t OH_DisplaySoloist_Start(OH_DisplaySoloist* displaySoloist, RSDisplaySoloistManager& soloistManager = RSDisplaySoloistManager::GetInstance(); soloistManager.InsertOnVsyncCallback(soloistId, callback, data); soloistManager.Start(soloistId); + HGM_LOGI("[DisplaySoloist] Start DisplaySoloist SoloistId: %{public}d", soloistId); return EXEC_SUCCESS; } @@ -91,6 +94,7 @@ int32_t OH_DisplaySoloist_Stop(OH_DisplaySoloist* displaySoloist) SoloistIdType soloistId = displaySoloist->soloistId_->GetId(); RSDisplaySoloistManager& soloistManager = RSDisplaySoloistManager::GetInstance(); soloistManager.Stop(soloistId); + HGM_LOGI("[DisplaySoloist] Stop DisplaySoloist SoloistId: %{public}d", soloistId); return EXEC_SUCCESS; } @@ -116,5 +120,7 @@ int32_t OH_DisplaySoloist_SetExpectedFrameRateRange(OH_DisplaySoloist* displaySo SoloistIdType soloistId = displaySoloist->soloistId_->GetId(); RSDisplaySoloistManager& soloistManager = RSDisplaySoloistManager::GetInstance(); soloistManager.InsertFrameRateRange(soloistId, frameRateRange); + HGM_LOGI("[DisplaySoloist] SoloistId: %{public}d SetExpectedFrameRateRange{%{public}d, %{public}d, %{public}d}", + soloistId, frameRateRange.min_, frameRateRange.max_, frameRateRange.preferred_); return EXEC_SUCCESS; } diff --git a/rosen/modules/render_service_base/src/pipeline/rs_render_display_sync.cpp b/rosen/modules/render_service_base/src/pipeline/rs_render_display_sync.cpp index 2ddc20743f..2a88bfee1c 100644 --- a/rosen/modules/render_service_base/src/pipeline/rs_render_display_sync.cpp +++ b/rosen/modules/render_service_base/src/pipeline/rs_render_display_sync.cpp @@ -55,6 +55,9 @@ void RSRenderDisplaySync::SetExpectedFrameRateRange(const FrameRateRange& range) if (expectedFrameRateRange_ != range) { expectedFrameRateRange_ = range; isSkipCountUpdate_ = true; + RS_LOGI("[RenderAnimation] Id: %{public}" PRIu64 " SetExpectedFrameRateRange" + "{%{public}d, %{public}d, %{public}d}", GetId(), expectedFrameRateRange_.min_, + expectedFrameRateRange_.max_, expectedFrameRateRange_.preferred_); } } @@ -111,6 +114,8 @@ bool RSRenderDisplaySync::OnFrameSkip(uint64_t timestamp, int64_t period, bool i RS_OPTIONAL_TRACE_NAME_FMT( "RSRenderDisplaySync::OnFrameSkip preferred: [%d] currentPeroid: [%d] isFrameSkip:[%d]", expectedFrameRateRange_.preferred_, currentPeriod_, isFrameSkip); + RS_LOGD("[RenderAnimation] Id: %{public}" PRIu64 " preferred: %{public}d " + "isFrameSkip: %{public}d", GetId(), expectedFrameRateRange_.preferred_, isFrameSkip); return isFrameSkip; }