From 8b740adc853cccfe469615e218de94a8bdf6a1b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=87=AF?= Date: Tue, 15 Apr 2025 02:59:10 +0000 Subject: [PATCH 1/5] update services/ui/driver/fbdev_driver.cpp. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 陈凯 --- services/ui/driver/fbdev_driver.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/services/ui/driver/fbdev_driver.cpp b/services/ui/driver/fbdev_driver.cpp index 69efb293..34bca7c5 100644 --- a/services/ui/driver/fbdev_driver.cpp +++ b/services/ui/driver/fbdev_driver.cpp @@ -152,6 +152,11 @@ void FbdevDriver::RegisterBlankHook(FbBlankHook blankHook) blankHook_ = blankHook; } +void FbdevDriver::RegisterBrightnessHook(FbBrightnessHook brightnessHook_) +{ + brightnessHook_ = blankHook; +} + void FbdevDriver::ReleaseFb(const struct FbBufferObject *fbo) { /* @@ -175,6 +180,11 @@ bool FbdevDriver::FbPowerContrl(int fd, bool powerOn) LOG(ERROR) << "failed to set fb0 power " << powerOn; return false; } + if (brightnessHook_ != nullptr) { + if (!devPath_.empty()) { + brightnessHook_(devPath_, powerOn); + } + } return true; } } // namespace Updater -- Gitee From 717ce4d00724dcc9939d356e9c34c3576c5b0829 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=87=AF?= Date: Tue, 15 Apr 2025 03:03:55 +0000 Subject: [PATCH 2/5] update services/ui/driver/fbdev_driver.h. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 陈凯 --- services/ui/driver/fbdev_driver.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/services/ui/driver/fbdev_driver.h b/services/ui/driver/fbdev_driver.h index fdcf6e2f..2aa28642 100644 --- a/services/ui/driver/fbdev_driver.h +++ b/services/ui/driver/fbdev_driver.h @@ -34,6 +34,7 @@ struct FbBufferObject { class FbdevDriver : public GraphicDrv { DISALLOW_COPY_MOVE(FbdevDriver); using FbBlankHook = std::function; + using FbBrightnessHook = std::function; public: FbdevDriver() = default; ~FbdevDriver() override; @@ -44,6 +45,7 @@ public: void Exit(void) override; static void SetDevPath(const std::string &devPath); static void RegisterBlankHook(FbBlankHook blankHook); + static void RegisterBrightnessHook(FbBrightnessHook brightness); private: void FBLog() const; void ReleaseFb(const struct FbBufferObject *fbo); @@ -53,6 +55,7 @@ private: bool FbPowerContrl(int fd, bool powerOn); static inline std::string devPath_ = FB_DEV_PATH; static inline FbBlankHook blankHook_ {}; + static inline FbBrightnessHook brightnesskHook_ {}; }; } // namespace Updater #endif -- Gitee From c40f8cb27f25834b62fee18f0dfb5f1381eb0163 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=87=AF?= Date: Tue, 15 Apr 2025 03:07:33 +0000 Subject: [PATCH 3/5] update services/ui/driver/fbdev_driver.cpp. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 陈凯 --- services/ui/driver/fbdev_driver.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/services/ui/driver/fbdev_driver.cpp b/services/ui/driver/fbdev_driver.cpp index 34bca7c5..3a02aa74 100644 --- a/services/ui/driver/fbdev_driver.cpp +++ b/services/ui/driver/fbdev_driver.cpp @@ -152,9 +152,9 @@ void FbdevDriver::RegisterBlankHook(FbBlankHook blankHook) blankHook_ = blankHook; } -void FbdevDriver::RegisterBrightnessHook(FbBrightnessHook brightnessHook_) +void FbdevDriver::RegisterBrightnessHook(FbBrightnessHook brightness) { - brightnessHook_ = blankHook; + brightnessHook_ = brightness; } void FbdevDriver::ReleaseFb(const struct FbBufferObject *fbo) -- Gitee From 15f8eb22befbb9fd906ddcb4e1cc821d62e653f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=87=AF?= Date: Tue, 15 Apr 2025 03:09:26 +0000 Subject: [PATCH 4/5] update services/ui/driver/fbdev_driver.h. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 陈凯 --- services/ui/driver/fbdev_driver.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/ui/driver/fbdev_driver.h b/services/ui/driver/fbdev_driver.h index 2aa28642..fce0231e 100644 --- a/services/ui/driver/fbdev_driver.h +++ b/services/ui/driver/fbdev_driver.h @@ -55,7 +55,7 @@ private: bool FbPowerContrl(int fd, bool powerOn); static inline std::string devPath_ = FB_DEV_PATH; static inline FbBlankHook blankHook_ {}; - static inline FbBrightnessHook brightnesskHook_ {}; + static inline FbBrightnessHook brightnessHook_ {}; }; } // namespace Updater #endif -- Gitee From 6860950ee8003bae3aa34a1b6577114e7f9bfe17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=87=AF?= Date: Tue, 15 Apr 2025 05:57:38 +0000 Subject: [PATCH 5/5] update services/ui/driver/fbdev_driver.cpp. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 陈凯 --- services/ui/driver/fbdev_driver.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/services/ui/driver/fbdev_driver.cpp b/services/ui/driver/fbdev_driver.cpp index 3a02aa74..f89dd7c5 100644 --- a/services/ui/driver/fbdev_driver.cpp +++ b/services/ui/driver/fbdev_driver.cpp @@ -181,9 +181,7 @@ bool FbdevDriver::FbPowerContrl(int fd, bool powerOn) return false; } if (brightnessHook_ != nullptr) { - if (!devPath_.empty()) { - brightnessHook_(devPath_, powerOn); - } + brightnessHook_(devPath_, powerOn); } return true; } -- Gitee