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

Commit edf3ef9f authored by ramindani's avatar ramindani
Browse files

IComposerClient wrapper for VTS tests

A wrapper helps with implementation details of IComposerClient and
improves re-usability with readback and base tests.

Changes from the original wrapper (ag/16578214):

Changed the createClient to return ScopedAStatus
as it helps more with the singleton test.
And updated getDisplays to go through all the configurations
and save it in the DisplayResources as we use
the properties like width, height, vsync later
in the test and we avoid querying to the composerClient for this.

With readback tests updated setReadbackBuffer method to use
const native_handle_t* buffer instead of const native_handle* buffer

BUG: 199413815

Test: atest VtsHalGraphicsComposer3_TargetTest
Change-Id: Ia33c9489bf15a52edcae55a91ec56666df3726c1
parent 0f6b2608
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -35,6 +35,9 @@ cc_test {
        "VtsHalGraphicsComposer3_TargetTest.cpp",
        "VtsHalGraphicsComposer3_ReadbackTest.cpp",
        "composer-vts/GraphicsComposerCallback.cpp",
        "composer-vts/ReadbackVts.cpp",
        "composer-vts/RenderEngineVts.cpp",
        "composer-vts/VtsComposerClient.cpp",
    ],

    shared_libs: [
@@ -72,15 +75,19 @@ cc_test {
        "android.hardware.graphics.allocator@2.0",
        "android.hardware.graphics.allocator@3.0",
        "android.hardware.graphics.allocator@4.0",
        "android.hardware.graphics.composer@3-vts",
        "android.hardware.graphics.mapper@2.0-vts",
        "android.hardware.graphics.mapper@2.1-vts",
        "android.hardware.graphics.mapper@3.0-vts",
        "android.hardware.graphics.mapper@4.0-vts",
        "libaidlcommonsupport",
        "libarect",
        "libbase",
        "libfmq",
        "libgtest",
        "libmath",
        "librenderengine",
        "libshaders",
        "libsync",
        "libtonemap",
    ],
    cflags: [
+0 −78
Original line number Diff line number Diff line
/**
 * Copyright (c) 2021, 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.
 */

package {
    // See: http://go/android-license-faq
    // A large-scale-change added 'default_applicable_licenses' to import
    // all of the 'license_kinds' from "hardware_interfaces_license"
    // to get the below license kinds:
    //   SPDX-license-identifier-Apache-2.0
    default_applicable_licenses: ["hardware_interfaces_license"],
}

cc_library_static {
    name: "android.hardware.graphics.composer@3-vts",
    defaults: ["hidl_defaults"],
    srcs: [
        "GraphicsComposerCallback.cpp",
        "ReadbackVts.cpp",
        "RenderEngineVts.cpp",
    ],
    header_libs: [
        "android.hardware.graphics.composer3-command-buffer",
    ],
    static_libs: [
        "android.hardware.graphics.composer3-V1-ndk",
        "android.hardware.graphics.common-V3-ndk",
        "android.hardware.common-V2-ndk",
        "android.hardware.common.fmq-V1-ndk",
        "libarect",
        "libgtest",
        "libbase",
        "libfmq",
        "libsync",
        "libmath",
        "libaidlcommonsupport",
        "libnativewindow",
        "librenderengine",
        "libshaders",
        "libtonemap",
        "android.hardware.graphics.mapper@2.0-vts",
        "android.hardware.graphics.mapper@2.1-vts",
        "android.hardware.graphics.mapper@3.0-vts",
        "android.hardware.graphics.mapper@4.0-vts",
    ],
    shared_libs: [
        "libbinder_ndk",
        "libhidlbase",
        "libui",
        "android.hardware.graphics.composer3-V1-ndk",
    ],
    export_static_lib_headers: [
        "android.hardware.graphics.mapper@2.1-vts",
        "librenderengine",
    ],
    cflags: [
        "-O0",
        "-g",
        "-DLOG_TAG=\"ComposerVts\"",
        "-Wconversion",
    ],
    export_header_lib_headers: [
        "android.hardware.graphics.composer3-command-buffer",
    ],
    export_include_dirs: ["include"],
}
+502 −0

File added.

Preview size limit exceeded, changes collapsed.

+0 −7
Original line number Diff line number Diff line
@@ -15,18 +15,11 @@
 */
#pragma once

// TODO(b/129481165): remove the #pragma below and fix conversion issues
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wconversion"

#include <aidl/android/hardware/graphics/composer3/BnComposerCallback.h>
#include <android-base/thread_annotations.h>
#include <mutex>
#include <unordered_set>

// TODO(b/129481165): remove the #pragma below and fix conversion issues
#pragma clang diagnostic pop  // ignored "-Wconversion

namespace aidl::android::hardware::graphics::composer3::vts {

class GraphicsComposerCallback : public BnComposerCallback {
+2 −2

File changed.

Preview size limit exceeded, changes collapsed.

Loading