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

Commit 6a05e911 authored by Valerie Hau's avatar Valerie Hau
Browse files

Returning HWC2_CAPABILITY_SKIP_VALIDATE capability if device supports it

For reasons unknown, HWC2_CAPABILITY_SKIP_VALIDATE was never added to
the IComposer hal.  However, we would like to tell the client that the
device has this capability when it is returned during a getCapabilities
query.  We manually add it to the list of IComposer::Capability
(static_cast should be ok since the IComposer::Capability has a fixed
underlying type of int32_t, and HWC2_CAPABILITY_SKIP_VALIDATE = 4 is in
this range).  Checking that device has skip validate functionality in
relevent test as well

Bug: 140813883
Test: build, boot, VtsHalGraphicsComposerV2_1TargetTest
Change-Id: I5f28268c4e6edeb2895502c5f4e009cebb566100
parent decd6eb7
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -67,6 +67,14 @@ class ComposerImpl : public Interface {
            }
        }

        // we do not have HWC2_CAPABILITY_SKIP_VALIDATE defined in
        // IComposer::Capability.  However, this is defined in hwcomposer2.h,
        // so if the device returns it, add it manually to be returned to the
        // client
        if (mHal->hasCapability(HWC2_CAPABILITY_SKIP_VALIDATE)) {
            caps.push_back(static_cast<IComposer::Capability>(HWC2_CAPABILITY_SKIP_VALIDATE));
        }

        hidl_vec<IComposer::Capability> caps_reply;
        caps_reply.setToExternal(caps.data(), caps.size());
        hidl_cb(caps_reply);
+7 −0
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@
#include <composer-vts/2.1/ComposerVts.h>
#include <composer-vts/2.1/GraphicsComposerCallback.h>
#include <composer-vts/2.1/TestCommandReader.h>
#include <hardware/hwcomposer2.h>
#include <mapper-vts/2.0/MapperVts.h>
#include <mapper-vts/3.0/MapperVts.h>
#include <mapper-vts/4.0/MapperVts.h>
@@ -789,6 +790,12 @@ TEST_F(GraphicsComposerHidlCommandTest, PRESENT_DISPLAY) {
 * surface damage have been set
 */
TEST_F(GraphicsComposerHidlCommandTest, PRESENT_DISPLAY_NO_LAYER_STATE_CHANGES) {
    if (!mComposer->hasCapability(
                static_cast<IComposer::Capability>(HWC2_CAPABILITY_SKIP_VALIDATE))) {
        std::cout << "Device does not have skip validate capability, skipping" << std::endl;
        GTEST_SUCCEED();
        return;
    }
    mWriter->selectDisplay(mPrimaryDisplay);
    mComposerClient->setPowerMode(mPrimaryDisplay, IComposerClient::PowerMode::ON);
    mComposerClient->setColorMode(mPrimaryDisplay, ColorMode::NATIVE);