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

Commit 72c5b503 authored by Ady Abraham's avatar Ady Abraham
Browse files

composer: pass expetcedPresentTime

Add expectedPresentTime as an optional field to DisplayCommand.

Test: VTS
Bug: 198186194
Change-Id: I1203422b5d052508ca42a80da5d252c106efc5ee
parent 898e6d6a
Loading
Loading
Loading
Loading
+38 −0
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.
 */
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE.                          //
///////////////////////////////////////////////////////////////////////////////

// This file is a snapshot of an AIDL file. Do not edit it manually. There are
// two cases:
// 1). this is a frozen version file - do not edit this in any case.
// 2). this is a 'current' file. If you make a backwards compatible change to
//     the interface (from the latest frozen version), the build system will
//     prompt you to update this file with `m <name>-update-api`.
//
// You must not make a backward incompatible change to any AIDL file built
// with the aidl_interface module type with versions property set. The module
// type is used to build AIDL files in a way that they can be used across
// independently updatable components of the system. If a device is shipped
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.

package android.hardware.graphics.composer3;
@VintfStability
parcelable ClockMonotonicTimestamp {
  long timestamp;
}
+1 −0
Original line number Diff line number Diff line
@@ -39,6 +39,7 @@ parcelable DisplayCommand {
  @nullable android.hardware.graphics.composer3.ColorTransformPayload colorTransform;
  @nullable android.hardware.graphics.composer3.ClientTarget clientTarget;
  @nullable android.hardware.graphics.composer3.Buffer virtualDisplayOutputBuffer;
  @nullable android.hardware.graphics.composer3.ClockMonotonicTimestamp expectedPresentTime;
  boolean validateDisplay;
  boolean acceptDisplayChanges;
  boolean presentDisplay;
+25 −0
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 android.hardware.graphics.composer3;

/**
 * Represents a nanoseconds timestamp in CLOCK_MONOTONIC.
 */
@VintfStability
parcelable ClockMonotonicTimestamp {
    long timestamp;
}
+9 −0
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@ package android.hardware.graphics.composer3;

import android.hardware.graphics.composer3.Buffer;
import android.hardware.graphics.composer3.ClientTarget;
import android.hardware.graphics.composer3.ClockMonotonicTimestamp;
import android.hardware.graphics.composer3.ColorTransformPayload;
import android.hardware.graphics.composer3.LayerCommand;

@@ -114,6 +115,14 @@ parcelable DisplayCommand {
     */
    @nullable Buffer virtualDisplayOutputBuffer;

    /**
     * Sets the expected present time to present the current content on screen.
     * The implementation should try to present the display as close as possible
     * to the given expectedPresentTime. If expectedPresentTime is 0, the
     * implementation should present the display as soon as possible.
     */
    @nullable ClockMonotonicTimestamp expectedPresentTime;

    /**
     * Instructs the device to inspect all of the layer state and determine if
     * there are any composition type changes necessary before presenting the
+17 −17
Original line number Diff line number Diff line
@@ -258,7 +258,7 @@ TEST_P(GraphicsCompositionTest, SingleSolidColorLayer) {

        writeLayers(layers);
        ASSERT_TRUE(mReader.takeErrors().empty());
        mWriter.validateDisplay(mPrimaryDisplay);
        mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp);
        execute();
        // if hwc cannot handle and asks for composition change,
        // just succeed the test
@@ -317,7 +317,7 @@ TEST_P(GraphicsCompositionTest, SetLayerBuffer) {

        writeLayers(layers);
        ASSERT_TRUE(mReader.takeErrors().empty());
        mWriter.validateDisplay(mPrimaryDisplay);
        mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp);
        execute();

        std::vector<int64_t> changedCompositionLayers;
@@ -377,7 +377,7 @@ TEST_P(GraphicsCompositionTest, SetLayerBufferNoEffect) {
                                      mDisplayWidth, mDisplayHeight, mPixelFormat, mDataspace);
        ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());

        mWriter.validateDisplay(mPrimaryDisplay);
        mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp);
        execute();

        std::vector<int64_t> changedCompositionLayers;
@@ -492,7 +492,7 @@ TEST_P(GraphicsCompositionTest, ClientComposition) {
        ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());
        writeLayers(layers);
        ASSERT_TRUE(mReader.takeErrors().empty());
        mWriter.validateDisplay(mPrimaryDisplay);
        mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp);
        execute();

        std::vector<int64_t> changedCompositionLayers;
@@ -606,7 +606,7 @@ TEST_P(GraphicsCompositionTest, DeviceAndClientComposition) {
        clientLayer->setDisplayFrame(clientFrame);
        clientLayer->setZOrder(0);
        clientLayer->write(mWriter);
        mWriter.validateDisplay(mPrimaryDisplay);
        mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp);
        execute();

        std::vector<int64_t> changedCompositionLayers;
@@ -685,7 +685,7 @@ TEST_P(GraphicsCompositionTest, SetLayerDamage) {

        writeLayers(layers);
        ASSERT_TRUE(mReader.takeErrors().empty());
        mWriter.validateDisplay(mPrimaryDisplay);
        mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp);
        execute();
        std::vector<int64_t> changedCompositionLayers;
        std::vector<Composition> changedCompositionTypes;
@@ -715,7 +715,7 @@ TEST_P(GraphicsCompositionTest, SetLayerDamage) {

        writeLayers(layers);
        ASSERT_TRUE(mReader.takeErrors().empty());
        mWriter.validateDisplay(mPrimaryDisplay);
        mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp);
        execute();
        ASSERT_TRUE(mReader.takeErrors().empty());
        mReader.takeChangedCompositionTypes(mPrimaryDisplay, &changedCompositionLayers,
@@ -756,7 +756,7 @@ TEST_P(GraphicsCompositionTest, SetLayerPlaneAlpha) {

        writeLayers(layers);
        ASSERT_TRUE(mReader.takeErrors().empty());
        mWriter.validateDisplay(mPrimaryDisplay);
        mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp);
        execute();
        std::vector<int64_t> changedCompositionLayers;
        std::vector<Composition> changedCompositionTypes;
@@ -819,7 +819,7 @@ TEST_P(GraphicsCompositionTest, SetLayerSourceCrop) {
        ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());
        writeLayers(layers);
        ASSERT_TRUE(mReader.takeErrors().empty());
        mWriter.validateDisplay(mPrimaryDisplay);
        mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp);
        execute();
        std::vector<int64_t> changedCompositionLayers;
        std::vector<Composition> changedCompositionTypes;
@@ -877,7 +877,7 @@ TEST_P(GraphicsCompositionTest, SetLayerZOrder) {

        writeLayers(layers);
        ASSERT_TRUE(mReader.takeErrors().empty());
        mWriter.validateDisplay(mPrimaryDisplay);
        mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp);
        execute();
        std::vector<int64_t> changedCompositionLayers;
        std::vector<Composition> changedCompositionTypes;
@@ -902,7 +902,7 @@ TEST_P(GraphicsCompositionTest, SetLayerZOrder) {

        writeLayers(layers);
        ASSERT_TRUE(mReader.takeErrors().empty());
        mWriter.validateDisplay(mPrimaryDisplay);
        mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp);
        execute();
        mReader.takeChangedCompositionTypes(mPrimaryDisplay, &changedCompositionLayers,
                                            &changedCompositionTypes);
@@ -1027,7 +1027,7 @@ TEST_P(GraphicsBlendModeCompositionTest, None) {
        ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());
        writeLayers(mLayers);
        ASSERT_TRUE(mReader.takeErrors().empty());
        mWriter.validateDisplay(mPrimaryDisplay);
        mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp);
        execute();
        std::vector<int64_t> changedCompositionLayers;
        std::vector<Composition> changedCompositionTypes;
@@ -1072,7 +1072,7 @@ TEST_P(GraphicsBlendModeCompositionTest, Coverage) {
        ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());
        writeLayers(mLayers);
        ASSERT_TRUE(mReader.takeErrors().empty());
        mWriter.validateDisplay(mPrimaryDisplay);
        mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp);
        execute();
        std::vector<int64_t> changedCompositionLayers;
        std::vector<Composition> changedCompositionTypes;
@@ -1112,7 +1112,7 @@ TEST_P(GraphicsBlendModeCompositionTest, Premultiplied) {
        ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());
        writeLayers(mLayers);
        ASSERT_TRUE(mReader.takeErrors().empty());
        mWriter.validateDisplay(mPrimaryDisplay);
        mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp);
        execute();
        std::vector<int64_t> changedCompositionLayers;
        std::vector<Composition> changedCompositionTypes;
@@ -1195,7 +1195,7 @@ TEST_P(GraphicsTransformCompositionTest, FLIP_H) {

        writeLayers(mLayers);
        ASSERT_TRUE(mReader.takeErrors().empty());
        mWriter.validateDisplay(mPrimaryDisplay);
        mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp);
        execute();
        std::vector<int64_t> changedCompositionLayers;
        std::vector<Composition> changedCompositionTypes;
@@ -1241,7 +1241,7 @@ TEST_P(GraphicsTransformCompositionTest, FLIP_V) {

        writeLayers(mLayers);
        ASSERT_TRUE(mReader.takeErrors().empty());
        mWriter.validateDisplay(mPrimaryDisplay);
        mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp);
        execute();
        std::vector<int64_t> changedCompositionLayers;
        std::vector<Composition> changedCompositionTypes;
@@ -1287,7 +1287,7 @@ TEST_P(GraphicsTransformCompositionTest, ROT_180) {

        writeLayers(mLayers);
        ASSERT_TRUE(mReader.takeErrors().empty());
        mWriter.validateDisplay(mPrimaryDisplay);
        mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp);
        execute();
        std::vector<int64_t> layers;
        std::vector<Composition> types;
Loading