mirror of
https://github.com/Evolution-X/hardware_interfaces
synced 2026-02-01 21:37:44 +00:00
Check the correct sysprop for P010 support for gralloc 3 and 4. am: 960c14db22 am: 1924f8cb9b
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2441523 Change-Id: Ia4d4a0a8f0db8713fec7e348d9bbbd54107ae0d2 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -99,11 +99,7 @@ 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";
|
||||
}
|
||||
GTEST_FAIL() << "failed to allocate buffers";
|
||||
}
|
||||
ASSERT_EQ(count, tmpBuffers.size()) << "invalid buffer array";
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -111,11 +111,7 @@ 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";
|
||||
}
|
||||
GTEST_FAIL() << "failed to allocate buffers";
|
||||
}
|
||||
ASSERT_EQ(count, buffers.size()) << "invalid buffer array";
|
||||
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -1000,6 +1002,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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user