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

Commit 353357bf authored by Marissa Wall's avatar Marissa Wall
Browse files

gralloc: use gralloctypes helper

Use the gralloctypes helper function to determine if a
PlaneLayoutComponentType is a standard type. Also update the
lock RGBA_8888 function to ignore non-standard
PlaneLayoutComponentTypes.

Bug: 141632767
Test: VtsHalGraphicsMapperV4_0TargetTest

Change-Id: Ie3ea4a22b2c9ecf4b1d85932833978d2e23f77c1
parent 46b5698a
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -131,7 +131,9 @@ class GraphicsMapperHidlTest : public ::testing::VtsHalHidlTargetTestBase {
        int64_t offsetInBitsA = -1;

        for (const auto& component : planeLayout.components) {
            EXPECT_EQ(GRALLOC4_PLANE_LAYOUT_COMPONENT_TYPE, component.type.name);
            if (!gralloc4::isStandardPlaneLayoutComponentType(component.type)) {
                continue;
            }
            EXPECT_EQ(8, component.sizeInBits);
            if (component.type.value == gralloc4::PlaneLayoutComponentType_R.value) {
                offsetInBitsR = component.offsetInBits;
@@ -221,9 +223,7 @@ class GraphicsMapperHidlTest : public ::testing::VtsHalHidlTargetTestBase {

        for (const auto& planeLayout : planeLayouts) {
            for (const auto& planeLayoutComponent : planeLayout.components) {
                std::string componentTypeName = planeLayoutComponent.type.name;
                if (!std::strncmp(componentTypeName.c_str(), GRALLOC4_PLANE_LAYOUT_COMPONENT_TYPE,
                                  componentTypeName.size())) {
                if (!gralloc4::isStandardPlaneLayoutComponentType(planeLayoutComponent.type)) {
                    continue;
                }
                ASSERT_EQ(0, planeLayoutComponent.offsetInBits % 8);