graphics: add gralloc tests to VTS
Test: vts-tradefed run vts -m HalGraphicsAllocatorHidlTargetTest
Test: vts-tradefed run vts -m HalGraphicsMapperHidlTargetTest
Change-Id: I35e03b42e693da1bd3cfc6beac2a64771e0b8ed9
diff --git a/graphics/mapper/2.0/Android.mk b/graphics/mapper/2.0/Android.mk
new file mode 100644
index 0000000..f9e3276
--- /dev/null
+++ b/graphics/mapper/2.0/Android.mk
@@ -0,0 +1,19 @@
+#
+# Copyright (C) 2016 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+LOCAL_PATH := $(call my-dir)
+
+include $(call all-subdir-makefiles)
diff --git a/graphics/mapper/2.0/vts/Android.mk b/graphics/mapper/2.0/vts/Android.mk
new file mode 100644
index 0000000..6185ddc
--- /dev/null
+++ b/graphics/mapper/2.0/vts/Android.mk
@@ -0,0 +1,19 @@
+#
+# Copyright (C) 2016 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+LOCAL_PATH := $(call my-dir)
+
+include $(LOCAL_PATH)/functional/vts/testcases/hal/graphics/mapper/hidl/target/Android.mk
diff --git a/graphics/mapper/2.0/vts/Mapper.vts b/graphics/mapper/2.0/vts/Mapper.vts
new file mode 100644
index 0000000..26e049f
--- /dev/null
+++ b/graphics/mapper/2.0/vts/Mapper.vts
@@ -0,0 +1,280 @@
+component_class: HAL_HIDL
+component_type_version: 2.0
+component_name: "IMapper"
+
+package: "android.hardware.graphics.mapper"
+
+import: "android.hardware.graphics.allocator@2.0::types"
+import: "android.hardware.graphics.common@1.0::types"
+import: "android.hardware.graphics.mapper@2.0::types"
+
+interface: {
+ attribute: {
+ name: "::android::hardware::graphics::mapper::V2_0::IMapper::Rect"
+ type: TYPE_STRUCT
+ struct_value: {
+ name: "left"
+ type: TYPE_SCALAR
+ scalar_type: "int32_t"
+ }
+ struct_value: {
+ name: "top"
+ type: TYPE_SCALAR
+ scalar_type: "int32_t"
+ }
+ struct_value: {
+ name: "width"
+ type: TYPE_SCALAR
+ scalar_type: "int32_t"
+ }
+ struct_value: {
+ name: "height"
+ type: TYPE_SCALAR
+ scalar_type: "int32_t"
+ }
+ }
+
+ api: {
+ name: "retain"
+ return_type_hidl: {
+ type: TYPE_ENUM
+ predefined_type: "::android::hardware::graphics::allocator::V2_0::Error"
+ }
+ arg: {
+ type: TYPE_HANDLE
+ }
+ callflow: {
+ entry: true
+ }
+ callflow: {
+ next: "*"
+ }
+ }
+
+ api: {
+ name: "release"
+ return_type_hidl: {
+ type: TYPE_ENUM
+ predefined_type: "::android::hardware::graphics::allocator::V2_0::Error"
+ }
+ arg: {
+ type: TYPE_HANDLE
+ }
+ callflow: {
+ exit: true
+ }
+ }
+
+ api: {
+ name: "getDimensions"
+ return_type_hidl: {
+ type: TYPE_ENUM
+ predefined_type: "::android::hardware::graphics::allocator::V2_0::Error"
+ }
+ return_type_hidl: {
+ type: TYPE_SCALAR
+ scalar_type: "uint32_t"
+ }
+ return_type_hidl: {
+ type: TYPE_SCALAR
+ scalar_type: "uint32_t"
+ }
+ arg: {
+ type: TYPE_HANDLE
+ }
+ callflow: {
+ next: "*"
+ }
+ }
+
+ api: {
+ name: "getFormat"
+ return_type_hidl: {
+ type: TYPE_ENUM
+ predefined_type: "::android::hardware::graphics::allocator::V2_0::Error"
+ }
+ return_type_hidl: {
+ type: TYPE_ENUM
+ predefined_type: "::android::hardware::graphics::common::V1_0::PixelFormat"
+ }
+ arg: {
+ type: TYPE_HANDLE
+ }
+ callflow: {
+ next: "*"
+ }
+ }
+
+ api: {
+ name: "getLayerCount"
+ return_type_hidl: {
+ type: TYPE_ENUM
+ predefined_type: "::android::hardware::graphics::allocator::V2_0::Error"
+ }
+ return_type_hidl: {
+ type: TYPE_SCALAR
+ scalar_type: "uint32_t"
+ }
+ arg: {
+ type: TYPE_HANDLE
+ }
+ callflow: {
+ next: "*"
+ }
+ }
+
+ api: {
+ name: "getProducerUsageMask"
+ return_type_hidl: {
+ type: TYPE_ENUM
+ predefined_type: "::android::hardware::graphics::allocator::V2_0::Error"
+ }
+ return_type_hidl: {
+ type: TYPE_SCALAR
+ scalar_type: "uint64_t"
+ }
+ arg: {
+ type: TYPE_HANDLE
+ }
+ callflow: {
+ next: "*"
+ }
+ }
+
+ api: {
+ name: "getConsumerUsageMask"
+ return_type_hidl: {
+ type: TYPE_ENUM
+ predefined_type: "::android::hardware::graphics::allocator::V2_0::Error"
+ }
+ return_type_hidl: {
+ type: TYPE_SCALAR
+ scalar_type: "uint64_t"
+ }
+ arg: {
+ type: TYPE_HANDLE
+ }
+ callflow: {
+ next: "*"
+ }
+ }
+
+ api: {
+ name: "getBackingStore"
+ return_type_hidl: {
+ type: TYPE_ENUM
+ predefined_type: "::android::hardware::graphics::allocator::V2_0::Error"
+ }
+ return_type_hidl: {
+ type: TYPE_SCALAR
+ scalar_type: "uint64_t"
+ }
+ arg: {
+ type: TYPE_HANDLE
+ }
+ callflow: {
+ next: "*"
+ }
+ }
+
+ api: {
+ name: "getStride"
+ return_type_hidl: {
+ type: TYPE_ENUM
+ predefined_type: "::android::hardware::graphics::allocator::V2_0::Error"
+ }
+ return_type_hidl: {
+ type: TYPE_SCALAR
+ scalar_type: "uint32_t"
+ }
+ arg: {
+ type: TYPE_HANDLE
+ }
+ callflow: {
+ next: "*"
+ }
+ }
+
+ api: {
+ name: "lock"
+ return_type_hidl: {
+ type: TYPE_ENUM
+ predefined_type: "::android::hardware::graphics::allocator::V2_0::Error"
+ }
+ return_type_hidl: {
+ type: TYPE_POINTER
+ }
+ arg: {
+ type: TYPE_HANDLE
+ }
+ arg: {
+ type: TYPE_SCALAR
+ scalar_type: "uint64_t"
+ }
+ arg: {
+ type: TYPE_SCALAR
+ scalar_type: "uint64_t"
+ }
+ arg: {
+ type: TYPE_STRUCT
+ predefined_type: "::android::hardware::graphics::mapper::V2_0::IMapper::Rect"
+ }
+ arg: {
+ type: TYPE_HANDLE
+ }
+ callflow: {
+ next: "unlock"
+ }
+ }
+
+ api: {
+ name: "lockFlex"
+ return_type_hidl: {
+ type: TYPE_ENUM
+ predefined_type: "::android::hardware::graphics::allocator::V2_0::Error"
+ }
+ return_type_hidl: {
+ type: TYPE_STRUCT
+ predefined_type: "::android::hardware::graphics::mapper::V2_0::FlexLayout"
+ }
+ arg: {
+ type: TYPE_HANDLE
+ }
+ arg: {
+ type: TYPE_SCALAR
+ scalar_type: "uint64_t"
+ }
+ arg: {
+ type: TYPE_SCALAR
+ scalar_type: "uint64_t"
+ }
+ arg: {
+ type: TYPE_STRUCT
+ predefined_type: "::android::hardware::graphics::mapper::V2_0::IMapper::Rect"
+ }
+ arg: {
+ type: TYPE_HANDLE
+ }
+ callflow: {
+ next: "unlock"
+ }
+ }
+
+ api: {
+ name: "unlock"
+ return_type_hidl: {
+ type: TYPE_ENUM
+ predefined_type: "::android::hardware::graphics::allocator::V2_0::Error"
+ }
+ return_type_hidl: {
+ type: TYPE_HANDLE
+ }
+ arg: {
+ type: TYPE_HANDLE
+ }
+ callflow: {
+ next: "*"
+ }
+ }
+
+}
diff --git a/graphics/mapper/2.0/vts/functional/Android.bp b/graphics/mapper/2.0/vts/functional/Android.bp
index e324322..53e6d16 100644
--- a/graphics/mapper/2.0/vts/functional/Android.bp
+++ b/graphics/mapper/2.0/vts/functional/Android.bp
@@ -33,7 +33,11 @@
],
static_libs: ["libgtest"],
cflags: [
+ "--coverage",
"-O0",
"-g",
],
+ ldflags: [
+ "--coverage",
+ ],
}
diff --git a/graphics/mapper/2.0/vts/functional/vts/testcases/hal/graphics/mapper/hidl/target/Android.mk b/graphics/mapper/2.0/vts/functional/vts/testcases/hal/graphics/mapper/hidl/target/Android.mk
new file mode 100644
index 0000000..5f7fae8
--- /dev/null
+++ b/graphics/mapper/2.0/vts/functional/vts/testcases/hal/graphics/mapper/hidl/target/Android.mk
@@ -0,0 +1,25 @@
+#
+# Copyright (C) 2016 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+LOCAL_PATH := $(call my-dir)
+
+include $(call all-subdir-makefiles)
+
+include $(CLEAR_VARS)
+
+LOCAL_MODULE := HalGraphicsMapperHidlTargetTest
+VTS_CONFIG_SRC_DIR := testcases/hal/graphics/mapper/hidl/target
+include test/vts/tools/build/Android.host_config.mk
diff --git a/graphics/mapper/2.0/vts/functional/vts/testcases/hal/graphics/mapper/hidl/target/AndroidTest.xml b/graphics/mapper/2.0/vts/functional/vts/testcases/hal/graphics/mapper/hidl/target/AndroidTest.xml
new file mode 100644
index 0000000..b602ec4
--- /dev/null
+++ b/graphics/mapper/2.0/vts/functional/vts/testcases/hal/graphics/mapper/hidl/target/AndroidTest.xml
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2016 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<configuration description="Config for VTS Graphics Mapper HIDL HAL's basic target-side test cases">
+ <target_preparer class="com.android.compatibility.common.tradefed.targetprep.VtsFilePusher">
+ <option name="push-group" value="HidlHalTest.push" />
+ </target_preparer>
+ <target_preparer class="com.android.tradefed.targetprep.VtsPythonVirtualenvPreparer" />
+ <test class="com.android.tradefed.testtype.VtsMultiDeviceTest">
+ <option name="test-module-name" value="HalGraphicsMapperHidlTargetTest" />
+ <option name="binary-test-sources" value="
+ _32bit::DATA/nativetest/graphics_mapper_hidl_hal_test/graphics_mapper_hidl_hal_test,
+ _64bit::DATA/nativetest64/graphics_mapper_hidl_hal_test/graphics_mapper_hidl_hal_test,
+ " />
+ <option name="binary-test-type" value="gtest" />
+ <option name="test-timeout" value="1m" />
+ </test>
+</configuration>
diff --git a/graphics/mapper/2.0/vts/types.vts b/graphics/mapper/2.0/vts/types.vts
new file mode 100644
index 0000000..fee8535
--- /dev/null
+++ b/graphics/mapper/2.0/vts/types.vts
@@ -0,0 +1,139 @@
+component_class: HAL_HIDL
+component_type_version: 2.0
+component_name: "types"
+
+package: "android.hardware.graphics.mapper"
+
+
+attribute: {
+ name: "::android::hardware::graphics::mapper::V2_0::FlexComponent"
+ type: TYPE_ENUM
+ enum_value: {
+ scalar_type: "int32_t"
+
+ enumerator: "Y"
+ scalar_value: {
+ int32_t: 1
+ }
+ enumerator: "CB"
+ scalar_value: {
+ int32_t: 2
+ }
+ enumerator: "CR"
+ scalar_value: {
+ int32_t: 4
+ }
+ enumerator: "R"
+ scalar_value: {
+ int32_t: 1024
+ }
+ enumerator: "G"
+ scalar_value: {
+ int32_t: 2048
+ }
+ enumerator: "B"
+ scalar_value: {
+ int32_t: 4096
+ }
+ enumerator: "A"
+ scalar_value: {
+ int32_t: 1073741824
+ }
+ }
+}
+
+attribute: {
+ name: "::android::hardware::graphics::mapper::V2_0::FlexFormat"
+ type: TYPE_ENUM
+ enum_value: {
+ scalar_type: "int32_t"
+
+ enumerator: "INVALID"
+ scalar_value: {
+ int32_t: 0
+ }
+ enumerator: "Y"
+ scalar_value: {
+ int32_t: 1
+ }
+ enumerator: "YCBCR"
+ scalar_value: {
+ int32_t: 7
+ }
+ enumerator: "YCBCRA"
+ scalar_value: {
+ int32_t: 1073741831
+ }
+ enumerator: "RGB"
+ scalar_value: {
+ int32_t: 7168
+ }
+ enumerator: "RGBA"
+ scalar_value: {
+ int32_t: 1073748992
+ }
+ }
+}
+
+attribute: {
+ name: "::android::hardware::graphics::mapper::V2_0::FlexPlane"
+ type: TYPE_STRUCT
+ struct_value: {
+ name: "topLeft"
+ type: TYPE_POINTER
+ }
+ struct_value: {
+ name: "component"
+ type: TYPE_ENUM
+ predefined_type: "::android::hardware::graphics::mapper::V2_0::FlexComponent"
+ }
+ struct_value: {
+ name: "bitsPerComponent"
+ type: TYPE_SCALAR
+ scalar_type: "int32_t"
+ }
+ struct_value: {
+ name: "bitsUsed"
+ type: TYPE_SCALAR
+ scalar_type: "int32_t"
+ }
+ struct_value: {
+ name: "hIncrement"
+ type: TYPE_SCALAR
+ scalar_type: "int32_t"
+ }
+ struct_value: {
+ name: "vIncrement"
+ type: TYPE_SCALAR
+ scalar_type: "int32_t"
+ }
+ struct_value: {
+ name: "hSubsampling"
+ type: TYPE_SCALAR
+ scalar_type: "int32_t"
+ }
+ struct_value: {
+ name: "vSubsampling"
+ type: TYPE_SCALAR
+ scalar_type: "int32_t"
+ }
+}
+
+attribute: {
+ name: "::android::hardware::graphics::mapper::V2_0::FlexLayout"
+ type: TYPE_STRUCT
+ struct_value: {
+ name: "format"
+ type: TYPE_ENUM
+ predefined_type: "::android::hardware::graphics::mapper::V2_0::FlexFormat"
+ }
+ struct_value: {
+ name: "planes"
+ type: TYPE_VECTOR
+ vector_value: {
+ type: TYPE_STRUCT
+ predefined_type: "::android::hardware::graphics::mapper::V2_0::FlexPlane"
+ }
+ }
+}
+