1
0
Fork 0

drm_hwcomposer: Migrate to android::drm_hwcomposer namespace

Change-Id: I2859aa8f55532d88231389724956fc77b0625339
This commit is contained in:
Andrew Wolfers 2025-09-04 20:20:44 +00:00
parent d4ab368f7f
commit 9255d0d10b
88 changed files with 281 additions and 241 deletions

View file

@ -24,7 +24,7 @@
#include "drm/DrmHwc.h" #include "drm/DrmHwc.h"
#include "hwc/HwcDisplay.h" #include "hwc/HwcDisplay.h"
namespace android { namespace android::drm_hwcomposer {
namespace { namespace {
@ -273,4 +273,4 @@ std::tuple<size_t, size_t> Backend::GetExtraClientRange(
REGISTER_BACKEND("generic", Backend); REGISTER_BACKEND("generic", Backend);
// clang-format on // clang-format on
} // namespace android } // namespace android::drm_hwcomposer

View file

@ -21,7 +21,7 @@
#include "compositor/LayerData.h" #include "compositor/LayerData.h"
namespace android { namespace android::drm_hwcomposer {
struct DrmKmsPlan; struct DrmKmsPlan;
class HwcDisplay; class HwcDisplay;
@ -63,4 +63,5 @@ class Backend {
const HwcDisplay* display, const std::vector<const HwcLayer*>& layers, const HwcDisplay* display, const std::vector<const HwcLayer*>& layers,
size_t client_start, size_t client_size, bool use_cursor_plane); size_t client_start, size_t client_size, bool use_cursor_plane);
}; };
} // namespace android
} // namespace android::drm_hwcomposer

View file

@ -19,7 +19,7 @@
#include "BackendManager.h" #include "BackendManager.h"
#include "hwc/HwcDisplay.h" #include "hwc/HwcDisplay.h"
namespace android { namespace android::drm_hwcomposer {
auto BackendClient::ValidateDisplay(HwcDisplay* display) auto BackendClient::ValidateDisplay(HwcDisplay* display)
-> ValidatedComposition { -> ValidatedComposition {
@ -31,4 +31,4 @@ auto BackendClient::ValidateDisplay(HwcDisplay* display)
REGISTER_BACKEND("client", BackendClient); REGISTER_BACKEND("client", BackendClient);
// clang-format on // clang-format on
} // namespace android } // namespace android::drm_hwcomposer

View file

@ -18,10 +18,11 @@
#include "Backend.h" #include "Backend.h"
namespace android { namespace android::drm_hwcomposer {
class BackendClient : public Backend { class BackendClient : public Backend {
public: public:
auto ValidateDisplay(HwcDisplay* display) -> ValidatedComposition override; auto ValidateDisplay(HwcDisplay* display) -> ValidatedComposition override;
}; };
} // namespace android
} // namespace android::drm_hwcomposer

View file

@ -22,7 +22,7 @@
#include "utils/log.h" #include "utils/log.h"
#include "utils/properties.h" #include "utils/properties.h"
namespace android { namespace android::drm_hwcomposer {
// NOLINTNEXTLINE(cert-err58-cpp) // NOLINTNEXTLINE(cert-err58-cpp)
const std::vector<std::string> BackendManager::kClientDevices = { const std::vector<std::string> BackendManager::kClientDevices = {
@ -81,4 +81,5 @@ std::unique_ptr<Backend> BackendManager::GetBackendByName(std::string &name) {
return available_backends_[name](); return available_backends_[name]();
} }
} // namespace android
} // namespace android::drm_hwcomposer

View file

@ -32,7 +32,7 @@
return std::make_unique<backend_>(); \ return std::make_unique<backend_>(); \
}); });
namespace android { namespace android::drm_hwcomposer {
class BackendManager { class BackendManager {
public: public:
@ -50,4 +50,5 @@ class BackendManager {
std::map<std::string, BackendConstructorT> available_backends_; std::map<std::string, BackendConstructorT> available_backends_;
}; };
} // namespace android
} // namespace android::drm_hwcomposer

View file

@ -19,7 +19,7 @@
#include <cstdint> #include <cstdint>
#include <memory> #include <memory>
namespace android { namespace android::drm_hwcomposer {
constexpr int kBufferMaxPlanes = 4; constexpr int kBufferMaxPlanes = 4;
@ -69,4 +69,4 @@ struct BufferInfo {
std::shared_ptr<PrimeFdsSharedBase> fds_shared; std::shared_ptr<PrimeFdsSharedBase> fds_shared;
}; };
} // namespace android } // namespace android::drm_hwcomposer

View file

@ -30,7 +30,7 @@
#include "utils/log.h" #include "utils/log.h"
#include "utils/properties.h" #include "utils/properties.h"
namespace android { namespace android::drm_hwcomposer {
BufferInfoGetter *BufferInfoGetter::GetInstance() { BufferInfoGetter *BufferInfoGetter::GetInstance() {
static std::unique_ptr<BufferInfoGetter> inst; static std::unique_ptr<BufferInfoGetter> inst;
@ -122,4 +122,4 @@ LegacyBufferInfoGetter::CreateInstance() {
return nullptr; return nullptr;
} }
} // namespace android } // namespace android::drm_hwcomposer

View file

@ -28,7 +28,7 @@
#define DRM_FORMAT_INVALID 0 #define DRM_FORMAT_INVALID 0
#endif #endif
namespace android { namespace android::drm_hwcomposer {
using BufferUniqueId = uint64_t; using BufferUniqueId = uint64_t;
@ -87,4 +87,4 @@ class LegacyBufferInfoGetter : public BufferInfoGetter {
} }
#endif #endif
} // namespace android } // namespace android::drm_hwcomposer

View file

@ -27,7 +27,7 @@
#include "utils/log.h" #include "utils/log.h"
namespace android { namespace android::drm_hwcomposer {
namespace { namespace {
@ -179,4 +179,4 @@ auto BufferInfoMapperMetadata::GetBoInfo(buffer_handle_t handle)
return bi; return bi;
} }
} // namespace android } // namespace android::drm_hwcomposer

View file

@ -18,7 +18,7 @@
#include "bufferinfo/BufferInfoGetter.h" #include "bufferinfo/BufferInfoGetter.h"
namespace android { namespace android::drm_hwcomposer {
class BufferInfoMapperMetadata : public BufferInfoGetter { class BufferInfoMapperMetadata : public BufferInfoGetter {
public: public:
@ -30,4 +30,5 @@ class BufferInfoMapperMetadata : public BufferInfoGetter {
static BufferInfoGetter *CreateInstance(); static BufferInfoGetter *CreateInstance();
}; };
} // namespace android
} // namespace android::drm_hwcomposer

View file

@ -25,7 +25,7 @@
#include "img_gralloc1_public.h" #include "img_gralloc1_public.h"
#include "utils/log.h" #include "utils/log.h"
namespace android { namespace android::drm_hwcomposer {
LEGACY_BUFFER_INFO_GETTER(BufferInfoImagination); LEGACY_BUFFER_INFO_GETTER(BufferInfoImagination);
@ -65,4 +65,4 @@ auto BufferInfoImagination::GetBoInfo(buffer_handle_t handle)
return bi; return bi;
} }
} // namespace android } // namespace android::drm_hwcomposer

View file

@ -20,7 +20,7 @@
#include "bufferinfo/BufferInfoGetter.h" #include "bufferinfo/BufferInfoGetter.h"
namespace android { namespace android::drm_hwcomposer {
class BufferInfoImagination : public LegacyBufferInfoGetter { class BufferInfoImagination : public LegacyBufferInfoGetter {
public: public:
@ -28,4 +28,5 @@ class BufferInfoImagination : public LegacyBufferInfoGetter {
auto GetBoInfo(buffer_handle_t handle) -> std::optional<BufferInfo> override; auto GetBoInfo(buffer_handle_t handle) -> std::optional<BufferInfo> override;
}; };
} // namespace android
} // namespace android::drm_hwcomposer

View file

@ -28,7 +28,7 @@
#include "utils/log.h" #include "utils/log.h"
#include "utils/properties.h" #include "utils/properties.h"
namespace android { namespace android::drm_hwcomposer {
LEGACY_BUFFER_INFO_GETTER(BufferInfoLibdrm); LEGACY_BUFFER_INFO_GETTER(BufferInfoLibdrm);
@ -227,4 +227,4 @@ int BufferInfoLibdrm::ValidateGralloc() {
return 0; return 0;
} }
} // namespace android } // namespace android::drm_hwcomposer

View file

@ -20,7 +20,7 @@
#include "bufferinfo/BufferInfoGetter.h" #include "bufferinfo/BufferInfoGetter.h"
namespace android { namespace android::drm_hwcomposer {
class BufferInfoLibdrm : public LegacyBufferInfoGetter { class BufferInfoLibdrm : public LegacyBufferInfoGetter {
public: public:
@ -33,4 +33,4 @@ class BufferInfoLibdrm : public LegacyBufferInfoGetter {
BufferInfo *bo); BufferInfo *bo);
}; };
} // namespace android } // namespace android::drm_hwcomposer

View file

@ -28,7 +28,7 @@
#define MALI_ALIGN(value, base) (((value) + ((base)-1)) & ~((base)-1)) #define MALI_ALIGN(value, base) (((value) + ((base)-1)) & ~((base)-1))
namespace android { namespace android::drm_hwcomposer {
LEGACY_BUFFER_INFO_GETTER(BufferInfoMaliHisi); LEGACY_BUFFER_INFO_GETTER(BufferInfoMaliHisi);
@ -122,4 +122,4 @@ auto BufferInfoMaliHisi::GetBoInfo(buffer_handle_t handle)
return bi; return bi;
} }
} // namespace android } // namespace android::drm_hwcomposer

View file

@ -20,7 +20,7 @@
#include "bufferinfo/BufferInfoGetter.h" #include "bufferinfo/BufferInfoGetter.h"
namespace android { namespace android::drm_hwcomposer {
class BufferInfoMaliHisi : public LegacyBufferInfoGetter { class BufferInfoMaliHisi : public LegacyBufferInfoGetter {
public: public:
@ -31,4 +31,5 @@ class BufferInfoMaliHisi : public LegacyBufferInfoGetter {
private: private:
uint64_t ConvertGrallocFormatToDrmModifiers(uint64_t flags, bool is_rgb); uint64_t ConvertGrallocFormatToDrmModifiers(uint64_t flags, bool is_rgb);
}; };
} // namespace android
} // namespace android::drm_hwcomposer

View file

@ -28,7 +28,7 @@
#include "gralloc_priv.h" #include "gralloc_priv.h"
#include "utils/log.h" #include "utils/log.h"
namespace android { namespace android::drm_hwcomposer {
LEGACY_BUFFER_INFO_GETTER(BufferInfoMaliMediatek); LEGACY_BUFFER_INFO_GETTER(BufferInfoMaliMediatek);
@ -54,4 +54,4 @@ auto BufferInfoMaliMediatek::GetBoInfo(buffer_handle_t handle)
return bi; return bi;
} }
} // namespace android } // namespace android::drm_hwcomposer

View file

@ -20,7 +20,7 @@
#include "bufferinfo/BufferInfoGetter.h" #include "bufferinfo/BufferInfoGetter.h"
namespace android { namespace android::drm_hwcomposer {
class BufferInfoMaliMediatek : public LegacyBufferInfoGetter { class BufferInfoMaliMediatek : public LegacyBufferInfoGetter {
public: public:
@ -28,4 +28,5 @@ class BufferInfoMaliMediatek : public LegacyBufferInfoGetter {
auto GetBoInfo(buffer_handle_t handle) -> std::optional<BufferInfo> override; auto GetBoInfo(buffer_handle_t handle) -> std::optional<BufferInfo> override;
}; };
} // namespace android
} // namespace android::drm_hwcomposer

View file

@ -26,7 +26,7 @@
#include "gralloc_priv.h" #include "gralloc_priv.h"
#include "utils/log.h" #include "utils/log.h"
namespace android { namespace android::drm_hwcomposer {
LEGACY_BUFFER_INFO_GETTER(BufferInfoMaliMeson); LEGACY_BUFFER_INFO_GETTER(BufferInfoMaliMeson);
@ -89,4 +89,4 @@ auto BufferInfoMaliMeson::GetBoInfo(buffer_handle_t handle)
return bi; return bi;
} }
} // namespace android } // namespace android::drm_hwcomposer

View file

@ -20,7 +20,7 @@
#include "bufferinfo/BufferInfoGetter.h" #include "bufferinfo/BufferInfoGetter.h"
namespace android { namespace android::drm_hwcomposer {
class BufferInfoMaliMeson : public LegacyBufferInfoGetter { class BufferInfoMaliMeson : public LegacyBufferInfoGetter {
public: public:
@ -30,4 +30,5 @@ class BufferInfoMaliMeson : public LegacyBufferInfoGetter {
private: private:
uint64_t ConvertGrallocFormatToDrmModifiers(uint64_t flags); uint64_t ConvertGrallocFormatToDrmModifiers(uint64_t flags);
}; };
} // namespace android
} // namespace android::drm_hwcomposer

View file

@ -25,7 +25,8 @@
#include <cstring> #include <cstring>
#include "utils/log.h" #include "utils/log.h"
namespace android {
namespace android::drm_hwcomposer {
LEGACY_BUFFER_INFO_GETTER(BufferInfoMinigbm); LEGACY_BUFFER_INFO_GETTER(BufferInfoMinigbm);
@ -122,4 +123,4 @@ int BufferInfoMinigbm::ValidateGralloc() {
return 0; return 0;
} }
} // namespace android } // namespace android::drm_hwcomposer

View file

@ -20,7 +20,7 @@
#include "bufferinfo/BufferInfoGetter.h" #include "bufferinfo/BufferInfoGetter.h"
namespace android { namespace android::drm_hwcomposer {
class BufferInfoMinigbm : public LegacyBufferInfoGetter { class BufferInfoMinigbm : public LegacyBufferInfoGetter {
public: public:
@ -29,4 +29,4 @@ class BufferInfoMinigbm : public LegacyBufferInfoGetter {
int ValidateGralloc() override; int ValidateGralloc() override;
}; };
} // namespace android } // namespace android::drm_hwcomposer

View file

@ -19,7 +19,7 @@
#include <array> #include <array>
#include <cstdint> #include <cstdint>
namespace android { namespace android::drm_hwcomposer {
/* /*
* 4x4 Identity matrix used for color transformations. * 4x4 Identity matrix used for color transformations.
@ -103,4 +103,4 @@ struct QueuedConfigTiming {
int64_t new_vsync_time_ns; int64_t new_vsync_time_ns;
}; };
} // namespace android } // namespace android::drm_hwcomposer

View file

@ -22,7 +22,8 @@
#include "drm/DrmPlane.h" #include "drm/DrmPlane.h"
#include "utils/log.h" #include "utils/log.h"
namespace android { namespace android::drm_hwcomposer {
auto DrmKmsPlan::CreateDrmKmsPlan(const DrmDisplayPipeline &pipe, auto DrmKmsPlan::CreateDrmKmsPlan(const DrmDisplayPipeline &pipe,
std::vector<LayerData> composition, std::vector<LayerData> composition,
std::optional<LayerData> cursor_layer) std::optional<LayerData> cursor_layer)
@ -71,4 +72,4 @@ auto DrmKmsPlan::CreateDrmKmsPlan(const DrmDisplayPipeline &pipe,
return plan; return plan;
} }
} // namespace android } // namespace android::drm_hwcomposer

View file

@ -21,7 +21,7 @@
#include "LayerData.h" #include "LayerData.h"
namespace android { namespace android::drm_hwcomposer {
class DrmDevice; class DrmDevice;
@ -40,4 +40,4 @@ struct DrmKmsPlan {
-> std::unique_ptr<DrmKmsPlan>; -> std::unique_ptr<DrmKmsPlan>;
}; };
} // namespace android } // namespace android::drm_hwcomposer

View file

@ -35,7 +35,7 @@
#include "utils/log.h" #include "utils/log.h"
namespace android { namespace android::drm_hwcomposer {
auto FlatteningController::CreateInstance(FlatConCallbacks &cbks) auto FlatteningController::CreateInstance(FlatConCallbacks &cbks)
-> std::shared_ptr<FlatteningController> { -> std::shared_ptr<FlatteningController> {
@ -98,4 +98,4 @@ void FlatteningController::ThreadFn() {
} }
} }
} // namespace android } // namespace android::drm_hwcomposer

View file

@ -21,7 +21,7 @@
#include <functional> #include <functional>
#include <thread> #include <thread>
namespace android { namespace android::drm_hwcomposer {
// NOLINTNEXTLINE(misc-unused-using-decls): False positive // NOLINTNEXTLINE(misc-unused-using-decls): False positive
using std::chrono_literals::operator""s; using std::chrono_literals::operator""s;
@ -73,4 +73,4 @@ class FlatteningController {
FlatConCallbacks cbks_; FlatConCallbacks cbks_;
}; };
} // namespace android } // namespace android::drm_hwcomposer

View file

@ -26,7 +26,7 @@
#include "drm/DrmFbImporter.h" #include "drm/DrmFbImporter.h"
#include "utils/fd.h" #include "utils/fd.h"
namespace android { namespace android::drm_hwcomposer {
class DrmFbIdHandle; class DrmFbIdHandle;
@ -107,4 +107,4 @@ struct LayerData {
SharedFd acquire_fence; SharedFd acquire_fence;
}; };
} // namespace android } // namespace android::drm_hwcomposer

View file

@ -33,7 +33,7 @@
#include "drm/DrmUnique.h" #include "drm/DrmUnique.h"
#include "utils/log.h" #include "utils/log.h"
namespace android { namespace android::drm_hwcomposer {
auto DrmAtomicStateManager::CreateInstance(DrmDisplayPipeline *pipe) auto DrmAtomicStateManager::CreateInstance(DrmDisplayPipeline *pipe)
-> std::shared_ptr<DrmAtomicStateManager> { -> std::shared_ptr<DrmAtomicStateManager> {
@ -579,4 +579,4 @@ auto DrmAtomicStateManager::ActivateDisplayUsingDPMS() -> int {
DRM_MODE_DPMS_ON); DRM_MODE_DPMS_ON);
} }
} // namespace android } // namespace android::drm_hwcomposer

View file

@ -29,7 +29,7 @@
#include "drm/ResourceManager.h" #include "drm/ResourceManager.h"
#include "drm/VSyncWorker.h" #include "drm/VSyncWorker.h"
namespace android { namespace android::drm_hwcomposer {
struct AtomicCommitArgs { struct AtomicCommitArgs {
/* inputs. All fields are optional, but at least one has to be specified */ /* 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_){}; int frames_tracked_ GUARDED_BY(mutex_){};
}; };
} // namespace android } // namespace android::drm_hwcomposer

View file

@ -41,7 +41,7 @@
#define DRM_MODE_CONNECTOR_USB 20 #define DRM_MODE_CONNECTOR_USB 20
#endif #endif
namespace android { namespace android::drm_hwcomposer {
constexpr size_t kTypesCount = 21; constexpr size_t kTypesCount = 21;
@ -302,4 +302,4 @@ std::optional<PanelOrientation> DrmConnector::GetPanelOrientation() {
return {}; return {};
} }
} // namespace android } // namespace android::drm_hwcomposer

View file

@ -29,7 +29,7 @@
#include "compositor/DisplayInfo.h" #include "compositor/DisplayInfo.h"
#include "utils/EdidWrapper.h" #include "utils/EdidWrapper.h"
namespace android { namespace android::drm_hwcomposer {
class DrmDevice; class DrmDevice;
@ -190,4 +190,5 @@ class DrmConnector : public PipelineBindable<DrmConnector> {
std::map<Colorspace, uint64_t> colorspace_enum_map_; std::map<Colorspace, uint64_t> colorspace_enum_map_;
std::map<uint64_t, PanelOrientation> panel_orientation_enum_map_; std::map<uint64_t, PanelOrientation> panel_orientation_enum_map_;
}; };
} // namespace android
} // namespace android::drm_hwcomposer

View file

@ -25,7 +25,7 @@
#include "DrmDevice.h" #include "DrmDevice.h"
namespace android { namespace android::drm_hwcomposer {
static int GetCrtcProperty(const DrmDevice &dev, const DrmCrtc &crtc, static int GetCrtcProperty(const DrmDevice &dev, const DrmCrtc &crtc,
const char *prop_name, DrmProperty *property) { const char *prop_name, DrmProperty *property) {
@ -69,4 +69,4 @@ auto DrmCrtc::CreateInstance(DrmDevice &dev, uint32_t crtc_id, uint32_t index)
return c; return c;
} }
} // namespace android } // namespace android::drm_hwcomposer

View file

@ -25,7 +25,7 @@
#include "DrmProperty.h" #include "DrmProperty.h"
#include "DrmUnique.h" #include "DrmUnique.h"
namespace android { namespace android::drm_hwcomposer {
class DrmDevice; class DrmDevice;
@ -76,4 +76,5 @@ class DrmCrtc : public PipelineBindable<DrmCrtc> {
DrmProperty mode_property_; DrmProperty mode_property_;
DrmProperty out_fence_ptr_property_; DrmProperty out_fence_ptr_property_;
}; };
} // namespace android
} // namespace android::drm_hwcomposer

View file

@ -33,7 +33,7 @@
#include "utils/log.h" #include "utils/log.h"
#include "utils/properties.h" #include "utils/properties.h"
namespace android { namespace android::drm_hwcomposer {
auto DrmDevice::CreateInstance(std::string const &path, auto DrmDevice::CreateInstance(std::string const &path,
ResourceManager *res_man, uint32_t index) ResourceManager *res_man, uint32_t index)
@ -401,4 +401,4 @@ done:
} }
// NOLINTEND(cppcoreguidelines-avoid-goto) // NOLINTEND(cppcoreguidelines-avoid-goto)
} // namespace android } // namespace android::drm_hwcomposer

View file

@ -27,7 +27,7 @@
#include "bufferinfo/BufferInfo.h" #include "bufferinfo/BufferInfo.h"
#include "utils/fd.h" #include "utils/fd.h"
namespace android { namespace android::drm_hwcomposer {
class DrmFbImporter; class DrmFbImporter;
class DrmPlane; class DrmPlane;
@ -141,4 +141,4 @@ class DrmDevice {
ResourceManager *const res_man_; ResourceManager *const res_man_;
}; };
} // namespace android } // namespace android::drm_hwcomposer

View file

@ -27,7 +27,7 @@
#include "utils/log.h" #include "utils/log.h"
#include "utils/properties.h" #include "utils/properties.h"
namespace android { namespace android::drm_hwcomposer {
template <class O> template <class O>
auto PipelineBindable<O>::BindPipeline(const DrmDisplayPipeline *pipeline, auto PipelineBindable<O>::BindPipeline(const DrmDisplayPipeline *pipeline,
@ -208,4 +208,4 @@ DrmDisplayPipeline::~DrmDisplayPipeline() {
atomic_state_manager->StopThread(); atomic_state_manager->StopThread();
} }
} // namespace android } // namespace android::drm_hwcomposer

View file

@ -19,7 +19,7 @@
#include <memory> #include <memory>
#include <vector> #include <vector>
namespace android { namespace android::drm_hwcomposer {
class DrmConnector; class DrmConnector;
class DrmDevice; class DrmDevice;
@ -92,4 +92,4 @@ struct DrmDisplayPipeline {
std::shared_ptr<DrmAtomicStateManager> atomic_state_manager; std::shared_ptr<DrmAtomicStateManager> atomic_state_manager;
}; };
} // namespace android } // namespace android::drm_hwcomposer

View file

@ -25,7 +25,7 @@
#include "DrmDevice.h" #include "DrmDevice.h"
#include "utils/log.h" #include "utils/log.h"
namespace android { namespace android::drm_hwcomposer {
auto DrmEncoder::CreateInstance(DrmDevice &dev, uint32_t encoder_id, auto DrmEncoder::CreateInstance(DrmDevice &dev, uint32_t encoder_id,
uint32_t index) -> std::unique_ptr<DrmEncoder> { uint32_t index) -> std::unique_ptr<DrmEncoder> {
@ -38,4 +38,4 @@ auto DrmEncoder::CreateInstance(DrmDevice &dev, uint32_t encoder_id,
return std::unique_ptr<DrmEncoder>(new DrmEncoder(std::move(e), index)); return std::unique_ptr<DrmEncoder>(new DrmEncoder(std::move(e), index));
} }
} // namespace android } // namespace android::drm_hwcomposer

View file

@ -25,7 +25,7 @@
#include "DrmCrtc.h" #include "DrmCrtc.h"
#include "DrmDisplayPipeline.h" #include "DrmDisplayPipeline.h"
namespace android { namespace android::drm_hwcomposer {
class DrmEncoder : public PipelineBindable<DrmEncoder> { class DrmEncoder : public PipelineBindable<DrmEncoder> {
public: public:
@ -63,4 +63,4 @@ class DrmEncoder : public PipelineBindable<DrmEncoder> {
const uint32_t index_in_res_array_; const uint32_t index_in_res_array_;
}; };
} // namespace android } // namespace android::drm_hwcomposer

View file

@ -32,7 +32,7 @@
#include "utils/log.h" #include "utils/log.h"
#include "utils/properties.h" #include "utils/properties.h"
namespace android { namespace android::drm_hwcomposer {
auto DrmFbIdHandle::CreateInstance(BufferInfo *bo, GemHandle first_gem_handle, auto DrmFbIdHandle::CreateInstance(BufferInfo *bo, GemHandle first_gem_handle,
DrmDevice &drm) DrmDevice &drm)
@ -172,4 +172,4 @@ auto DrmFbImporter::GetOrCreateFbId(BufferInfo *bo)
return fb_id_handle; return fb_id_handle;
} }
} // namespace android } // namespace android::drm_hwcomposer

View file

@ -32,7 +32,7 @@
using GemHandle = uint32_t; using GemHandle = uint32_t;
namespace android { namespace android::drm_hwcomposer {
class DrmFbIdHandle { class DrmFbIdHandle {
public: public:
@ -87,4 +87,4 @@ class DrmFbImporter {
std::map<GemHandle, std::weak_ptr<DrmFbIdHandle>> drm_fb_id_handle_cache_; std::map<GemHandle, std::weak_ptr<DrmFbIdHandle>> drm_fb_id_handle_cache_;
}; };
} // namespace android } // namespace android::drm_hwcomposer

View file

@ -24,7 +24,8 @@
#include "utils/log.h" #include "utils/log.h"
#include "utils/properties.h" #include "utils/properties.h"
namespace android { namespace android::drm_hwcomposer {
namespace { namespace {
// Helper functions for implementing dumpsys support. // Helper functions for implementing dumpsys support.
std::string DumpStats(const CompositionStats &stats) { std::string DumpStats(const CompositionStats &stats) {
@ -249,4 +250,4 @@ void DrmHwc::DeinitDisplays() {
} }
} }
} // namespace android } // namespace android::drm_hwcomposer

View file

@ -21,7 +21,7 @@
#include "hwc/HwcDisplay.h" #include "hwc/HwcDisplay.h"
#include "stats/CompositionStats.h" #include "stats/CompositionStats.h"
namespace android { namespace android::drm_hwcomposer {
class DrmHwc : public PipelineToFrontendBindingInterface, class DrmHwc : public PipelineToFrontendBindingInterface,
public CompositionStatsProvider { public CompositionStatsProvider {
@ -100,4 +100,5 @@ class DrmHwc : public PipelineToFrontendBindingInterface,
DisplayHandle last_display_handle_ = kPrimaryDisplay; DisplayHandle last_display_handle_ = kPrimaryDisplay;
CompositionStatsTracker dump_stats_tracker_; CompositionStatsTracker dump_stats_tracker_;
}; };
} // namespace android
} // namespace android::drm_hwcomposer

View file

@ -20,7 +20,7 @@
#include "DrmDevice.h" #include "DrmDevice.h"
namespace android { namespace android::drm_hwcomposer {
DrmMode::DrmMode(drmModeModeInfoPtr m) : mode_(*m){}; DrmMode::DrmMode(drmModeModeInfoPtr m) : mode_(*m){};
@ -45,4 +45,4 @@ auto DrmMode::CreateModeBlob(const DrmDevice &drm) const
sizeof(struct drm_mode_modeinfo)); sizeof(struct drm_mode_modeinfo));
} }
} // namespace android } // namespace android::drm_hwcomposer

View file

@ -24,7 +24,7 @@
#include "DrmUnique.h" #include "DrmUnique.h"
namespace android { namespace android::drm_hwcomposer {
class DrmDevice; class DrmDevice;
@ -66,4 +66,5 @@ class DrmMode {
private: private:
drmModeModeInfo mode_; drmModeModeInfo mode_;
}; };
} // namespace android
} // namespace android::drm_hwcomposer

View file

@ -28,7 +28,7 @@
#include "compositor/LayerData.h" #include "compositor/LayerData.h"
#include "utils/log.h" #include "utils/log.h"
namespace android { namespace android::drm_hwcomposer {
namespace { namespace {
// Ensure that |src| does not exceed the bounds of the buffer. // 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; return true;
} }
} // namespace android } // namespace android::drm_hwcomposer

View file

@ -25,7 +25,7 @@
#include "DrmProperty.h" #include "DrmProperty.h"
#include "compositor/LayerData.h" #include "compositor/LayerData.h"
namespace android { namespace android::drm_hwcomposer {
class DrmDevice; class DrmDevice;
struct LayerData; struct LayerData;
@ -108,4 +108,5 @@ class DrmPlane : public PipelineBindable<DrmPlane> {
uint64_t transform_enum_mask_ = DRM_MODE_ROTATE_0; uint64_t transform_enum_mask_ = DRM_MODE_ROTATE_0;
std::vector<drm_plane_size_hint_local> size_hints_; std::vector<drm_plane_size_hint_local> size_hints_;
}; };
} // namespace android
} // namespace android::drm_hwcomposer

View file

@ -29,7 +29,7 @@
#include "DrmDevice.h" #include "DrmDevice.h"
#include "utils/log.h" #include "utils/log.h"
namespace android { namespace android::drm_hwcomposer {
DrmProperty::DrmPropertyEnum::DrmPropertyEnum(drm_mode_property_enum *e) DrmProperty::DrmPropertyEnum::DrmPropertyEnum(drm_mode_property_enum *e)
: value(e->value), name(e->name) { : value(e->value), name(e->name) {
@ -166,4 +166,4 @@ auto DrmProperty::GetEnumMask(uint64_t &mask) -> bool {
return true; return true;
} }
} // namespace android } // namespace android::drm_hwcomposer

View file

@ -29,7 +29,7 @@
#include "utils/fd.h" #include "utils/fd.h"
#include "utils/log.h" #include "utils/log.h"
namespace android { namespace android::drm_hwcomposer {
class DrmProperty { class DrmProperty {
public: public:
@ -183,4 +183,4 @@ bool DrmProperty::GetBlobData(std::vector<T> &data_out) const {
return true; return true;
} }
} // namespace android } // namespace android::drm_hwcomposer

View file

@ -21,7 +21,7 @@
#include <functional> #include <functional>
#include <memory> #include <memory>
namespace android { namespace android::drm_hwcomposer {
template <typename T> template <typename T>
using DUniquePtr = std::unique_ptr<T, std::function<void(T *)>>; using DUniquePtr = std::unique_ptr<T, std::function<void(T *)>>;
@ -85,4 +85,4 @@ auto inline MakeDrmModeResUnique(int fd) {
[](drmModeRes *it) { drmModeFreeResources(it); }); [](drmModeRes *it) { drmModeFreeResources(it); });
} }
} // namespace android } // namespace android::drm_hwcomposer

View file

@ -32,7 +32,7 @@
#include "utils/log.h" #include "utils/log.h"
#include "utils/properties.h" #include "utils/properties.h"
namespace android { namespace android::drm_hwcomposer {
ResourceManager::ResourceManager( ResourceManager::ResourceManager(
PipelineToFrontendBindingInterface *p2f_bind_interface) PipelineToFrontendBindingInterface *p2f_bind_interface)
@ -222,4 +222,4 @@ auto ResourceManager::GetWritebackConnectorsCount() -> uint32_t {
return count; return count;
} }
} // namespace android } // namespace android::drm_hwcomposer

View file

@ -27,7 +27,7 @@
#include "UEventListener.h" #include "UEventListener.h"
#include "utils/properties.h" #include "utils/properties.h"
namespace android { namespace android::drm_hwcomposer {
class PipelineToFrontendBindingInterface { class PipelineToFrontendBindingInterface {
public: public:
@ -94,4 +94,5 @@ class ResourceManager {
bool initialized_{}; bool initialized_{};
}; };
} // namespace android
} // namespace android::drm_hwcomposer

View file

@ -22,7 +22,7 @@
#include "utils/log.h" #include "utils/log.h"
namespace android { namespace android::drm_hwcomposer {
UEventListener::~UEventListener() { UEventListener::~UEventListener() {
StopThread(); StopThread();
@ -69,4 +69,4 @@ void UEventListener::ThreadFn() {
ALOGI("UEvent thread exit"); ALOGI("UEvent thread exit");
} }
} // namespace android } // namespace android::drm_hwcomposer

View file

@ -22,7 +22,7 @@
#include "utils/UEvent.h" #include "utils/UEvent.h"
namespace android { namespace android::drm_hwcomposer {
class UEventListener { class UEventListener {
public: public:
@ -48,4 +48,5 @@ class UEventListener {
std::function<void()> hotplug_handler_; std::function<void()> hotplug_handler_;
}; };
} // namespace android
} // namespace android::drm_hwcomposer

View file

@ -28,7 +28,7 @@
#include "drm/ResourceManager.h" #include "drm/ResourceManager.h"
#include "utils/log.h" #include "utils/log.h"
namespace android { namespace android::drm_hwcomposer {
auto VSyncWorker::CreateInstance(std::shared_ptr<DrmDisplayPipeline> &pipe) auto VSyncWorker::CreateInstance(std::shared_ptr<DrmDisplayPipeline> &pipe)
-> std::unique_ptr<VSyncWorker> { -> std::unique_ptr<VSyncWorker> {
@ -222,4 +222,5 @@ void VSyncWorker::ThreadFn() {
ALOGI("VSyncWorker thread exit"); ALOGI("VSyncWorker thread exit");
} }
} // namespace android
} // namespace android::drm_hwcomposer

View file

@ -26,7 +26,7 @@
#include "DrmDevice.h" #include "DrmDevice.h"
namespace android { namespace android::drm_hwcomposer {
class VSyncWorker { class VSyncWorker {
public: public:
@ -87,4 +87,5 @@ class VSyncWorker {
std::thread vswt_; std::thread vswt_;
std::mutex mutex_; std::mutex mutex_;
}; };
} // namespace android
} // namespace android::drm_hwcomposer

View file

@ -31,10 +31,9 @@
#include "drm/DrmHwc.h" #include "drm/DrmHwc.h"
#include "utils/properties.h" #include "utils/properties.h"
using ::android::DrmDisplayPipeline;
using ColorGamut = ::android::ColorSpace; using ColorGamut = ::android::ColorSpace;
namespace android { namespace android::drm_hwcomposer {
namespace { namespace {
@ -1177,4 +1176,4 @@ void HwcDisplay::SetConfigGroupsForActiveConfig() {
configs_.SanitizeGroups(); configs_.SanitizeGroups();
} }
} // namespace android } // namespace android::drm_hwcomposer

View file

@ -30,7 +30,7 @@
#include "drm/VSyncWorker.h" #include "drm/VSyncWorker.h"
#include "stats/CompositionStats.h" #include "stats/CompositionStats.h"
namespace android { namespace android::drm_hwcomposer {
using DisplayHandle = int64_t; using DisplayHandle = int64_t;
@ -320,4 +320,4 @@ class HwcDisplay {
std::shared_ptr<FrontendDisplayBase> frontend_private_data_; std::shared_ptr<FrontendDisplayBase> frontend_private_data_;
}; };
} // namespace android } // namespace android::drm_hwcomposer

View file

@ -34,7 +34,7 @@ constexpr uint32_t kBackPorch = 10;
constexpr uint32_t kFrontPorch = 10; constexpr uint32_t kFrontPorch = 10;
constexpr uint32_t kHzInKHz = 1000; constexpr uint32_t kHzInKHz = 1000;
namespace android { namespace android::drm_hwcomposer {
void HwcDisplayConfigs::GenFakeMode(uint16_t width, uint16_t height) { void HwcDisplayConfigs::GenFakeMode(uint16_t width, uint16_t height) {
hwc_configs.clear(); hwc_configs.clear();
@ -177,4 +177,4 @@ bool HwcDisplayConfigs::SanitizeGroups() {
return true; return true;
} }
} // namespace android } // namespace android::drm_hwcomposer

View file

@ -20,7 +20,7 @@
#include "drm/DrmMode.h" #include "drm/DrmMode.h"
namespace android { namespace android::drm_hwcomposer {
using ConfigId = int32_t; using ConfigId = int32_t;
@ -69,4 +69,4 @@ struct HwcDisplayConfigs {
uint32_t mm_height = 0; uint32_t mm_height = 0;
}; };
} // namespace android } // namespace android::drm_hwcomposer

View file

@ -22,7 +22,7 @@
#include "bufferinfo/BufferInfoGetter.h" #include "bufferinfo/BufferInfoGetter.h"
#include "utils/log.h" #include "utils/log.h"
namespace android { namespace android::drm_hwcomposer {
void HwcLayer::SetLayerProperties(const LayerProperties& layer_properties) { void HwcLayer::SetLayerProperties(const LayerProperties& layer_properties) {
if (layer_properties.slot_buffer) { if (layer_properties.slot_buffer) {
@ -132,4 +132,4 @@ bool HwcLayer::IsLayerUsableAsDevice() const {
return it->second.fb != nullptr; return it->second.fb != nullptr;
} }
} // namespace android } // namespace android::drm_hwcomposer

View file

@ -23,7 +23,7 @@
#include "compositor/LayerData.h" #include "compositor/LayerData.h"
#include "utils/fd.h" #include "utils/fd.h"
namespace android { namespace android::drm_hwcomposer {
class HwcDisplay; class HwcDisplay;
@ -147,4 +147,4 @@ class HwcLayer {
bool IsLayerUsableAsDevice() const; bool IsLayerUsableAsDevice() const;
}; };
} // namespace android } // namespace android::drm_hwcomposer

View file

@ -23,7 +23,7 @@
#include "backend/Backend.h" #include "backend/Backend.h"
#include "utils/log.h" #include "utils/log.h"
namespace android { namespace android::drm_hwcomposer {
HWC2::Error DrmHwcTwo::RegisterCallback(int32_t descriptor, HWC2::Error DrmHwcTwo::RegisterCallback(int32_t descriptor,
hwc2_callback_data_t data, hwc2_callback_data_t data,
@ -122,4 +122,4 @@ const std::string& DrmHwcTwo::RefreshStateDump() {
return last_state_dump_; return last_state_dump_;
} }
} // namespace android } // namespace android::drm_hwcomposer

View file

@ -20,7 +20,7 @@
#include "drm/DrmHwc.h" #include "drm/DrmHwc.h"
namespace android { namespace android::drm_hwcomposer {
class DrmHwcTwo : public DrmHwc { class DrmHwcTwo : public DrmHwc {
public: public:
@ -54,4 +54,5 @@ class DrmHwcTwo : public DrmHwc {
std::string last_state_dump_; std::string last_state_dump_;
}; };
} // namespace android
} // namespace android::drm_hwcomposer

View file

@ -34,7 +34,7 @@
#include "hwc/HwcLayer.h" #include "hwc/HwcLayer.h"
#include "utils/log.h" #include "utils/log.h"
namespace android { namespace android::drm_hwcomposer {
static int32_t ConfigErrorToHWC2(HwcDisplay::ConfigError result) { static int32_t ConfigErrorToHWC2(HwcDisplay::ConfigError result) {
switch (result) { switch (result) {
@ -1490,11 +1490,11 @@ static int HookDevOpen(const struct hw_module_t *module, const char *name,
return 0; return 0;
} }
} // namespace android } // namespace android::drm_hwcomposer
// NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables) // NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables)
static struct hw_module_methods_t hwc2_module_methods = { static struct hw_module_methods_t hwc2_module_methods = {
.open = android::HookDevOpen, .open = android::drm_hwcomposer::HookDevOpen,
}; };
// NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables) // NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables)

View file

@ -27,7 +27,7 @@
#include "utils/log.h" #include "utils/log.h"
#include "utils/properties.h" #include "utils/properties.h"
using ::android::Properties; using ::android::drm_hwcomposer::Properties;
namespace aidl::android::hardware::graphics::composer3::impl { namespace aidl::android::hardware::graphics::composer3::impl {

View file

@ -50,24 +50,23 @@
#include "stats/CompositionStatsAtomReporter.h" #include "stats/CompositionStatsAtomReporter.h"
#include "stats/CompositionStatsPoller.h" #include "stats/CompositionStatsPoller.h"
using ::android::BufferBlendMode; using ::android::drm_hwcomposer::BufferBlendMode;
using ::android::BufferColorSpace; using ::android::drm_hwcomposer::BufferColorSpace;
using ::android::BufferSampleRange; using ::android::drm_hwcomposer::BufferSampleRange;
using ::android::CompositionStatsAtomReporter; using ::android::drm_hwcomposer::CompositionStatsPoller;
using ::android::CompositionStatsPoller; using ::android::drm_hwcomposer::CompositionType;
using ::android::CompositionType; using ::android::drm_hwcomposer::DamageInfo;
using ::android::DamageInfo; using ::android::drm_hwcomposer::DisplayHandle;
using ::android::DisplayHandle; using ::android::drm_hwcomposer::DstRectInfo;
using ::android::DstRectInfo; using ::android::drm_hwcomposer::HwcDisplay;
using ::android::HwcDisplay; using ::android::drm_hwcomposer::HwcDisplayConfig;
using ::android::HwcDisplayConfig; using ::android::drm_hwcomposer::HwcLayer;
using ::android::HwcLayer; using ::android::drm_hwcomposer::IRect;
using ::android::IRect; using ::android::drm_hwcomposer::LayerTransform;
using ::android::LayerTransform; using ::android::drm_hwcomposer::PanelOrientation;
using ::android::PanelOrientation; using ::android::drm_hwcomposer::SrcRectInfo;
using ::android::SrcRectInfo;
using HwcOutputType = ::android::OutputType; using HwcOutputType = ::android::drm_hwcomposer::OutputType;
#if __ANDROID_API__ >= 36 #if __ANDROID_API__ >= 36
using AidlOutputType = aidl::android::hardware::graphics::composer3::OutputType; using AidlOutputType = aidl::android::hardware::graphics::composer3::OutputType;
#endif #endif
@ -216,7 +215,7 @@ std::optional<std::array<float, kCtmSize>> AidlToColorTransformMatrix(
} }
std::array<float, kCtmSize> std::array<float, kCtmSize>
color_transform_matrix = ::android::kIdentityMatrix; color_transform_matrix = ::android::drm_hwcomposer::kIdentityMatrix;
std::copy(aidl_color_transform_matrix->begin(), std::copy(aidl_color_transform_matrix->begin(),
aidl_color_transform_matrix->end(), color_transform_matrix.begin()); aidl_color_transform_matrix->end(), color_transform_matrix.begin());
return color_transform_matrix; return color_transform_matrix;
@ -376,7 +375,7 @@ std::optional<DamageInfo> AidlToDamage(
} // namespace } // namespace
class Hwc3BufferHandle : public ::android::PrimeFdsSharedBase { class Hwc3BufferHandle : public ::android::drm_hwcomposer::PrimeFdsSharedBase {
public: public:
static auto Create(buffer_handle_t handle) static auto Create(buffer_handle_t handle)
-> std::shared_ptr<Hwc3BufferHandle> { -> std::shared_ptr<Hwc3BufferHandle> {
@ -406,10 +405,11 @@ class Hwc3BufferHandle : public ::android::PrimeFdsSharedBase {
buffer_handle_t imported_handle_{}; buffer_handle_t imported_handle_{};
}; };
class Hwc3Layer : public ::android::FrontendLayerBase { class Hwc3Layer : public ::android::drm_hwcomposer::FrontendLayerBase {
public: public:
auto HandleNextBuffer(std::optional<buffer_handle_t> raw_handle, auto HandleNextBuffer(std::optional<buffer_handle_t> raw_handle,
::android::SharedFd fence_fd, int32_t slot_id) ::android::drm_hwcomposer::SharedFd fence_fd,
int32_t slot_id)
-> std::optional<HwcLayer::LayerProperties> { -> std::optional<HwcLayer::LayerProperties> {
HwcLayer::LayerProperties lp; HwcLayer::LayerProperties lp;
if (!raw_handle && slots_.count(slot_id) != 0) { if (!raw_handle && slots_.count(slot_id) != 0) {
@ -431,8 +431,8 @@ class Hwc3Layer : public ::android::FrontendLayerBase {
return std::nullopt; return std::nullopt;
} }
auto bi = ::android::BufferInfoGetter::GetInstance()->GetBoInfo( auto bi = ::android::drm_hwcomposer::BufferInfoGetter::GetInstance()
hwc3->GetHandle()); ->GetBoInfo(hwc3->GetHandle());
if (bi) { if (bi) {
bi->fds_shared = hwc3; bi->fds_shared = hwc3;
@ -495,7 +495,8 @@ void ComposerClient::Init() {
DEBUG_FUNC(); DEBUG_FUNC();
hwc_ = std::make_unique<DrmHwcThree>(); hwc_ = std::make_unique<DrmHwcThree>();
auto reporter = CompositionStatsAtomReporter::Create(); auto reporter = ::android::drm_hwcomposer::CompositionStatsAtomReporter::
Create();
if (reporter) { if (reporter) {
stats_poller_ = std::make_unique<CompositionStatsPoller>(std::move( stats_poller_ = std::make_unique<CompositionStatsPoller>(std::move(
reporter), reporter),
@ -586,7 +587,7 @@ ndk::ScopedAStatus ComposerClient::destroyVirtualDisplay(
return ndk::ScopedAStatus::ok(); return ndk::ScopedAStatus::ok();
} }
::android::HwcDisplay* ComposerClient::GetDisplay(int64_t display_handle) { HwcDisplay* ComposerClient::GetDisplay(int64_t display_handle) {
return hwc_->GetDisplay(static_cast<DisplayHandle>(display_handle)); return hwc_->GetDisplay(static_cast<DisplayHandle>(display_handle));
} }
@ -660,9 +661,11 @@ void ComposerClient::DispatchLayerCommand(int64_t display_handle,
auto fence = const_cast<::ndk::ScopedFileDescriptor&>(command.buffer->fence) auto fence = const_cast<::ndk::ScopedFileDescriptor&>(command.buffer->fence)
.release(); .release();
auto lp = hwc3_layer->HandleNextBuffer(buffer_handle, auto lp = hwc3_layer
::android::MakeSharedFd(fence), ->HandleNextBuffer(buffer_handle,
command.buffer->slot); ::android::drm_hwcomposer::MakeSharedFd(
fence),
command.buffer->slot);
if (!lp) { if (!lp) {
cmd_result_writer_->AddError(hwc3::Error::kBadLayer); cmd_result_writer_->AddError(hwc3::Error::kBadLayer);
@ -785,7 +788,7 @@ void ComposerClient::ExecuteDisplayCommand(const DisplayCommand& command) {
return; return;
} }
::android::SharedFd present_fence; ::android::drm_hwcomposer::SharedFd present_fence;
std::vector<HwcDisplay::ReleaseFence> release_fences; std::vector<HwcDisplay::ReleaseFence> release_fences;
bool ret = display->PresentStagedComposition(hwc3_display bool ret = display->PresentStagedComposition(hwc3_display
->desired_present_time, ->desired_present_time,
@ -798,11 +801,13 @@ void ComposerClient::ExecuteDisplayCommand(const DisplayCommand& command) {
using ::android::base::unique_fd; using ::android::base::unique_fd;
cmd_result_writer_->AddPresentFence( // 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<int64_t, unique_fd> hal_release_fences; std::unordered_map<int64_t, unique_fd> hal_release_fences;
for (const auto& [layer_id, release_fence] : 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); cmd_result_writer_->AddReleaseFence(display_handle, hal_release_fences);
} }
@ -865,8 +870,9 @@ ndk::ScopedAStatus ComposerClient::getDataspaceSaturationMatrix(
} }
matrix->clear(); matrix->clear();
matrix->insert(matrix->begin(), ::android::kIdentityMatrix.begin(), matrix->insert(matrix->begin(),
::android::kIdentityMatrix.end()); ::android::drm_hwcomposer::kIdentityMatrix.begin(),
::android::drm_hwcomposer::kIdentityMatrix.end());
return ndk::ScopedAStatus::ok(); return ndk::ScopedAStatus::ok();
} }
@ -931,7 +937,7 @@ ndk::ScopedAStatus ComposerClient::getDisplayCapabilities(
// Skip color transform altogether if device/drm cannot support it. // Skip color transform altogether if device/drm cannot support it.
if (hwc_->GetResMan().GetCtmHandling() == if (hwc_->GetResMan().GetCtmHandling() ==
::android::CtmHandling::kDrmOrIgnore) { ::android::drm_hwcomposer::CtmHandling::kDrmOrIgnore) {
caps->emplace_back(DisplayCapability::SKIP_CLIENT_COLOR_TRANSFORM); caps->emplace_back(DisplayCapability::SKIP_CLIENT_COLOR_TRANSFORM);
} }
return ndk::ScopedAStatus::ok(); return ndk::ScopedAStatus::ok();
@ -1147,7 +1153,8 @@ ndk::ScopedAStatus ComposerClient::getReadbackBufferFence(
return ToBinderStatus(hwc3::Error::kUnsupported); return ToBinderStatus(hwc3::Error::kUnsupported);
} }
::android::SharedFd fence = display->GetWritebackBufferFence(); ::android::drm_hwcomposer::SharedFd fence = display
->GetWritebackBufferFence();
display->SetWritebackEnabled(false); display->SetWritebackEnabled(false);
display->GetWritebackLayer()->ClearSlots(); display->GetWritebackLayer()->ClearSlots();
if (!fence) { if (!fence) {
@ -1156,7 +1163,8 @@ ndk::ScopedAStatus ComposerClient::getReadbackBufferFence(
} }
if (fence && *fence >= 0) { if (fence && *fence >= 0) {
*acquire_fence = ndk::ScopedFileDescriptor(::android::DupFd(fence)); *acquire_fence = ndk::ScopedFileDescriptor(
::android::drm_hwcomposer::DupFd(fence));
} }
return ndk::ScopedAStatus::ok(); return ndk::ScopedAStatus::ok();
@ -1219,7 +1227,8 @@ ndk::ScopedAStatus ComposerClient::setActiveConfig(int64_t display_handle,
VsyncPeriodChangeTimeline timeline; VsyncPeriodChangeTimeline timeline;
VsyncPeriodChangeConstraints constraints = { VsyncPeriodChangeConstraints constraints = {
.desiredTimeNanos = ::android::ResourceManager::GetTimeMonotonicNs(), .desiredTimeNanos = ::android::drm_hwcomposer::ResourceManager::
GetTimeMonotonicNs(),
.seamlessRequired = false, .seamlessRequired = false,
}; };
return setActiveConfigWithConstraints(display_handle, config, constraints, 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. // Always try to queue a seamless commit to reduce jank and flicker artifacts.
// Fall-back to a full blocking commit otherwise. // Fall-back to a full blocking commit otherwise.
::android::QueuedConfigTiming timing{}; ::android::drm_hwcomposer::QueuedConfigTiming timing{};
auto error = display->QueueConfig(config, constraints.desiredTimeNanos, auto error = display->QueueConfig(config, constraints.desiredTimeNanos,
&timing); &timing);
if (error == HwcDisplay::kNone) { if (error == HwcDisplay::kNone) {
@ -1273,8 +1282,8 @@ ndk::ScopedAStatus ComposerClient::setActiveConfigWithConstraints(
config); config);
error = display->SetConfig(config); error = display->SetConfig(config);
timeline->newVsyncAppliedTimeNanos = ::android::ResourceManager:: timeline->newVsyncAppliedTimeNanos = ::android::drm_hwcomposer::
GetTimeMonotonicNs(); ResourceManager::GetTimeMonotonicNs();
timeline->refreshRequired = false; timeline->refreshRequired = false;
} }
@ -1353,7 +1362,8 @@ ndk::ScopedAStatus ComposerClient::setColorMode(int64_t display_handle,
if (intent != RenderIntent::COLORIMETRIC) if (intent != RenderIntent::COLORIMETRIC)
return ToBinderStatus(hwc3::Error::kUnsupported); 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); return ToBinderStatus(hwc3::Error::kNone);
} }
@ -1445,14 +1455,14 @@ ndk::ScopedAStatus ComposerClient::setReadbackBuffer(
HwcLayer::LayerProperties properties; HwcLayer::LayerProperties properties;
properties.slot_buffer = { properties.slot_buffer = {
.slot_id = 0, .slot_id = 0,
.bi = ::android::BufferInfoGetter::GetInstance()->GetBoInfo( .bi = ::android::drm_hwcomposer::BufferInfoGetter::GetInstance()
imported_handle), ->GetBoInfo(imported_handle),
}; };
ndk::ScopedFileDescriptor release_fence = ndk::ScopedFileDescriptor( ndk::ScopedFileDescriptor release_fence = ndk::ScopedFileDescriptor(
release_fence_in.get()); release_fence_in.get());
properties.active_slot = { properties.active_slot = {
.slot_id = 0, .slot_id = 0,
.fence = ::android::MakeSharedFd(release_fence.release()), .fence = ::android::drm_hwcomposer::MakeSharedFd(release_fence.release()),
}; };
properties.blend_mode = BufferBlendMode::kNone; properties.blend_mode = BufferBlendMode::kNone;
@ -1583,7 +1593,8 @@ void ComposerClient::ExecuteSetDisplayClientTarget(
.release(); .release();
auto properties = hwc3layer->HandleNextBuffer(raw_buffer, auto properties = hwc3layer->HandleNextBuffer(raw_buffer,
::android::MakeSharedFd(fence), ::android::drm_hwcomposer::
MakeSharedFd(fence),
command.buffer.slot); command.buffer.slot);
if (!properties) { if (!properties) {
@ -1626,7 +1637,8 @@ void ComposerClient::ExecuteSetDisplayOutputBuffer(int64_t display_handle,
auto fence = const_cast<::ndk::ScopedFileDescriptor&>(buffer.fence).release(); auto fence = const_cast<::ndk::ScopedFileDescriptor&>(buffer.fence).release();
auto properties = hwc3layer->HandleNextBuffer(raw_buffer, auto properties = hwc3layer->HandleNextBuffer(raw_buffer,
::android::MakeSharedFd(fence), ::android::drm_hwcomposer::
MakeSharedFd(fence),
buffer.slot); buffer.slot);
if (!properties) { if (!properties) {

View file

@ -28,10 +28,10 @@
using AidlPixelFormat = aidl::android::hardware::graphics::common::PixelFormat; using AidlPixelFormat = aidl::android::hardware::graphics::common::PixelFormat;
using AidlNativeHandle = aidl::android::hardware::common::NativeHandle; using AidlNativeHandle = aidl::android::hardware::common::NativeHandle;
namespace android { namespace android::drm_hwcomposer {
class CompositionStatsPoller; class CompositionStatsPoller;
class HwcDisplay; class HwcDisplay;
} // namespace android } // namespace android::drm_hwcomposer
namespace aidl::android::hardware::graphics::composer3::impl { namespace aidl::android::hardware::graphics::composer3::impl {
using AidlColorMode = ColorMode; using AidlColorMode = ColorMode;
@ -160,9 +160,9 @@ class ComposerClient : public BnComposerClient {
::ndk::SpAIBinder createBinder() override; ::ndk::SpAIBinder createBinder() override;
private: private:
hwc3::Error ImportLayerBuffer(int64_t display_handle, int64_t layer_id, hwc3::Error ImportLayerBuffer(
const Buffer& buffer, int64_t display_handle, int64_t layer_id, const Buffer& buffer,
::android::HwcLayer::Buffer* out_buffer); ::android::drm_hwcomposer::HwcLayer::Buffer* out_buffer);
// Layer commands // Layer commands
void DispatchLayerCommand(int64_t display_handle, void DispatchLayerCommand(int64_t display_handle,
@ -175,13 +175,14 @@ class ComposerClient : public BnComposerClient {
void ExecuteSetDisplayOutputBuffer(int64_t display_handle, void ExecuteSetDisplayOutputBuffer(int64_t display_handle,
const Buffer& buffer); const Buffer& buffer);
::android::HwcDisplay* GetDisplay(int64_t display_handle); ::android::drm_hwcomposer::HwcDisplay* GetDisplay(int64_t display_handle);
std::unique_ptr<CommandResultWriter> cmd_result_writer_; std::unique_ptr<CommandResultWriter> cmd_result_writer_;
std::unique_ptr<DrmHwcThree> hwc_; std::unique_ptr<DrmHwcThree> hwc_;
std::unique_ptr<::android::CompositionStatsPoller> stats_poller_; std::unique_ptr<::android::drm_hwcomposer::CompositionStatsPoller>
stats_poller_;
}; };
} // namespace aidl::android::hardware::graphics::composer3::impl } // namespace aidl::android::hardware::graphics::composer3::impl

View file

@ -26,7 +26,7 @@
namespace aidl::android::hardware::graphics::composer3::impl { namespace aidl::android::hardware::graphics::composer3::impl {
auto DrmHwcThree::GetHwc3Display(::android::HwcDisplay& display) auto DrmHwcThree::GetHwc3Display(::android::drm_hwcomposer::HwcDisplay& display)
-> std::shared_ptr<Hwc3Display> { -> std::shared_ptr<Hwc3Display> {
auto frontend_private_data = display.GetFrontendPrivateData(); auto frontend_private_data = display.GetFrontendPrivateData();
if (!frontend_private_data) { if (!frontend_private_data) {
@ -47,7 +47,8 @@ void DrmHwcThree::Init(std::shared_ptr<IComposerCallback> callback) {
} }
void DrmHwcThree::SendVsyncPeriodTimingChangedEventToClient( void DrmHwcThree::SendVsyncPeriodTimingChangedEventToClient(
::android::DisplayHandle display_handle, int64_t timestamp) const { ::android::drm_hwcomposer::DisplayHandle display_handle,
int64_t timestamp) const {
VsyncPeriodChangeTimeline timeline; VsyncPeriodChangeTimeline timeline;
timeline.newVsyncAppliedTimeNanos = timestamp; timeline.newVsyncAppliedTimeNanos = timestamp;
timeline.refreshRequired = false; timeline.refreshRequired = false;
@ -59,7 +60,7 @@ void DrmHwcThree::SendVsyncPeriodTimingChangedEventToClient(
} }
void DrmHwcThree::SendRefreshEventToClient( void DrmHwcThree::SendRefreshEventToClient(
::android::DisplayHandle display_handle) { ::android::drm_hwcomposer::DisplayHandle display_handle) {
{ {
const std::scoped_lock lock(must_validate_lock_); const std::scoped_lock lock(must_validate_lock_);
must_validate_.insert(display_handle); must_validate_.insert(display_handle);
@ -68,14 +69,14 @@ void DrmHwcThree::SendRefreshEventToClient(
} }
void DrmHwcThree::SendVsyncEventToClient( void DrmHwcThree::SendVsyncEventToClient(
::android::DisplayHandle display_handle, int64_t timestamp, ::android::drm_hwcomposer::DisplayHandle display_handle, int64_t timestamp,
uint32_t vsync_period) const { uint32_t vsync_period) const {
composer_callback_->onVsync(static_cast<int64_t>(display_handle), timestamp, composer_callback_->onVsync(static_cast<int64_t>(display_handle), timestamp,
static_cast<int32_t>(vsync_period)); static_cast<int32_t>(vsync_period));
} }
void DrmHwcThree::SendHotplugEventToClient( void DrmHwcThree::SendHotplugEventToClient(
::android::DisplayHandle display_handle, ::android::drm_hwcomposer::DisplayHandle display_handle,
DrmHwc::DisplayStatus display_status) { DrmHwc::DisplayStatus display_status) {
common::DisplayHotplugEvent event = common::DisplayHotplugEvent::DISCONNECTED; common::DisplayHotplugEvent event = common::DisplayHotplugEvent::DISCONNECTED;
switch (display_status) { switch (display_status) {
@ -97,13 +98,13 @@ void DrmHwcThree::SendHotplugEventToClient(
} }
auto DrmHwcThree::GetMustValidateDisplay( auto DrmHwcThree::GetMustValidateDisplay(
::android::DisplayHandle display_handle) -> bool { ::android::drm_hwcomposer::DisplayHandle display_handle) -> bool {
std::scoped_lock lock(must_validate_lock_); std::scoped_lock lock(must_validate_lock_);
return must_validate_.find(display_handle) != must_validate_.end(); return must_validate_.find(display_handle) != must_validate_.end();
} }
void DrmHwcThree::ClearMustValidateDisplay( void DrmHwcThree::ClearMustValidateDisplay(
::android::DisplayHandle display_handle) { ::android::drm_hwcomposer::DisplayHandle display_handle) {
std::scoped_lock lock(must_validate_lock_); std::scoped_lock lock(must_validate_lock_);
must_validate_.erase(display_handle); must_validate_.erase(display_handle);
} }

View file

@ -24,7 +24,7 @@
namespace aidl::android::hardware::graphics::composer3::impl { namespace aidl::android::hardware::graphics::composer3::impl {
class Hwc3Display : public ::android::FrontendDisplayBase { class Hwc3Display : public ::android::drm_hwcomposer::FrontendDisplayBase {
public: public:
// Desired present time for a composition that has been validated but not // Desired present time for a composition that has been validated but not
// yet presented. nullopt means it should be presented at the next vsync. // 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; int64_t next_layer_id = 1;
}; };
class DrmHwcThree : public ::android::DrmHwc { class DrmHwcThree : public ::android::drm_hwcomposer::DrmHwc {
public: public:
explicit DrmHwcThree() = default; explicit DrmHwcThree() = default;
~DrmHwcThree() override; ~DrmHwcThree() override;
@ -41,28 +41,32 @@ class DrmHwcThree : public ::android::DrmHwc {
void Init(std::shared_ptr<IComposerCallback> callback); void Init(std::shared_ptr<IComposerCallback> callback);
// DrmHwcInterface // DrmHwcInterface
void SendVsyncEventToClient(::android::DisplayHandle display_handle, void SendVsyncEventToClient(
int64_t timestamp, ::android::drm_hwcomposer::DisplayHandle display_handle,
uint32_t vsync_period) const override; int64_t timestamp, uint32_t vsync_period) const override;
void SendVsyncPeriodTimingChangedEventToClient( void SendVsyncPeriodTimingChangedEventToClient(
::android::DisplayHandle display_handle, ::android::drm_hwcomposer::DisplayHandle display_handle,
int64_t timestamp) const override; int64_t timestamp) const override;
void SendRefreshEventToClient( void SendRefreshEventToClient(
::android::DisplayHandle display_handle) override; ::android::drm_hwcomposer::DisplayHandle display_handle) override;
void SendHotplugEventToClient(::android::DisplayHandle display_handle, void SendHotplugEventToClient(
DrmHwc::DisplayStatus display_status) override; ::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<Hwc3Display>; -> std::shared_ptr<Hwc3Display>;
auto GetMustValidateDisplay(::android::DisplayHandle display_handle) -> bool; auto GetMustValidateDisplay(
void ClearMustValidateDisplay(::android::DisplayHandle display_handle); ::android::drm_hwcomposer::DisplayHandle display_handle) -> bool;
void ClearMustValidateDisplay(
::android::drm_hwcomposer::DisplayHandle display_handle);
private: private:
std::shared_ptr<IComposerCallback> composer_callback_; std::shared_ptr<IComposerCallback> composer_callback_;
std::mutex must_validate_lock_; std::mutex must_validate_lock_;
std::set<::android::DisplayHandle> must_validate_ std::set<::android::drm_hwcomposer::DisplayHandle> must_validate_
GUARDED_BY(must_validate_lock_); GUARDED_BY(must_validate_lock_);
}; };
} // namespace aidl::android::hardware::graphics::composer3::impl } // namespace aidl::android::hardware::graphics::composer3::impl

View file

@ -16,7 +16,7 @@
#include "stats/CompositionStats.h" #include "stats/CompositionStats.h"
namespace android { namespace android::drm_hwcomposer {
CompositionStats operator-(const CompositionStats& a, CompositionStats operator-(const CompositionStats& a,
const CompositionStats& b) { const CompositionStats& b) {
@ -39,4 +39,4 @@ void CompositionStatsTracker::ReportStats(const Callback& callback) {
previous_stats_ = new_stats; previous_stats_ = new_stats;
} }
} // namespace android } // namespace android::drm_hwcomposer

View file

@ -20,7 +20,7 @@
#include <functional> #include <functional>
#include <map> #include <map>
namespace android { namespace android::drm_hwcomposer {
struct CompositionStats { struct CompositionStats {
uint32_t total_frames = 0; uint32_t total_frames = 0;
@ -70,4 +70,4 @@ class CompositionStatsTracker {
std::map<int64_t, CompositionStats> previous_stats_; std::map<int64_t, CompositionStats> previous_stats_;
}; };
} // namespace android } // namespace android::drm_hwcomposer

View file

@ -20,7 +20,7 @@
#include "utils/log.h" #include "utils/log.h"
namespace android { namespace android::drm_hwcomposer {
std::unique_ptr<CompositionStatsAtomReporter> std::unique_ptr<CompositionStatsAtomReporter>
CompositionStatsAtomReporter::Create() { CompositionStatsAtomReporter::Create() {
@ -28,4 +28,4 @@ CompositionStatsAtomReporter::Create() {
return {}; return {};
} }
} // namespace android } // namespace android::drm_hwcomposer

View file

@ -18,7 +18,7 @@
#include <memory> #include <memory>
namespace android { namespace android::drm_hwcomposer {
// CompositionStatsAtomReporter is a wrapper around creation of a VendorAtom // CompositionStatsAtomReporter is a wrapper around creation of a VendorAtom
// and pushing it to the IStats::reportVendorAtom interface. // and pushing it to the IStats::reportVendorAtom interface.
@ -35,4 +35,4 @@ class CompositionStatsAtomReporter {
virtual ~CompositionStatsAtomReporter() = default; virtual ~CompositionStatsAtomReporter() = default;
}; };
} // namespace android } // namespace android::drm_hwcomposer

View file

@ -32,7 +32,7 @@ using aidl::android::frameworks::stats::IStats;
using aidl::android::frameworks::stats::VendorAtom; using aidl::android::frameworks::stats::VendorAtom;
namespace DesktopAtoms = android::vendor::google::desktop::stats::DesktopAtoms; namespace DesktopAtoms = android::vendor::google::desktop::stats::DesktopAtoms;
namespace android { namespace android::drm_hwcomposer {
namespace { namespace {
const std::string kStatsServiceName = std::string(IStats::descriptor) const std::string kStatsServiceName = std::string(IStats::descriptor)
@ -80,4 +80,4 @@ CompositionStatsAtomReporter::Create() {
return std::make_unique<CompositionStatsReporterDesktop>(); return std::make_unique<CompositionStatsReporterDesktop>();
} }
} // namespace android } // namespace android::drm_hwcomposer

View file

@ -21,7 +21,7 @@
#include "hwc/HwcDisplay.h" #include "hwc/HwcDisplay.h"
#include "stats/CompositionStatsAtomReporter.h" #include "stats/CompositionStatsAtomReporter.h"
namespace android { namespace android::drm_hwcomposer {
CompositionStatsPoller::CompositionStatsPoller( CompositionStatsPoller::CompositionStatsPoller(
std::unique_ptr<CompositionStatsAtomReporter> reporter, std::unique_ptr<CompositionStatsAtomReporter> reporter,
@ -63,4 +63,4 @@ void CompositionStatsPoller::PollFunc() {
} }
} }
} // namespace android } // namespace android::drm_hwcomposer

View file

@ -25,7 +25,7 @@
#include <android-base/thread_annotations.h> #include <android-base/thread_annotations.h>
namespace android { namespace android::drm_hwcomposer {
class CompositionStatsAtomReporter; class CompositionStatsAtomReporter;
@ -53,4 +53,4 @@ class CompositionStatsPoller {
std::unique_ptr<CompositionStatsAtomReporter> reporter_; std::unique_ptr<CompositionStatsAtomReporter> reporter_;
}; };
} // namespace android } // namespace android::drm_hwcomposer

View file

@ -28,7 +28,7 @@ using ::testing::NiceMock;
using ::testing::Return; using ::testing::Return;
using ::testing::StrictMock; using ::testing::StrictMock;
namespace android { namespace android::drm_hwcomposer {
// Equality operator to be used by Eq, ASSERT_EQ, etc. Needs to be static rather // 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. // than in anonymous namespace to ensure gmock can find it.
@ -301,4 +301,4 @@ TEST_F(CompositionStatsTrackerTest, ReportStatsDisplayRemoved) {
tracker_->ReportStats(mock_callback.AsStdFunction()); tracker_->ReportStats(mock_callback.AsStdFunction());
} }
} // namespace android } // namespace android::drm_hwcomposer

View file

@ -5,7 +5,7 @@
#include "utils/UEvent.h" #include "utils/UEvent.h"
int main() { int main() {
auto uevent = android::UEvent::CreateInstance(); auto uevent = android::drm_hwcomposer::UEvent::CreateInstance();
if (!uevent) { if (!uevent) {
std::cout << "Can't initialize UEvent class\n"; std::cout << "Can't initialize UEvent class\n";
return -ENODEV; return -ENODEV;

View file

@ -28,7 +28,7 @@ extern "C" {
#include "compositor/DisplayInfo.h" #include "compositor/DisplayInfo.h"
#include "drm/DrmUnique.h" #include "drm/DrmUnique.h"
namespace android { namespace android::drm_hwcomposer {
// Stub wrapper class for edid parsing // Stub wrapper class for edid parsing
class EdidWrapper { class EdidWrapper {
@ -84,4 +84,4 @@ class LibdisplayEdidWrapper final : public EdidWrapper {
}; };
#endif #endif
} // namespace android } // namespace android::drm_hwcomposer

View file

@ -21,7 +21,7 @@
#include "utils/EdidWrapper.h" #include "utils/EdidWrapper.h"
#include "utils/log.h" #include "utils/log.h"
namespace android { namespace android::drm_hwcomposer {
auto LibdisplayEdidWrapper::Create(DrmModePropertyBlobUnique blob) auto LibdisplayEdidWrapper::Create(DrmModePropertyBlobUnique blob)
-> std::unique_ptr<LibdisplayEdidWrapper> { -> std::unique_ptr<LibdisplayEdidWrapper> {
@ -110,5 +110,6 @@ auto LibdisplayEdidWrapper::GetBoundsMm() -> std::pair<int32_t, int32_t> {
return {dtd->horiz_image_mm, dtd->vert_image_mm}; return {dtd->horiz_image_mm, dtd->vert_image_mm};
} }
} // namespace android } // namespace android::drm_hwcomposer
#endif #endif

View file

@ -29,7 +29,7 @@
#include "fd.h" #include "fd.h"
#include "log.h" #include "log.h"
namespace android { namespace android::drm_hwcomposer {
class UEvent { class UEvent {
public: public:
@ -143,4 +143,4 @@ class UEvent {
UniqueFd stop_event_fd_; UniqueFd stop_event_fd_;
}; };
} // namespace android } // namespace android::drm_hwcomposer

View file

@ -16,7 +16,7 @@
#include "fd.h" #include "fd.h"
namespace android { namespace android::drm_hwcomposer {
static void CloseFd(const int *fd) { static void CloseFd(const int *fd) {
if (fd != nullptr) { if (fd != nullptr) {
@ -49,4 +49,4 @@ auto DupFd(SharedFd const &fd) -> int {
return fcntl(*fd, F_DUPFD_CLOEXEC, 0); return fcntl(*fd, F_DUPFD_CLOEXEC, 0);
} }
} // namespace android } // namespace android::drm_hwcomposer

View file

@ -22,7 +22,7 @@
#include <memory> #include <memory>
#include <utility> #include <utility>
namespace android { namespace android::drm_hwcomposer {
using UniqueFd = std::unique_ptr<int, void (*)(const int *)>; using UniqueFd = std::unique_ptr<int, void (*)(const int *)>;
using SharedFd = std::shared_ptr<int>; using SharedFd = std::shared_ptr<int>;
@ -33,4 +33,4 @@ auto MakeSharedFd(int fd) -> SharedFd;
auto DupFd(SharedFd const &fd) -> int; auto DupFd(SharedFd const &fd) -> int;
} // namespace android } // namespace android::drm_hwcomposer

View file

@ -82,7 +82,7 @@ auto inline property_get_bool(const char *key, int8_t default_value) -> int8_t {
} // namespace } // namespace
#endif #endif
namespace android { namespace android::drm_hwcomposer {
/** /**
* @brief Determine if the "Present Not Reliable" property is enabled. * @brief Determine if the "Present Not Reliable" property is enabled.
@ -144,4 +144,4 @@ auto Properties::GetDevicePath() -> std::string {
return {path_pattern}; return {path_pattern};
} }
} // namespace android } // namespace android::drm_hwcomposer

View file

@ -19,7 +19,7 @@
#include <optional> #include <optional>
#include <string> #include <string>
namespace android { namespace android::drm_hwcomposer {
enum class CtmHandling { enum class CtmHandling {
kDrmOrGpu, /* Handled by DRM is possible, otherwise by GPU */ kDrmOrGpu, /* Handled by DRM is possible, otherwise by GPU */
@ -38,4 +38,4 @@ class Properties {
static auto GetDevicePath() -> std::string; static auto GetDevicePath() -> std::string;
}; };
} // namespace android } // namespace android::drm_hwcomposer