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

Commit 9388922c authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Remove direct mapper from composer2.4 VTS" into main

parents 46519ddb 7f996c3f
Loading
Loading
Loading
Loading
+1 −11
Original line number Original line Diff line number Diff line
@@ -38,16 +38,10 @@ cc_test {
        "libbinder_ndk",
        "libbinder_ndk",
        "libfmq",
        "libfmq",
        "libsync",
        "libsync",
        "libui",
        "android.hardware.common-V2-ndk",
        "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: [
    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",
        "android.hardware.graphics.composer@2.1-vts",
        "android.hardware.graphics.composer@2.1-vts",
        "android.hardware.graphics.composer@2.2",
        "android.hardware.graphics.composer@2.2",
@@ -56,10 +50,6 @@ cc_test {
        "android.hardware.graphics.composer@2.3-vts",
        "android.hardware.graphics.composer@2.3-vts",
        "android.hardware.graphics.composer@2.4",
        "android.hardware.graphics.composer@2.4",
        "android.hardware.graphics.composer@2.4-vts",
        "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",
        "libaidlcommonsupport",
    ],
    ],
    header_libs: [
    header_libs: [
+10 −14
Original line number Original line Diff line number Diff line
@@ -22,7 +22,6 @@


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


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


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


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

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


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


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


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


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


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


        mWriter->selectLayer(layer);
        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->setLayerSurfaceDamage(std::vector<IComposerClient::Rect>(1, {0, 0, 10, 10}));
        mWriter->validateDisplay();
        mWriter->validateDisplay();
        execute();
        execute();