Loading services/surfaceflinger/CompositionEngine/Android.bp +1 −0 Original line number Diff line number Diff line Loading @@ -42,6 +42,7 @@ cc_defaults { "libutils", ], static_libs: [ "libguiflags", "libmath", "librenderengine", "libtimestats", Loading services/surfaceflinger/CompositionEngine/include/compositionengine/DisplayCreationArgs.h +16 −0 Original line number Diff line number Diff line Loading @@ -46,6 +46,12 @@ struct DisplayCreationArgs { // content. bool isProtected = false; // True if this display has picture processing hardware and pipelines. bool hasPictureProcessing = false; // The number of layer-specific picture-processing pipelines. int32_t maxLayerPictureProfiles = 0; // Optional pointer to the power advisor interface, if one is needed for // this display. adpf::PowerAdvisor* powerAdvisor = nullptr; Loading Loading @@ -82,6 +88,16 @@ public: return *this; } DisplayCreationArgsBuilder& setHasPictureProcessing(bool hasPictureProcessing) { mArgs.hasPictureProcessing = hasPictureProcessing; return *this; } DisplayCreationArgsBuilder& setMaxLayerPictureProfiles(int32_t maxLayerPictureProfiles) { mArgs.maxLayerPictureProfiles = maxLayerPictureProfiles; return *this; } DisplayCreationArgsBuilder& setPowerAdvisor(adpf::PowerAdvisor* powerAdvisor) { mArgs.powerAdvisor = powerAdvisor; return *this; Loading services/surfaceflinger/CompositionEngine/include/compositionengine/LayerFECompositionState.h +9 −0 Original line number Diff line number Diff line Loading @@ -25,6 +25,7 @@ #include <ui/BlurRegion.h> #include <ui/FloatRect.h> #include <ui/LayerStack.h> #include <ui/PictureProfileHandle.h> #include <ui/Rect.h> #include <ui/Region.h> #include <ui/ShadowSettings.h> Loading Loading @@ -219,6 +220,14 @@ struct LayerFECompositionState { float currentHdrSdrRatio = 1.f; float desiredHdrSdrRatio = 1.f; // A picture profile handle refers to a PictureProfile configured on the display, which is a // set of parameters that configures the picture processing hardware that is used to enhance // the quality of buffer contents. PictureProfileHandle pictureProfileHandle{PictureProfileHandle::NONE}; // A layer's priority in terms of limited picture processing pipeline utilization. int64_t pictureProfilePriority; gui::CachingHint cachingHint = gui::CachingHint::Enabled; std::shared_ptr<gui::DisplayLuts> luts; Loading services/surfaceflinger/CompositionEngine/include/compositionengine/Output.h +8 −3 Original line number Diff line number Diff line Loading @@ -16,6 +16,8 @@ #pragma once #include <ftl/future.h> #include <ftl/optional.h> #include <cstdint> #include <iterator> #include <optional> Loading @@ -26,18 +28,18 @@ #include <vector> #include <compositionengine/LayerFE.h> #include <ftl/future.h> #include <renderengine/LayerSettings.h> #include <ui/DisplayIdentification.h> #include <ui/Fence.h> #include <ui/FenceTime.h> #include <ui/GraphicTypes.h> #include <ui/LayerStack.h> #include <ui/PictureProfileHandle.h> #include <ui/Region.h> #include <ui/Transform.h> #include <utils/StrongPointer.h> #include <utils/Vector.h> #include <ui/DisplayIdentification.h> #include "DisplayHardware/HWComposer.h" namespace android { Loading Loading @@ -167,7 +169,7 @@ public: virtual bool isValid() const = 0; // Returns the DisplayId the output represents, if it has one virtual std::optional<DisplayId> getDisplayId() const = 0; virtual ftl::Optional<DisplayId> getDisplayId() const = 0; // Enables (or disables) composition on this output virtual void setCompositionEnabled(bool) = 0; Loading Loading @@ -331,6 +333,9 @@ protected: virtual bool canPredictCompositionStrategy(const CompositionRefreshArgs&) = 0; virtual const aidl::android::hardware::graphics::composer3::OverlayProperties* getOverlaySupport() = 0; virtual bool hasPictureProcessing() const = 0; virtual int32_t getMaxLayerPictureProfiles() const = 0; virtual void applyPictureProfile() = 0; }; } // namespace compositionengine Loading services/surfaceflinger/CompositionEngine/include/compositionengine/OutputLayer.h +11 −0 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ #include <string> #include <vector> #include <ui/PictureProfileHandle.h> #include <ui/Transform.h> #include <utils/StrongPointer.h> Loading Loading @@ -86,6 +87,16 @@ public: // longer cares about. virtual void uncacheBuffers(const std::vector<uint64_t>& bufferIdsToUncache) = 0; // Get the relative priority of the layer's picture profile with respect to the importance of // the visual content to the user experience. Lower is higher priority. virtual int64_t getPictureProfilePriority() const = 0; // The picture profile handle for the layer. virtual const PictureProfileHandle& getPictureProfileHandle() const = 0; // Commit the picture profile to the composition state. virtual void commitPictureProfileToCompositionState() = 0; // Recalculates the state of the output layer from the output-independent // layer. If includeGeometry is false, the geometry state can be skipped. // internalDisplayRotationFlags must be set to the rotation flags for the Loading Loading
services/surfaceflinger/CompositionEngine/Android.bp +1 −0 Original line number Diff line number Diff line Loading @@ -42,6 +42,7 @@ cc_defaults { "libutils", ], static_libs: [ "libguiflags", "libmath", "librenderengine", "libtimestats", Loading
services/surfaceflinger/CompositionEngine/include/compositionengine/DisplayCreationArgs.h +16 −0 Original line number Diff line number Diff line Loading @@ -46,6 +46,12 @@ struct DisplayCreationArgs { // content. bool isProtected = false; // True if this display has picture processing hardware and pipelines. bool hasPictureProcessing = false; // The number of layer-specific picture-processing pipelines. int32_t maxLayerPictureProfiles = 0; // Optional pointer to the power advisor interface, if one is needed for // this display. adpf::PowerAdvisor* powerAdvisor = nullptr; Loading Loading @@ -82,6 +88,16 @@ public: return *this; } DisplayCreationArgsBuilder& setHasPictureProcessing(bool hasPictureProcessing) { mArgs.hasPictureProcessing = hasPictureProcessing; return *this; } DisplayCreationArgsBuilder& setMaxLayerPictureProfiles(int32_t maxLayerPictureProfiles) { mArgs.maxLayerPictureProfiles = maxLayerPictureProfiles; return *this; } DisplayCreationArgsBuilder& setPowerAdvisor(adpf::PowerAdvisor* powerAdvisor) { mArgs.powerAdvisor = powerAdvisor; return *this; Loading
services/surfaceflinger/CompositionEngine/include/compositionengine/LayerFECompositionState.h +9 −0 Original line number Diff line number Diff line Loading @@ -25,6 +25,7 @@ #include <ui/BlurRegion.h> #include <ui/FloatRect.h> #include <ui/LayerStack.h> #include <ui/PictureProfileHandle.h> #include <ui/Rect.h> #include <ui/Region.h> #include <ui/ShadowSettings.h> Loading Loading @@ -219,6 +220,14 @@ struct LayerFECompositionState { float currentHdrSdrRatio = 1.f; float desiredHdrSdrRatio = 1.f; // A picture profile handle refers to a PictureProfile configured on the display, which is a // set of parameters that configures the picture processing hardware that is used to enhance // the quality of buffer contents. PictureProfileHandle pictureProfileHandle{PictureProfileHandle::NONE}; // A layer's priority in terms of limited picture processing pipeline utilization. int64_t pictureProfilePriority; gui::CachingHint cachingHint = gui::CachingHint::Enabled; std::shared_ptr<gui::DisplayLuts> luts; Loading
services/surfaceflinger/CompositionEngine/include/compositionengine/Output.h +8 −3 Original line number Diff line number Diff line Loading @@ -16,6 +16,8 @@ #pragma once #include <ftl/future.h> #include <ftl/optional.h> #include <cstdint> #include <iterator> #include <optional> Loading @@ -26,18 +28,18 @@ #include <vector> #include <compositionengine/LayerFE.h> #include <ftl/future.h> #include <renderengine/LayerSettings.h> #include <ui/DisplayIdentification.h> #include <ui/Fence.h> #include <ui/FenceTime.h> #include <ui/GraphicTypes.h> #include <ui/LayerStack.h> #include <ui/PictureProfileHandle.h> #include <ui/Region.h> #include <ui/Transform.h> #include <utils/StrongPointer.h> #include <utils/Vector.h> #include <ui/DisplayIdentification.h> #include "DisplayHardware/HWComposer.h" namespace android { Loading Loading @@ -167,7 +169,7 @@ public: virtual bool isValid() const = 0; // Returns the DisplayId the output represents, if it has one virtual std::optional<DisplayId> getDisplayId() const = 0; virtual ftl::Optional<DisplayId> getDisplayId() const = 0; // Enables (or disables) composition on this output virtual void setCompositionEnabled(bool) = 0; Loading Loading @@ -331,6 +333,9 @@ protected: virtual bool canPredictCompositionStrategy(const CompositionRefreshArgs&) = 0; virtual const aidl::android::hardware::graphics::composer3::OverlayProperties* getOverlaySupport() = 0; virtual bool hasPictureProcessing() const = 0; virtual int32_t getMaxLayerPictureProfiles() const = 0; virtual void applyPictureProfile() = 0; }; } // namespace compositionengine Loading
services/surfaceflinger/CompositionEngine/include/compositionengine/OutputLayer.h +11 −0 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ #include <string> #include <vector> #include <ui/PictureProfileHandle.h> #include <ui/Transform.h> #include <utils/StrongPointer.h> Loading Loading @@ -86,6 +87,16 @@ public: // longer cares about. virtual void uncacheBuffers(const std::vector<uint64_t>& bufferIdsToUncache) = 0; // Get the relative priority of the layer's picture profile with respect to the importance of // the visual content to the user experience. Lower is higher priority. virtual int64_t getPictureProfilePriority() const = 0; // The picture profile handle for the layer. virtual const PictureProfileHandle& getPictureProfileHandle() const = 0; // Commit the picture profile to the composition state. virtual void commitPictureProfileToCompositionState() = 0; // Recalculates the state of the output layer from the output-independent // layer. If includeGeometry is false, the geometry state can be skipped. // internalDisplayRotationFlags must be set to the rotation flags for the Loading