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

Commit 9f85133e authored by Chia-I Wu's avatar Chia-I Wu Committed by Android (Google) Code Review
Browse files

Merge changes from topic 'hwc-hal'

* changes:
  graphics: add a default implementation for IComposer
  graphics: add HIDL definition for HW composer
parents 952f5293 7f8d3966
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -7,6 +7,8 @@ subdirs = [
    "biometrics/fingerprint/2.1",
    "graphics/allocator/2.0",
    "graphics/allocator/2.0/default",
    "graphics/composer/2.1",
    "graphics/composer/2.1/default",
    "graphics/mapper/2.0",
    "graphics/mapper/2.0/default",
    "light/2.0",
+55 −0
Original line number Diff line number Diff line
// This file is autogenerated by hidl-gen. Do not edit manually.

genrule {
    name: "android.hardware.graphics.composer@2.1_genc++",
    tool: "hidl-gen",
    cmd: "$tool -o $genDir -Lc++ -randroid.hardware:hardware/interfaces android.hardware.graphics.composer@2.1",
    srcs: [
        "types.hal",
        "IComposer.hal",
        "IComposerCallback.hal",
    ],
    out: [
        "android/hardware/graphics/composer/2.1/types.cpp",
        "android/hardware/graphics/composer/2.1/ComposerAll.cpp",
        "android/hardware/graphics/composer/2.1/ComposerCallbackAll.cpp",
    ],
}

genrule {
    name: "android.hardware.graphics.composer@2.1_genc++_headers",
    tool: "hidl-gen",
    cmd: "$tool -o $genDir -Lc++ -randroid.hardware:hardware/interfaces android.hardware.graphics.composer@2.1",
    srcs: [
        "types.hal",
        "IComposer.hal",
        "IComposerCallback.hal",
    ],
    out: [
        "android/hardware/graphics/composer/2.1/types.h",
        "android/hardware/graphics/composer/2.1/IComposer.h",
        "android/hardware/graphics/composer/2.1/IHwComposer.h",
        "android/hardware/graphics/composer/2.1/BnComposer.h",
        "android/hardware/graphics/composer/2.1/BpComposer.h",
        "android/hardware/graphics/composer/2.1/BsComposer.h",
        "android/hardware/graphics/composer/2.1/IComposerCallback.h",
        "android/hardware/graphics/composer/2.1/IHwComposerCallback.h",
        "android/hardware/graphics/composer/2.1/BnComposerCallback.h",
        "android/hardware/graphics/composer/2.1/BpComposerCallback.h",
        "android/hardware/graphics/composer/2.1/BsComposerCallback.h",
    ],
}

cc_library_shared {
    name: "android.hardware.graphics.composer@2.1",
    generated_sources: ["android.hardware.graphics.composer@2.1_genc++"],
    generated_headers: ["android.hardware.graphics.composer@2.1_genc++_headers"],
    export_generated_headers: ["android.hardware.graphics.composer@2.1_genc++_headers"],
    shared_libs: [
        "libhidl",
        "libhwbinder",
        "libutils",
        "libcutils",
        "android.hardware.graphics.allocator@2.0",
    ],
}
+1166 −0

File added.

Preview size limit exceeded, changes collapsed.

+72 −0
Original line number Diff line number Diff line
/*
 * 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.
 */

package android.hardware.graphics.composer@2.1;

interface IComposerCallback {
    enum Connection : int32_t {
        INVALID = 0,

        /* The display has been connected */
        CONNECTED = 1,
        /* The display has been disconnected */
        DISCONNECTED = 2,
    };

    /*
     * Notifies the client that the given display has either been connected or
     * disconnected. Every active display (even a built-in physical display)
     * must trigger at least one hotplug notification, even if it only occurs
     * immediately after callback registration.
     *
     * Displays which have been connected are assumed to be in PowerMode::OFF,
     * and the onVsync callback should not be called for a display until vsync
     * has been enabled with setVsyncEnabled.
     *
     * The client may call back into the device while the callback is in
     * progress. The device must serialize calls to this callback such that
     * only one thread is calling it at a time.
     *
     * @param display is the display that triggers the hotplug event.
     * @param connected indicates whether the display is connected or
     *        disconnected.
     */
    onHotplug(Display display, Connection connected);

    /*
     * Notifies the client to trigger a screen refresh. This forces all layer
     * state for this display to be resent, and the display to be validated
     * and presented, even if there have been no changes.

     * This refresh will occur some time after the callback is initiated, but
     * not necessarily before it returns.  It is safe to trigger this callback
     * from other functions which call into the device.
     *
     * @param display is the display to refresh.
     */
    oneway onRefresh(Display display);

    /*
     * Notifies the client that a vsync event has occurred. This callback must
     * only be triggered when vsync is enabled for this display (through
     * setVsyncEnabled).
     *
     * @param display is the display which has received a vsync event
     * @param timestamp is the CLOCK_MONOTONIC time at which the vsync event
     *        occurred, in nanoseconds.
     */
    oneway onVsync(Display display, int64_t timestamp);
};
+16 −0
Original line number Diff line number Diff line
cc_library_shared {
    name: "android.hardware.graphics.composer@2.1-impl",
    relative_install_path: "hw",
    srcs: ["Hwc.cpp"],
    shared_libs: [
        "android.hardware.graphics.allocator@2.0",
        "android.hardware.graphics.composer@2.1",
        "libbase",
        "libcutils",
        "libhardware",
        "libhidl",
        "libhwbinder",
        "liblog",
        "libutils",
    ],
}
Loading