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

Commit b9f8d256 authored by Alec Mouri's avatar Alec Mouri Committed by Android (Google) Code Review
Browse files

Merge "Check the correct sysprop for P010 support for gralloc 3 and 4."

parents 50358c1b 78d76ea4
Loading
Loading
Loading
Loading
+1 −5
Original line number Diff line number Diff line
@@ -99,12 +99,8 @@ std::vector<const native_handle_t*> Gralloc::allocate(const BufferDescriptor& de
            descriptor, count,
            [&](const auto& tmpError, const auto& tmpStride, const auto& tmpBuffers) {
                if (tmpError != Error::NONE) {
                    if (base::GetIntProperty("ro.vendor.build.version.sdk", 0, 0, INT_MAX) < 33) {
                        GTEST_SKIP() << "Old vendor grallocs may not support P010";
                    } else {
                    GTEST_FAIL() << "failed to allocate buffers";
                }
                }
                ASSERT_EQ(count, tmpBuffers.size()) << "invalid buffer array";

                for (uint32_t i = 0; i < count; i++) {
+4 −0
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@
#include <vector>

#include <android-base/logging.h>
#include <android-base/properties.h>
#include <gtest/gtest.h>
#include <hidl/GtestPrinter.h>
#include <hidl/ServiceManagement.h>
@@ -330,6 +331,9 @@ TEST_P(GraphicsMapperHidlTest, LockUnlockBasic) {
 * Test IMapper::lockYCbCr.  This locks a YCbCr_P010 buffer and verifies that it's initialized.
 */
TEST_P(GraphicsMapperHidlTest, LockYCbCrP010) {
    if (base::GetIntProperty("ro.vendor.api_level", __ANDROID_API_FUTURE__) < __ANDROID_API_T__) {
        GTEST_SKIP() << "Old vendor grallocs may not support P010";
    }
    auto info = mDummyDescriptorInfo;
    info.format = PixelFormat::YCBCR_P010;

+1 −5
Original line number Diff line number Diff line
@@ -111,12 +111,8 @@ std::vector<const native_handle_t*> Gralloc::allocate(const BufferDescriptor& de
        }

        if (error != Error::NONE) {
            if (base::GetIntProperty("ro.vendor.build.version.sdk", 0, 0, INT_MAX) < 33) {
                GTEST_SKIP() << "Old vendor grallocs may not support P010";
            } else {
            GTEST_FAIL() << "failed to allocate buffers";
        }
        }
        ASSERT_EQ(count, buffers.size()) << "invalid buffer array";

        for (uint32_t i = 0; i < count; i++) {
+5 −0
Original line number Diff line number Diff line
@@ -29,12 +29,14 @@
#include <aidlcommonsupport/NativeHandle.h>

#include <android-base/logging.h>
#include <android-base/properties.h>
#include <android-base/unique_fd.h>
#include <android/sync.h>
#include <gralloctypes/Gralloc4.h>
#include <gtest/gtest.h>
#include <hidl/GtestPrinter.h>
#include <hidl/ServiceManagement.h>

#include <mapper-vts/4.0/MapperVts.h>
#include <system/graphics.h>

@@ -998,6 +1000,9 @@ TEST_P(GraphicsMapperHidlTest, Lock_RAW12) {
}

TEST_P(GraphicsMapperHidlTest, Lock_YCBCR_P010) {
    if (base::GetIntProperty("ro.vendor.api_level", __ANDROID_API_FUTURE__) < __ANDROID_API_T__) {
        GTEST_SKIP() << "Old vendor grallocs may not support P010";
    }
    auto info = mDummyDescriptorInfo;
    info.format = PixelFormat::YCBCR_P010;