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

Commit 536f04e3 authored by Leon Scroggins III's avatar Leon Scroggins III
Browse files

Add LayerCommand.blockingRegion

This hint tells the HWC that it may use a blocking feature to skip a
portion of the layer's buffer.

Bug: 212736475
Test: TODO (b/213361853)
Change-Id: Ib0fa41e56196feeff201637d5599830d2565da2b
parent b9d017c2
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.WhitePointNits whitePointNits;
  @nullable android.hardware.graphics.composer3.PerFrameMetadata[] perFrameMetadata;
  @nullable android.hardware.graphics.composer3.PerFrameMetadataBlob[] perFrameMetadataBlob;
  @nullable android.hardware.graphics.common.Rect[] blockingRegion;
}
+11 −0
Original line number Diff line number Diff line
@@ -264,4 +264,15 @@ parcelable LayerCommand {
     * This command may be called every frame.
     */
    @nullable PerFrameMetadataBlob[] perFrameMetadataBlob;

    /**
     * Specifies a region of the layer that is transparent and may be skipped
     * by the DPU, e.g. using a blocking region, in order to save power. This
     * is only a hint, so the composition of the layer must look the same
     * whether or not this region is skipped.
     *
     * The region is in screen space and must not exceed the dimensions of
     * the screen.
     */
    @nullable Rect[] blockingRegion;
}
+4 −0
Original line number Diff line number Diff line
@@ -213,6 +213,10 @@ class ComposerClientWriter {
                .whitePointNits.emplace(WhitePointNits{.nits = whitePointNits});
    }

    void setLayerBlockingRegion(int64_t display, int64_t layer, const std::vector<Rect>& blocking) {
        getLayerCommand(display, layer).blockingRegion.emplace(blocking.begin(), blocking.end());
    }

    const std::vector<DisplayCommand>& getPendingCommands() {
        flushLayerCommand();
        flushDisplayCommand();