Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7f996c3f authored by John Reck's avatar John Reck
Browse files

Remove direct mapper from composer2.4 VTS

Bug: 292584923
Test: make VtsHalGraphicsComposerV2_4TargetTest
Change-Id: I4379df1d673fc709b9a496b5c44cb9420798a05d
parent e849ecd0
Loading
Loading
Loading
Loading
+1 −11
Original line number Diff line number Diff line
@@ -38,16 +38,10 @@ cc_test {
        "libbinder_ndk",
        "libfmq",
        "libsync",
        "libui",
        "android.hardware.common-V2-ndk",
        "android.hardware.graphics.mapper@2.0",
        "android.hardware.graphics.mapper@2.1",
        "android.hardware.graphics.mapper@3.0",
        "android.hardware.graphics.mapper@4.0",
    ],
    static_libs: [
        "android.hardware.graphics.allocator@2.0",
        "android.hardware.graphics.allocator@3.0",
        "android.hardware.graphics.allocator@4.0",
        "android.hardware.graphics.composer@2.1",
        "android.hardware.graphics.composer@2.1-vts",
        "android.hardware.graphics.composer@2.2",
@@ -56,10 +50,6 @@ cc_test {
        "android.hardware.graphics.composer@2.3-vts",
        "android.hardware.graphics.composer@2.4",
        "android.hardware.graphics.composer@2.4-vts",
        "android.hardware.graphics.mapper@2.0-vts",
        "android.hardware.graphics.mapper@2.1-vts",
        "android.hardware.graphics.mapper@3.0-vts",
        "android.hardware.graphics.mapper@4.0-vts",
        "libaidlcommonsupport",
    ],
    header_libs: [
+10 −14
Original line number Diff line number Diff line
@@ -22,7 +22,6 @@

#include <android-base/logging.h>
#include <android-base/properties.h>
#include <android/hardware/graphics/mapper/2.0/IMapper.h>
#include <composer-command-buffer/2.4/ComposerCommandBuffer.h>
#include <composer-vts/2.4/ComposerVts.h>
#include <composer-vts/2.4/GraphicsComposerCallback.h>
@@ -30,9 +29,7 @@
#include <gtest/gtest.h>
#include <hidl/GtestPrinter.h>
#include <hidl/ServiceManagement.h>
#include <mapper-vts/2.0/MapperVts.h>
#include <mapper-vts/3.0/MapperVts.h>
#include <mapper-vts/4.0/MapperVts.h>
#include <ui/GraphicBuffer.h>
#include <utils/Timers.h>

namespace android {
@@ -53,7 +50,6 @@ using common::V1_2::PixelFormat;
using V2_1::Layer;
using V2_1::vts::NativeHandleWrapper;
using V2_2::Transform;
using V2_2::vts::Gralloc;

using ContentType = IComposerClient::ContentType;
using DisplayCapability = IComposerClient::DisplayCapability;
@@ -103,8 +99,6 @@ class GraphicsComposerHidlTest : public ::testing::TestWithParam<std::string> {
        }
        mComposerCallback->setVsyncAllowed(false);

        ASSERT_NO_FATAL_FAILURE(mGralloc = std::make_unique<Gralloc>());

        mWriter = std::make_unique<CommandWriterBase>(1024);
        mReader = std::make_unique<TestCommandReader>();
    }
@@ -157,12 +151,15 @@ class GraphicsComposerHidlTest : public ::testing::TestWithParam<std::string> {

    void execute() { mComposerClient->execute(mReader.get(), mWriter.get()); }

    NativeHandleWrapper allocate(int32_t width, int32_t height) {
        return mGralloc->allocate(
                width, height, /*layerCount*/ 1,
                static_cast<common::V1_1::PixelFormat>(PixelFormat::RGBA_8888),
    sp<GraphicBuffer> allocate(int32_t width, int32_t height) {
        auto result = sp<GraphicBuffer>::make(
                width, height, static_cast<int32_t>(PixelFormat::RGBA_8888), /*layerCount*/ 1,
                static_cast<uint64_t>(BufferUsage::CPU_WRITE_OFTEN | BufferUsage::CPU_READ_OFTEN |
                                      BufferUsage::COMPOSER_OVERLAY));
        if (result->initCheck() != STATUS_OK) {
            return nullptr;
        }
        return result;
    }

    struct TestParameters {
@@ -256,7 +253,6 @@ class GraphicsComposerHidlTest : public ::testing::TestWithParam<std::string> {
    std::unique_ptr<CommandWriterBase> mWriter;
    std::unique_ptr<TestCommandReader> mReader;
    sp<GraphicsComposerCallback> mComposerCallback;
    std::unique_ptr<Gralloc> mGralloc;
};

TEST_P(GraphicsComposerHidlTest, getDisplayCapabilitiesBadDisplay) {
@@ -458,7 +454,7 @@ void GraphicsComposerHidlTest::sendRefreshFrame(const VtsDisplay& display,
        mWriter->setLayerBlendMode(IComposerClient::BlendMode::NONE);
        mWriter->setLayerSurfaceDamage(
                std::vector<IComposerClient::Rect>(1, display.getFrameRect()));
        mWriter->setLayerBuffer(0, handle.get(), -1);
        mWriter->setLayerBuffer(0, handle->handle, -1);
        mWriter->setLayerDataspace(Dataspace::UNKNOWN);

        mWriter->validateDisplay();
@@ -476,7 +472,7 @@ void GraphicsComposerHidlTest::sendRefreshFrame(const VtsDisplay& display,
        ASSERT_NE(nullptr, handle.get());

        mWriter->selectLayer(layer);
        mWriter->setLayerBuffer(0, handle.get(), -1);
        mWriter->setLayerBuffer(0, handle->handle, -1);
        mWriter->setLayerSurfaceDamage(std::vector<IComposerClient::Rect>(1, {0, 0, 10, 10}));
        mWriter->validateDisplay();
        execute();