From 035eee984600397aadde6f31e265416fa1041c12 Mon Sep 17 00:00:00 2001 From: "Eunki, Hong" Date: Wed, 17 Jan 2024 17:47:02 +0900 Subject: [PATCH] Add trace marker for some EGL CONTROLLER Render case Make trace don't wait sleep + Print more logs when we trace EGL Change-Id: Id4894c99c2c525c82b716625e52fc5e29a5cf00a Signed-off-by: Eunki, Hong --- .../common/combined-update-render-controller.cpp | 6 ++++-- .../graphics/gles-impl/egl-graphics-controller.cpp | 21 +++++++++++++++++++++ dali/internal/graphics/gles/gl-implementation.h | 10 +++++++++- 3 files changed, 34 insertions(+), 3 deletions(-) diff --git a/dali/internal/adaptor/common/combined-update-render-controller.cpp b/dali/internal/adaptor/common/combined-update-render-controller.cpp index b9598cc..48b7f25 100644 --- a/dali/internal/adaptor/common/combined-update-render-controller.cpp +++ b/dali/internal/adaptor/common/combined-update-render-controller.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Samsung Electronics Co., Ltd. + * Copyright (c) 2024 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -623,7 +623,7 @@ void CombinedUpdateRenderController::UpdateRenderThread() while(UpdateRenderReady(useElapsedTime, updateRequired, timeToSleepUntil)) { LOG_UPDATE_RENDER_TRACE; - TRACE_UPDATE_RENDER_SCOPE("DALI_UPDATE_RENDER"); + TRACE_UPDATE_RENDER_BEGIN("DALI_UPDATE_RENDER"); // For thread safe bool uploadOnly = mUploadWithoutRendering; @@ -909,6 +909,8 @@ void CombinedUpdateRenderController::UpdateRenderThread() } } + TRACE_UPDATE_RENDER_END("DALI_UPDATE_RENDER"); + // Render to FBO is intended to measure fps above 60 so sleep is not wanted. if(0u == renderToFboInterval) { diff --git a/dali/internal/graphics/gles-impl/egl-graphics-controller.cpp b/dali/internal/graphics/gles-impl/egl-graphics-controller.cpp index db7879c..d8b911b 100644 --- a/dali/internal/graphics/gles-impl/egl-graphics-controller.cpp +++ b/dali/internal/graphics/gles-impl/egl-graphics-controller.cpp @@ -18,6 +18,7 @@ #include // EXTERNAL INCLUDES +#include #include // INTERNAL INCLUDES @@ -128,6 +129,7 @@ T0* CastObject(T1* apiObject) // Maximum size of texture upload buffer. const uint32_t TEXTURE_UPLOAD_MAX_BUFER_SIZE_MB = 1; +DALI_INIT_TRACE_FILTER(gTraceFilter, DALI_TRACE_EGL, false); } // namespace EglGraphicsController::EglGraphicsController() @@ -435,6 +437,8 @@ void EglGraphicsController::AddFramebuffer(GLES::Framebuffer& framebuffer) void EglGraphicsController::ProcessDiscardQueues() { + DALI_TRACE_SCOPE(gTraceFilter, "DALI_EGL_CONTROLLER_DISCARD_QUEUE"); + // Process textures ProcessDiscardQueue(mDiscardTextureQueue); @@ -476,6 +480,7 @@ void EglGraphicsController::ProcessDiscardQueues() void EglGraphicsController::ProcessCreateQueues() { + DALI_TRACE_SCOPE(gTraceFilter, "DALI_EGL_CONTROLLER_CREATE_QUEUE"); // Process textures ProcessCreateQueue(mCreateTextureQueue); @@ -490,6 +495,11 @@ void EglGraphicsController::ProcessCommandBuffer(const GLES::CommandBuffer& comm { auto count = 0u; const auto commands = commandBuffer.GetCommands(count); + + DALI_TRACE_BEGIN_WITH_MESSAGE_GENERATOR(gTraceFilter, "DALI_EGL_CONTROLLER_PROCESS", [&](std::ostringstream& oss) { + oss << "[commandCount:" << count << "]"; + }); + for(auto i = 0u; i < count; ++i) { auto& cmd = commands[i]; @@ -702,6 +712,7 @@ void EglGraphicsController::ProcessCommandBuffer(const GLES::CommandBuffer& comm } } } + DALI_TRACE_END(gTraceFilter, "DALI_EGL_CONTROLLER_PROCESS"); } void EglGraphicsController::ProcessCommandQueues() @@ -721,6 +732,11 @@ void EglGraphicsController::ProcessCommandQueues() void EglGraphicsController::ProcessTextureUpdateQueue() { + if(mTextureUpdateRequests.empty()) + { + return; + } + DALI_TRACE_SCOPE(gTraceFilter, "DALI_EGL_CONTROLLER_TEXTURE_UPDATE"); while(!mTextureUpdateRequests.empty()) { TextureUpdateRequest& request = mTextureUpdateRequests.front(); @@ -933,6 +949,11 @@ void EglGraphicsController::UpdateTextures(const std::vector& void EglGraphicsController::ProcessTextureMipmapGenerationQueue() { + if(mTextureMipmapGenerationRequests.empty()) + { + return; + } + DALI_TRACE_SCOPE(gTraceFilter, "DALI_EGL_CONTROLLER_TEXTURE_MIPMAP"); while(!mTextureMipmapGenerationRequests.empty()) { auto* texture = mTextureMipmapGenerationRequests.front(); diff --git a/dali/internal/graphics/gles/gl-implementation.h b/dali/internal/graphics/gles/gl-implementation.h index 0a4b2e7..bf40d8c 100644 --- a/dali/internal/graphics/gles/gl-implementation.h +++ b/dali/internal/graphics/gles/gl-implementation.h @@ -2,7 +2,7 @@ #define DALI_INTERNAL_GL_IMPLEMENTATION_H /* - * Copyright (c) 2023 Samsung Electronics Co., Ltd. + * Copyright (c) 2024 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -556,12 +556,20 @@ public: void Finish(void) override { + START_DURATION_CHECK(); + glFinish(); + + FINISH_DURATION_CHECK("glFinish"); } void Flush(void) override { + START_DURATION_CHECK(); + glFlush(); + + FINISH_DURATION_CHECK("glFlush"); } void FramebufferRenderbuffer(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer) override -- 2.7.4