Loading libs/vr/libvrflinger/Android.bp +1 −0 Original line number Diff line number Diff line Loading @@ -64,6 +64,7 @@ sharedLibraries = [ headerLibraries = [ "android.hardware.graphics.composer@2.1-command-buffer", "android.hardware.graphics.composer@2.2-command-buffer", "android.hardware.graphics.composer@2.3-command-buffer", "libdvr_headers", "libsurfaceflinger_headers", ] Loading services/surfaceflinger/Android.bp +1 −0 Original line number Diff line number Diff line Loading @@ -65,6 +65,7 @@ cc_defaults { header_libs: [ "android.hardware.graphics.composer@2.1-command-buffer", "android.hardware.graphics.composer@2.2-command-buffer", "android.hardware.graphics.composer@2.3-command-buffer", ], export_static_lib_headers: [ "librenderengine", Loading services/surfaceflinger/DisplayHardware/ComposerHal.cpp +12 −0 Original line number Diff line number Diff line Loading @@ -991,6 +991,18 @@ Error Composer::getDisplayIdentificationData(Display display, uint8_t* outPort, return error; } Error Composer::setLayerColorTransform(Display display, Layer layer, const float* matrix) { if (!mClient_2_3) { return Error::UNSUPPORTED; } mWriter.selectDisplay(display); mWriter.selectLayer(layer); mWriter.setLayerColorTransform(matrix); return Error::NONE; } CommandReader::~CommandReader() { resetData(); Loading services/surfaceflinger/DisplayHardware/ComposerHal.h +6 −3 Original line number Diff line number Diff line Loading @@ -27,7 +27,7 @@ #include <android/hardware/graphics/common/1.1/types.h> #include <android/hardware/graphics/composer/2.3/IComposer.h> #include <android/hardware/graphics/composer/2.3/IComposerClient.h> #include <composer-command-buffer/2.2/ComposerCommandBuffer.h> #include <composer-command-buffer/2.3/ComposerCommandBuffer.h> #include <gui/HdrMetadata.h> #include <math/mat4.h> #include <ui/GraphicBuffer.h> Loading Loading @@ -60,8 +60,8 @@ using V2_1::Error; using V2_1::IComposerCallback; using V2_1::Layer; using V2_2::CommandReaderBase; using V2_2::CommandWriterBase; using V2_3::CommandReaderBase; using V2_3::CommandWriterBase; using V2_3::IComposer; using V2_3::IComposerClient; Loading Loading @@ -191,6 +191,8 @@ public: // Composer HAL 2.3 virtual Error getDisplayIdentificationData(Display display, uint8_t* outPort, std::vector<uint8_t>* outData) = 0; virtual Error setLayerColorTransform(Display display, Layer layer, const float* matrix) = 0; }; namespace impl { Loading Loading @@ -389,6 +391,7 @@ public: // Composer HAL 2.3 Error getDisplayIdentificationData(Display display, uint8_t* outPort, std::vector<uint8_t>* outData) override; Error setLayerColorTransform(Display display, Layer layer, const float* matrix) override; private: class CommandWriter : public CommandWriterBase { Loading services/surfaceflinger/DisplayHardware/HWC2.cpp +12 −1 Original line number Diff line number Diff line Loading @@ -781,7 +781,8 @@ Layer::Layer(android::Hwc2::Composer& composer, const std::unordered_set<Capabil : mComposer(composer), mCapabilities(capabilities), mDisplayId(displayId), mId(layerId) mId(layerId), mColorMatrix(android::mat4()) { ALOGV("Created layer %" PRIu64 " on display %" PRIu64, layerId, displayId); } Loading Loading @@ -988,4 +989,14 @@ Error Layer::setInfo(uint32_t type, uint32_t appId) return static_cast<Error>(intError); } // Composer HAL 2.3 Error Layer::setColorTransform(const android::mat4& matrix) { if (matrix == mColorMatrix) { return Error::None; } mColorMatrix = matrix; auto intError = mComposer.setLayerColorTransform(mDisplayId, mId, matrix.asArray()); return static_cast<Error>(intError); } } // namespace HWC2 Loading
libs/vr/libvrflinger/Android.bp +1 −0 Original line number Diff line number Diff line Loading @@ -64,6 +64,7 @@ sharedLibraries = [ headerLibraries = [ "android.hardware.graphics.composer@2.1-command-buffer", "android.hardware.graphics.composer@2.2-command-buffer", "android.hardware.graphics.composer@2.3-command-buffer", "libdvr_headers", "libsurfaceflinger_headers", ] Loading
services/surfaceflinger/Android.bp +1 −0 Original line number Diff line number Diff line Loading @@ -65,6 +65,7 @@ cc_defaults { header_libs: [ "android.hardware.graphics.composer@2.1-command-buffer", "android.hardware.graphics.composer@2.2-command-buffer", "android.hardware.graphics.composer@2.3-command-buffer", ], export_static_lib_headers: [ "librenderengine", Loading
services/surfaceflinger/DisplayHardware/ComposerHal.cpp +12 −0 Original line number Diff line number Diff line Loading @@ -991,6 +991,18 @@ Error Composer::getDisplayIdentificationData(Display display, uint8_t* outPort, return error; } Error Composer::setLayerColorTransform(Display display, Layer layer, const float* matrix) { if (!mClient_2_3) { return Error::UNSUPPORTED; } mWriter.selectDisplay(display); mWriter.selectLayer(layer); mWriter.setLayerColorTransform(matrix); return Error::NONE; } CommandReader::~CommandReader() { resetData(); Loading
services/surfaceflinger/DisplayHardware/ComposerHal.h +6 −3 Original line number Diff line number Diff line Loading @@ -27,7 +27,7 @@ #include <android/hardware/graphics/common/1.1/types.h> #include <android/hardware/graphics/composer/2.3/IComposer.h> #include <android/hardware/graphics/composer/2.3/IComposerClient.h> #include <composer-command-buffer/2.2/ComposerCommandBuffer.h> #include <composer-command-buffer/2.3/ComposerCommandBuffer.h> #include <gui/HdrMetadata.h> #include <math/mat4.h> #include <ui/GraphicBuffer.h> Loading Loading @@ -60,8 +60,8 @@ using V2_1::Error; using V2_1::IComposerCallback; using V2_1::Layer; using V2_2::CommandReaderBase; using V2_2::CommandWriterBase; using V2_3::CommandReaderBase; using V2_3::CommandWriterBase; using V2_3::IComposer; using V2_3::IComposerClient; Loading Loading @@ -191,6 +191,8 @@ public: // Composer HAL 2.3 virtual Error getDisplayIdentificationData(Display display, uint8_t* outPort, std::vector<uint8_t>* outData) = 0; virtual Error setLayerColorTransform(Display display, Layer layer, const float* matrix) = 0; }; namespace impl { Loading Loading @@ -389,6 +391,7 @@ public: // Composer HAL 2.3 Error getDisplayIdentificationData(Display display, uint8_t* outPort, std::vector<uint8_t>* outData) override; Error setLayerColorTransform(Display display, Layer layer, const float* matrix) override; private: class CommandWriter : public CommandWriterBase { Loading
services/surfaceflinger/DisplayHardware/HWC2.cpp +12 −1 Original line number Diff line number Diff line Loading @@ -781,7 +781,8 @@ Layer::Layer(android::Hwc2::Composer& composer, const std::unordered_set<Capabil : mComposer(composer), mCapabilities(capabilities), mDisplayId(displayId), mId(layerId) mId(layerId), mColorMatrix(android::mat4()) { ALOGV("Created layer %" PRIu64 " on display %" PRIu64, layerId, displayId); } Loading Loading @@ -988,4 +989,14 @@ Error Layer::setInfo(uint32_t type, uint32_t appId) return static_cast<Error>(intError); } // Composer HAL 2.3 Error Layer::setColorTransform(const android::mat4& matrix) { if (matrix == mColorMatrix) { return Error::None; } mColorMatrix = matrix; auto intError = mComposer.setLayerColorTransform(mDisplayId, mId, matrix.asArray()); return static_cast<Error>(intError); } } // namespace HWC2