From 9255d0d10b9e2284e36d754ff0f4b6736a1d8bc2 Mon Sep 17 00:00:00 2001 From: Andrew Wolfers Date: Thu, 4 Sep 2025 20:20:44 +0000 Subject: [PATCH] drm_hwcomposer: Migrate to android::drm_hwcomposer namespace Change-Id: I2859aa8f55532d88231389724956fc77b0625339 --- backend/Backend.cpp | 4 +- backend/Backend.h | 5 +- backend/BackendClient.cpp | 4 +- backend/BackendClient.h | 5 +- backend/BackendManager.cpp | 5 +- backend/BackendManager.h | 5 +- bufferinfo/BufferInfo.h | 4 +- bufferinfo/BufferInfoGetter.cpp | 4 +- bufferinfo/BufferInfoGetter.h | 4 +- bufferinfo/BufferInfoMapperMetadata.cpp | 4 +- bufferinfo/BufferInfoMapperMetadata.h | 5 +- bufferinfo/legacy/BufferInfoImagination.cpp | 4 +- bufferinfo/legacy/BufferInfoImagination.h | 5 +- bufferinfo/legacy/BufferInfoLibdrm.cpp | 4 +- bufferinfo/legacy/BufferInfoLibdrm.h | 4 +- bufferinfo/legacy/BufferInfoMaliHisi.cpp | 4 +- bufferinfo/legacy/BufferInfoMaliHisi.h | 5 +- bufferinfo/legacy/BufferInfoMaliMediatek.cpp | 4 +- bufferinfo/legacy/BufferInfoMaliMediatek.h | 5 +- bufferinfo/legacy/BufferInfoMaliMeson.cpp | 4 +- bufferinfo/legacy/BufferInfoMaliMeson.h | 5 +- bufferinfo/legacy/BufferInfoMinigbm.cpp | 5 +- bufferinfo/legacy/BufferInfoMinigbm.h | 4 +- compositor/DisplayInfo.h | 4 +- compositor/DrmKmsPlan.cpp | 5 +- compositor/DrmKmsPlan.h | 4 +- compositor/FlatteningController.cpp | 4 +- compositor/FlatteningController.h | 4 +- compositor/LayerData.h | 4 +- drm/DrmAtomicStateManager.cpp | 4 +- drm/DrmAtomicStateManager.h | 4 +- drm/DrmConnector.cpp | 4 +- drm/DrmConnector.h | 5 +- drm/DrmCrtc.cpp | 4 +- drm/DrmCrtc.h | 5 +- drm/DrmDevice.cpp | 4 +- drm/DrmDevice.h | 4 +- drm/DrmDisplayPipeline.cpp | 4 +- drm/DrmDisplayPipeline.h | 4 +- drm/DrmEncoder.cpp | 4 +- drm/DrmEncoder.h | 4 +- drm/DrmFbImporter.cpp | 4 +- drm/DrmFbImporter.h | 4 +- drm/DrmHwc.cpp | 5 +- drm/DrmHwc.h | 5 +- drm/DrmMode.cpp | 4 +- drm/DrmMode.h | 5 +- drm/DrmPlane.cpp | 4 +- drm/DrmPlane.h | 5 +- drm/DrmProperty.cpp | 4 +- drm/DrmProperty.h | 4 +- drm/DrmUnique.h | 4 +- drm/ResourceManager.cpp | 4 +- drm/ResourceManager.h | 5 +- drm/UEventListener.cpp | 4 +- drm/UEventListener.h | 5 +- drm/VSyncWorker.cpp | 5 +- drm/VSyncWorker.h | 5 +- hwc/HwcDisplay.cpp | 5 +- hwc/HwcDisplay.h | 4 +- hwc/HwcDisplayConfigs.cpp | 4 +- hwc/HwcDisplayConfigs.h | 4 +- hwc/HwcLayer.cpp | 4 +- hwc/HwcLayer.h | 4 +- hwc2_device/DrmHwcTwo.cpp | 4 +- hwc2_device/DrmHwcTwo.h | 5 +- hwc2_device/hwc2_device.cpp | 6 +- hwc3/Composer.cpp | 2 +- hwc3/ComposerClient.cpp | 104 ++++++++++-------- hwc3/ComposerClient.h | 15 +-- hwc3/DrmHwcThree.cpp | 15 +-- hwc3/DrmHwcThree.h | 30 ++--- stats/CompositionStats.cpp | 4 +- stats/CompositionStats.h | 4 +- stats/CompositionStatsAtomReporter.cpp | 4 +- stats/CompositionStatsAtomReporter.h | 4 +- stats/CompositionStatsAtomReporterDesktop.cpp | 4 +- stats/CompositionStatsPoller.cpp | 4 +- stats/CompositionStatsPoller.h | 4 +- stats/CompositionStatsTest.cpp | 4 +- tests/uevent_print.cpp | 2 +- utils/EdidWrapper.h | 4 +- utils/LibdisplayEdidWrapper.cpp | 5 +- utils/UEvent.h | 4 +- utils/fd.cpp | 4 +- utils/fd.h | 4 +- utils/properties.cpp | 4 +- utils/properties.h | 4 +- 88 files changed, 281 insertions(+), 241 deletions(-) diff --git a/backend/Backend.cpp b/backend/Backend.cpp index 7d93476..d477bf1 100644 --- a/backend/Backend.cpp +++ b/backend/Backend.cpp @@ -24,7 +24,7 @@ #include "drm/DrmHwc.h" #include "hwc/HwcDisplay.h" -namespace android { +namespace android::drm_hwcomposer { namespace { @@ -273,4 +273,4 @@ std::tuple Backend::GetExtraClientRange( REGISTER_BACKEND("generic", Backend); // clang-format on -} // namespace android +} // namespace android::drm_hwcomposer diff --git a/backend/Backend.h b/backend/Backend.h index 283ff94..2c2f347 100644 --- a/backend/Backend.h +++ b/backend/Backend.h @@ -21,7 +21,7 @@ #include "compositor/LayerData.h" -namespace android { +namespace android::drm_hwcomposer { struct DrmKmsPlan; class HwcDisplay; @@ -63,4 +63,5 @@ class Backend { const HwcDisplay* display, const std::vector& layers, size_t client_start, size_t client_size, bool use_cursor_plane); }; -} // namespace android + +} // namespace android::drm_hwcomposer diff --git a/backend/BackendClient.cpp b/backend/BackendClient.cpp index 6ade9dc..16c0b07 100644 --- a/backend/BackendClient.cpp +++ b/backend/BackendClient.cpp @@ -19,7 +19,7 @@ #include "BackendManager.h" #include "hwc/HwcDisplay.h" -namespace android { +namespace android::drm_hwcomposer { auto BackendClient::ValidateDisplay(HwcDisplay* display) -> ValidatedComposition { @@ -31,4 +31,4 @@ auto BackendClient::ValidateDisplay(HwcDisplay* display) REGISTER_BACKEND("client", BackendClient); // clang-format on -} // namespace android +} // namespace android::drm_hwcomposer diff --git a/backend/BackendClient.h b/backend/BackendClient.h index 3885551..c22f728 100644 --- a/backend/BackendClient.h +++ b/backend/BackendClient.h @@ -18,10 +18,11 @@ #include "Backend.h" -namespace android { +namespace android::drm_hwcomposer { class BackendClient : public Backend { public: auto ValidateDisplay(HwcDisplay* display) -> ValidatedComposition override; }; -} // namespace android + +} // namespace android::drm_hwcomposer diff --git a/backend/BackendManager.cpp b/backend/BackendManager.cpp index 9fc4d49..55808ca 100644 --- a/backend/BackendManager.cpp +++ b/backend/BackendManager.cpp @@ -22,7 +22,7 @@ #include "utils/log.h" #include "utils/properties.h" -namespace android { +namespace android::drm_hwcomposer { // NOLINTNEXTLINE(cert-err58-cpp) const std::vector BackendManager::kClientDevices = { @@ -81,4 +81,5 @@ std::unique_ptr BackendManager::GetBackendByName(std::string &name) { return available_backends_[name](); } -} // namespace android + +} // namespace android::drm_hwcomposer diff --git a/backend/BackendManager.h b/backend/BackendManager.h index 125410e..0d740a4 100644 --- a/backend/BackendManager.h +++ b/backend/BackendManager.h @@ -32,7 +32,7 @@ return std::make_unique(); \ }); -namespace android { +namespace android::drm_hwcomposer { class BackendManager { public: @@ -50,4 +50,5 @@ class BackendManager { std::map available_backends_; }; -} // namespace android + +} // namespace android::drm_hwcomposer diff --git a/bufferinfo/BufferInfo.h b/bufferinfo/BufferInfo.h index 96cd06d..a3af45a 100644 --- a/bufferinfo/BufferInfo.h +++ b/bufferinfo/BufferInfo.h @@ -19,7 +19,7 @@ #include #include -namespace android { +namespace android::drm_hwcomposer { constexpr int kBufferMaxPlanes = 4; @@ -69,4 +69,4 @@ struct BufferInfo { std::shared_ptr fds_shared; }; -} // namespace android +} // namespace android::drm_hwcomposer diff --git a/bufferinfo/BufferInfoGetter.cpp b/bufferinfo/BufferInfoGetter.cpp index f158fed..1eb89c8 100644 --- a/bufferinfo/BufferInfoGetter.cpp +++ b/bufferinfo/BufferInfoGetter.cpp @@ -30,7 +30,7 @@ #include "utils/log.h" #include "utils/properties.h" -namespace android { +namespace android::drm_hwcomposer { BufferInfoGetter *BufferInfoGetter::GetInstance() { static std::unique_ptr inst; @@ -122,4 +122,4 @@ LegacyBufferInfoGetter::CreateInstance() { return nullptr; } -} // namespace android +} // namespace android::drm_hwcomposer diff --git a/bufferinfo/BufferInfoGetter.h b/bufferinfo/BufferInfoGetter.h index 5131c37..169e43f 100644 --- a/bufferinfo/BufferInfoGetter.h +++ b/bufferinfo/BufferInfoGetter.h @@ -28,7 +28,7 @@ #define DRM_FORMAT_INVALID 0 #endif -namespace android { +namespace android::drm_hwcomposer { using BufferUniqueId = uint64_t; @@ -87,4 +87,4 @@ class LegacyBufferInfoGetter : public BufferInfoGetter { } #endif -} // namespace android +} // namespace android::drm_hwcomposer diff --git a/bufferinfo/BufferInfoMapperMetadata.cpp b/bufferinfo/BufferInfoMapperMetadata.cpp index 2b92b02..0d11c5c 100644 --- a/bufferinfo/BufferInfoMapperMetadata.cpp +++ b/bufferinfo/BufferInfoMapperMetadata.cpp @@ -27,7 +27,7 @@ #include "utils/log.h" -namespace android { +namespace android::drm_hwcomposer { namespace { @@ -179,4 +179,4 @@ auto BufferInfoMapperMetadata::GetBoInfo(buffer_handle_t handle) return bi; } -} // namespace android +} // namespace android::drm_hwcomposer diff --git a/bufferinfo/BufferInfoMapperMetadata.h b/bufferinfo/BufferInfoMapperMetadata.h index 5b05325..168f267 100644 --- a/bufferinfo/BufferInfoMapperMetadata.h +++ b/bufferinfo/BufferInfoMapperMetadata.h @@ -18,7 +18,7 @@ #include "bufferinfo/BufferInfoGetter.h" -namespace android { +namespace android::drm_hwcomposer { class BufferInfoMapperMetadata : public BufferInfoGetter { public: @@ -30,4 +30,5 @@ class BufferInfoMapperMetadata : public BufferInfoGetter { static BufferInfoGetter *CreateInstance(); }; -} // namespace android + +} // namespace android::drm_hwcomposer diff --git a/bufferinfo/legacy/BufferInfoImagination.cpp b/bufferinfo/legacy/BufferInfoImagination.cpp index 0bb0aaa..dff560d 100644 --- a/bufferinfo/legacy/BufferInfoImagination.cpp +++ b/bufferinfo/legacy/BufferInfoImagination.cpp @@ -25,7 +25,7 @@ #include "img_gralloc1_public.h" #include "utils/log.h" -namespace android { +namespace android::drm_hwcomposer { LEGACY_BUFFER_INFO_GETTER(BufferInfoImagination); @@ -65,4 +65,4 @@ auto BufferInfoImagination::GetBoInfo(buffer_handle_t handle) return bi; } -} // namespace android +} // namespace android::drm_hwcomposer diff --git a/bufferinfo/legacy/BufferInfoImagination.h b/bufferinfo/legacy/BufferInfoImagination.h index 3f4e13a..8c748bd 100644 --- a/bufferinfo/legacy/BufferInfoImagination.h +++ b/bufferinfo/legacy/BufferInfoImagination.h @@ -20,7 +20,7 @@ #include "bufferinfo/BufferInfoGetter.h" -namespace android { +namespace android::drm_hwcomposer { class BufferInfoImagination : public LegacyBufferInfoGetter { public: @@ -28,4 +28,5 @@ class BufferInfoImagination : public LegacyBufferInfoGetter { auto GetBoInfo(buffer_handle_t handle) -> std::optional override; }; -} // namespace android + +} // namespace android::drm_hwcomposer diff --git a/bufferinfo/legacy/BufferInfoLibdrm.cpp b/bufferinfo/legacy/BufferInfoLibdrm.cpp index 6978b08..f9422e2 100644 --- a/bufferinfo/legacy/BufferInfoLibdrm.cpp +++ b/bufferinfo/legacy/BufferInfoLibdrm.cpp @@ -28,7 +28,7 @@ #include "utils/log.h" #include "utils/properties.h" -namespace android { +namespace android::drm_hwcomposer { LEGACY_BUFFER_INFO_GETTER(BufferInfoLibdrm); @@ -227,4 +227,4 @@ int BufferInfoLibdrm::ValidateGralloc() { return 0; } -} // namespace android +} // namespace android::drm_hwcomposer diff --git a/bufferinfo/legacy/BufferInfoLibdrm.h b/bufferinfo/legacy/BufferInfoLibdrm.h index d913d57..ec85bba 100644 --- a/bufferinfo/legacy/BufferInfoLibdrm.h +++ b/bufferinfo/legacy/BufferInfoLibdrm.h @@ -20,7 +20,7 @@ #include "bufferinfo/BufferInfoGetter.h" -namespace android { +namespace android::drm_hwcomposer { class BufferInfoLibdrm : public LegacyBufferInfoGetter { public: @@ -33,4 +33,4 @@ class BufferInfoLibdrm : public LegacyBufferInfoGetter { BufferInfo *bo); }; -} // namespace android +} // namespace android::drm_hwcomposer diff --git a/bufferinfo/legacy/BufferInfoMaliHisi.cpp b/bufferinfo/legacy/BufferInfoMaliHisi.cpp index bfb2e7b..f6827f7 100644 --- a/bufferinfo/legacy/BufferInfoMaliHisi.cpp +++ b/bufferinfo/legacy/BufferInfoMaliHisi.cpp @@ -28,7 +28,7 @@ #define MALI_ALIGN(value, base) (((value) + ((base)-1)) & ~((base)-1)) -namespace android { +namespace android::drm_hwcomposer { LEGACY_BUFFER_INFO_GETTER(BufferInfoMaliHisi); @@ -122,4 +122,4 @@ auto BufferInfoMaliHisi::GetBoInfo(buffer_handle_t handle) return bi; } -} // namespace android +} // namespace android::drm_hwcomposer diff --git a/bufferinfo/legacy/BufferInfoMaliHisi.h b/bufferinfo/legacy/BufferInfoMaliHisi.h index 35c7989..d12ce85 100644 --- a/bufferinfo/legacy/BufferInfoMaliHisi.h +++ b/bufferinfo/legacy/BufferInfoMaliHisi.h @@ -20,7 +20,7 @@ #include "bufferinfo/BufferInfoGetter.h" -namespace android { +namespace android::drm_hwcomposer { class BufferInfoMaliHisi : public LegacyBufferInfoGetter { public: @@ -31,4 +31,5 @@ class BufferInfoMaliHisi : public LegacyBufferInfoGetter { private: uint64_t ConvertGrallocFormatToDrmModifiers(uint64_t flags, bool is_rgb); }; -} // namespace android + +} // namespace android::drm_hwcomposer diff --git a/bufferinfo/legacy/BufferInfoMaliMediatek.cpp b/bufferinfo/legacy/BufferInfoMaliMediatek.cpp index 4493c98..43f5e59 100644 --- a/bufferinfo/legacy/BufferInfoMaliMediatek.cpp +++ b/bufferinfo/legacy/BufferInfoMaliMediatek.cpp @@ -28,7 +28,7 @@ #include "gralloc_priv.h" #include "utils/log.h" -namespace android { +namespace android::drm_hwcomposer { LEGACY_BUFFER_INFO_GETTER(BufferInfoMaliMediatek); @@ -54,4 +54,4 @@ auto BufferInfoMaliMediatek::GetBoInfo(buffer_handle_t handle) return bi; } -} // namespace android +} // namespace android::drm_hwcomposer diff --git a/bufferinfo/legacy/BufferInfoMaliMediatek.h b/bufferinfo/legacy/BufferInfoMaliMediatek.h index 120a88c..b8bcb3c 100644 --- a/bufferinfo/legacy/BufferInfoMaliMediatek.h +++ b/bufferinfo/legacy/BufferInfoMaliMediatek.h @@ -20,7 +20,7 @@ #include "bufferinfo/BufferInfoGetter.h" -namespace android { +namespace android::drm_hwcomposer { class BufferInfoMaliMediatek : public LegacyBufferInfoGetter { public: @@ -28,4 +28,5 @@ class BufferInfoMaliMediatek : public LegacyBufferInfoGetter { auto GetBoInfo(buffer_handle_t handle) -> std::optional override; }; -} // namespace android + +} // namespace android::drm_hwcomposer diff --git a/bufferinfo/legacy/BufferInfoMaliMeson.cpp b/bufferinfo/legacy/BufferInfoMaliMeson.cpp index aa77529..88558ac 100644 --- a/bufferinfo/legacy/BufferInfoMaliMeson.cpp +++ b/bufferinfo/legacy/BufferInfoMaliMeson.cpp @@ -26,7 +26,7 @@ #include "gralloc_priv.h" #include "utils/log.h" -namespace android { +namespace android::drm_hwcomposer { LEGACY_BUFFER_INFO_GETTER(BufferInfoMaliMeson); @@ -89,4 +89,4 @@ auto BufferInfoMaliMeson::GetBoInfo(buffer_handle_t handle) return bi; } -} // namespace android +} // namespace android::drm_hwcomposer diff --git a/bufferinfo/legacy/BufferInfoMaliMeson.h b/bufferinfo/legacy/BufferInfoMaliMeson.h index 9a484d3..d950454 100644 --- a/bufferinfo/legacy/BufferInfoMaliMeson.h +++ b/bufferinfo/legacy/BufferInfoMaliMeson.h @@ -20,7 +20,7 @@ #include "bufferinfo/BufferInfoGetter.h" -namespace android { +namespace android::drm_hwcomposer { class BufferInfoMaliMeson : public LegacyBufferInfoGetter { public: @@ -30,4 +30,5 @@ class BufferInfoMaliMeson : public LegacyBufferInfoGetter { private: uint64_t ConvertGrallocFormatToDrmModifiers(uint64_t flags); }; -} // namespace android + +} // namespace android::drm_hwcomposer diff --git a/bufferinfo/legacy/BufferInfoMinigbm.cpp b/bufferinfo/legacy/BufferInfoMinigbm.cpp index 4bc4358..9f02041 100644 --- a/bufferinfo/legacy/BufferInfoMinigbm.cpp +++ b/bufferinfo/legacy/BufferInfoMinigbm.cpp @@ -25,7 +25,8 @@ #include #include "utils/log.h" -namespace android { + +namespace android::drm_hwcomposer { LEGACY_BUFFER_INFO_GETTER(BufferInfoMinigbm); @@ -122,4 +123,4 @@ int BufferInfoMinigbm::ValidateGralloc() { return 0; } -} // namespace android +} // namespace android::drm_hwcomposer diff --git a/bufferinfo/legacy/BufferInfoMinigbm.h b/bufferinfo/legacy/BufferInfoMinigbm.h index 5525110..5f59655 100644 --- a/bufferinfo/legacy/BufferInfoMinigbm.h +++ b/bufferinfo/legacy/BufferInfoMinigbm.h @@ -20,7 +20,7 @@ #include "bufferinfo/BufferInfoGetter.h" -namespace android { +namespace android::drm_hwcomposer { class BufferInfoMinigbm : public LegacyBufferInfoGetter { public: @@ -29,4 +29,4 @@ class BufferInfoMinigbm : public LegacyBufferInfoGetter { int ValidateGralloc() override; }; -} // namespace android +} // namespace android::drm_hwcomposer diff --git a/compositor/DisplayInfo.h b/compositor/DisplayInfo.h index 15fcb8f..d9746f8 100644 --- a/compositor/DisplayInfo.h +++ b/compositor/DisplayInfo.h @@ -19,7 +19,7 @@ #include #include -namespace android { +namespace android::drm_hwcomposer { /* * 4x4 Identity matrix used for color transformations. @@ -103,4 +103,4 @@ struct QueuedConfigTiming { int64_t new_vsync_time_ns; }; -} // namespace android +} // namespace android::drm_hwcomposer diff --git a/compositor/DrmKmsPlan.cpp b/compositor/DrmKmsPlan.cpp index e531f7d..067838c 100644 --- a/compositor/DrmKmsPlan.cpp +++ b/compositor/DrmKmsPlan.cpp @@ -22,7 +22,8 @@ #include "drm/DrmPlane.h" #include "utils/log.h" -namespace android { +namespace android::drm_hwcomposer { + auto DrmKmsPlan::CreateDrmKmsPlan(const DrmDisplayPipeline &pipe, std::vector composition, std::optional cursor_layer) @@ -71,4 +72,4 @@ auto DrmKmsPlan::CreateDrmKmsPlan(const DrmDisplayPipeline &pipe, return plan; } -} // namespace android +} // namespace android::drm_hwcomposer diff --git a/compositor/DrmKmsPlan.h b/compositor/DrmKmsPlan.h index 950f853..76b8111 100644 --- a/compositor/DrmKmsPlan.h +++ b/compositor/DrmKmsPlan.h @@ -21,7 +21,7 @@ #include "LayerData.h" -namespace android { +namespace android::drm_hwcomposer { class DrmDevice; @@ -40,4 +40,4 @@ struct DrmKmsPlan { -> std::unique_ptr; }; -} // namespace android +} // namespace android::drm_hwcomposer diff --git a/compositor/FlatteningController.cpp b/compositor/FlatteningController.cpp index 43799f7..3cae6e3 100644 --- a/compositor/FlatteningController.cpp +++ b/compositor/FlatteningController.cpp @@ -35,7 +35,7 @@ #include "utils/log.h" -namespace android { +namespace android::drm_hwcomposer { auto FlatteningController::CreateInstance(FlatConCallbacks &cbks) -> std::shared_ptr { @@ -98,4 +98,4 @@ void FlatteningController::ThreadFn() { } } -} // namespace android +} // namespace android::drm_hwcomposer diff --git a/compositor/FlatteningController.h b/compositor/FlatteningController.h index 18e3516..8bd3e35 100644 --- a/compositor/FlatteningController.h +++ b/compositor/FlatteningController.h @@ -21,7 +21,7 @@ #include #include -namespace android { +namespace android::drm_hwcomposer { // NOLINTNEXTLINE(misc-unused-using-decls): False positive using std::chrono_literals::operator""s; @@ -73,4 +73,4 @@ class FlatteningController { FlatConCallbacks cbks_; }; -} // namespace android +} // namespace android::drm_hwcomposer diff --git a/compositor/LayerData.h b/compositor/LayerData.h index 21e7269..082e9cc 100644 --- a/compositor/LayerData.h +++ b/compositor/LayerData.h @@ -26,7 +26,7 @@ #include "drm/DrmFbImporter.h" #include "utils/fd.h" -namespace android { +namespace android::drm_hwcomposer { class DrmFbIdHandle; @@ -107,4 +107,4 @@ struct LayerData { SharedFd acquire_fence; }; -} // namespace android +} // namespace android::drm_hwcomposer diff --git a/drm/DrmAtomicStateManager.cpp b/drm/DrmAtomicStateManager.cpp index 7fa6998..61c38e6 100644 --- a/drm/DrmAtomicStateManager.cpp +++ b/drm/DrmAtomicStateManager.cpp @@ -33,7 +33,7 @@ #include "drm/DrmUnique.h" #include "utils/log.h" -namespace android { +namespace android::drm_hwcomposer { auto DrmAtomicStateManager::CreateInstance(DrmDisplayPipeline *pipe) -> std::shared_ptr { @@ -579,4 +579,4 @@ auto DrmAtomicStateManager::ActivateDisplayUsingDPMS() -> int { DRM_MODE_DPMS_ON); } -} // namespace android +} // namespace android::drm_hwcomposer diff --git a/drm/DrmAtomicStateManager.h b/drm/DrmAtomicStateManager.h index f17724f..1d39989 100644 --- a/drm/DrmAtomicStateManager.h +++ b/drm/DrmAtomicStateManager.h @@ -29,7 +29,7 @@ #include "drm/ResourceManager.h" #include "drm/VSyncWorker.h" -namespace android { +namespace android::drm_hwcomposer { struct AtomicCommitArgs { /* inputs. All fields are optional, but at least one has to be specified */ @@ -174,4 +174,4 @@ class DrmAtomicStateManager { int frames_tracked_ GUARDED_BY(mutex_){}; }; -} // namespace android +} // namespace android::drm_hwcomposer diff --git a/drm/DrmConnector.cpp b/drm/DrmConnector.cpp index c5222ee..057b484 100644 --- a/drm/DrmConnector.cpp +++ b/drm/DrmConnector.cpp @@ -41,7 +41,7 @@ #define DRM_MODE_CONNECTOR_USB 20 #endif -namespace android { +namespace android::drm_hwcomposer { constexpr size_t kTypesCount = 21; @@ -302,4 +302,4 @@ std::optional DrmConnector::GetPanelOrientation() { return {}; } -} // namespace android +} // namespace android::drm_hwcomposer diff --git a/drm/DrmConnector.h b/drm/DrmConnector.h index 0b62424..2fa8c2b 100644 --- a/drm/DrmConnector.h +++ b/drm/DrmConnector.h @@ -29,7 +29,7 @@ #include "compositor/DisplayInfo.h" #include "utils/EdidWrapper.h" -namespace android { +namespace android::drm_hwcomposer { class DrmDevice; @@ -190,4 +190,5 @@ class DrmConnector : public PipelineBindable { std::map colorspace_enum_map_; std::map panel_orientation_enum_map_; }; -} // namespace android + +} // namespace android::drm_hwcomposer diff --git a/drm/DrmCrtc.cpp b/drm/DrmCrtc.cpp index ecee9e2..f6584d7 100644 --- a/drm/DrmCrtc.cpp +++ b/drm/DrmCrtc.cpp @@ -25,7 +25,7 @@ #include "DrmDevice.h" -namespace android { +namespace android::drm_hwcomposer { static int GetCrtcProperty(const DrmDevice &dev, const DrmCrtc &crtc, const char *prop_name, DrmProperty *property) { @@ -69,4 +69,4 @@ auto DrmCrtc::CreateInstance(DrmDevice &dev, uint32_t crtc_id, uint32_t index) return c; } -} // namespace android +} // namespace android::drm_hwcomposer diff --git a/drm/DrmCrtc.h b/drm/DrmCrtc.h index 96443cd..dcbb1a3 100644 --- a/drm/DrmCrtc.h +++ b/drm/DrmCrtc.h @@ -25,7 +25,7 @@ #include "DrmProperty.h" #include "DrmUnique.h" -namespace android { +namespace android::drm_hwcomposer { class DrmDevice; @@ -76,4 +76,5 @@ class DrmCrtc : public PipelineBindable { DrmProperty mode_property_; DrmProperty out_fence_ptr_property_; }; -} // namespace android + +} // namespace android::drm_hwcomposer diff --git a/drm/DrmDevice.cpp b/drm/DrmDevice.cpp index 21926e8..eb4a87e 100644 --- a/drm/DrmDevice.cpp +++ b/drm/DrmDevice.cpp @@ -33,7 +33,7 @@ #include "utils/log.h" #include "utils/properties.h" -namespace android { +namespace android::drm_hwcomposer { auto DrmDevice::CreateInstance(std::string const &path, ResourceManager *res_man, uint32_t index) @@ -401,4 +401,4 @@ done: } // NOLINTEND(cppcoreguidelines-avoid-goto) -} // namespace android +} // namespace android::drm_hwcomposer diff --git a/drm/DrmDevice.h b/drm/DrmDevice.h index d432c0e..57aea6b 100644 --- a/drm/DrmDevice.h +++ b/drm/DrmDevice.h @@ -27,7 +27,7 @@ #include "bufferinfo/BufferInfo.h" #include "utils/fd.h" -namespace android { +namespace android::drm_hwcomposer { class DrmFbImporter; class DrmPlane; @@ -141,4 +141,4 @@ class DrmDevice { ResourceManager *const res_man_; }; -} // namespace android +} // namespace android::drm_hwcomposer diff --git a/drm/DrmDisplayPipeline.cpp b/drm/DrmDisplayPipeline.cpp index 0bf6205..dee11ed 100644 --- a/drm/DrmDisplayPipeline.cpp +++ b/drm/DrmDisplayPipeline.cpp @@ -27,7 +27,7 @@ #include "utils/log.h" #include "utils/properties.h" -namespace android { +namespace android::drm_hwcomposer { template auto PipelineBindable::BindPipeline(const DrmDisplayPipeline *pipeline, @@ -208,4 +208,4 @@ DrmDisplayPipeline::~DrmDisplayPipeline() { atomic_state_manager->StopThread(); } -} // namespace android +} // namespace android::drm_hwcomposer diff --git a/drm/DrmDisplayPipeline.h b/drm/DrmDisplayPipeline.h index 34e4d9c..c1135a3 100644 --- a/drm/DrmDisplayPipeline.h +++ b/drm/DrmDisplayPipeline.h @@ -19,7 +19,7 @@ #include #include -namespace android { +namespace android::drm_hwcomposer { class DrmConnector; class DrmDevice; @@ -92,4 +92,4 @@ struct DrmDisplayPipeline { std::shared_ptr atomic_state_manager; }; -} // namespace android +} // namespace android::drm_hwcomposer diff --git a/drm/DrmEncoder.cpp b/drm/DrmEncoder.cpp index 7480ce6..a4ecab3 100644 --- a/drm/DrmEncoder.cpp +++ b/drm/DrmEncoder.cpp @@ -25,7 +25,7 @@ #include "DrmDevice.h" #include "utils/log.h" -namespace android { +namespace android::drm_hwcomposer { auto DrmEncoder::CreateInstance(DrmDevice &dev, uint32_t encoder_id, uint32_t index) -> std::unique_ptr { @@ -38,4 +38,4 @@ auto DrmEncoder::CreateInstance(DrmDevice &dev, uint32_t encoder_id, return std::unique_ptr(new DrmEncoder(std::move(e), index)); } -} // namespace android +} // namespace android::drm_hwcomposer diff --git a/drm/DrmEncoder.h b/drm/DrmEncoder.h index 89e664c..782d281 100644 --- a/drm/DrmEncoder.h +++ b/drm/DrmEncoder.h @@ -25,7 +25,7 @@ #include "DrmCrtc.h" #include "DrmDisplayPipeline.h" -namespace android { +namespace android::drm_hwcomposer { class DrmEncoder : public PipelineBindable { public: @@ -63,4 +63,4 @@ class DrmEncoder : public PipelineBindable { const uint32_t index_in_res_array_; }; -} // namespace android +} // namespace android::drm_hwcomposer diff --git a/drm/DrmFbImporter.cpp b/drm/DrmFbImporter.cpp index fe80891..53d3614 100644 --- a/drm/DrmFbImporter.cpp +++ b/drm/DrmFbImporter.cpp @@ -32,7 +32,7 @@ #include "utils/log.h" #include "utils/properties.h" -namespace android { +namespace android::drm_hwcomposer { auto DrmFbIdHandle::CreateInstance(BufferInfo *bo, GemHandle first_gem_handle, DrmDevice &drm) @@ -172,4 +172,4 @@ auto DrmFbImporter::GetOrCreateFbId(BufferInfo *bo) return fb_id_handle; } -} // namespace android +} // namespace android::drm_hwcomposer diff --git a/drm/DrmFbImporter.h b/drm/DrmFbImporter.h index 30f57ba..fd2f44b 100644 --- a/drm/DrmFbImporter.h +++ b/drm/DrmFbImporter.h @@ -32,7 +32,7 @@ using GemHandle = uint32_t; -namespace android { +namespace android::drm_hwcomposer { class DrmFbIdHandle { public: @@ -87,4 +87,4 @@ class DrmFbImporter { std::map> drm_fb_id_handle_cache_; }; -} // namespace android +} // namespace android::drm_hwcomposer diff --git a/drm/DrmHwc.cpp b/drm/DrmHwc.cpp index 0cd42ed..63f2148 100644 --- a/drm/DrmHwc.cpp +++ b/drm/DrmHwc.cpp @@ -24,7 +24,8 @@ #include "utils/log.h" #include "utils/properties.h" -namespace android { +namespace android::drm_hwcomposer { + namespace { // Helper functions for implementing dumpsys support. std::string DumpStats(const CompositionStats &stats) { @@ -249,4 +250,4 @@ void DrmHwc::DeinitDisplays() { } } -} // namespace android \ No newline at end of file +} // namespace android::drm_hwcomposer diff --git a/drm/DrmHwc.h b/drm/DrmHwc.h index 096ed19..bb1ea98 100644 --- a/drm/DrmHwc.h +++ b/drm/DrmHwc.h @@ -21,7 +21,7 @@ #include "hwc/HwcDisplay.h" #include "stats/CompositionStats.h" -namespace android { +namespace android::drm_hwcomposer { class DrmHwc : public PipelineToFrontendBindingInterface, public CompositionStatsProvider { @@ -100,4 +100,5 @@ class DrmHwc : public PipelineToFrontendBindingInterface, DisplayHandle last_display_handle_ = kPrimaryDisplay; CompositionStatsTracker dump_stats_tracker_; }; -} // namespace android + +} // namespace android::drm_hwcomposer diff --git a/drm/DrmMode.cpp b/drm/DrmMode.cpp index a9e3246..7fbf192 100644 --- a/drm/DrmMode.cpp +++ b/drm/DrmMode.cpp @@ -20,7 +20,7 @@ #include "DrmDevice.h" -namespace android { +namespace android::drm_hwcomposer { DrmMode::DrmMode(drmModeModeInfoPtr m) : mode_(*m){}; @@ -45,4 +45,4 @@ auto DrmMode::CreateModeBlob(const DrmDevice &drm) const sizeof(struct drm_mode_modeinfo)); } -} // namespace android +} // namespace android::drm_hwcomposer diff --git a/drm/DrmMode.h b/drm/DrmMode.h index f739c07..217aa56 100644 --- a/drm/DrmMode.h +++ b/drm/DrmMode.h @@ -24,7 +24,7 @@ #include "DrmUnique.h" -namespace android { +namespace android::drm_hwcomposer { class DrmDevice; @@ -66,4 +66,5 @@ class DrmMode { private: drmModeModeInfo mode_; }; -} // namespace android + +} // namespace android::drm_hwcomposer diff --git a/drm/DrmPlane.cpp b/drm/DrmPlane.cpp index fc8ef85..049c437 100644 --- a/drm/DrmPlane.cpp +++ b/drm/DrmPlane.cpp @@ -28,7 +28,7 @@ #include "compositor/LayerData.h" #include "utils/log.h" -namespace android { +namespace android::drm_hwcomposer { namespace { // Ensure that |src| does not exceed the bounds of the buffer. @@ -414,4 +414,4 @@ auto DrmPlane::GetPlaneProperty(const char *prop_name, DrmProperty &property, return true; } -} // namespace android +} // namespace android::drm_hwcomposer diff --git a/drm/DrmPlane.h b/drm/DrmPlane.h index 4ec424b..dd6a1fe 100644 --- a/drm/DrmPlane.h +++ b/drm/DrmPlane.h @@ -25,7 +25,7 @@ #include "DrmProperty.h" #include "compositor/LayerData.h" -namespace android { +namespace android::drm_hwcomposer { class DrmDevice; struct LayerData; @@ -108,4 +108,5 @@ class DrmPlane : public PipelineBindable { uint64_t transform_enum_mask_ = DRM_MODE_ROTATE_0; std::vector size_hints_; }; -} // namespace android + +} // namespace android::drm_hwcomposer diff --git a/drm/DrmProperty.cpp b/drm/DrmProperty.cpp index 24a67bc..c9df052 100644 --- a/drm/DrmProperty.cpp +++ b/drm/DrmProperty.cpp @@ -29,7 +29,7 @@ #include "DrmDevice.h" #include "utils/log.h" -namespace android { +namespace android::drm_hwcomposer { DrmProperty::DrmPropertyEnum::DrmPropertyEnum(drm_mode_property_enum *e) : value(e->value), name(e->name) { @@ -166,4 +166,4 @@ auto DrmProperty::GetEnumMask(uint64_t &mask) -> bool { return true; } -} // namespace android +} // namespace android::drm_hwcomposer diff --git a/drm/DrmProperty.h b/drm/DrmProperty.h index c0f6161..ec5b539 100644 --- a/drm/DrmProperty.h +++ b/drm/DrmProperty.h @@ -29,7 +29,7 @@ #include "utils/fd.h" #include "utils/log.h" -namespace android { +namespace android::drm_hwcomposer { class DrmProperty { public: @@ -183,4 +183,4 @@ bool DrmProperty::GetBlobData(std::vector &data_out) const { return true; } -} // namespace android +} // namespace android::drm_hwcomposer diff --git a/drm/DrmUnique.h b/drm/DrmUnique.h index 0afa067..ac14bc3 100644 --- a/drm/DrmUnique.h +++ b/drm/DrmUnique.h @@ -21,7 +21,7 @@ #include #include -namespace android { +namespace android::drm_hwcomposer { template using DUniquePtr = std::unique_ptr>; @@ -85,4 +85,4 @@ auto inline MakeDrmModeResUnique(int fd) { [](drmModeRes *it) { drmModeFreeResources(it); }); } -} // namespace android +} // namespace android::drm_hwcomposer diff --git a/drm/ResourceManager.cpp b/drm/ResourceManager.cpp index c202c24..9068234 100644 --- a/drm/ResourceManager.cpp +++ b/drm/ResourceManager.cpp @@ -32,7 +32,7 @@ #include "utils/log.h" #include "utils/properties.h" -namespace android { +namespace android::drm_hwcomposer { ResourceManager::ResourceManager( PipelineToFrontendBindingInterface *p2f_bind_interface) @@ -222,4 +222,4 @@ auto ResourceManager::GetWritebackConnectorsCount() -> uint32_t { return count; } -} // namespace android +} // namespace android::drm_hwcomposer diff --git a/drm/ResourceManager.h b/drm/ResourceManager.h index e25f526..087d450 100644 --- a/drm/ResourceManager.h +++ b/drm/ResourceManager.h @@ -27,7 +27,7 @@ #include "UEventListener.h" #include "utils/properties.h" -namespace android { +namespace android::drm_hwcomposer { class PipelineToFrontendBindingInterface { public: @@ -94,4 +94,5 @@ class ResourceManager { bool initialized_{}; }; -} // namespace android + +} // namespace android::drm_hwcomposer diff --git a/drm/UEventListener.cpp b/drm/UEventListener.cpp index b664b85..2b1421f 100644 --- a/drm/UEventListener.cpp +++ b/drm/UEventListener.cpp @@ -22,7 +22,7 @@ #include "utils/log.h" -namespace android { +namespace android::drm_hwcomposer { UEventListener::~UEventListener() { StopThread(); @@ -69,4 +69,4 @@ void UEventListener::ThreadFn() { ALOGI("UEvent thread exit"); } -} // namespace android +} // namespace android::drm_hwcomposer diff --git a/drm/UEventListener.h b/drm/UEventListener.h index 3052b57..44580cc 100644 --- a/drm/UEventListener.h +++ b/drm/UEventListener.h @@ -22,7 +22,7 @@ #include "utils/UEvent.h" -namespace android { +namespace android::drm_hwcomposer { class UEventListener { public: @@ -48,4 +48,5 @@ class UEventListener { std::function hotplug_handler_; }; -} // namespace android + +} // namespace android::drm_hwcomposer diff --git a/drm/VSyncWorker.cpp b/drm/VSyncWorker.cpp index f27e381..08dc9ea 100644 --- a/drm/VSyncWorker.cpp +++ b/drm/VSyncWorker.cpp @@ -28,7 +28,7 @@ #include "drm/ResourceManager.h" #include "utils/log.h" -namespace android { +namespace android::drm_hwcomposer { auto VSyncWorker::CreateInstance(std::shared_ptr &pipe) -> std::unique_ptr { @@ -222,4 +222,5 @@ void VSyncWorker::ThreadFn() { ALOGI("VSyncWorker thread exit"); } -} // namespace android + +} // namespace android::drm_hwcomposer diff --git a/drm/VSyncWorker.h b/drm/VSyncWorker.h index cdeae21..72869f5 100644 --- a/drm/VSyncWorker.h +++ b/drm/VSyncWorker.h @@ -26,7 +26,7 @@ #include "DrmDevice.h" -namespace android { +namespace android::drm_hwcomposer { class VSyncWorker { public: @@ -87,4 +87,5 @@ class VSyncWorker { std::thread vswt_; std::mutex mutex_; }; -} // namespace android + +} // namespace android::drm_hwcomposer diff --git a/hwc/HwcDisplay.cpp b/hwc/HwcDisplay.cpp index 48c9eb9..c4ffc7f 100644 --- a/hwc/HwcDisplay.cpp +++ b/hwc/HwcDisplay.cpp @@ -31,10 +31,9 @@ #include "drm/DrmHwc.h" #include "utils/properties.h" -using ::android::DrmDisplayPipeline; using ColorGamut = ::android::ColorSpace; -namespace android { +namespace android::drm_hwcomposer { namespace { @@ -1177,4 +1176,4 @@ void HwcDisplay::SetConfigGroupsForActiveConfig() { configs_.SanitizeGroups(); } -} // namespace android +} // namespace android::drm_hwcomposer diff --git a/hwc/HwcDisplay.h b/hwc/HwcDisplay.h index c6f6c54..704411e 100644 --- a/hwc/HwcDisplay.h +++ b/hwc/HwcDisplay.h @@ -30,7 +30,7 @@ #include "drm/VSyncWorker.h" #include "stats/CompositionStats.h" -namespace android { +namespace android::drm_hwcomposer { using DisplayHandle = int64_t; @@ -320,4 +320,4 @@ class HwcDisplay { std::shared_ptr frontend_private_data_; }; -} // namespace android +} // namespace android::drm_hwcomposer diff --git a/hwc/HwcDisplayConfigs.cpp b/hwc/HwcDisplayConfigs.cpp index 9a1ff5a..8400a80 100644 --- a/hwc/HwcDisplayConfigs.cpp +++ b/hwc/HwcDisplayConfigs.cpp @@ -34,7 +34,7 @@ constexpr uint32_t kBackPorch = 10; constexpr uint32_t kFrontPorch = 10; constexpr uint32_t kHzInKHz = 1000; -namespace android { +namespace android::drm_hwcomposer { void HwcDisplayConfigs::GenFakeMode(uint16_t width, uint16_t height) { hwc_configs.clear(); @@ -177,4 +177,4 @@ bool HwcDisplayConfigs::SanitizeGroups() { return true; } -} // namespace android +} // namespace android::drm_hwcomposer diff --git a/hwc/HwcDisplayConfigs.h b/hwc/HwcDisplayConfigs.h index a4e4d12..c7e4f01 100644 --- a/hwc/HwcDisplayConfigs.h +++ b/hwc/HwcDisplayConfigs.h @@ -20,7 +20,7 @@ #include "drm/DrmMode.h" -namespace android { +namespace android::drm_hwcomposer { using ConfigId = int32_t; @@ -69,4 +69,4 @@ struct HwcDisplayConfigs { uint32_t mm_height = 0; }; -} // namespace android +} // namespace android::drm_hwcomposer diff --git a/hwc/HwcLayer.cpp b/hwc/HwcLayer.cpp index d9dfdfd..f3482c2 100644 --- a/hwc/HwcLayer.cpp +++ b/hwc/HwcLayer.cpp @@ -22,7 +22,7 @@ #include "bufferinfo/BufferInfoGetter.h" #include "utils/log.h" -namespace android { +namespace android::drm_hwcomposer { void HwcLayer::SetLayerProperties(const LayerProperties& layer_properties) { if (layer_properties.slot_buffer) { @@ -132,4 +132,4 @@ bool HwcLayer::IsLayerUsableAsDevice() const { return it->second.fb != nullptr; } -} // namespace android \ No newline at end of file +} // namespace android::drm_hwcomposer diff --git a/hwc/HwcLayer.h b/hwc/HwcLayer.h index a3a69bd..c28fafb 100644 --- a/hwc/HwcLayer.h +++ b/hwc/HwcLayer.h @@ -23,7 +23,7 @@ #include "compositor/LayerData.h" #include "utils/fd.h" -namespace android { +namespace android::drm_hwcomposer { class HwcDisplay; @@ -147,4 +147,4 @@ class HwcLayer { bool IsLayerUsableAsDevice() const; }; -} // namespace android +} // namespace android::drm_hwcomposer diff --git a/hwc2_device/DrmHwcTwo.cpp b/hwc2_device/DrmHwcTwo.cpp index 93cf7ba..95ef75c 100644 --- a/hwc2_device/DrmHwcTwo.cpp +++ b/hwc2_device/DrmHwcTwo.cpp @@ -23,7 +23,7 @@ #include "backend/Backend.h" #include "utils/log.h" -namespace android { +namespace android::drm_hwcomposer { HWC2::Error DrmHwcTwo::RegisterCallback(int32_t descriptor, hwc2_callback_data_t data, @@ -122,4 +122,4 @@ const std::string& DrmHwcTwo::RefreshStateDump() { return last_state_dump_; } -} // namespace android +} // namespace android::drm_hwcomposer diff --git a/hwc2_device/DrmHwcTwo.h b/hwc2_device/DrmHwcTwo.h index e085913..deb9deb 100644 --- a/hwc2_device/DrmHwcTwo.h +++ b/hwc2_device/DrmHwcTwo.h @@ -20,7 +20,7 @@ #include "drm/DrmHwc.h" -namespace android { +namespace android::drm_hwcomposer { class DrmHwcTwo : public DrmHwc { public: @@ -54,4 +54,5 @@ class DrmHwcTwo : public DrmHwc { std::string last_state_dump_; }; -} // namespace android + +} // namespace android::drm_hwcomposer diff --git a/hwc2_device/hwc2_device.cpp b/hwc2_device/hwc2_device.cpp index dce30e2..269be24 100644 --- a/hwc2_device/hwc2_device.cpp +++ b/hwc2_device/hwc2_device.cpp @@ -34,7 +34,7 @@ #include "hwc/HwcLayer.h" #include "utils/log.h" -namespace android { +namespace android::drm_hwcomposer { static int32_t ConfigErrorToHWC2(HwcDisplay::ConfigError result) { switch (result) { @@ -1490,11 +1490,11 @@ static int HookDevOpen(const struct hw_module_t *module, const char *name, return 0; } -} // namespace android +} // namespace android::drm_hwcomposer // NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables) static struct hw_module_methods_t hwc2_module_methods = { - .open = android::HookDevOpen, + .open = android::drm_hwcomposer::HookDevOpen, }; // NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables) diff --git a/hwc3/Composer.cpp b/hwc3/Composer.cpp index c369f49..17e1ec8 100644 --- a/hwc3/Composer.cpp +++ b/hwc3/Composer.cpp @@ -27,7 +27,7 @@ #include "utils/log.h" #include "utils/properties.h" -using ::android::Properties; +using ::android::drm_hwcomposer::Properties; namespace aidl::android::hardware::graphics::composer3::impl { diff --git a/hwc3/ComposerClient.cpp b/hwc3/ComposerClient.cpp index b3cfcc0..bcd32e4 100644 --- a/hwc3/ComposerClient.cpp +++ b/hwc3/ComposerClient.cpp @@ -50,24 +50,23 @@ #include "stats/CompositionStatsAtomReporter.h" #include "stats/CompositionStatsPoller.h" -using ::android::BufferBlendMode; -using ::android::BufferColorSpace; -using ::android::BufferSampleRange; -using ::android::CompositionStatsAtomReporter; -using ::android::CompositionStatsPoller; -using ::android::CompositionType; -using ::android::DamageInfo; -using ::android::DisplayHandle; -using ::android::DstRectInfo; -using ::android::HwcDisplay; -using ::android::HwcDisplayConfig; -using ::android::HwcLayer; -using ::android::IRect; -using ::android::LayerTransform; -using ::android::PanelOrientation; -using ::android::SrcRectInfo; +using ::android::drm_hwcomposer::BufferBlendMode; +using ::android::drm_hwcomposer::BufferColorSpace; +using ::android::drm_hwcomposer::BufferSampleRange; +using ::android::drm_hwcomposer::CompositionStatsPoller; +using ::android::drm_hwcomposer::CompositionType; +using ::android::drm_hwcomposer::DamageInfo; +using ::android::drm_hwcomposer::DisplayHandle; +using ::android::drm_hwcomposer::DstRectInfo; +using ::android::drm_hwcomposer::HwcDisplay; +using ::android::drm_hwcomposer::HwcDisplayConfig; +using ::android::drm_hwcomposer::HwcLayer; +using ::android::drm_hwcomposer::IRect; +using ::android::drm_hwcomposer::LayerTransform; +using ::android::drm_hwcomposer::PanelOrientation; +using ::android::drm_hwcomposer::SrcRectInfo; -using HwcOutputType = ::android::OutputType; +using HwcOutputType = ::android::drm_hwcomposer::OutputType; #if __ANDROID_API__ >= 36 using AidlOutputType = aidl::android::hardware::graphics::composer3::OutputType; #endif @@ -216,7 +215,7 @@ std::optional> AidlToColorTransformMatrix( } std::array - color_transform_matrix = ::android::kIdentityMatrix; + color_transform_matrix = ::android::drm_hwcomposer::kIdentityMatrix; std::copy(aidl_color_transform_matrix->begin(), aidl_color_transform_matrix->end(), color_transform_matrix.begin()); return color_transform_matrix; @@ -376,7 +375,7 @@ std::optional AidlToDamage( } // namespace -class Hwc3BufferHandle : public ::android::PrimeFdsSharedBase { +class Hwc3BufferHandle : public ::android::drm_hwcomposer::PrimeFdsSharedBase { public: static auto Create(buffer_handle_t handle) -> std::shared_ptr { @@ -406,10 +405,11 @@ class Hwc3BufferHandle : public ::android::PrimeFdsSharedBase { buffer_handle_t imported_handle_{}; }; -class Hwc3Layer : public ::android::FrontendLayerBase { +class Hwc3Layer : public ::android::drm_hwcomposer::FrontendLayerBase { public: auto HandleNextBuffer(std::optional raw_handle, - ::android::SharedFd fence_fd, int32_t slot_id) + ::android::drm_hwcomposer::SharedFd fence_fd, + int32_t slot_id) -> std::optional { HwcLayer::LayerProperties lp; if (!raw_handle && slots_.count(slot_id) != 0) { @@ -431,8 +431,8 @@ class Hwc3Layer : public ::android::FrontendLayerBase { return std::nullopt; } - auto bi = ::android::BufferInfoGetter::GetInstance()->GetBoInfo( - hwc3->GetHandle()); + auto bi = ::android::drm_hwcomposer::BufferInfoGetter::GetInstance() + ->GetBoInfo(hwc3->GetHandle()); if (bi) { bi->fds_shared = hwc3; @@ -495,7 +495,8 @@ void ComposerClient::Init() { DEBUG_FUNC(); hwc_ = std::make_unique(); - auto reporter = CompositionStatsAtomReporter::Create(); + auto reporter = ::android::drm_hwcomposer::CompositionStatsAtomReporter:: + Create(); if (reporter) { stats_poller_ = std::make_unique(std::move( reporter), @@ -586,7 +587,7 @@ ndk::ScopedAStatus ComposerClient::destroyVirtualDisplay( return ndk::ScopedAStatus::ok(); } -::android::HwcDisplay* ComposerClient::GetDisplay(int64_t display_handle) { +HwcDisplay* ComposerClient::GetDisplay(int64_t display_handle) { return hwc_->GetDisplay(static_cast(display_handle)); } @@ -660,9 +661,11 @@ void ComposerClient::DispatchLayerCommand(int64_t display_handle, auto fence = const_cast<::ndk::ScopedFileDescriptor&>(command.buffer->fence) .release(); - auto lp = hwc3_layer->HandleNextBuffer(buffer_handle, - ::android::MakeSharedFd(fence), - command.buffer->slot); + auto lp = hwc3_layer + ->HandleNextBuffer(buffer_handle, + ::android::drm_hwcomposer::MakeSharedFd( + fence), + command.buffer->slot); if (!lp) { cmd_result_writer_->AddError(hwc3::Error::kBadLayer); @@ -785,7 +788,7 @@ void ComposerClient::ExecuteDisplayCommand(const DisplayCommand& command) { return; } - ::android::SharedFd present_fence; + ::android::drm_hwcomposer::SharedFd present_fence; std::vector release_fences; bool ret = display->PresentStagedComposition(hwc3_display ->desired_present_time, @@ -798,11 +801,13 @@ void ComposerClient::ExecuteDisplayCommand(const DisplayCommand& command) { using ::android::base::unique_fd; cmd_result_writer_->AddPresentFence( // - display_handle, unique_fd(::android::DupFd(present_fence))); + display_handle, + unique_fd(::android::drm_hwcomposer::DupFd(present_fence))); std::unordered_map hal_release_fences; for (const auto& [layer_id, release_fence] : release_fences) { - hal_release_fences[layer_id] = unique_fd(::android::DupFd(release_fence)); + hal_release_fences[layer_id] = unique_fd( + ::android::drm_hwcomposer::DupFd(release_fence)); } cmd_result_writer_->AddReleaseFence(display_handle, hal_release_fences); } @@ -865,8 +870,9 @@ ndk::ScopedAStatus ComposerClient::getDataspaceSaturationMatrix( } matrix->clear(); - matrix->insert(matrix->begin(), ::android::kIdentityMatrix.begin(), - ::android::kIdentityMatrix.end()); + matrix->insert(matrix->begin(), + ::android::drm_hwcomposer::kIdentityMatrix.begin(), + ::android::drm_hwcomposer::kIdentityMatrix.end()); return ndk::ScopedAStatus::ok(); } @@ -931,7 +937,7 @@ ndk::ScopedAStatus ComposerClient::getDisplayCapabilities( // Skip color transform altogether if device/drm cannot support it. if (hwc_->GetResMan().GetCtmHandling() == - ::android::CtmHandling::kDrmOrIgnore) { + ::android::drm_hwcomposer::CtmHandling::kDrmOrIgnore) { caps->emplace_back(DisplayCapability::SKIP_CLIENT_COLOR_TRANSFORM); } return ndk::ScopedAStatus::ok(); @@ -1147,7 +1153,8 @@ ndk::ScopedAStatus ComposerClient::getReadbackBufferFence( return ToBinderStatus(hwc3::Error::kUnsupported); } - ::android::SharedFd fence = display->GetWritebackBufferFence(); + ::android::drm_hwcomposer::SharedFd fence = display + ->GetWritebackBufferFence(); display->SetWritebackEnabled(false); display->GetWritebackLayer()->ClearSlots(); if (!fence) { @@ -1156,7 +1163,8 @@ ndk::ScopedAStatus ComposerClient::getReadbackBufferFence( } if (fence && *fence >= 0) { - *acquire_fence = ndk::ScopedFileDescriptor(::android::DupFd(fence)); + *acquire_fence = ndk::ScopedFileDescriptor( + ::android::drm_hwcomposer::DupFd(fence)); } return ndk::ScopedAStatus::ok(); @@ -1219,7 +1227,8 @@ ndk::ScopedAStatus ComposerClient::setActiveConfig(int64_t display_handle, VsyncPeriodChangeTimeline timeline; VsyncPeriodChangeConstraints constraints = { - .desiredTimeNanos = ::android::ResourceManager::GetTimeMonotonicNs(), + .desiredTimeNanos = ::android::drm_hwcomposer::ResourceManager:: + GetTimeMonotonicNs(), .seamlessRequired = false, }; return setActiveConfigWithConstraints(display_handle, config, constraints, @@ -1259,7 +1268,7 @@ ndk::ScopedAStatus ComposerClient::setActiveConfigWithConstraints( // Always try to queue a seamless commit to reduce jank and flicker artifacts. // Fall-back to a full blocking commit otherwise. - ::android::QueuedConfigTiming timing{}; + ::android::drm_hwcomposer::QueuedConfigTiming timing{}; auto error = display->QueueConfig(config, constraints.desiredTimeNanos, &timing); if (error == HwcDisplay::kNone) { @@ -1273,8 +1282,8 @@ ndk::ScopedAStatus ComposerClient::setActiveConfigWithConstraints( config); error = display->SetConfig(config); - timeline->newVsyncAppliedTimeNanos = ::android::ResourceManager:: - GetTimeMonotonicNs(); + timeline->newVsyncAppliedTimeNanos = ::android::drm_hwcomposer:: + ResourceManager::GetTimeMonotonicNs(); timeline->refreshRequired = false; } @@ -1353,7 +1362,8 @@ ndk::ScopedAStatus ComposerClient::setColorMode(int64_t display_handle, if (intent != RenderIntent::COLORIMETRIC) return ToBinderStatus(hwc3::Error::kUnsupported); - display->SetColorMode(static_cast<::android::ColorMode>(mode)); + display->SetColorMode( + static_cast<::android::drm_hwcomposer::ColorMode>(mode)); return ToBinderStatus(hwc3::Error::kNone); } @@ -1445,14 +1455,14 @@ ndk::ScopedAStatus ComposerClient::setReadbackBuffer( HwcLayer::LayerProperties properties; properties.slot_buffer = { .slot_id = 0, - .bi = ::android::BufferInfoGetter::GetInstance()->GetBoInfo( - imported_handle), + .bi = ::android::drm_hwcomposer::BufferInfoGetter::GetInstance() + ->GetBoInfo(imported_handle), }; ndk::ScopedFileDescriptor release_fence = ndk::ScopedFileDescriptor( release_fence_in.get()); properties.active_slot = { .slot_id = 0, - .fence = ::android::MakeSharedFd(release_fence.release()), + .fence = ::android::drm_hwcomposer::MakeSharedFd(release_fence.release()), }; properties.blend_mode = BufferBlendMode::kNone; @@ -1583,7 +1593,8 @@ void ComposerClient::ExecuteSetDisplayClientTarget( .release(); auto properties = hwc3layer->HandleNextBuffer(raw_buffer, - ::android::MakeSharedFd(fence), + ::android::drm_hwcomposer:: + MakeSharedFd(fence), command.buffer.slot); if (!properties) { @@ -1626,7 +1637,8 @@ void ComposerClient::ExecuteSetDisplayOutputBuffer(int64_t display_handle, auto fence = const_cast<::ndk::ScopedFileDescriptor&>(buffer.fence).release(); auto properties = hwc3layer->HandleNextBuffer(raw_buffer, - ::android::MakeSharedFd(fence), + ::android::drm_hwcomposer:: + MakeSharedFd(fence), buffer.slot); if (!properties) { diff --git a/hwc3/ComposerClient.h b/hwc3/ComposerClient.h index b626006..a2ddf4b 100644 --- a/hwc3/ComposerClient.h +++ b/hwc3/ComposerClient.h @@ -28,10 +28,10 @@ using AidlPixelFormat = aidl::android::hardware::graphics::common::PixelFormat; using AidlNativeHandle = aidl::android::hardware::common::NativeHandle; -namespace android { +namespace android::drm_hwcomposer { class CompositionStatsPoller; class HwcDisplay; -} // namespace android +} // namespace android::drm_hwcomposer namespace aidl::android::hardware::graphics::composer3::impl { using AidlColorMode = ColorMode; @@ -160,9 +160,9 @@ class ComposerClient : public BnComposerClient { ::ndk::SpAIBinder createBinder() override; private: - hwc3::Error ImportLayerBuffer(int64_t display_handle, int64_t layer_id, - const Buffer& buffer, - ::android::HwcLayer::Buffer* out_buffer); + hwc3::Error ImportLayerBuffer( + int64_t display_handle, int64_t layer_id, const Buffer& buffer, + ::android::drm_hwcomposer::HwcLayer::Buffer* out_buffer); // Layer commands void DispatchLayerCommand(int64_t display_handle, @@ -175,13 +175,14 @@ class ComposerClient : public BnComposerClient { void ExecuteSetDisplayOutputBuffer(int64_t display_handle, const Buffer& buffer); - ::android::HwcDisplay* GetDisplay(int64_t display_handle); + ::android::drm_hwcomposer::HwcDisplay* GetDisplay(int64_t display_handle); std::unique_ptr cmd_result_writer_; std::unique_ptr hwc_; - std::unique_ptr<::android::CompositionStatsPoller> stats_poller_; + std::unique_ptr<::android::drm_hwcomposer::CompositionStatsPoller> + stats_poller_; }; } // namespace aidl::android::hardware::graphics::composer3::impl diff --git a/hwc3/DrmHwcThree.cpp b/hwc3/DrmHwcThree.cpp index c6f2284..0f15f73 100644 --- a/hwc3/DrmHwcThree.cpp +++ b/hwc3/DrmHwcThree.cpp @@ -26,7 +26,7 @@ namespace aidl::android::hardware::graphics::composer3::impl { -auto DrmHwcThree::GetHwc3Display(::android::HwcDisplay& display) +auto DrmHwcThree::GetHwc3Display(::android::drm_hwcomposer::HwcDisplay& display) -> std::shared_ptr { auto frontend_private_data = display.GetFrontendPrivateData(); if (!frontend_private_data) { @@ -47,7 +47,8 @@ void DrmHwcThree::Init(std::shared_ptr callback) { } void DrmHwcThree::SendVsyncPeriodTimingChangedEventToClient( - ::android::DisplayHandle display_handle, int64_t timestamp) const { + ::android::drm_hwcomposer::DisplayHandle display_handle, + int64_t timestamp) const { VsyncPeriodChangeTimeline timeline; timeline.newVsyncAppliedTimeNanos = timestamp; timeline.refreshRequired = false; @@ -59,7 +60,7 @@ void DrmHwcThree::SendVsyncPeriodTimingChangedEventToClient( } void DrmHwcThree::SendRefreshEventToClient( - ::android::DisplayHandle display_handle) { + ::android::drm_hwcomposer::DisplayHandle display_handle) { { const std::scoped_lock lock(must_validate_lock_); must_validate_.insert(display_handle); @@ -68,14 +69,14 @@ void DrmHwcThree::SendRefreshEventToClient( } void DrmHwcThree::SendVsyncEventToClient( - ::android::DisplayHandle display_handle, int64_t timestamp, + ::android::drm_hwcomposer::DisplayHandle display_handle, int64_t timestamp, uint32_t vsync_period) const { composer_callback_->onVsync(static_cast(display_handle), timestamp, static_cast(vsync_period)); } void DrmHwcThree::SendHotplugEventToClient( - ::android::DisplayHandle display_handle, + ::android::drm_hwcomposer::DisplayHandle display_handle, DrmHwc::DisplayStatus display_status) { common::DisplayHotplugEvent event = common::DisplayHotplugEvent::DISCONNECTED; switch (display_status) { @@ -97,13 +98,13 @@ void DrmHwcThree::SendHotplugEventToClient( } auto DrmHwcThree::GetMustValidateDisplay( - ::android::DisplayHandle display_handle) -> bool { + ::android::drm_hwcomposer::DisplayHandle display_handle) -> bool { std::scoped_lock lock(must_validate_lock_); return must_validate_.find(display_handle) != must_validate_.end(); } void DrmHwcThree::ClearMustValidateDisplay( - ::android::DisplayHandle display_handle) { + ::android::drm_hwcomposer::DisplayHandle display_handle) { std::scoped_lock lock(must_validate_lock_); must_validate_.erase(display_handle); } diff --git a/hwc3/DrmHwcThree.h b/hwc3/DrmHwcThree.h index 722d72d..c9f65ce 100644 --- a/hwc3/DrmHwcThree.h +++ b/hwc3/DrmHwcThree.h @@ -24,7 +24,7 @@ namespace aidl::android::hardware::graphics::composer3::impl { -class Hwc3Display : public ::android::FrontendDisplayBase { +class Hwc3Display : public ::android::drm_hwcomposer::FrontendDisplayBase { public: // Desired present time for a composition that has been validated but not // yet presented. nullopt means it should be presented at the next vsync. @@ -33,7 +33,7 @@ class Hwc3Display : public ::android::FrontendDisplayBase { int64_t next_layer_id = 1; }; -class DrmHwcThree : public ::android::DrmHwc { +class DrmHwcThree : public ::android::drm_hwcomposer::DrmHwc { public: explicit DrmHwcThree() = default; ~DrmHwcThree() override; @@ -41,28 +41,32 @@ class DrmHwcThree : public ::android::DrmHwc { void Init(std::shared_ptr callback); // DrmHwcInterface - void SendVsyncEventToClient(::android::DisplayHandle display_handle, - int64_t timestamp, - uint32_t vsync_period) const override; + void SendVsyncEventToClient( + ::android::drm_hwcomposer::DisplayHandle display_handle, + int64_t timestamp, uint32_t vsync_period) const override; void SendVsyncPeriodTimingChangedEventToClient( - ::android::DisplayHandle display_handle, + ::android::drm_hwcomposer::DisplayHandle display_handle, int64_t timestamp) const override; void SendRefreshEventToClient( - ::android::DisplayHandle display_handle) override; - void SendHotplugEventToClient(::android::DisplayHandle display_handle, - DrmHwc::DisplayStatus display_status) override; + ::android::drm_hwcomposer::DisplayHandle display_handle) override; + void SendHotplugEventToClient( + ::android::drm_hwcomposer::DisplayHandle display_handle, + DrmHwc::DisplayStatus display_status) override; - static auto GetHwc3Display(::android::HwcDisplay& display) + static auto GetHwc3Display(::android::drm_hwcomposer::HwcDisplay& display) -> std::shared_ptr; - auto GetMustValidateDisplay(::android::DisplayHandle display_handle) -> bool; - void ClearMustValidateDisplay(::android::DisplayHandle display_handle); + auto GetMustValidateDisplay( + ::android::drm_hwcomposer::DisplayHandle display_handle) -> bool; + void ClearMustValidateDisplay( + ::android::drm_hwcomposer::DisplayHandle display_handle); private: std::shared_ptr composer_callback_; std::mutex must_validate_lock_; - std::set<::android::DisplayHandle> must_validate_ + std::set<::android::drm_hwcomposer::DisplayHandle> must_validate_ GUARDED_BY(must_validate_lock_); }; + } // namespace aidl::android::hardware::graphics::composer3::impl diff --git a/stats/CompositionStats.cpp b/stats/CompositionStats.cpp index e964558..643fbf5 100644 --- a/stats/CompositionStats.cpp +++ b/stats/CompositionStats.cpp @@ -16,7 +16,7 @@ #include "stats/CompositionStats.h" -namespace android { +namespace android::drm_hwcomposer { CompositionStats operator-(const CompositionStats& a, const CompositionStats& b) { @@ -39,4 +39,4 @@ void CompositionStatsTracker::ReportStats(const Callback& callback) { previous_stats_ = new_stats; } -} // namespace android \ No newline at end of file +} // namespace android::drm_hwcomposer diff --git a/stats/CompositionStats.h b/stats/CompositionStats.h index aa65c91..342f90d 100644 --- a/stats/CompositionStats.h +++ b/stats/CompositionStats.h @@ -20,7 +20,7 @@ #include #include -namespace android { +namespace android::drm_hwcomposer { struct CompositionStats { uint32_t total_frames = 0; @@ -70,4 +70,4 @@ class CompositionStatsTracker { std::map previous_stats_; }; -} // namespace android +} // namespace android::drm_hwcomposer diff --git a/stats/CompositionStatsAtomReporter.cpp b/stats/CompositionStatsAtomReporter.cpp index 9fc8a46..d097999 100644 --- a/stats/CompositionStatsAtomReporter.cpp +++ b/stats/CompositionStatsAtomReporter.cpp @@ -20,7 +20,7 @@ #include "utils/log.h" -namespace android { +namespace android::drm_hwcomposer { std::unique_ptr CompositionStatsAtomReporter::Create() { @@ -28,4 +28,4 @@ CompositionStatsAtomReporter::Create() { return {}; } -} // namespace android \ No newline at end of file +} // namespace android::drm_hwcomposer diff --git a/stats/CompositionStatsAtomReporter.h b/stats/CompositionStatsAtomReporter.h index a7fb863..92e0416 100644 --- a/stats/CompositionStatsAtomReporter.h +++ b/stats/CompositionStatsAtomReporter.h @@ -18,7 +18,7 @@ #include -namespace android { +namespace android::drm_hwcomposer { // CompositionStatsAtomReporter is a wrapper around creation of a VendorAtom // and pushing it to the IStats::reportVendorAtom interface. @@ -35,4 +35,4 @@ class CompositionStatsAtomReporter { virtual ~CompositionStatsAtomReporter() = default; }; -} // namespace android +} // namespace android::drm_hwcomposer diff --git a/stats/CompositionStatsAtomReporterDesktop.cpp b/stats/CompositionStatsAtomReporterDesktop.cpp index e5e65d0..bbee6de 100644 --- a/stats/CompositionStatsAtomReporterDesktop.cpp +++ b/stats/CompositionStatsAtomReporterDesktop.cpp @@ -32,7 +32,7 @@ using aidl::android::frameworks::stats::IStats; using aidl::android::frameworks::stats::VendorAtom; namespace DesktopAtoms = android::vendor::google::desktop::stats::DesktopAtoms; -namespace android { +namespace android::drm_hwcomposer { namespace { const std::string kStatsServiceName = std::string(IStats::descriptor) @@ -80,4 +80,4 @@ CompositionStatsAtomReporter::Create() { return std::make_unique(); } -} // namespace android \ No newline at end of file +} // namespace android::drm_hwcomposer diff --git a/stats/CompositionStatsPoller.cpp b/stats/CompositionStatsPoller.cpp index 82c8867..b7e2aff 100644 --- a/stats/CompositionStatsPoller.cpp +++ b/stats/CompositionStatsPoller.cpp @@ -21,7 +21,7 @@ #include "hwc/HwcDisplay.h" #include "stats/CompositionStatsAtomReporter.h" -namespace android { +namespace android::drm_hwcomposer { CompositionStatsPoller::CompositionStatsPoller( std::unique_ptr reporter, @@ -63,4 +63,4 @@ void CompositionStatsPoller::PollFunc() { } } -} // namespace android \ No newline at end of file +} // namespace android::drm_hwcomposer diff --git a/stats/CompositionStatsPoller.h b/stats/CompositionStatsPoller.h index ec4af09..e286089 100644 --- a/stats/CompositionStatsPoller.h +++ b/stats/CompositionStatsPoller.h @@ -25,7 +25,7 @@ #include -namespace android { +namespace android::drm_hwcomposer { class CompositionStatsAtomReporter; @@ -53,4 +53,4 @@ class CompositionStatsPoller { std::unique_ptr reporter_; }; -} // namespace android +} // namespace android::drm_hwcomposer diff --git a/stats/CompositionStatsTest.cpp b/stats/CompositionStatsTest.cpp index 6ee2caf..b68ae5e 100644 --- a/stats/CompositionStatsTest.cpp +++ b/stats/CompositionStatsTest.cpp @@ -28,7 +28,7 @@ using ::testing::NiceMock; using ::testing::Return; using ::testing::StrictMock; -namespace android { +namespace android::drm_hwcomposer { // Equality operator to be used by Eq, ASSERT_EQ, etc. Needs to be static rather // than in anonymous namespace to ensure gmock can find it. @@ -301,4 +301,4 @@ TEST_F(CompositionStatsTrackerTest, ReportStatsDisplayRemoved) { tracker_->ReportStats(mock_callback.AsStdFunction()); } -} // namespace android +} // namespace android::drm_hwcomposer diff --git a/tests/uevent_print.cpp b/tests/uevent_print.cpp index cfe2191..d7b49b9 100644 --- a/tests/uevent_print.cpp +++ b/tests/uevent_print.cpp @@ -5,7 +5,7 @@ #include "utils/UEvent.h" int main() { - auto uevent = android::UEvent::CreateInstance(); + auto uevent = android::drm_hwcomposer::UEvent::CreateInstance(); if (!uevent) { std::cout << "Can't initialize UEvent class\n"; return -ENODEV; diff --git a/utils/EdidWrapper.h b/utils/EdidWrapper.h index 1e00a6a..8d3a6fe 100644 --- a/utils/EdidWrapper.h +++ b/utils/EdidWrapper.h @@ -28,7 +28,7 @@ extern "C" { #include "compositor/DisplayInfo.h" #include "drm/DrmUnique.h" -namespace android { +namespace android::drm_hwcomposer { // Stub wrapper class for edid parsing class EdidWrapper { @@ -84,4 +84,4 @@ class LibdisplayEdidWrapper final : public EdidWrapper { }; #endif -} // namespace android +} // namespace android::drm_hwcomposer diff --git a/utils/LibdisplayEdidWrapper.cpp b/utils/LibdisplayEdidWrapper.cpp index 4545d29..0ce3659 100644 --- a/utils/LibdisplayEdidWrapper.cpp +++ b/utils/LibdisplayEdidWrapper.cpp @@ -21,7 +21,7 @@ #include "utils/EdidWrapper.h" #include "utils/log.h" -namespace android { +namespace android::drm_hwcomposer { auto LibdisplayEdidWrapper::Create(DrmModePropertyBlobUnique blob) -> std::unique_ptr { @@ -110,5 +110,6 @@ auto LibdisplayEdidWrapper::GetBoundsMm() -> std::pair { return {dtd->horiz_image_mm, dtd->vert_image_mm}; } -} // namespace android +} // namespace android::drm_hwcomposer + #endif diff --git a/utils/UEvent.h b/utils/UEvent.h index 555700e..102b867 100644 --- a/utils/UEvent.h +++ b/utils/UEvent.h @@ -29,7 +29,7 @@ #include "fd.h" #include "log.h" -namespace android { +namespace android::drm_hwcomposer { class UEvent { public: @@ -143,4 +143,4 @@ class UEvent { UniqueFd stop_event_fd_; }; -} // namespace android +} // namespace android::drm_hwcomposer diff --git a/utils/fd.cpp b/utils/fd.cpp index 15570c5..92ed181 100644 --- a/utils/fd.cpp +++ b/utils/fd.cpp @@ -16,7 +16,7 @@ #include "fd.h" -namespace android { +namespace android::drm_hwcomposer { static void CloseFd(const int *fd) { if (fd != nullptr) { @@ -49,4 +49,4 @@ auto DupFd(SharedFd const &fd) -> int { return fcntl(*fd, F_DUPFD_CLOEXEC, 0); } -} // namespace android +} // namespace android::drm_hwcomposer diff --git a/utils/fd.h b/utils/fd.h index 6bfd0fa..43f9531 100644 --- a/utils/fd.h +++ b/utils/fd.h @@ -22,7 +22,7 @@ #include #include -namespace android { +namespace android::drm_hwcomposer { using UniqueFd = std::unique_ptr; using SharedFd = std::shared_ptr; @@ -33,4 +33,4 @@ auto MakeSharedFd(int fd) -> SharedFd; auto DupFd(SharedFd const &fd) -> int; -} // namespace android +} // namespace android::drm_hwcomposer diff --git a/utils/properties.cpp b/utils/properties.cpp index 5a874c5..a57f2fe 100644 --- a/utils/properties.cpp +++ b/utils/properties.cpp @@ -82,7 +82,7 @@ auto inline property_get_bool(const char *key, int8_t default_value) -> int8_t { } // namespace #endif -namespace android { +namespace android::drm_hwcomposer { /** * @brief Determine if the "Present Not Reliable" property is enabled. @@ -144,4 +144,4 @@ auto Properties::GetDevicePath() -> std::string { return {path_pattern}; } -} // namespace android +} // namespace android::drm_hwcomposer diff --git a/utils/properties.h b/utils/properties.h index e127761..0138e9b 100644 --- a/utils/properties.h +++ b/utils/properties.h @@ -19,7 +19,7 @@ #include #include -namespace android { +namespace android::drm_hwcomposer { enum class CtmHandling { kDrmOrGpu, /* Handled by DRM is possible, otherwise by GPU */ @@ -38,4 +38,4 @@ class Properties { static auto GetDevicePath() -> std::string; }; -} // namespace android +} // namespace android::drm_hwcomposer