diff --git a/hisysevent.yaml b/hisysevent.yaml index 35075e5433..acb6e573ec 100644 --- a/hisysevent.yaml +++ b/hisysevent.yaml @@ -59,4 +59,11 @@ RS_COMPOSITION_TIMEOUT: UID: {type: INT32, desc: RS_COMPOSITION_TIMEOUT the uid of current ability} BUNDLE_NAME: {type: STRING, desc: RS_COMPOSITION_TIMEOUT bundle name} ABILITY_NAME: {type: STRING, desc: RS_COMPOSITION_TIMEOUT ability name} - MSG: {type: STRING, desc: RS_COMPOSITION_TIMEOUT message} \ No newline at end of file + MSG: {type: STRING, desc: RS_COMPOSITION_TIMEOUT message} + +EPS_LCD_FREQ: + __BASE: {type: STATISTIC, level: MINOR, tag: PowerStats, desc: rs screen refresh rate change} + SOURCERATE: {type: INT32, desc: source refresh rate} + TARGETRATE: {type: INT32, desc: target refresh rate} + WIDTH: {type: INT32, desc: screen resolution width} + HEIGHT: {type: INT32, desc: screen resolution height} diff --git a/rosen/modules/render_service/BUILD.gn b/rosen/modules/render_service/BUILD.gn index 22c573d7a7..5ccabd7dfc 100644 --- a/rosen/modules/render_service/BUILD.gn +++ b/rosen/modules/render_service/BUILD.gn @@ -121,6 +121,7 @@ ohos_shared_library("librender_service") { "c_utils:utils", "eventhandler:libeventhandler", "hicollie_native:libhicollie", + "hisysevent_native:libhisysevent", "hitrace_native:hitrace_meter", "init:libbegetutil", "ipc:ipc_core", diff --git a/rosen/modules/render_service/core/screen_manager/rs_screen.cpp b/rosen/modules/render_service/core/screen_manager/rs_screen.cpp index f238279c37..88bfb1d4db 100644 --- a/rosen/modules/render_service/core/screen_manager/rs_screen.cpp +++ b/rosen/modules/render_service/core/screen_manager/rs_screen.cpp @@ -19,6 +19,7 @@ #include "platform/common/rs_log.h" #include "string_utils.h" +#include "hisysevent.h" namespace OHOS { namespace Rosen { @@ -169,6 +170,14 @@ void RSScreen::SetActiveMode(uint32_t modeId) if (activeMode) { width_ = activeMode->width; height_ = activeMode->height; + static GraphicDisplayModeInfo modeInfo; + if ((modeInfo.freshRate != activeMode->freshRate) + || modeInfo.width != activeMode->width || modeInfo.height != activeMode->height) { + HiSysEventWrite(HiSysEvent::Domain::GRAPHIC, "EPS_LCD_FREQ", + HiSysEvent::EventType::STATISTIC, "SOURCERATE", modeInfo.freshRate, + "TARGETRATE", activeMode->freshRate, "WIDTH", width_, "HEIGHT", height_); + modeInfo = activeMode.value(); + } } }