diff options
author | android-build-team Robot | 2018-05-23 02:26:48 -0500 |
---|---|---|
committer | android-build-team Robot | 2018-05-23 02:26:48 -0500 |
commit | e4db4f546c3453e741d688311ce60ee3f55f7fe3 (patch) | |
tree | aec20c986ac9d22fd0ca80664ce481d6c2822840 | |
parent | b9b5b354b92bc5e1cf69c8c4d7d58d3208eb9ace (diff) | |
parent | 08009ec4be0dcb202712a2f1e2f57a3e64797f1d (diff) | |
download | platform-hardware-interfaces-e4db4f546c3453e741d688311ce60ee3f55f7fe3.tar.gz platform-hardware-interfaces-e4db4f546c3453e741d688311ce60ee3f55f7fe3.tar.xz platform-hardware-interfaces-e4db4f546c3453e741d688311ce60ee3f55f7fe3.zip |
Snap for 4799153 from 08009ec4be0dcb202712a2f1e2f57a3e64797f1d to pi-release
Change-Id: I1aa2f0203717f12b730f006ad9458e035386059a
4 files changed, 48 insertions, 9 deletions
diff --git a/graphics/composer/2.2/utils/vts/ComposerVts.cpp b/graphics/composer/2.2/utils/vts/ComposerVts.cpp index 357c7725..6a320712 100644 --- a/graphics/composer/2.2/utils/vts/ComposerVts.cpp +++ b/graphics/composer/2.2/utils/vts/ComposerVts.cpp | |||
@@ -45,6 +45,10 @@ std::unique_ptr<ComposerClient_v2_2> Composer_v2_2::createClient_v2_2() { | |||
45 | return client; | 45 | return client; |
46 | } | 46 | } |
47 | 47 | ||
48 | sp<V2_2::IComposerClient> ComposerClient_v2_2::getRaw() const { | ||
49 | return mClient_v2_2; | ||
50 | } | ||
51 | |||
48 | std::vector<IComposerClient::PerFrameMetadataKey> ComposerClient_v2_2::getPerFrameMetadataKeys( | 52 | std::vector<IComposerClient::PerFrameMetadataKey> ComposerClient_v2_2::getPerFrameMetadataKeys( |
49 | Display display) { | 53 | Display display) { |
50 | std::vector<IComposerClient::PerFrameMetadataKey> keys; | 54 | std::vector<IComposerClient::PerFrameMetadataKey> keys; |
diff --git a/graphics/composer/2.2/utils/vts/include/composer-vts/2.2/ComposerVts.h b/graphics/composer/2.2/utils/vts/include/composer-vts/2.2/ComposerVts.h index 62ab83f3..1c6d7ae0 100644 --- a/graphics/composer/2.2/utils/vts/include/composer-vts/2.2/ComposerVts.h +++ b/graphics/composer/2.2/utils/vts/include/composer-vts/2.2/ComposerVts.h | |||
@@ -63,6 +63,8 @@ class ComposerClient_v2_2 | |||
63 | ComposerClient_v2_2(const sp<IComposerClient>& client) | 63 | ComposerClient_v2_2(const sp<IComposerClient>& client) |
64 | : V2_1::vts::ComposerClient(client), mClient_v2_2(client){}; | 64 | : V2_1::vts::ComposerClient(client), mClient_v2_2(client){}; |
65 | 65 | ||
66 | sp<V2_2::IComposerClient> getRaw() const; | ||
67 | |||
66 | void execute_v2_2(V2_1::vts::TestCommandReader* reader, V2_2::CommandWriterBase* writer); | 68 | void execute_v2_2(V2_1::vts::TestCommandReader* reader, V2_2::CommandWriterBase* writer); |
67 | 69 | ||
68 | std::vector<IComposerClient::PerFrameMetadataKey> getPerFrameMetadataKeys(Display display); | 70 | std::vector<IComposerClient::PerFrameMetadataKey> getPerFrameMetadataKeys(Display display); |
diff --git a/graphics/composer/2.2/vts/functional/VtsHalGraphicsComposerV2_2TargetTest.cpp b/graphics/composer/2.2/vts/functional/VtsHalGraphicsComposerV2_2TargetTest.cpp index 4e41333e..f0d22504 100644 --- a/graphics/composer/2.2/vts/functional/VtsHalGraphicsComposerV2_2TargetTest.cpp +++ b/graphics/composer/2.2/vts/functional/VtsHalGraphicsComposerV2_2TargetTest.cpp | |||
@@ -78,6 +78,11 @@ class GraphicsComposerHidlTest : public ::testing::VtsHalHidlTargetTestBase { | |||
78 | // explicitly disable vsync | 78 | // explicitly disable vsync |
79 | mComposerClient->setVsyncEnabled(mPrimaryDisplay, false); | 79 | mComposerClient->setVsyncEnabled(mPrimaryDisplay, false); |
80 | mComposerCallback->setVsyncAllowed(false); | 80 | mComposerCallback->setVsyncAllowed(false); |
81 | |||
82 | mComposerClient->getRaw()->getReadbackBufferAttributes( | ||
83 | mPrimaryDisplay, [&](const auto& tmpError, const auto&, const auto&) { | ||
84 | mHasReadbackBuffer = tmpError == Error::NONE; | ||
85 | }); | ||
81 | } | 86 | } |
82 | 87 | ||
83 | void TearDown() override { | 88 | void TearDown() override { |
@@ -96,6 +101,7 @@ class GraphicsComposerHidlTest : public ::testing::VtsHalHidlTargetTestBase { | |||
96 | sp<V2_1::vts::GraphicsComposerCallback> mComposerCallback; | 101 | sp<V2_1::vts::GraphicsComposerCallback> mComposerCallback; |
97 | // the first display and is assumed never to be removed | 102 | // the first display and is assumed never to be removed |
98 | Display mPrimaryDisplay; | 103 | Display mPrimaryDisplay; |
104 | bool mHasReadbackBuffer; | ||
99 | 105 | ||
100 | private: | 106 | private: |
101 | Display waitForFirstDisplay() { | 107 | Display waitForFirstDisplay() { |
@@ -257,18 +263,44 @@ TEST_F(GraphicsComposerHidlTest, setPowerMode_2_2) { | |||
257 | } | 263 | } |
258 | 264 | ||
259 | TEST_F(GraphicsComposerHidlTest, setReadbackBuffer) { | 265 | TEST_F(GraphicsComposerHidlTest, setReadbackBuffer) { |
260 | mComposerClient->setReadbackBuffer(mPrimaryDisplay, nullptr, -1); | 266 | if (!mHasReadbackBuffer) { |
261 | } | 267 | return; |
262 | 268 | } | |
263 | TEST_F(GraphicsComposerHidlTest, getReadbackBufferFence) { | ||
264 | int32_t fence; | ||
265 | mComposerClient->getReadbackBufferFence(mPrimaryDisplay, &fence); | ||
266 | } | ||
267 | 269 | ||
268 | TEST_F(GraphicsComposerHidlTest, getReadbackBufferAttributes) { | ||
269 | PixelFormat pixelFormat; | 270 | PixelFormat pixelFormat; |
270 | Dataspace dataspace; | 271 | Dataspace dataspace; |
271 | mComposerClient->getReadbackBufferAttributes(mPrimaryDisplay, &pixelFormat, &dataspace); | 272 | mComposerClient->getReadbackBufferAttributes(mPrimaryDisplay, &pixelFormat, &dataspace); |
273 | ASSERT_LT(static_cast<PixelFormat>(0), pixelFormat); | ||
274 | ASSERT_NE(Dataspace::UNKNOWN, dataspace); | ||
275 | |||
276 | IMapper::BufferDescriptorInfo info{}; | ||
277 | Config config = mComposerClient->getActiveConfig(mPrimaryDisplay); | ||
278 | info.width = mComposerClient->getDisplayAttribute(mPrimaryDisplay, config, | ||
279 | IComposerClient::Attribute::WIDTH); | ||
280 | info.height = mComposerClient->getDisplayAttribute(mPrimaryDisplay, config, | ||
281 | IComposerClient::Attribute::HEIGHT); | ||
282 | info.layerCount = 1; | ||
283 | info.format = pixelFormat; | ||
284 | // BufferUsage::COMPOSER_OUTPUT is missing | ||
285 | info.usage = static_cast<uint64_t>(BufferUsage::COMPOSER_OVERLAY | BufferUsage::CPU_READ_OFTEN); | ||
286 | |||
287 | std::unique_ptr<Gralloc> gralloc; | ||
288 | const native_handle_t* buffer; | ||
289 | ASSERT_NO_FATAL_FAILURE(gralloc = std::make_unique<Gralloc>()); | ||
290 | ASSERT_NO_FATAL_FAILURE(buffer = gralloc->allocate(info)); | ||
291 | |||
292 | mComposerClient->setReadbackBuffer(mPrimaryDisplay, buffer, -1); | ||
293 | } | ||
294 | |||
295 | TEST_F(GraphicsComposerHidlTest, getReadbackBufferFenceInactive) { | ||
296 | if (!mHasReadbackBuffer) { | ||
297 | return; | ||
298 | } | ||
299 | |||
300 | mComposerClient->getRaw()->getReadbackBufferFence( | ||
301 | mPrimaryDisplay, [&](const auto& tmpError, const auto&) { | ||
302 | ASSERT_EQ(Error::UNSUPPORTED, tmpError) << "readback buffer is active"; | ||
303 | }); | ||
272 | } | 304 | } |
273 | 305 | ||
274 | /** | 306 | /** |
diff --git a/light/utils/main.cpp b/light/utils/main.cpp index d07e799a..724e0eef 100644 --- a/light/utils/main.cpp +++ b/light/utils/main.cpp | |||
@@ -55,5 +55,6 @@ int main() { | |||
55 | } | 55 | } |
56 | }); | 56 | }); |
57 | 57 | ||
58 | return 0; | 58 | // b/77934844: Avoid running static destructors. |
59 | _exit(1); | ||
59 | } | 60 | } |