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

Commit a28fc6bc authored by Brian Lindahl's avatar Brian Lindahl Committed by Android (Google) Code Review
Browse files

Merge changes from topic "uncache-hal-buffer-api"

* changes:
  Add VTS for new API for clearing buffer slots
  Add to AIDL field to LayerCommand to clear buffer slots
parents 98fff3f6 78ff2d64
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -54,4 +54,5 @@ parcelable LayerCommand {
  @nullable android.hardware.graphics.composer3.PerFrameMetadata[] perFrameMetadata;
  @nullable android.hardware.graphics.composer3.PerFrameMetadataBlob[] perFrameMetadataBlob;
  @nullable android.hardware.graphics.common.Rect[] blockingRegion;
  @nullable int[] bufferSlotsToClear;
}
+7 −0
Original line number Diff line number Diff line
@@ -258,4 +258,11 @@ parcelable LayerCommand {
     * the screen.
     */
    @nullable Rect[] blockingRegion;

    /**
     * Specifies which buffer slots should be cleared of buffer references
     * because these buffers will no longer be used and the memory should
     * be freed.
     */
    @nullable int[] bufferSlotsToClear;
}
+8 −0
Original line number Diff line number Diff line
@@ -142,6 +142,14 @@ class ComposerClientWriter final {
        flushLayerCommand();
    }

    void setLayerBufferSlotsToClear(int64_t display, int64_t layer,
                                    const std::vector<uint32_t>& slotsToClear) {
        LayerCommand& layerCommand = getLayerCommand(display, layer);
        for (auto slot : slotsToClear) {
            layerCommand.bufferSlotsToClear.emplace(static_cast<int32_t>(slot));
        }
    }

    void setLayerSurfaceDamage(int64_t display, int64_t layer, const std::vector<Rect>& damage) {
        getLayerCommand(display, layer).damage.emplace(damage.begin(), damage.end());
    }
+6 −0
Original line number Diff line number Diff line
@@ -58,6 +58,12 @@ bool VtsComposerClient::tearDown() {
    return verifyComposerCallbackParams() && destroyAllLayers();
}

std::pair<ScopedAStatus, int32_t> VtsComposerClient::getInterfaceVersion() {
    int32_t version = 1;
    auto status = mComposerClient->getInterfaceVersion(&version);
    return {std::move(status), version};
}

std::pair<ScopedAStatus, VirtualDisplay> VtsComposerClient::createVirtualDisplay(
        int32_t width, int32_t height, PixelFormat pixelFormat, int32_t bufferSlotCount) {
    VirtualDisplay outVirtualDisplay;
+2 −0
Original line number Diff line number Diff line
@@ -61,6 +61,8 @@ class VtsComposerClient {

    bool tearDown();

    std::pair<ScopedAStatus, int32_t> getInterfaceVersion();

    std::pair<ScopedAStatus, VirtualDisplay> createVirtualDisplay(int32_t width, int32_t height,
                                                                  PixelFormat pixelFormat,
                                                                  int32_t bufferSlotCount);
Loading