drm_hwcomposer: Reorganize struct DrmHwcLayer
1. Move BlendMode, ColorSpace, SampleRange fields to the struct BufferInfo,
allowing extraction of the data from native_handle using Metadata@4 API.
Use it when data from HWC2 API can't be used (Currently it's a BlendMode
case for CLIENT layer)
2. Rename DrmHwcLayer to LayerData and move it to compositor/ directory.
(I was confused in the past because of similarity of names DrmHwcLayer
vs HwcLayer, so this step should meke it easier for newcomers to
understand the code)
3. Allow clonning of the LayerData to propagate it through the composition
pipeline. Thus LayerData can be used by both HwcLayer to track state
and by the compositor.
Signed-off-by: Roman Stratiienko <roman.o.stratiienko@globallogic.com>
diff --git a/drm/DrmPlane.h b/drm/DrmPlane.h
index 65f458f..31f0a33 100644
--- a/drm/DrmPlane.h
+++ b/drm/DrmPlane.h
@@ -24,12 +24,12 @@
#include "DrmCrtc.h"
#include "DrmProperty.h"
-#include "drmhwcomposer.h"
+#include "compositor/LayerData.h"
namespace android {
class DrmDevice;
-struct DrmHwcLayer;
+struct LayerData;
class DrmPlane : public PipelineBindable<DrmPlane> {
public:
@@ -40,7 +40,7 @@
-> std::unique_ptr<DrmPlane>;
bool IsCrtcSupported(const DrmCrtc &crtc) const;
- bool IsValidForLayer(DrmHwcLayer *layer);
+ bool IsValidForLayer(LayerData *layer);
auto GetType() const {
return type_;
@@ -49,7 +49,7 @@
bool IsFormatSupported(uint32_t format) const;
bool HasNonRgbFormat() const;
- auto AtomicSetState(drmModeAtomicReq &pset, DrmHwcLayer &layer, uint32_t zpos,
+ auto AtomicSetState(drmModeAtomicReq &pset, LayerData &layer, uint32_t zpos,
uint32_t crtc_id) -> int;
auto AtomicDisablePlane(drmModeAtomicReq &pset) -> int;
auto &GetZPosProperty() const {
@@ -94,10 +94,10 @@
DrmProperty color_encoding_propery_;
DrmProperty color_range_property_;
- std::map<DrmHwcBlending, uint64_t> blending_enum_map_;
- std::map<DrmHwcColorSpace, uint64_t> color_encoding_enum_map_;
- std::map<DrmHwcSampleRange, uint64_t> color_range_enum_map_;
- std::map<DrmHwcTransform, uint64_t> transform_enum_map_;
+ std::map<BufferBlendMode, uint64_t> blending_enum_map_;
+ std::map<BufferColorSpace, uint64_t> color_encoding_enum_map_;
+ std::map<BufferSampleRange, uint64_t> color_range_enum_map_;
+ std::map<LayerTransform, uint64_t> transform_enum_map_;
};
} // namespace android