diff --git a/display_server/drivers/hal/base/BUILD.gn b/display_server/drivers/hal/base/BUILD.gn index 8f1fff9975fb13b225f0a29d9885c4487c9d9acc..1a67606345de74a86cfe5ad373a20e1881399c40 100644 --- a/display_server/drivers/hal/base/BUILD.gn +++ b/display_server/drivers/hal/base/BUILD.gn @@ -14,28 +14,28 @@ import("//build/gn/fangtian.gni") config("hal_base_public_config") { - include_dirs = [ + include_dirs = [ "./includes", - "./includes/event_loop" + "./includes/event_loop", ] } -ft_shared_library("hal_base") { +ft_shared_library("ft_event_loop") { sources = [ "./src/current_thread.cpp", - "./src/timestamp.cpp", "./src/event_loop/event_channel.cpp", "./src/event_loop/event_loop.cpp", "./src/event_loop/event_loop_thread.cpp", "./src/event_loop/event_poller.cpp", "./src/event_loop/timer.cpp", "./src/event_loop/timer_queue.cpp", + "./src/timestamp.cpp", ] public_configs = [ ":hal_base_public_config" ] public_deps = [ - "//build/gn/configs/system_libs:hilog", "//build/gn/configs/system_libs:c_utils", + "//build/gn/configs/system_libs:hilog", ] -} \ No newline at end of file +} diff --git a/display_server/drivers/hal/base/includes/current_thread.h b/display_server/drivers/hal/base/includes/current_thread.h index 95ba86a7c4e2633dbe6c4655768fb8ac302fe538..9626ef8e92928524d9cbdfe675983fd98c78160c 100644 --- a/display_server/drivers/hal/base/includes/current_thread.h +++ b/display_server/drivers/hal/base/includes/current_thread.h @@ -17,7 +17,7 @@ #include "types.h" -namespace oewm { +namespace FT { namespace CurrentThread { // Thread Local Storage struct TLS { @@ -53,4 +53,4 @@ inline const char *Name() const char *TidString(); const char *PidString(); } // namespace CurrentThread -} // namespace oewm +} // namespace FT diff --git a/display_server/drivers/hal/base/includes/event_loop/event_channel.h b/display_server/drivers/hal/base/includes/event_loop/event_channel.h index 363d1437971e6bcb8bd4367ddc904ecbbbdae5e9..622f5160c72e8237b14c03574b307590cfeac7ca 100644 --- a/display_server/drivers/hal/base/includes/event_loop/event_channel.h +++ b/display_server/drivers/hal/base/includes/event_loop/event_channel.h @@ -24,7 +24,7 @@ #include "noncopyable_hal.h" #include "timestamp.h" -namespace oewm { +namespace FT { using EventCallback = std::function; using ReadCallback = std::function; @@ -144,4 +144,4 @@ protected: std::weak_ptr ownerObj_; std::atomic tied_{false}; }; -} // namespace oewm +} // namespace FT diff --git a/display_server/drivers/hal/base/includes/event_loop/event_loop.h b/display_server/drivers/hal/base/includes/event_loop/event_loop.h index 4f01029c3cbecee8a59fbb0cb5fadfc5bcccc8f0..bb03b20ddae783436a998d0f386a5922775d5af9 100644 --- a/display_server/drivers/hal/base/includes/event_loop/event_loop.h +++ b/display_server/drivers/hal/base/includes/event_loop/event_loop.h @@ -21,7 +21,7 @@ #include "event_poller.h" #include "timer_queue.h" -namespace oewm { +namespace FT { using Functor = std::function; namespace detail { @@ -114,4 +114,4 @@ private: std::unique_ptr timerQueue_; }; -} // namespace oewm +} // namespace FT diff --git a/display_server/drivers/hal/base/includes/event_loop/event_loop_thread.h b/display_server/drivers/hal/base/includes/event_loop/event_loop_thread.h index 6121b0d1b169873038f119a03cd308eb778dd2c4..89d3e8ac586ae107bd9388ac5ec016b76566b28b 100644 --- a/display_server/drivers/hal/base/includes/event_loop/event_loop_thread.h +++ b/display_server/drivers/hal/base/includes/event_loop/event_loop_thread.h @@ -21,7 +21,7 @@ #include "event_loop.h" -namespace oewm { +namespace FT { class EventLoopThread : NonCopyable { public: EventLoopThread(); @@ -43,4 +43,4 @@ private: std::thread thread_; EventLoop *loop_ = nullptr; }; -} // namespace oewm +} // namespace FT diff --git a/display_server/drivers/hal/base/includes/event_loop/event_poller.h b/display_server/drivers/hal/base/includes/event_loop/event_poller.h index 6342ffbb0be577f1c9483d1f983b6d82c5ebc7fa..3ac2e4cf31013232b355034592a264ea73763243 100644 --- a/display_server/drivers/hal/base/includes/event_loop/event_poller.h +++ b/display_server/drivers/hal/base/includes/event_loop/event_poller.h @@ -21,7 +21,7 @@ #include "unique_fd.h" #include "event_channel.h" -namespace oewm { +namespace FT { class EventLoop; class EventPoller : NonCopyable { @@ -43,4 +43,4 @@ private: std::vector activeEvents_; // to receive events from epoll_wait. std::unordered_map channels_; }; -} // namespace oewm +} // namespace FT diff --git a/display_server/drivers/hal/base/includes/event_loop/timer.h b/display_server/drivers/hal/base/includes/event_loop/timer.h index 564c7c7a41b98946f6cb51dbf43d6021de37207d..56934d34db01e11d97403002c250e95ab375c174 100644 --- a/display_server/drivers/hal/base/includes/event_loop/timer.h +++ b/display_server/drivers/hal/base/includes/event_loop/timer.h @@ -20,7 +20,7 @@ #include "noncopyable_hal.h" #include "timestamp.h" -namespace oewm { +namespace FT { class Timer; // NonCopyable @@ -87,12 +87,12 @@ private: bool repeat_ = false; TimerId id_; }; -} // namespace oewm +} // namespace FT namespace std { template <> -struct hash { - std::size_t operator()(oewm::TimerId timerId) const +struct hash { + std::size_t operator()(FT::TimerId timerId) const { return static_cast(timerId.id ^ reinterpret_cast(timerId.timer)); } diff --git a/display_server/drivers/hal/base/includes/event_loop/timer_queue.h b/display_server/drivers/hal/base/includes/event_loop/timer_queue.h index bc64de5c88c75c846253211ddd9cc007c9439519..43c95bc0a837f4a520b159da87d01814c9060ebf 100644 --- a/display_server/drivers/hal/base/includes/event_loop/timer_queue.h +++ b/display_server/drivers/hal/base/includes/event_loop/timer_queue.h @@ -23,7 +23,7 @@ #include "event_channel.h" #include "timer.h" -namespace oewm { +namespace FT { class EventLoop; using TimerPtr = std::unique_ptr; @@ -64,4 +64,4 @@ private: TimerMap timers_; TimerEntrySet timerEntries_; }; -} // namespace oewm +} // namespace FT diff --git a/display_server/drivers/hal/base/includes/noncopyable_hal.h b/display_server/drivers/hal/base/includes/noncopyable_hal.h index bce0c5ba669461edcefc712bed95cef16dc9d9da..06acc818f1b598f0be8b85a591706e516422efa7 100644 --- a/display_server/drivers/hal/base/includes/noncopyable_hal.h +++ b/display_server/drivers/hal/base/includes/noncopyable_hal.h @@ -15,7 +15,7 @@ #pragma once -namespace oewm { +namespace FT { class NonCopyable { public: NonCopyable(const NonCopyable &other) = delete; @@ -25,4 +25,4 @@ protected: NonCopyable() = default; ~NonCopyable() = default; }; -} // namespace oewm +} // namespace FT diff --git a/display_server/drivers/hal/base/includes/timestamp.h b/display_server/drivers/hal/base/includes/timestamp.h index 1c533f841726a08f25095da13f7c5f8ae0b701c7..96904f8c8d220d8de5386c1df32691bf27c829ff 100644 --- a/display_server/drivers/hal/base/includes/timestamp.h +++ b/display_server/drivers/hal/base/includes/timestamp.h @@ -17,7 +17,7 @@ #include "types.h" -namespace oewm { +namespace FT { constexpr int MILLI_SECS_PER_SECOND = 1000; constexpr int MICRO_SECS_PER_MILLISECOND = 1000; constexpr int MICRO_SECS_PER_SECOND = MICRO_SECS_PER_MILLISECOND * MILLI_SECS_PER_SECOND; @@ -114,4 +114,4 @@ inline TimeStamp TimeAdd(TimeStamp t, TimeType micros) { return TimeStamp(t.Micros() + micros); } -} // namespace oewm +} // namespace FT diff --git a/display_server/drivers/hal/base/includes/types.h b/display_server/drivers/hal/base/includes/types.h index 6113bc608cbc7b05607217b6b7c21b4892500ff1..5361fa65ecd1c214a64fe98e1725320c2e8b09c6 100644 --- a/display_server/drivers/hal/base/includes/types.h +++ b/display_server/drivers/hal/base/includes/types.h @@ -37,7 +37,7 @@ #define OE_UNLIKELY(x) (__builtin_expect(!!(x), 0)) #endif -namespace oewm { +namespace FT { template inline constexpr typename std::underlying_type::type ECast(EnumType e) { @@ -156,4 +156,4 @@ inline size_t HashCombine(const Args &...args) (HashCombineOne(hash, args), ...); return hash; } -} // namespace oewm +} // namespace FT diff --git a/display_server/drivers/hal/base/src/current_thread.cpp b/display_server/drivers/hal/base/src/current_thread.cpp index 6105fc4e0a154f41848eb6fac408245906ca4bcb..ab9cc5665678c2ee4ae2789cf4fad01dab258b9a 100644 --- a/display_server/drivers/hal/base/src/current_thread.cpp +++ b/display_server/drivers/hal/base/src/current_thread.cpp @@ -18,7 +18,7 @@ #include #include -namespace oewm { +namespace FT { namespace detail { static ProcessId pid = 0; static char pidString[16]; @@ -76,4 +76,4 @@ const char *PidString() return detail::pidString; } } // namespace CurrentThread -} // namespace oewm +} // namespace FT diff --git a/display_server/drivers/hal/base/src/event_loop/BUILD.gn b/display_server/drivers/hal/base/src/event_loop/BUILD.gn index e58135b1df4996385d7482a0bafa8a75c9ad951a..07e404ef4626b55271a47cb425ef3c03819d0c5f 100644 --- a/display_server/drivers/hal/base/src/event_loop/BUILD.gn +++ b/display_server/drivers/hal/base/src/event_loop/BUILD.gn @@ -1,5 +1,5 @@ # -# Copyright (c) 2022 Huawei Technologies Co., Ltd. +# Copyright (c) 2023 Huawei Technologies Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at @@ -11,6 +11,7 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. + import("//build/gn/fangtian.gni") ft_shared_library("hal_event_loop") { @@ -23,7 +24,5 @@ ft_shared_library("hal_event_loop") { "timer_queue.cpp", ] configs = [ "//display_server/drivers/hal:hal_public_config" ] - public_deps = [ - "//display_server/drivers/hal/base:hal_base", - ] + public_deps = [ "//display_server/drivers/hal/base:ft_event_loop" ] } diff --git a/display_server/drivers/hal/base/src/event_loop/event_channel.cpp b/display_server/drivers/hal/base/src/event_loop/event_channel.cpp index f8486fe34a09aacedeefd51d3a9171ea6eff06db..461f20e34899f162752a82e04a77c7a91176ba1d 100644 --- a/display_server/drivers/hal/base/src/event_loop/event_channel.cpp +++ b/display_server/drivers/hal/base/src/event_loop/event_channel.cpp @@ -18,7 +18,7 @@ #include "event_loop.h" #include "log.h" -namespace oewm { +namespace FT { EventChannel::EventChannel(int fd, EventLoop *eventLoop) : fd_(fd), eventLoop_(eventLoop) { if (eventLoop_ == nullptr) { @@ -145,4 +145,4 @@ void EventChannel::HandleEventInner(TimeStamp receivedTime) } } } -} // namespace oewm +} // namespace FT diff --git a/display_server/drivers/hal/base/src/event_loop/event_loop.cpp b/display_server/drivers/hal/base/src/event_loop/event_loop.cpp index e9b66c9158ccde5cb5e4025302c6f5619b81996a..c853f5ada34b7aa1c9c3c34c6e3f74ccc3387f37 100644 --- a/display_server/drivers/hal/base/src/event_loop/event_loop.cpp +++ b/display_server/drivers/hal/base/src/event_loop/event_loop.cpp @@ -21,7 +21,7 @@ #include "current_thread.h" #include "log.h" -namespace oewm { +namespace FT { namespace detail { int CreateEventFdOrDie() { @@ -204,4 +204,4 @@ EventLoop *EventLoop::EventLoopOfCurrThread() { return t_currLoop; } -} // namespace oewm +} // namespace FT diff --git a/display_server/drivers/hal/base/src/event_loop/event_loop_thread.cpp b/display_server/drivers/hal/base/src/event_loop/event_loop_thread.cpp index e52dfb27888676d0840f28b6f333bee1b927621b..dd1175c93492c2f8b5100caf5b06af886d1ebd47 100644 --- a/display_server/drivers/hal/base/src/event_loop/event_loop_thread.cpp +++ b/display_server/drivers/hal/base/src/event_loop/event_loop_thread.cpp @@ -17,7 +17,7 @@ #include "log.h" -namespace oewm { +namespace FT { EventLoopThread::EventLoopThread() : EventLoopThread("OEWMEventLoopThread") {} EventLoopThread::EventLoopThread(std::string name) : name_(std::move(name)) {} @@ -64,4 +64,4 @@ void EventLoopThread::LoopThreadFunc() loop_ = nullptr; } } -} // namespace oewm +} // namespace FT diff --git a/display_server/drivers/hal/base/src/event_loop/event_poller.cpp b/display_server/drivers/hal/base/src/event_loop/event_poller.cpp index 5c055bc820b2522cd2a4b1feeeb9cdb6af817633..8d98c705aff9dd5eda8d1c76a38de06c81ff20a3 100644 --- a/display_server/drivers/hal/base/src/event_loop/event_poller.cpp +++ b/display_server/drivers/hal/base/src/event_loop/event_poller.cpp @@ -20,7 +20,7 @@ #include "log.h" -namespace oewm { +namespace FT { namespace detail { std::string EpollOperationToString(int operation) { @@ -93,7 +93,7 @@ void EventPoller::EpollCtl(EventChannel *channel, int operation) epollEvent.data.fd = fd; int ret = TEMP_FAILURE_RETRY(::epoll_ctl(epollFd_.Get(), operation, fd, &epollEvent)); if (ret < 0) { - LOG_ERROR("%{public}s failed for EventPoller(fd: %{public}i): %{public}s.", + LOG_ERROR("%{public}s failed for EventPoller(fd: %{public}i): %{public}s.", detail::EpollOperationToString(operation).c_str(), fd, ErrnoToString(errno).c_str()); } } @@ -134,4 +134,4 @@ void EventPoller::RemoveChannel(int fd) EpollCtl(channels_[fd], EPOLL_CTL_DEL); channels_.erase(fd); } -} // namespace oewm +} // namespace FT diff --git a/display_server/drivers/hal/base/src/event_loop/timer.cpp b/display_server/drivers/hal/base/src/event_loop/timer.cpp index 71d59aff97dc6e923a36be419b4fa3884ec12e59..9c28a49ec253807c6c24911e25967a4afd2734eb 100644 --- a/display_server/drivers/hal/base/src/event_loop/timer.cpp +++ b/display_server/drivers/hal/base/src/event_loop/timer.cpp @@ -17,7 +17,7 @@ #include -namespace oewm { +namespace FT { namespace detail { uint64_t GenSequenceId() { @@ -46,4 +46,4 @@ void Timer::Restart(TimeStamp now) ASSERT(IsRepeat()); expireTime_ = TimeAdd(now, interval_); } -} // namespace oewm +} // namespace FT diff --git a/display_server/drivers/hal/base/src/event_loop/timer_queue.cpp b/display_server/drivers/hal/base/src/event_loop/timer_queue.cpp index aaab9c850abb162080f5b3eb21fb525828e10487..b64c1b8d2b1b68075c437e9811d261864a7ed4a5 100644 --- a/display_server/drivers/hal/base/src/event_loop/timer_queue.cpp +++ b/display_server/drivers/hal/base/src/event_loop/timer_queue.cpp @@ -20,7 +20,7 @@ #include "event_loop.h" #include "log.h" -namespace oewm { +namespace FT { namespace detail { int CreateTimerFd() { @@ -181,4 +181,4 @@ void TimerQueue::TimerFdReset(TimeStamp expireTime) LOG_FATAL("TimerFd set time error: %{public}s", ErrnoToString(errno).c_str()); } } -} // namespace oewm +} // namespace FT diff --git a/display_server/drivers/hal/base/src/timestamp.cpp b/display_server/drivers/hal/base/src/timestamp.cpp index 1104417e3f677fffd5dfb85be40a80f4c7d34d3c..113721839142cdc3a7fa719f6c0bd7616ff67707 100644 --- a/display_server/drivers/hal/base/src/timestamp.cpp +++ b/display_server/drivers/hal/base/src/timestamp.cpp @@ -19,7 +19,7 @@ #include #include -namespace oewm { +namespace FT { namespace detail { // Class std::chrono::steady_clock represents a monotonic clock. The time points of this clock cannot decrease as // physical time moves forward and the time between ticks of this clock is constant. This clock is not related to wall @@ -106,4 +106,4 @@ std::string TimeStamp::ToFormattedString(TimePrecision precision) const noexcept return ss.str(); } -} // namespace oewm +} // namespace FT diff --git a/display_server/drivers/hal/drm_backend/display_device/BUILD.gn b/display_server/drivers/hal/drm_backend/display_device/BUILD.gn index 44acd008ed796344e6925a1634842558f10fa603..136cadd0f9110c29b6f7f5502a956053f2e6607b 100644 --- a/display_server/drivers/hal/drm_backend/display_device/BUILD.gn +++ b/display_server/drivers/hal/drm_backend/display_device/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2022 Huawei Technologies Co., Ltd. +# Copyright (c) 2023 Huawei Technologies Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at @@ -10,6 +10,7 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. + import("//build/gn/fangtian.gni") config("display_device_public_config") { @@ -42,18 +43,16 @@ ft_shared_library("display_device") { ] configs = [ "//display_server/drivers/hal:hal_public_config" ] - public_configs = [ + public_configs = [ ":display_device_public_config", - "//display_server/drivers/hal/drm_backend:import_system_gbm_config" + "//display_server/drivers/hal/drm_backend:import_system_gbm_config", ] - public_deps = [ + public_deps = [ + "//display_server/drivers/hal/base:ft_event_loop", "//display_server/drivers/hal/drm_backend:display_drm_dep", - "//display_server/drivers/hal/base:hal_base", "//display_server/utils/sync_fence/ft_build:sync_fence", ] - deps = [ - "//build/gn/configs/system_libs:ipc_core", - ] + deps = [ "//build/gn/configs/system_libs:ipc_core" ] } diff --git a/display_server/drivers/hal/drm_backend/display_device/device_event_monitor.cpp b/display_server/drivers/hal/drm_backend/display_device/device_event_monitor.cpp index 68037ab993945fde4d9d7ad796c07175bbaf63e9..c16df20305fe50f1afe89c5f3313c5e3f83971b5 100644 --- a/display_server/drivers/hal/drm_backend/display_device/device_event_monitor.cpp +++ b/display_server/drivers/hal/drm_backend/display_device/device_event_monitor.cpp @@ -19,7 +19,7 @@ #include "hdi_display.h" #include "log.h" -namespace oewm { +namespace FT { namespace HDI { namespace DISPLAY { namespace detail { @@ -183,7 +183,7 @@ void DeviceEventMonitor::RegisterVsyncEventHandler() } else { #endif // ENABLE_HARDWARE_VSYNC // use soft vsync. - softVsyncTimer_ = loop_->RunEvery([this]() { + softVsyncTimer_ = loop_->RunEvery([this]() { TimeStamp timestamp(TimeDiff(TimeStamp::Now(), TimeStamp::SystemStartTime())); OnSoftVsyncEvent(timestamp); }, softVsyncPeriod_); @@ -218,4 +218,4 @@ bool DeviceEventMonitor::Init() } } // namespace DISPLAY } // namespace HDI -} // namespace oewm +} // namespace FT diff --git a/display_server/drivers/hal/drm_backend/display_device/device_event_monitor.h b/display_server/drivers/hal/drm_backend/display_device/device_event_monitor.h index 1da7a03c8e3ffb07c6dd35cb4def8473cda545eb..8c76fcf851030f9e8aac7a1c41d2d2379968efc2 100644 --- a/display_server/drivers/hal/drm_backend/display_device/device_event_monitor.h +++ b/display_server/drivers/hal/drm_backend/display_device/device_event_monitor.h @@ -20,7 +20,7 @@ #include "event_loop/event_loop_thread.h" #include "udev_object_helper.h" -namespace oewm { +namespace FT { namespace HDI { namespace DISPLAY { class DeviceEventMonitor : NonCopyable { @@ -83,4 +83,4 @@ private: }; } // namespace DISPLAY } // namespace HDI -} // namespace oewm +} // namespace FT diff --git a/display_server/drivers/hal/drm_backend/display_device/drm_atomic_committer.cpp b/display_server/drivers/hal/drm_backend/display_device/drm_atomic_committer.cpp index 0c8adf4d778ff6179508c7f3f1ec58b2b6b79eee..bcea384ff99ae044f204676d8b80457445c4e0c1 100644 --- a/display_server/drivers/hal/drm_backend/display_device/drm_atomic_committer.cpp +++ b/display_server/drivers/hal/drm_backend/display_device/drm_atomic_committer.cpp @@ -18,7 +18,7 @@ #include "drm_display.h" #include "log.h" -namespace oewm { +namespace FT { namespace drm { DrmAtomicCommitter::DrmAtomicCommitter(int drmFd, int flags, void *userData) : drmFd_(drmFd), req_(drmModeAtomicAlloc()), flags_(flags), userData_(userData) @@ -51,4 +51,4 @@ void DrmAtomicCommitter::Commit() } } } // namespace drm -} // namespace oewm +} // namespace FT diff --git a/display_server/drivers/hal/drm_backend/display_device/drm_atomic_committer.h b/display_server/drivers/hal/drm_backend/display_device/drm_atomic_committer.h index a2c467e6352164ef4c2c9ef87c9665783b289330..16f215449d050eaa85ee5979a0c4013c37b7e089 100644 --- a/display_server/drivers/hal/drm_backend/display_device/drm_atomic_committer.h +++ b/display_server/drivers/hal/drm_backend/display_device/drm_atomic_committer.h @@ -17,7 +17,7 @@ #include "drm_common.h" -namespace oewm { +namespace FT { namespace drm { // RAII object for drm auto atomic committing. class DrmAtomicCommitter : NonCopyable { @@ -38,4 +38,4 @@ private: void *userData_ = nullptr; }; } // namespace drm -} // namespace oewm \ No newline at end of file +} // namespace FT \ No newline at end of file diff --git a/display_server/drivers/hal/drm_backend/display_device/drm_common.h b/display_server/drivers/hal/drm_backend/display_device/drm_common.h index 3638d6058aa115fde3ad348505786cee43c1d61a..7b63053c6ed27df1299bd2a37aa7981f66ff2770 100644 --- a/display_server/drivers/hal/drm_backend/display_device/drm_common.h +++ b/display_server/drivers/hal/drm_backend/display_device/drm_common.h @@ -23,7 +23,7 @@ #include "noncopyable_hal.h" #include "types.h" -namespace oewm { +namespace FT { namespace drm { constexpr uint32_t DRM_INVALID_OBJECT_ID = 0; constexpr uint32_t DRM_INVALID_OBJECT_TYPE = 0; @@ -65,4 +65,4 @@ inline std::string ObjInfoDump(uint32_t objId, uint32_t objType) return "DrmObject [id: " + std::to_string(objId) + ", type: " + DrmObjTypeToString(objType) + "]"; } } // namespace drm -} // namespace oewm +} // namespace FT diff --git a/display_server/drivers/hal/drm_backend/display_device/drm_connector.cpp b/display_server/drivers/hal/drm_backend/display_device/drm_connector.cpp index 7c7c593a26a6cc9ae3a94d557b44931c0774ba5b..5c169a34c66438e195dedee30f0b9a9efc9ff57a 100644 --- a/display_server/drivers/hal/drm_backend/display_device/drm_connector.cpp +++ b/display_server/drivers/hal/drm_backend/display_device/drm_connector.cpp @@ -20,7 +20,7 @@ #include "log.h" #include "drm_property.h" -namespace oewm { +namespace FT { namespace drm { DrmConnector::DrmConnector(int drmFd, uint32_t connectorId) : drmFd_(drmFd), id_(connectorId) { @@ -226,4 +226,4 @@ bool DrmConnector::SetBrightness(uint64_t brightness) return true; } } // namespace drm -} // namespace oewm +} // namespace FT diff --git a/display_server/drivers/hal/drm_backend/display_device/drm_connector.h b/display_server/drivers/hal/drm_backend/display_device/drm_connector.h index d9a511b9bbe18946516bff2df961c88f933c6ebc..a611429c1e388a9de20e1845500a4ffd633b7391 100644 --- a/display_server/drivers/hal/drm_backend/display_device/drm_connector.h +++ b/display_server/drivers/hal/drm_backend/display_device/drm_connector.h @@ -23,7 +23,7 @@ #include "drm_encoder.h" #include "drm_crtc.h" -namespace oewm { +namespace FT { namespace drm { // prop for connector constexpr char PROP_CRTCID[] = "CRTC_ID"; @@ -150,4 +150,4 @@ private: uint32_t activeModeId_ = -1; }; } // namespace drm -} // namespace oewm +} // namespace FT diff --git a/display_server/drivers/hal/drm_backend/display_device/drm_crtc.cpp b/display_server/drivers/hal/drm_backend/display_device/drm_crtc.cpp index b1099cd77ca6cced5f08de9fe0b4fe657e61076b..ed31bfb28ba864dd09411c068620fd89348875d4 100644 --- a/display_server/drivers/hal/drm_backend/display_device/drm_crtc.cpp +++ b/display_server/drivers/hal/drm_backend/display_device/drm_crtc.cpp @@ -19,7 +19,7 @@ #include "log.h" #include "drm_property.h" -namespace oewm { +namespace FT { namespace drm { DrmCrtc::DrmCrtc(int drmFd, uint32_t crtcId, uint32_t pipe) : drmFd_(drmFd), id_(crtcId), pipe_(pipe) { @@ -67,4 +67,4 @@ void DrmCrtc::ParseFrom(drmModeCrtcPtr const &crtc) outFencePropId_ = crtcPropFetcher.GetPropId(PROP_OUTFENCE); } } // namespace drm -} // namespace oewm +} // namespace FT diff --git a/display_server/drivers/hal/drm_backend/display_device/drm_crtc.h b/display_server/drivers/hal/drm_backend/display_device/drm_crtc.h index 82c76348294ce317d7bbb521692cbcea9d315917..ed0a8f59499a53d8fc0fd4b52ea02aed9655ef8c 100644 --- a/display_server/drivers/hal/drm_backend/display_device/drm_crtc.h +++ b/display_server/drivers/hal/drm_backend/display_device/drm_crtc.h @@ -20,7 +20,7 @@ #include "drm_property.h" #include "hdi_display.h" -namespace oewm { +namespace FT { namespace drm { // prop for crtc constexpr char PROP_MODEID[] = "MODE_ID"; @@ -78,4 +78,4 @@ private: uint32_t pipe_ = 0; }; } // namespace drm -} // namespace oewm +} // namespace FT diff --git a/display_server/drivers/hal/drm_backend/display_device/drm_device.cpp b/display_server/drivers/hal/drm_backend/display_device/drm_device.cpp index 327b6e6d3b985693f4f536ddc72ba381cbf2d6a3..b75fc55d8e3ea36a48cc4a7503f101d9e4c2f8cb 100644 --- a/display_server/drivers/hal/drm_backend/display_device/drm_device.cpp +++ b/display_server/drivers/hal/drm_backend/display_device/drm_device.cpp @@ -21,7 +21,7 @@ #include "drm_display.h" #include "log.h" -namespace oewm { +namespace FT { namespace drm { std::shared_ptr DrmDevice::Create(std::string devicePath) { @@ -103,14 +103,14 @@ bool DrmDevice::InitKmsCaps() ret = drmSetClientCap(fd_, DRM_CLIENT_CAP_UNIVERSAL_PLANES, 1); if (ret) { - LOG_ERROR("%{public}s DRM KMS doesn't support universal planes! error: %{public}s", + LOG_ERROR("%{public}s DRM KMS doesn't support universal planes! error: %{public}s", devicePath_.c_str(), ErrnoToString(errno).c_str()); return false; } ret = drmGetCap(fd_, DRM_CAP_DUMB_BUFFER, &cap); if (ret != 0 || cap == 0) { - LOG_ERROR("%{public}s DRM KMS doesn't support dumb buffers! error: %{public}s", + LOG_ERROR("%{public}s DRM KMS doesn't support dumb buffers! error: %{public}s", devicePath_.c_str(), ErrnoToString(errno).c_str()); } supportDumbBuffer_ = (cap != 0); @@ -241,14 +241,14 @@ void DrmDevice::DiscoveryDisplays() for (int i = 0; i != drmResource_->count_connectors; ++i) { auto connectorId = drmResource_->connectors[i]; if (connectors_.count(connectorId) == 0) { - LOG_ERROR("DrmDevice::DiscoveryDisplays: unexpected error: can not find connector for conId %{public}" PRIu32 ".", + LOG_ERROR("DrmDevice::DiscoveryDisplays: unexpected error: can not find connector for conId %{public}" PRIu32 ".", connectorId); continue; } const auto &connector = connectors_.at(connectorId); if (!connector->Connected()) { - LOG_INFO("DrmDevice::DiscoveryDisplays: ignore unused connector %{public}" PRIu32 ".", + LOG_INFO("DrmDevice::DiscoveryDisplays: ignore unused connector %{public}" PRIu32 ".", connectorId); continue; } @@ -262,4 +262,4 @@ void DrmDevice::DiscoveryDisplays() } } } // namespace drm -} // namespace oewm +} // namespace FT diff --git a/display_server/drivers/hal/drm_backend/display_device/drm_device.h b/display_server/drivers/hal/drm_backend/display_device/drm_device.h index bb1365d67f8e8b3dc13c45edc0a92a2d817ca81e..e3ac8b2db4eaab53edafaae642f22cfe6dbeda7a 100644 --- a/display_server/drivers/hal/drm_backend/display_device/drm_device.h +++ b/display_server/drivers/hal/drm_backend/display_device/drm_device.h @@ -29,7 +29,7 @@ #include "drm_encoder.h" #include "drm_plane.h" -namespace oewm { +namespace FT { namespace drm { class DrmDevice : private NonCopyable { public: @@ -153,4 +153,4 @@ private: IdMapPtr displays_; // guarded by mutex_; }; } // namespace drm -} // namespace oewm +} // namespace FT diff --git a/display_server/drivers/hal/drm_backend/display_device/drm_display.cpp b/display_server/drivers/hal/drm_backend/display_device/drm_display.cpp index 1f8be31328285540cb0ebd4d3ef4ceca585de6ed..51e9d597682dd16fb4605fbdb1b714efccbcaaef 100644 --- a/display_server/drivers/hal/drm_backend/display_device/drm_display.cpp +++ b/display_server/drivers/hal/drm_backend/display_device/drm_display.cpp @@ -21,7 +21,7 @@ #include "hdi_session.h" -namespace oewm { +namespace FT { namespace drm { DrmDisplay::DrmDisplay( int drmFd, @@ -197,7 +197,7 @@ bool DrmDisplay::IsConnected() void DrmDisplay::InitReservedFb() { - const auto &displayDevice = oewm::HDI::DISPLAY::HdiSession::GetInstance().GetDisplayDevice(); + const auto &displayDevice = FT::HDI::DISPLAY::HdiSession::GetInstance().GetDisplayDevice(); ASSERT(displayDevice != nullptr); auto modeId = connector_->GetActiveModeId(); @@ -234,7 +234,7 @@ int32_t DrmDisplay::RegDisplayVBlankCallback(VBlankCallback cb, void *data) return DISPLAY_FAILURE; } - const auto &displayDevice = oewm::HDI::DISPLAY::HdiSession::GetInstance().GetDisplayDevice(); + const auto &displayDevice = FT::HDI::DISPLAY::HdiSession::GetInstance().GetDisplayDevice(); ASSERT(displayDevice != nullptr); int fenceFd = INVALID_FD; @@ -360,7 +360,7 @@ int32_t DrmDisplay::SetDisplayClientBuffer(const BufferHandle *buffer, int32_t f int32_t DrmDisplay::PrepareDisplayLayers(bool *needFlushFb) { changeLayers_.clear(); - std::vector layers; + std::vector layers; for (auto &[layerId, layer] : layers_) { UNUSED(layerId); layers.push_back(layer.get()); @@ -368,7 +368,7 @@ int32_t DrmDisplay::PrepareDisplayLayers(bool *needFlushFb) sort( layers.begin(), layers.end(), - [](const oewm::HDI::DISPLAY::HdiLayer *lhs, const oewm::HDI::DISPLAY::HdiLayer *rhs) { + [](const FT::HDI::DISPLAY::HdiLayer *lhs, const FT::HDI::DISPLAY::HdiLayer *rhs) { return lhs->GetZOrder() < rhs->GetZOrder(); }); // sort by Zorder for (auto &layer : layers) { @@ -404,7 +404,7 @@ int32_t DrmDisplay::GetDisplayCompChange(uint32_t *num, uint32_t *layers, int32_ if (layers != nullptr && type != nullptr) { *(layers + i) = changeLayers_[i]->GetId(); *(type + i) = changeLayers_[i]->GetCompositionType(); - LOG_DEBUG("DrmDisplay::GetDisplayCompChange layerId %{public}u, fencefd %{public}i", + LOG_DEBUG("DrmDisplay::GetDisplayCompChange layerId %{public}u, fencefd %{public}i", changeLayers_[i]->GetId(), changeLayers_[i]->GetCompositionType()); } } @@ -432,7 +432,7 @@ void DrmDisplay::CommitAtomic(int32_t *fence, const DrmFrameBuffer *fb, int comm "Plain CRTC W: %{public}u, " "Plain CRTC H: %{public}u, " "Commit flag: %{public}d.", - connector_->Id(), crtc_->Id(), connector_->BlobId(), (uint64_t)fence, + connector_->Id(), crtc_->Id(), connector_->BlobId(), (uint64_t)fence, primaryPlane_->Id(), fbId, width << 16, height << 16, width, height, commitFlag); DrmAtomicCommitter atomicAutoCommitter(drmFd_, commitFlag, this); @@ -503,7 +503,7 @@ int32_t DrmDisplay::Commit(int32_t *fence) fb = reservedFb_.get(); } - if (oewm::HDI::DISPLAY::HdiSession::GetInstance().GetDisplayDevice()->SupportAtomicModeSet()) { + if (FT::HDI::DISPLAY::HdiSession::GetInstance().GetDisplayDevice()->SupportAtomicModeSet()) { CommitAtomic(fence, fb, commitFlag_); } else { // legacy @@ -513,4 +513,4 @@ int32_t DrmDisplay::Commit(int32_t *fence) return DISPLAY_SUCCESS; } } // namespace drm -} // namespace oewm +} // namespace FT diff --git a/display_server/drivers/hal/drm_backend/display_device/drm_display.h b/display_server/drivers/hal/drm_backend/display_device/drm_display.h index 40ac4ece644ecae260939d3010a620714b8cf780..9005d2ab992a0680a957a2516f3b783a943a07c4 100644 --- a/display_server/drivers/hal/drm_backend/display_device/drm_display.h +++ b/display_server/drivers/hal/drm_backend/display_device/drm_display.h @@ -24,7 +24,7 @@ #include "drm_plane.h" #include "hdi_display.h" -namespace oewm { +namespace FT { namespace drm { class DrmDisplay : public HdiDisplay { public: @@ -103,4 +103,4 @@ private: #endif // ENABLE_HARDWARE_VSYNC }; } // namespace drm -} // namespace oewm +} // namespace FT diff --git a/display_server/drivers/hal/drm_backend/display_device/drm_encoder.cpp b/display_server/drivers/hal/drm_backend/display_device/drm_encoder.cpp index a051af7653c2940068bc409b3190b1818ba3df9c..4a2f3051cd960b6b991822514ff630d85f3d44ac 100644 --- a/display_server/drivers/hal/drm_backend/display_device/drm_encoder.cpp +++ b/display_server/drivers/hal/drm_backend/display_device/drm_encoder.cpp @@ -20,7 +20,7 @@ #include "log.h" -namespace oewm { +namespace FT { namespace drm { DrmEncoder::DrmEncoder(int drmFd, uint32_t encoderId) : drmFd_(drmFd), id_(encoderId) { @@ -70,4 +70,4 @@ void DrmEncoder::ParseFrom(drmModeEncoderPtr const &encoder) possibleCrtcs_ = encoder->possible_crtcs; } } // namespace drm -} // namespace oewm +} // namespace FT diff --git a/display_server/drivers/hal/drm_backend/display_device/drm_encoder.h b/display_server/drivers/hal/drm_backend/display_device/drm_encoder.h index 2671b84793ed284e9536236cb475a9136d07aee3..eb841d8181095ce6ed37612b52e280759f8ade49 100644 --- a/display_server/drivers/hal/drm_backend/display_device/drm_encoder.h +++ b/display_server/drivers/hal/drm_backend/display_device/drm_encoder.h @@ -19,7 +19,7 @@ #include "drm_common.h" #include "drm_crtc.h" -namespace oewm { +namespace FT { namespace drm { class DrmEncoder : NonCopyable { public: @@ -36,4 +36,4 @@ private: uint32_t possibleCrtcs_ = DRM_INVALID_OBJECT_ID; }; } // namespace drm -} // namespace oewm +} // namespace FT diff --git a/display_server/drivers/hal/drm_backend/display_device/drm_frame_buffer.cpp b/display_server/drivers/hal/drm_backend/display_device/drm_frame_buffer.cpp index 8244fd80b83a7ac36906ee4b6e3a75645cfe8e52..946305ce3eda2741edd3139d7b92d018b53c061c 100644 --- a/display_server/drivers/hal/drm_backend/display_device/drm_frame_buffer.cpp +++ b/display_server/drivers/hal/drm_backend/display_device/drm_frame_buffer.cpp @@ -20,7 +20,7 @@ #include "log.h" -namespace oewm { +namespace FT { namespace drm { namespace detail { // add fbId to fbInfo @@ -190,7 +190,7 @@ DrmFrameBuffer::DrmFrameBuffer(int drmFd, const FrameBufferInfo &fbInfo, uint32_ : drmFd_(drmFd), info_(fbInfo), isCreateFromBufferHandle_(false), fbHandle_(fbHandle) {} -DrmFrameBuffer::DrmFrameBuffer(int drmFd, const FrameBufferInfo &fbInfo) +DrmFrameBuffer::DrmFrameBuffer(int drmFd, const FrameBufferInfo &fbInfo) : drmFd_(drmFd), info_(fbInfo), isCreateFromBufferHandle_(true) {} @@ -237,4 +237,4 @@ void DrmFrameBuffer::Cleanup(uint32_t color) } } } // namespace drm -} // namespace oewm +} // namespace FT diff --git a/display_server/drivers/hal/drm_backend/display_device/drm_frame_buffer.h b/display_server/drivers/hal/drm_backend/display_device/drm_frame_buffer.h index 0c2c166584ea93e1a0a0dd8b913f0f2612a4bb15..637f3f7c74e5181ae44cf0c6cea80d4bcf698f02 100644 --- a/display_server/drivers/hal/drm_backend/display_device/drm_frame_buffer.h +++ b/display_server/drivers/hal/drm_backend/display_device/drm_frame_buffer.h @@ -21,7 +21,7 @@ #include "display_type.h" #include "drm_common.h" -namespace oewm { +namespace FT { namespace drm { struct FrameBufferInfo { uint32_t fbId = DRM_INVALID_OBJECT_ID; @@ -70,4 +70,4 @@ private: uint32_t fbHandle_ = DRM_INVALID_OBJECT_ID; }; } // namespace drm -} // namespace oewm +} // namespace FT diff --git a/display_server/drivers/hal/drm_backend/display_device/drm_layer.cpp b/display_server/drivers/hal/drm_backend/display_device/drm_layer.cpp index 4229b9b5e3da68dafcc9b2fa82da646dfe09d842..ea80378488ec0b55410d67d18fbca26e9223f413 100644 --- a/display_server/drivers/hal/drm_backend/display_device/drm_layer.cpp +++ b/display_server/drivers/hal/drm_backend/display_device/drm_layer.cpp @@ -17,7 +17,7 @@ #include "log.h" -namespace oewm { +namespace FT { namespace drm { DrmFrameBuffer *DrmLayer::GetFrameBuffer(int drmFd) { @@ -44,4 +44,4 @@ DrmFrameBuffer *DrmLayer::GetFrameBuffer(int drmFd) return currentFrameBuffer_.get(); } } // namespace drm -} // namespace oewm +} // namespace FT diff --git a/display_server/drivers/hal/drm_backend/display_device/drm_layer.h b/display_server/drivers/hal/drm_backend/display_device/drm_layer.h index 9a91cdc6871b02834df85d15de01212767ffd7ac..30731e1f81bc3efb9fc704029d96cf68f23e7f59 100644 --- a/display_server/drivers/hal/drm_backend/display_device/drm_layer.h +++ b/display_server/drivers/hal/drm_backend/display_device/drm_layer.h @@ -20,7 +20,7 @@ #include "drm_frame_buffer.h" #include "hdi_layer.h" -namespace oewm { +namespace FT { namespace drm { class DrmLayer : public HdiLayer { public: @@ -34,4 +34,4 @@ private: std::unique_ptr currentFrameBuffer_; }; } // namespace drm -} // namespace oewm +} // namespace FT diff --git a/display_server/drivers/hal/drm_backend/display_device/drm_mode_info.cpp b/display_server/drivers/hal/drm_backend/display_device/drm_mode_info.cpp index 72bbc1a84f500af0ea5f53a54fe73c97a7853cee..296ab3e343f99f9991e95bf6095a978aa8941ef5 100644 --- a/display_server/drivers/hal/drm_backend/display_device/drm_mode_info.cpp +++ b/display_server/drivers/hal/drm_backend/display_device/drm_mode_info.cpp @@ -17,7 +17,7 @@ #include "log.h" -namespace oewm { +namespace FT { namespace drm { DrmModeInfo::DrmModeInfo(const drmModeModeInfo &modeInfo, int id, int drmFd) : modeInfo_(modeInfo), id_(id), drmFd_(drmFd) @@ -48,4 +48,4 @@ DisplayModeInfo DrmModeInfo::ToHdiModeInfo() const return res; } } // namespace drm -} // namespace oewm +} // namespace FT diff --git a/display_server/drivers/hal/drm_backend/display_device/drm_mode_info.h b/display_server/drivers/hal/drm_backend/display_device/drm_mode_info.h index 055aadb315ed5d3309d217e9ff0da8b8cc1b5b83..7352dd8d040865b2c2ed14fc0e4e7dfac82c99f9 100644 --- a/display_server/drivers/hal/drm_backend/display_device/drm_mode_info.h +++ b/display_server/drivers/hal/drm_backend/display_device/drm_mode_info.h @@ -20,7 +20,7 @@ #include "display_type.h" #include "drm_common.h" -namespace oewm { +namespace FT { namespace drm { // typedef struct _drmModeModeInfo { // uint32_t clock; @@ -60,4 +60,4 @@ private: uint32_t blobId_ = DRM_INVALID_OBJECT_ID; }; } // namespace drm -} // namespace oewm +} // namespace FT diff --git a/display_server/drivers/hal/drm_backend/display_device/drm_plane.cpp b/display_server/drivers/hal/drm_backend/display_device/drm_plane.cpp index 0c64842c11af80934de7f0ec0014e78bed48538a..9453e27ad96d592a3188aa572a0ac2d7df08d482 100644 --- a/display_server/drivers/hal/drm_backend/display_device/drm_plane.cpp +++ b/display_server/drivers/hal/drm_backend/display_device/drm_plane.cpp @@ -18,7 +18,7 @@ #include "drm_mode.h" #include "log.h" -namespace oewm { +namespace FT { namespace drm { DrmPlane::DrmPlane(int drmFd, uint32_t planeId) : drmFd_(drmFd), id_(planeId) { @@ -51,4 +51,4 @@ void DrmPlane::ParseFrom(drmModePlanePtr const &plane) possibleCrtcs_ = plane->possible_crtcs; } } // namespace drm -} // namespace oewm +} // namespace FT diff --git a/display_server/drivers/hal/drm_backend/display_device/drm_plane.h b/display_server/drivers/hal/drm_backend/display_device/drm_plane.h index 49a258123c8409885748f66a82c9595554e392d0..f7466d8677cd48cc253fb0053822e7d258531feb 100644 --- a/display_server/drivers/hal/drm_backend/display_device/drm_plane.h +++ b/display_server/drivers/hal/drm_backend/display_device/drm_plane.h @@ -19,7 +19,7 @@ #include "drm_common.h" #include "drm_property.h" -namespace oewm { +namespace FT { namespace drm { // prop for plane constexpr char PROP_FBID[] = "FB_ID"; @@ -128,4 +128,4 @@ private: uint32_t possibleCrtcs_ = 0; }; } // namespace drm -} // namespace oewm +} // namespace FT diff --git a/display_server/drivers/hal/drm_backend/display_device/drm_property.cpp b/display_server/drivers/hal/drm_backend/display_device/drm_property.cpp index 541f65e1cd27f71dc6bfe5beab58bbfd3a1c7881..a4d2885b5f7e8a5d6d4b4dc69bf8b4e03e76703c 100644 --- a/display_server/drivers/hal/drm_backend/display_device/drm_property.cpp +++ b/display_server/drivers/hal/drm_backend/display_device/drm_property.cpp @@ -17,7 +17,7 @@ #include "log.h" -namespace oewm { +namespace FT { namespace drm { DrmProperty::DrmProperty(int drmFd, uint32_t propId, uint64_t propValue) : prop_(::drmModeGetProperty(drmFd, propId)), propId_(propId), value_(propValue) @@ -107,4 +107,4 @@ uint64_t DrmObjectPropertyFetcher::GetPropValue(const std::string &name) const return propsMap_.at(name)->Value(); } } // namespace drm -} // namespace oewm +} // namespace FT diff --git a/display_server/drivers/hal/drm_backend/display_device/drm_property.h b/display_server/drivers/hal/drm_backend/display_device/drm_property.h index 1a351f0ae69bd3abb4eccd2d1244fcf0f729a064..92b49683274acd4d891b40abec65d4412ca91bfc 100644 --- a/display_server/drivers/hal/drm_backend/display_device/drm_property.h +++ b/display_server/drivers/hal/drm_backend/display_device/drm_property.h @@ -21,7 +21,7 @@ #include "drm_common.h" -namespace oewm { +namespace FT { namespace drm { enum class DrmPropertyType { DRM_PROPERTY_TYPE_RANGE, @@ -132,4 +132,4 @@ private: std::unordered_map> propsMap_; }; } // namespace drm -} // namespace oewm +} // namespace FT diff --git a/display_server/drivers/hal/drm_backend/display_device/hdi_display.cpp b/display_server/drivers/hal/drm_backend/display_device/hdi_display.cpp index 05904a7c12105768bce669c9d15cfdf947ba8d24..68735fdfe6f9580db440e7be722b3c8fcb097d98 100644 --- a/display_server/drivers/hal/drm_backend/display_device/hdi_display.cpp +++ b/display_server/drivers/hal/drm_backend/display_device/hdi_display.cpp @@ -17,7 +17,7 @@ #include "log.h" -namespace oewm { +namespace FT { namespace HDI { namespace DISPLAY { HdiDisplay::HdiDisplay() {} @@ -92,4 +92,4 @@ HdiLayer *HdiDisplay::GetHdiLayer(LayerId id) } } // namespace DISPLAY } // namespace HDI -} // namespace oewm +} // namespace FT diff --git a/display_server/drivers/hal/drm_backend/display_device/hdi_display.h b/display_server/drivers/hal/drm_backend/display_device/hdi_display.h index d59293d18795b37805aff11360299d70b863d43b..a1e6b26edc283af7dbb14164abbba8df1853277c 100644 --- a/display_server/drivers/hal/drm_backend/display_device/hdi_display.h +++ b/display_server/drivers/hal/drm_backend/display_device/hdi_display.h @@ -21,7 +21,7 @@ #include "display_device.h" #include "hdi_layer.h" -namespace oewm { +namespace FT { namespace HDI { namespace DISPLAY { using DisplayId = uint32_t; @@ -95,4 +95,4 @@ protected: } // namespace HDI using HdiDisplayId = HDI::DISPLAY::DisplayId; using HdiDisplay = HDI::DISPLAY::HdiDisplay; -} // namespace oewm +} // namespace FT diff --git a/display_server/drivers/hal/drm_backend/display_device/hdi_layer.cpp b/display_server/drivers/hal/drm_backend/display_device/hdi_layer.cpp index 18adad65300748471d2f1a461e6fa04c78a9c566..cfec79e4f3b07b1ac73bc0fd7eaaf9431e5037d3 100644 --- a/display_server/drivers/hal/drm_backend/display_device/hdi_layer.cpp +++ b/display_server/drivers/hal/drm_backend/display_device/hdi_layer.cpp @@ -22,7 +22,7 @@ #include "log.h" #include "types.h" -namespace oewm { +namespace FT { namespace HDI { namespace DISPLAY { HdiLayerBuffer::HdiLayerBuffer(const BufferHandle &handle) @@ -38,7 +38,7 @@ HdiLayerBuffer::HdiLayerBuffer(const BufferHandle &handle) if (!IsInvalidFd(handle.fd)) { fd_ = OHOS::UniqueFd(::dup(handle.fd)); if (fd_ < 0) { - LOG_ERROR("Failed to dup from fd: %{public}i, err: %{public}s, errno: %{public}i", + LOG_ERROR("Failed to dup from fd: %{public}i, err: %{public}s, errno: %{public}i", handle.fd, ErrnoToString(errno).c_str(), errno); } } @@ -177,7 +177,7 @@ void HdiLayer::SetPixel(const BufferHandle &handle, int x, int y, uint32_t color } if (x < 0 || x >= handle.width || y < 0 || y >= handle.height) { - LOG_ERROR("HdiLayer::SetPixel: invalid parameter: x: %{public}d, bufWidth: %{public}d, y: %{public}d, bufHeight: %{public}d", + LOG_ERROR("HdiLayer::SetPixel: invalid parameter: x: %{public}d, bufWidth: %{public}d, y: %{public}d, bufHeight: %{public}d", x, handle.width, y, handle.height); return; } @@ -211,4 +211,4 @@ void HdiLayer::WaitAcquireFence() } } // namespace DISPLAY } // namespace HDI -} // namespace oewm +} // namespace FT diff --git a/display_server/drivers/hal/drm_backend/display_device/hdi_layer.h b/display_server/drivers/hal/drm_backend/display_device/hdi_layer.h index 30ac6993068ec64e4663383edff819a6b6304bb4..36f96f33c2add10e24794e57bb1e95d9278cec22 100644 --- a/display_server/drivers/hal/drm_backend/display_device/hdi_layer.h +++ b/display_server/drivers/hal/drm_backend/display_device/hdi_layer.h @@ -22,7 +22,7 @@ #include "display_type.h" #include "noncopyable_hal.h" -namespace oewm { +namespace FT { namespace HDI { namespace DISPLAY { const uint32_t INVALID_VALUE = ~0x0; @@ -220,4 +220,4 @@ using HdiLayerId = HDI::DISPLAY::LayerId; using HdiLayer = HDI::DISPLAY::HdiLayer; using HdiLayerBuffer = HDI::DISPLAY::HdiLayerBuffer; } // namespace drm -} // namespace oewm +} // namespace FT diff --git a/display_server/drivers/hal/drm_backend/display_device/hdi_session.cpp b/display_server/drivers/hal/drm_backend/display_device/hdi_session.cpp index 0545acaef1ba35dc37948ebead968b45958e187b..b391a7788f3bec5517e3e628a50f4043147a9eca 100644 --- a/display_server/drivers/hal/drm_backend/display_device/hdi_session.cpp +++ b/display_server/drivers/hal/drm_backend/display_device/hdi_session.cpp @@ -19,7 +19,7 @@ #include "display_layer.h" -namespace oewm { +namespace FT { namespace HDI { namespace DISPLAY { namespace detail { @@ -151,9 +151,9 @@ void HdiSession::OnHotPlugEvent(TimeStamp timeStamp, struct udev_device *event) #endif // USE_LIBUDEV } // namespace DISPLAY } // namespace HDI -} // namespace oewm +} // namespace FT -using namespace oewm::HDI::DISPLAY; +using namespace FT::HDI::DISPLAY; static int32_t RegHotPlugCallback(HotPlugCallback callback, void *data) { HdiSession::GetInstance().RegHotPlugCallback(callback, data); @@ -508,7 +508,7 @@ int32_t DeviceInitialize(DeviceFuncs **funcs) auto deviceFuncs = (DeviceFuncs *)calloc(1, sizeof(DeviceFuncs)); if (deviceFuncs == nullptr) { - LOG_ERROR("DeviceInitialize: deviceFuncs alloc failed, err: %{public}s", oewm::ErrnoToString(errno).c_str()); + LOG_ERROR("DeviceInitialize: deviceFuncs alloc failed, err: %{public}s", FT::ErrnoToString(errno).c_str()); return DISPLAY_FAILURE; } @@ -572,7 +572,7 @@ int32_t LayerInitialize(LayerFuncs **funcs) LayerFuncs *layerFuncs = (LayerFuncs *)calloc(1, sizeof(LayerFuncs)); if (layerFuncs == nullptr) { - LOG_ERROR("LayerInitialize: layerFuncs alloc failed, err: %{public}s", oewm::ErrnoToString(errno).c_str()); + LOG_ERROR("LayerInitialize: layerFuncs alloc failed, err: %{public}s", FT::ErrnoToString(errno).c_str()); return DISPLAY_FAILURE; } diff --git a/display_server/drivers/hal/drm_backend/display_device/hdi_session.h b/display_server/drivers/hal/drm_backend/display_device/hdi_session.h index ef5bf7d7e3626175882d327966a7f33ae9d4fc7e..a717fa6dd4cddc294f5ceac1fcd238bb001a1a15 100644 --- a/display_server/drivers/hal/drm_backend/display_device/hdi_session.h +++ b/display_server/drivers/hal/drm_backend/display_device/hdi_session.h @@ -25,7 +25,7 @@ #include "udev_object_helper.h" #endif // USE_LIBUDEV -namespace oewm { +namespace FT { namespace HDI { namespace DISPLAY { // singleton @@ -77,7 +77,7 @@ public: auto &display = displays.at(devId); auto layer = display->GetHdiLayer(layerId); if (layer == nullptr) { - LOG_ERROR("HdiSession::CallLayerFunction: can not find layer(id: %{public}" PRIu32 ") for display %{public}" PRIu32, + LOG_ERROR("HdiSession::CallLayerFunction: can not find layer(id: %{public}" PRIu32 ") for display %{public}" PRIu32, layerId, devId); return DISPLAY_FAILURE; } @@ -103,4 +103,4 @@ private: }; } // namespace DISPLAY } // namespace HDI -} // namespace oewm +} // namespace FT diff --git a/display_server/drivers/hal/drm_backend/display_device/udev_object_helper.h b/display_server/drivers/hal/drm_backend/display_device/udev_object_helper.h index 7e388c0ccf8d5659c6ae5e2f5c48494e21460ab8..82c504f200c0738b0d7a351cbfef85629e3d9054 100644 --- a/display_server/drivers/hal/drm_backend/display_device/udev_object_helper.h +++ b/display_server/drivers/hal/drm_backend/display_device/udev_object_helper.h @@ -22,7 +22,7 @@ #include "types.h" -namespace oewm { +namespace FT { static constexpr char defaultSeat[] = "seat0"; // RAII for udev objects to do auto unref. @@ -74,4 +74,4 @@ inline bool IsBootVGADevice(struct udev_device *device) return strcmp(bootVGAId, "1") == 0; } -} // namespace oewm +} // namespace FT diff --git a/display_server/drivers/hal/drm_backend/display_gralloc/BUILD.gn b/display_server/drivers/hal/drm_backend/display_gralloc/BUILD.gn index 3dd8760fc93e74c22d6b0d66b56f28baa5be2ac2..eb6310f7d90caa53d91cfa24b7d042b405cdc5ff 100644 --- a/display_server/drivers/hal/drm_backend/display_gralloc/BUILD.gn +++ b/display_server/drivers/hal/drm_backend/display_gralloc/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2022 Huawei Technologies Co., Ltd. +# Copyright (c) 2023 Huawei Technologies Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at @@ -10,6 +10,7 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. + import("//build/gn/fangtian.gni") config("display_gralloc_public_config") { @@ -35,18 +36,16 @@ ft_shared_library("display_gralloc") { "shm_allocator.cpp", ] - configs = [ - "//display_server/drivers/hal:hal_public_config" - ] - - public_configs = [ + configs = [ "//display_server/drivers/hal:hal_public_config" ] + + public_configs = [ ":display_gralloc_public_config", - "//display_server/drivers/hal/drm_backend:import_system_gbm_config" + "//display_server/drivers/hal/drm_backend:import_system_gbm_config", ] - - public_deps = [ + + public_deps = [ + "//display_server/drivers/hal/base:ft_event_loop", "//display_server/drivers/hal/drm_backend:display_drm_dep", - "//display_server/drivers/hal/base:hal_base", "//display_server/drivers/hal/drm_backend/display_device:display_device", ] } diff --git a/display_server/drivers/hal/drm_backend/display_gralloc/allocator.cpp b/display_server/drivers/hal/drm_backend/display_gralloc/allocator.cpp index 399faadc77aeccacc172e0c302c1ba05003fd692..e1b7aa8014b383a5a1930834eaeb6439507b82e4 100644 --- a/display_server/drivers/hal/drm_backend/display_gralloc/allocator.cpp +++ b/display_server/drivers/hal/drm_backend/display_gralloc/allocator.cpp @@ -15,8 +15,8 @@ #include "allocator.h" -namespace oewm { +namespace FT { namespace HDI { namespace DISPLAY {} // namespace DISPLAY } // namespace HDI -} // namespace oewm +} // namespace FT diff --git a/display_server/drivers/hal/drm_backend/display_gralloc/allocator.h b/display_server/drivers/hal/drm_backend/display_gralloc/allocator.h index b566893b4033ad3a623eada125f86438067f7f23..c7f7bc4b8da7d547f7583cdb1af088b47594b625 100644 --- a/display_server/drivers/hal/drm_backend/display_gralloc/allocator.h +++ b/display_server/drivers/hal/drm_backend/display_gralloc/allocator.h @@ -19,7 +19,7 @@ #include -namespace oewm { +namespace FT { namespace HDI { namespace DISPLAY { @@ -80,4 +80,4 @@ public: } // namespace DISPLAY } // namespace HDI -} // namespace oewm +} // namespace FT diff --git a/display_server/drivers/hal/drm_backend/display_gralloc/allocator_controller.cpp b/display_server/drivers/hal/drm_backend/display_gralloc/allocator_controller.cpp index 3e8d1e1f1be73d47268cb64d74b104a04fd1b80e..aeb5b5179923c52a94033cd4b12d6640cc2ff44c 100644 --- a/display_server/drivers/hal/drm_backend/display_gralloc/allocator_controller.cpp +++ b/display_server/drivers/hal/drm_backend/display_gralloc/allocator_controller.cpp @@ -21,7 +21,7 @@ #include "display_type.h" #include "log.h" -namespace oewm { +namespace FT { namespace HDI { namespace DISPLAY { @@ -87,4 +87,4 @@ std::shared_ptr AllocatorController::GetAllocator(uint64_t usage) } // namespace DISPLAY } // namespace HDI -} // namespace oewm \ No newline at end of file +} // namespace FT \ No newline at end of file diff --git a/display_server/drivers/hal/drm_backend/display_gralloc/allocator_controller.h b/display_server/drivers/hal/drm_backend/display_gralloc/allocator_controller.h index db129d5d852367bdb61db6fb0cd7bff5172e48dc..7f96e55ebe55926bc64bab979bce5923be8e0f2a 100644 --- a/display_server/drivers/hal/drm_backend/display_gralloc/allocator_controller.h +++ b/display_server/drivers/hal/drm_backend/display_gralloc/allocator_controller.h @@ -20,7 +20,7 @@ #include #include -namespace oewm { +namespace FT { namespace HDI { namespace DISPLAY { @@ -71,4 +71,4 @@ private: } // namespace DISPLAY } // namespace HDI -} // namespace oewm +} // namespace FT diff --git a/display_server/drivers/hal/drm_backend/display_gralloc/display_gralloc.cpp b/display_server/drivers/hal/drm_backend/display_gralloc/display_gralloc.cpp index e2b6e76264601fab09051bec952f03d75a05867a..7ff429bf6bd9c734e33ebefccebe74d04ff5e23f 100644 --- a/display_server/drivers/hal/drm_backend/display_gralloc/display_gralloc.cpp +++ b/display_server/drivers/hal/drm_backend/display_gralloc/display_gralloc.cpp @@ -31,7 +31,7 @@ #include "display_type.h" #include "log.h" -using namespace oewm::HDI::DISPLAY; +using namespace FT::HDI::DISPLAY; int32_t AllocMem(const AllocInfo *info, BufferHandle **handle) { @@ -100,7 +100,7 @@ int32_t Unmap(BufferHandle *handle) if (allocator == nullptr) { return DISPLAY_NULL_PTR; } - + return allocator->InvalidateCache(*handle); } diff --git a/display_server/drivers/hal/drm_backend/display_gralloc/display_gralloc_utils.cpp b/display_server/drivers/hal/drm_backend/display_gralloc/display_gralloc_utils.cpp index 8ed65775b5a4e52fc97df77eb1a50aad9b4ef8c4..f7a6d1ef72e595f21f59375303b651226ce07064 100644 --- a/display_server/drivers/hal/drm_backend/display_gralloc/display_gralloc_utils.cpp +++ b/display_server/drivers/hal/drm_backend/display_gralloc/display_gralloc_utils.cpp @@ -24,7 +24,7 @@ namespace GrallocUtils { int GetDrmFdFromSession() { - const auto &session = oewm::HDI::DISPLAY::HdiSession::GetInstance(); + const auto &session = FT::HDI::DISPLAY::HdiSession::GetInstance(); const auto &device = session.GetDisplayDevice(); if (device == nullptr) { LOG_ERROR("[Gralloc] Get empty DRM device from HdiSession."); @@ -98,7 +98,7 @@ int ReopenDrmFd(int drmFd, bool enableRenderNode /*= true*/) return -1; } - LOG_INFO("[Gralloc::GbmUtils::ReopenDrmFd] Reopen new device '%{public}s'(%{public}d) from DRM fd(%{public}d).", + LOG_INFO("[Gralloc::GbmUtils::ReopenDrmFd] Reopen new device '%{public}s'(%{public}d) from DRM fd(%{public}d).", deviceName, newFd, drmFd); /* Clear */ diff --git a/display_server/drivers/hal/drm_backend/display_gralloc/dumb_allocator.cpp b/display_server/drivers/hal/drm_backend/display_gralloc/dumb_allocator.cpp index 75226d8e64c963d2a4036a6f3c78a6ad7c06bbbb..51f6d91440c797d12c69f215a92f3b620b68852f 100644 --- a/display_server/drivers/hal/drm_backend/display_gralloc/dumb_allocator.cpp +++ b/display_server/drivers/hal/drm_backend/display_gralloc/dumb_allocator.cpp @@ -32,7 +32,7 @@ #include "hdi_session.h" #include "log.h" -namespace oewm { +namespace FT { namespace HDI { namespace DISPLAY { @@ -261,8 +261,8 @@ int32_t DumbAllocator::DestroyGemDumbHandle(unsigned int handle) bool DumbAllocator::GetSupportGbmModifyFromSession() { - auto &session = oewm::HDI::DISPLAY::HdiSession::GetInstance(); - const std::shared_ptr device = session.GetDisplayDevice(); + auto &session = FT::HDI::DISPLAY::HdiSession::GetInstance(); + const std::shared_ptr device = session.GetDisplayDevice(); if (device == nullptr) { LOG_ERROR("[Gralloc::DumbAllocator::DestroyGemDumbHandle] Get empty DRM device from HdiSession."); return false; @@ -271,4 +271,4 @@ bool DumbAllocator::GetSupportGbmModifyFromSession() } } // namespace DISPLAY } // namespace HDI -} // namespace oewm +} // namespace FT diff --git a/display_server/drivers/hal/drm_backend/display_gralloc/dumb_allocator.h b/display_server/drivers/hal/drm_backend/display_gralloc/dumb_allocator.h index 1444a2595699ac07f6aa87c1bca69bee68be124d..de537f3eddfdb6b57efc9392a25f0da04eb3e313 100644 --- a/display_server/drivers/hal/drm_backend/display_gralloc/dumb_allocator.h +++ b/display_server/drivers/hal/drm_backend/display_gralloc/dumb_allocator.h @@ -19,7 +19,7 @@ #include -namespace oewm { +namespace FT { namespace HDI { namespace DISPLAY { @@ -48,4 +48,4 @@ private: } // namespace DISPLAY } // namespace HDI -} // namespace oewm +} // namespace FT diff --git a/display_server/drivers/hal/drm_backend/display_gralloc/gbm_allocator.cpp b/display_server/drivers/hal/drm_backend/display_gralloc/gbm_allocator.cpp index 0bd1779b6886e7efd2e45c910e9eead3157c5bef..2ac7bb84caa3e88d1bd85b003a54b3122f24a3f4 100644 --- a/display_server/drivers/hal/drm_backend/display_gralloc/gbm_allocator.cpp +++ b/display_server/drivers/hal/drm_backend/display_gralloc/gbm_allocator.cpp @@ -25,7 +25,7 @@ #include #include -namespace oewm { +namespace FT { namespace HDI { namespace DISPLAY { GbmAllocator::~GbmAllocator() noexcept @@ -56,7 +56,7 @@ int32_t GbmAllocator::Init() return DISPLAY_FAILURE; } - LOG_INFO("[Gralloc::GbmAllocator::Init] Created GBM device with backend: %{public}s", + LOG_INFO("[Gralloc::GbmAllocator::Init] Created GBM device with backend: %{public}s", gbm_device_get_backend_name(gbmContext_)); char *drmName = drmGetDeviceNameFromFd2(drmFd); LOG_INFO("[Gralloc::GbmAllocator::Init] Using DRM node: %{public}s", drmName); @@ -218,7 +218,7 @@ int32_t GbmAllocator::Unmap(BufferHandle &buffer) gbm_bo_unmap(gbmBo, buffer.virAddr); buffer.virAddr = nullptr; - + LOG_DEBUG("[Gralloc::GbmAllocator::Unmap] Unmap done."); return DISPLAY_SUCCESS; @@ -334,4 +334,4 @@ int32_t GbmAllocator::AllocMemWithUsage(const AllocInfo &info, BufferHandle **bu } } // namespace DISPLAY } // namespace HDI -} // namespace oewm +} // namespace FT diff --git a/display_server/drivers/hal/drm_backend/display_gralloc/gbm_allocator.h b/display_server/drivers/hal/drm_backend/display_gralloc/gbm_allocator.h index 2d470d4a6c0d01613ed3b5d39422f90d6035b6d8..afdbcc447a1ed79fb63d573ff77f2ce7fa980ba2 100644 --- a/display_server/drivers/hal/drm_backend/display_gralloc/gbm_allocator.h +++ b/display_server/drivers/hal/drm_backend/display_gralloc/gbm_allocator.h @@ -21,7 +21,7 @@ #include #include -namespace oewm { +namespace FT { namespace HDI { namespace DISPLAY { @@ -54,4 +54,4 @@ private: }; } // namespace DISPLAY } // namespace HDI -} // namespace oewm +} // namespace FT diff --git a/display_server/drivers/hal/drm_backend/display_gralloc/hi_drm_format.cpp b/display_server/drivers/hal/drm_backend/display_gralloc/hi_drm_format.cpp index 78ab398a35ef9483d050d194048fb9221dd786c7..2db4da78b17492d72bcbcc18f905e9166c78d7cb 100644 --- a/display_server/drivers/hal/drm_backend/display_gralloc/hi_drm_format.cpp +++ b/display_server/drivers/hal/drm_backend/display_gralloc/hi_drm_format.cpp @@ -183,9 +183,9 @@ uint32_t ConvertPixelFormatToDrmFormat(PixelFormat fmtIn) } // LOG_DEBUG << "Convert pixelFormat(" << fmtIn << " : " << GetHdiPixelFmtStr(fmtIn) << ") to DrmFormat(" << fmtOut // << " : " << GetDrmFmtStr(fmtOut) << ")"; - // LOG_DEBUG << oewm::Fmt( + // LOG_DEBUG << FT::Fmt( // "Convert PixelFormat(%u:%s) to DrmFormat(%u:%s)", - // oewm::ECast(fmtIn), + // FT::ECast(fmtIn), // GetHdiPixelFmtStr(fmtIn), // fmtOut, // GetDrmFmtStr(fmtOut)); @@ -201,11 +201,11 @@ PixelFormat ConvertDrmFormatToPixelFormat(uint32_t fmtIn) break; } } - // LOG_DEBUG << oewm::Fmt( + // LOG_DEBUG << FT::Fmt( // "Convert DrmFormat(%u:%s) to PixelFormat(%u:%s)", // fmtIn, // GetDrmFmtStr(fmtIn), - // oewm::ECast(fmtOut), + // FT::ECast(fmtOut), // GetHdiPixelFmtStr(fmtOut)); return fmtOut; } diff --git a/display_server/drivers/hal/drm_backend/display_gralloc/shm_allocator.cpp b/display_server/drivers/hal/drm_backend/display_gralloc/shm_allocator.cpp index f370f1b2d45437ad1ae1bb2bea8d71d578ff21a4..ad96f4b9c2f9df1045a503ca335d21b88f3ccb12 100644 --- a/display_server/drivers/hal/drm_backend/display_gralloc/shm_allocator.cpp +++ b/display_server/drivers/hal/drm_backend/display_gralloc/shm_allocator.cpp @@ -24,7 +24,7 @@ #include #include // for shm_xxx -namespace oewm { +namespace FT { namespace HDI { namespace DISPLAY { @@ -213,4 +213,4 @@ int ShmAllocator::AllocateShmFile(size_t size) } // namespace DISPLAY } // namespace HDI -} // namespace oewm +} // namespace FT diff --git a/display_server/drivers/hal/drm_backend/display_gralloc/shm_allocator.h b/display_server/drivers/hal/drm_backend/display_gralloc/shm_allocator.h index a0654f6ff230490ced798098de41efb11c6db822..24c60838df1b01756567fd5445a9990f3f226642 100644 --- a/display_server/drivers/hal/drm_backend/display_gralloc/shm_allocator.h +++ b/display_server/drivers/hal/drm_backend/display_gralloc/shm_allocator.h @@ -19,7 +19,7 @@ #include -namespace oewm { +namespace FT { namespace HDI { namespace DISPLAY { @@ -46,4 +46,4 @@ private: } // namespace DISPLAY } // namespace HDI -} // namespace oewm +} // namespace FT diff --git a/display_server/drivers/hal/test/BUILD.gn b/display_server/drivers/hal/test/BUILD.gn index 4c23998b58bc2c29d55c540babbb602bedab512e..bdfdb9b5346897539c7f180ac398b19da5843c1e 100644 --- a/display_server/drivers/hal/test/BUILD.gn +++ b/display_server/drivers/hal/test/BUILD.gn @@ -16,40 +16,33 @@ import("//build/gn/fangtian.gni") ft_executable("drm_backend_test") { testonly = true - sources = [ - "system_test/main.cpp" - ] + sources = [ "system_test/main.cpp" ] deps = [ + "//build/gn/configs/system_libs:ipc_core", + "//display_server/drivers/hal/base:ft_event_loop", "//display_server/drivers/hal/drm_backend:drm_backend", - "//display_server/drivers/hal/base:hal_base", "//display_server/utils/sync_fence/ft_build:sync_fence", - - "//build/gn/configs/system_libs:ipc_core", ] - configs = [ - "//display_server/drivers/hal:hal_public_config" - ] + configs = [ "//display_server/drivers/hal:hal_public_config" ] } ft_executable("gpu_backend_test") { - testonly = true - - sources = [ - "system_test/gpu_backend_test.cpp" - ] - - deps = [ - "//display_server/drivers/hal/drm_backend:drm_backend", - "//display_server/drivers/hal/base:hal_base", - "//display_server/utils/sync_fence/ft_build:sync_fence", - "//build/gn/configs/system_libs:ipc_core", - ] - - configs = [ - "//display_server/drivers/hal:hal_public_config" - ] - libs = [ "EGL", "GLESv2" ] -} + testonly = true + + sources = [ "system_test/gpu_backend_test.cpp" ] + deps = [ + "//build/gn/configs/system_libs:ipc_core", + "//display_server/drivers/hal/base:ft_event_loop", + "//display_server/drivers/hal/drm_backend:drm_backend", + "//display_server/utils/sync_fence/ft_build:sync_fence", + ] + + configs = [ "//display_server/drivers/hal:hal_public_config" ] + libs = [ + "EGL", + "GLESv2", + ] +} diff --git a/display_server/drivers/hal/test/system_test/gpu_backend_test.cpp b/display_server/drivers/hal/test/system_test/gpu_backend_test.cpp index fda1756f797e00f5b583e4e03f24604bdde81a02..06834c1f9ae5e226b84fe54cecdfe06823587aed 100644 --- a/display_server/drivers/hal/test/system_test/gpu_backend_test.cpp +++ b/display_server/drivers/hal/test/system_test/gpu_backend_test.cpp @@ -26,9 +26,9 @@ #include #include -oewm::HDI::DISPLAY::HdiSession& g_session = oewm::HDI::DISPLAY::HdiSession::GetInstance(); -oewm::HDI::DISPLAY::AllocatorController& g_alloc_controller = oewm::HDI::DISPLAY::AllocatorController::GetInstance(); -oewm::EventLoop g_mainLoop = oewm::EventLoop(); +FT::HDI::DISPLAY::HdiSession& g_session = FT::HDI::DISPLAY::HdiSession::GetInstance(); +FT::HDI::DISPLAY::AllocatorController& g_alloc_controller = FT::HDI::DISPLAY::AllocatorController::GetInstance(); +FT::EventLoop g_mainLoop = FT::EventLoop(); bool DestoryBufferHandle(BufferHandle **handle); @@ -58,7 +58,7 @@ static struct gbm_device *gbm_device; static EGLContext context; static struct gbm_surface *gbm_surface; static EGLSurface egl_surface; -static BufferHandle tmpBufferHandle; +static BufferHandle tmpBufferHandle; EGLConfig GetEGLConfig() { @@ -110,8 +110,8 @@ struct gbm_bo* SwapBuffer(BufferHandle *handle) } //获取前端缓冲区的句柄 handle->key = gbm_bo_get_handle(bo).u32; - handle->stride = gbm_bo_get_stride(bo); - handle->size = handle->stride * handle->height; + handle->stride = gbm_bo_get_stride(bo); + handle->size = handle->stride * handle->height; handle->format = gbm_bo_get_format(bo); return bo; } @@ -138,9 +138,9 @@ bool InitEGL(uint32_t devId, BufferHandle **handle) uint32_t num = 0; int32_t ret = g_session.CallDisplayFunction( - devId, - &oewm::HDI::DISPLAY::HdiDisplay::GetDisplaySupportedModes, - &num, + devId, + &FT::HDI::DISPLAY::HdiDisplay::GetDisplaySupportedModes, + &num, (DisplayModeInfo*)nullptr ); if (ret != DISPLAY_SUCCESS) { @@ -155,9 +155,9 @@ bool InitEGL(uint32_t devId, BufferHandle **handle) displayModeInfos.resize(num); ret = g_session.CallDisplayFunction( - devId, - &oewm::HDI::DISPLAY::HdiDisplay::GetDisplaySupportedModes, - &num, + devId, + &FT::HDI::DISPLAY::HdiDisplay::GetDisplaySupportedModes, + &num, displayModeInfos.data() ); if (ret != DISPLAY_SUCCESS) { @@ -171,8 +171,8 @@ bool InitEGL(uint32_t devId, BufferHandle **handle) uint32_t width = displayModeInfos[DEFAULT_MODE_INDEX].width; uint32_t height = displayModeInfos[DEFAULT_MODE_INDEX].height; ret = g_session.CallDisplayFunction( - devId, - &oewm::HDI::DISPLAY::HdiDisplay::SetDisplayMode, + devId, + &FT::HDI::DISPLAY::HdiDisplay::SetDisplayMode, DEFAULT_MODE_INDEX); if (ret != DISPLAY_SUCCESS) { printf("Draw: Failed to set display mode, ret=%d\n", ret); @@ -181,7 +181,7 @@ bool InitEGL(uint32_t devId, BufferHandle **handle) printf("CreateBuffer: choose display mode 0 to create fb: width=%d, height=%d.\n", width, height); gbm_device = g_session.GetDisplayDevice()->GetGbmDevice(); - defaultDisplay = eglGetDisplay(gbm_device); + defaultDisplay = eglGetDisplay(gbm_device); int major, minor; eglInitialize(defaultDisplay, &major, &minor); printf("EGL version:%d.%d\n", major, minor); @@ -244,7 +244,7 @@ void Screen::OnVsync(uint32_t sequence, uint64_t timestamp, void *data) printf("OnVSync: screen is null\n"); return; } - + // Do draw in main loop g_mainLoop.RunInLoop([screen, sequence, timestamp]() { uint32_t devId = screen->devId; @@ -274,19 +274,19 @@ void Screen::OnVsync(uint32_t sequence, uint64_t timestamp, void *data) // Set fb as screen's current buffer ret = g_session.CallDisplayFunction( - devId, - &oewm::HDI::DISPLAY::HdiDisplay::SetDisplayClientBuffer, - static_cast(screen->fb[0]->handle), + devId, + &FT::HDI::DISPLAY::HdiDisplay::SetDisplayClientBuffer, + static_cast(screen->fb[0]->handle), fenceFd); if (ret != DISPLAY_SUCCESS) { printf("Draw: Failed to set display client buffer, ret=%d\n", ret); return; } - + // Commit ret = g_session.CallDisplayFunction( - devId, - &oewm::HDI::DISPLAY::HdiDisplay::Commit, + devId, + &FT::HDI::DISPLAY::HdiDisplay::Commit, &fenceFd); if (fenceFd >= 0) { auto fence = OHOS::SyncFence(fenceFd); @@ -310,8 +310,8 @@ static void OnHotPlug(uint32_t devId, bool connected, void *data) // Register VSync callback int32_t ret = g_session.CallDisplayFunction( - devId, - &oewm::HDI::DISPLAY::HdiDisplay::RegDisplayVBlankCallback, + devId, + &FT::HDI::DISPLAY::HdiDisplay::RegDisplayVBlankCallback, Screen::OnVsync, static_cast(g_screens.at(devId)) ); diff --git a/display_server/drivers/hal/test/system_test/main.cpp b/display_server/drivers/hal/test/system_test/main.cpp index 5dd0cea7334cf3a4420ed1e95f868f751e547dfd..72c5a35d8541994f3ea93bb5de0849a5ed86a6fb 100644 --- a/display_server/drivers/hal/test/system_test/main.cpp +++ b/display_server/drivers/hal/test/system_test/main.cpp @@ -22,9 +22,9 @@ #include "sync_fence.h" #include "allocator_controller.h" -oewm::HDI::DISPLAY::HdiSession& g_session = oewm::HDI::DISPLAY::HdiSession::GetInstance(); -oewm::HDI::DISPLAY::AllocatorController& g_alloc_controller = oewm::HDI::DISPLAY::AllocatorController::GetInstance(); -oewm::EventLoop g_mainLoop = oewm::EventLoop(); +FT::HDI::DISPLAY::HdiSession& g_session = FT::HDI::DISPLAY::HdiSession::GetInstance(); +FT::HDI::DISPLAY::AllocatorController& g_alloc_controller = FT::HDI::DISPLAY::AllocatorController::GetInstance(); +FT::EventLoop g_mainLoop = FT::EventLoop(); bool DestoryBufferHandle(BufferHandle **handle); @@ -61,9 +61,9 @@ bool CreateBuffer(uint32_t devId, BufferHandle **handle) uint32_t num = 0; int32_t ret = g_session.CallDisplayFunction( - devId, - &oewm::HDI::DISPLAY::HdiDisplay::GetDisplaySupportedModes, - &num, + devId, + &FT::HDI::DISPLAY::HdiDisplay::GetDisplaySupportedModes, + &num, (DisplayModeInfo*)nullptr ); if (ret != DISPLAY_SUCCESS) { @@ -78,9 +78,9 @@ bool CreateBuffer(uint32_t devId, BufferHandle **handle) displayModeInfos.resize(num); ret = g_session.CallDisplayFunction( - devId, - &oewm::HDI::DISPLAY::HdiDisplay::GetDisplaySupportedModes, - &num, + devId, + &FT::HDI::DISPLAY::HdiDisplay::GetDisplaySupportedModes, + &num, displayModeInfos.data() ); if (ret != DISPLAY_SUCCESS) { @@ -94,8 +94,8 @@ bool CreateBuffer(uint32_t devId, BufferHandle **handle) uint32_t width = displayModeInfos[DEFAULT_MODE_INDEX].width; uint32_t height = displayModeInfos[DEFAULT_MODE_INDEX].height; ret = g_session.CallDisplayFunction( - devId, - &oewm::HDI::DISPLAY::HdiDisplay::SetDisplayMode, + devId, + &FT::HDI::DISPLAY::HdiDisplay::SetDisplayMode, DEFAULT_MODE_INDEX); if (ret != DISPLAY_SUCCESS) { printf("Draw: Failed to set display mode, ret=%d\n", ret); @@ -109,12 +109,12 @@ bool CreateBuffer(uint32_t devId, BufferHandle **handle) .height = height, .usage = HBM_USE_MEM_DMA | HBM_USE_CPU_READ | HBM_USE_MEM_FB | HBM_USE_CPU_WRITE, // allocate dumb buffer with "HBM_USE_CPU_WRITE" .format = PIXEL_FMT_BGRA_8888}; // TODO: format - auto allocator = g_alloc_controller.GetAllocator(info.usage); + auto allocator = g_alloc_controller.GetAllocator(info.usage); if (allocator == nullptr) { printf("CreateBuffer: Failed to get buffer allocator.\n"); return false; } - + // Do allocate memory ret = allocator->AllocMem(info, handle); if (*handle == nullptr || ret != DISPLAY_SUCCESS) { @@ -128,7 +128,7 @@ bool CreateBuffer(uint32_t devId, BufferHandle **handle) printf("CreateBuffer: Failed to mmap fb.\n"); return false; } - + printf("CreateBuffer: end. handle fd: %i.\n", (*handle)->fd); return true; } @@ -193,12 +193,12 @@ void Screen::OnVsync(uint32_t sequence, uint64_t timestamp, void *data) printf("OnVSync: screen is null\n"); return; } - + // Print first frames static int i = 0; if (i < 3) { printf("OnVSync: screen devId=%d, sequence=%u, timestamp=%lu\n", screen->devId, sequence, timestamp); - LOG_DEBUG("DRM Backend Test: OnVSync: screen devId=%{public}d, sequence=%{public}u, timestamp=%{public}lu", + LOG_DEBUG("DRM Backend Test: OnVSync: screen devId=%{public}d, sequence=%{public}u, timestamp=%{public}lu", screen->devId, sequence, timestamp); ++i; } @@ -228,9 +228,9 @@ void Screen::OnVsync(uint32_t sequence, uint64_t timestamp, void *data) // // Set fb as screen's current buffer // ret = g_session.CallDisplayFunction( - // devId, - // &oewm::HDI::DISPLAY::HdiDisplay::SetDisplayClientBuffer, - // static_cast(screen->fb[screen->fbIdx]->handle), + // devId, + // &FT::HDI::DISPLAY::HdiDisplay::SetDisplayClientBuffer, + // static_cast(screen->fb[screen->fbIdx]->handle), // fenceFd); // if (ret != DISPLAY_SUCCESS) { // printf("Draw: Failed to set display client buffer, ret=%d\n", ret); @@ -247,26 +247,26 @@ void Screen::OnVsync(uint32_t sequence, uint64_t timestamp, void *data) // Set fb as screen's current buffer ret = g_session.CallDisplayFunction( - devId, - &oewm::HDI::DISPLAY::HdiDisplay::SetDisplayClientBuffer, - static_cast(screen->fb[screen->fbIdx]->handle), + devId, + &FT::HDI::DISPLAY::HdiDisplay::SetDisplayClientBuffer, + static_cast(screen->fb[screen->fbIdx]->handle), fenceFd); if (ret != DISPLAY_SUCCESS) { printf("Draw: Failed to set display client buffer, ret=%d\n", ret); return; } - + // Commit ret = g_session.CallDisplayFunction( - devId, - &oewm::HDI::DISPLAY::HdiDisplay::Commit, + devId, + &FT::HDI::DISPLAY::HdiDisplay::Commit, &fenceFd); if (fenceFd >= 0) { auto fence = OHOS::SyncFence(fenceFd); } else { auto fence = OHOS::SyncFence(-1); } - + screen->fbIdx ^= 1; }); } @@ -284,9 +284,9 @@ static void OnHotPlug(uint32_t devId, bool connected, void *data) // Register VSync callback int32_t ret = g_session.CallDisplayFunction( - devId, - &oewm::HDI::DISPLAY::HdiDisplay::RegDisplayVBlankCallback, - Screen::OnVsync, + devId, + &FT::HDI::DISPLAY::HdiDisplay::RegDisplayVBlankCallback, + Screen::OnVsync, static_cast(g_screens.at(devId)) ); if (ret != DISPLAY_SUCCESS) {