From d4ab368f7f66e541abd098e0605600f65f74178f Mon Sep 17 00:00:00 2001 From: Andrew Wolfers Date: Thu, 4 Sep 2025 20:17:12 +0000 Subject: [PATCH] drm_hwcomposer: Add missing namespaces Change-Id: I2ac3580664018cf63dc14e9f8025c2e60f843e3c --- bufferinfo/BufferInfo.h | 4 ++++ compositor/DisplayInfo.h | 4 ++++ drm/DrmUnique.h | 4 ++++ hwc3/ComposerClient.cpp | 17 +++++++++++------ 4 files changed, 23 insertions(+), 6 deletions(-) diff --git a/bufferinfo/BufferInfo.h b/bufferinfo/BufferInfo.h index db4c53e..96cd06d 100644 --- a/bufferinfo/BufferInfo.h +++ b/bufferinfo/BufferInfo.h @@ -19,6 +19,8 @@ #include #include +namespace android { + constexpr int kBufferMaxPlanes = 4; enum class BufferColorSpace : int32_t { @@ -66,3 +68,5 @@ struct BufferInfo { * closed while the BufferInfo is still in use. */ std::shared_ptr fds_shared; }; + +} // namespace android diff --git a/compositor/DisplayInfo.h b/compositor/DisplayInfo.h index 0913b99..15fcb8f 100644 --- a/compositor/DisplayInfo.h +++ b/compositor/DisplayInfo.h @@ -19,6 +19,8 @@ #include #include +namespace android { + /* * 4x4 Identity matrix used for color transformations. */ @@ -100,3 +102,5 @@ struct QueuedConfigTiming { // The time when the display will start to refresh at the new vsync period. int64_t new_vsync_time_ns; }; + +} // namespace android diff --git a/drm/DrmUnique.h b/drm/DrmUnique.h index 2be1eb9..0afa067 100644 --- a/drm/DrmUnique.h +++ b/drm/DrmUnique.h @@ -21,6 +21,8 @@ #include #include +namespace android { + template using DUniquePtr = std::unique_ptr>; @@ -82,3 +84,5 @@ auto inline MakeDrmModeResUnique(int fd) { return DrmModeResUnique(drmModeGetResources(fd), [](drmModeRes *it) { drmModeFreeResources(it); }); } + +} // namespace android diff --git a/hwc3/ComposerClient.cpp b/hwc3/ComposerClient.cpp index 9aea03c..b3cfcc0 100644 --- a/hwc3/ComposerClient.cpp +++ b/hwc3/ComposerClient.cpp @@ -50,6 +50,9 @@ #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; @@ -61,6 +64,7 @@ using ::android::HwcDisplayConfig; using ::android::HwcLayer; using ::android::IRect; using ::android::LayerTransform; +using ::android::PanelOrientation; using ::android::SrcRectInfo; using HwcOutputType = ::android::OutputType; @@ -211,7 +215,8 @@ std::optional> AidlToColorTransformMatrix( return std::nullopt; } - std::array color_transform_matrix = kIdentityMatrix; + std::array + color_transform_matrix = ::android::kIdentityMatrix; std::copy(aidl_color_transform_matrix->begin(), aidl_color_transform_matrix->end(), color_transform_matrix.begin()); return color_transform_matrix; @@ -371,7 +376,7 @@ std::optional AidlToDamage( } // namespace -class Hwc3BufferHandle : public PrimeFdsSharedBase { +class Hwc3BufferHandle : public ::android::PrimeFdsSharedBase { public: static auto Create(buffer_handle_t handle) -> std::shared_ptr { @@ -860,8 +865,8 @@ ndk::ScopedAStatus ComposerClient::getDataspaceSaturationMatrix( } matrix->clear(); - matrix->insert(matrix->begin(), kIdentityMatrix.begin(), - kIdentityMatrix.end()); + matrix->insert(matrix->begin(), ::android::kIdentityMatrix.begin(), + ::android::kIdentityMatrix.end()); return ndk::ScopedAStatus::ok(); } @@ -1254,7 +1259,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. - QueuedConfigTiming timing{}; + ::android::QueuedConfigTiming timing{}; auto error = display->QueueConfig(config, constraints.desiredTimeNanos, &timing); if (error == HwcDisplay::kNone) { @@ -1348,7 +1353,7 @@ ndk::ScopedAStatus ComposerClient::setColorMode(int64_t display_handle, if (intent != RenderIntent::COLORIMETRIC) return ToBinderStatus(hwc3::Error::kUnsupported); - display->SetColorMode(static_cast<::ColorMode>(mode)); + display->SetColorMode(static_cast<::android::ColorMode>(mode)); return ToBinderStatus(hwc3::Error::kNone); }