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

Commit 9e0b057b authored by Manali Bhutiyani's avatar Manali Bhutiyani Committed by Android (Google) Code Review
Browse files

Merge "[hwc-batching] AIDL changes for HWC command batching support." into main

parents d89a37bc 38565ccd
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -55,4 +55,6 @@ parcelable LayerCommand {
  @nullable android.hardware.graphics.composer3.PerFrameMetadataBlob[] perFrameMetadataBlob;
  @nullable android.hardware.graphics.common.Rect[] blockingRegion;
  @nullable int[] bufferSlotsToClear;
  android.hardware.graphics.composer3.LayerLifecycleBatchCommandType layerLifecycleBatchCommandType;
  int newBufferSlotCount;
}
+40 −0
Original line number Diff line number Diff line
/**
 * Copyright (c) 2023, 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;
@Backing(type="int") @VintfStability
enum LayerLifecycleBatchCommandType {
  MODIFY = 0,
  CREATE = 1,
  DESTROY = 2,
}
+14 −0
Original line number Diff line number Diff line
@@ -23,6 +23,7 @@ import android.hardware.graphics.common.Rect;
import android.hardware.graphics.composer3.Buffer;
import android.hardware.graphics.composer3.Color;
import android.hardware.graphics.composer3.LayerBrightness;
import android.hardware.graphics.composer3.LayerLifecycleBatchCommandType;
import android.hardware.graphics.composer3.ParcelableBlendMode;
import android.hardware.graphics.composer3.ParcelableComposition;
import android.hardware.graphics.composer3.ParcelableDataspace;
@@ -265,4 +266,17 @@ parcelable LayerCommand {
     * be freed.
     */
    @nullable int[] bufferSlotsToClear;

    /**
     * Specifies if this layer command is on type modify, create or destroy.
     * This command is replacing the older IComposerClient.createLayer and destroyLayer
     * and making it more efficient with reduced aidls to the HAL.
     * The HAL will report the errors by setting CommandResultPayload::CommandError.
     */
    LayerLifecycleBatchCommandType layerLifecycleBatchCommandType;

    /**
     * Specifies the number of buffer slot to be reserved.
     */
    int newBufferSlotCount;
}
+39 −0
Original line number Diff line number Diff line
/**
 * Copyright (c) 2023, 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;

/**
 * Possible batch command types for a given layer.
 */
@VintfStability
@Backing(type="int")
enum LayerLifecycleBatchCommandType {
    /**
     * Layer attributes are being modified for already created layer.
     */
    MODIFY = 0,
    /**
     * This indicates that the current LayerCommand should also create the layer,
     * before processing the other attributes in the LayerCommand.
     */
    CREATE = 1,
    /**
     * This indicates that the current LayerCommand should also destroyes the layer,
     * after processing the other attributes in the LayerCommand.
     */
    DESTROY = 2,
}
+10 −0
Original line number Diff line number Diff line
@@ -29,6 +29,7 @@
#include <aidl/android/hardware/graphics/composer3/Composition.h>
#include <aidl/android/hardware/graphics/composer3/DisplayBrightness.h>
#include <aidl/android/hardware/graphics/composer3/LayerBrightness.h>
#include <aidl/android/hardware/graphics/composer3/LayerLifecycleBatchCommandType.h>
#include <aidl/android/hardware/graphics/composer3/PerFrameMetadata.h>
#include <aidl/android/hardware/graphics/composer3/PerFrameMetadataBlob.h>

@@ -99,6 +100,15 @@ class ComposerClientWriter final {
                getBufferCommand(slot, buffer, releaseFence));
    }

    void setLayerLifecycleBatchCommandType(int64_t display, int64_t layer,
                                           LayerLifecycleBatchCommandType cmd) {
        getLayerCommand(display, layer).layerLifecycleBatchCommandType = cmd;
    }

    void setNewBufferSlotCount(int64_t display, int64_t layer, int32_t newBufferSlotToCount) {
        getLayerCommand(display, layer).newBufferSlotCount = newBufferSlotToCount;
    }

    void validateDisplay(int64_t display,
                         std::optional<ClockMonotonicTimestamp> expectedPresentTime,
                         int32_t frameIntervalNs) {
Loading