From 536f04e354c055a60be2e19c52b579730dc50582 Mon Sep 17 00:00:00 2001 From: Leon Scroggins III Date: Tue, 4 Jan 2022 13:33:11 -0500 Subject: [PATCH] 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 --- .../hardware/graphics/composer3/LayerCommand.aidl | 1 + .../hardware/graphics/composer3/LayerCommand.aidl | 11 +++++++++++ .../graphics/composer3/ComposerClientWriter.h | 4 ++++ 3 files changed, 16 insertions(+) diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerCommand.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerCommand.aidl index ab77880daf..ac080ddab4 100644 --- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerCommand.aidl +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerCommand.aidl @@ -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; } diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/LayerCommand.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/LayerCommand.aidl index 44fd4dcb9a..f9ae28ee6e 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/LayerCommand.aidl +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/LayerCommand.aidl @@ -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; } diff --git a/graphics/composer/aidl/include/android/hardware/graphics/composer3/ComposerClientWriter.h b/graphics/composer/aidl/include/android/hardware/graphics/composer3/ComposerClientWriter.h index 16d63e57ca..128bc1a095 100644 --- a/graphics/composer/aidl/include/android/hardware/graphics/composer3/ComposerClientWriter.h +++ b/graphics/composer/aidl/include/android/hardware/graphics/composer3/ComposerClientWriter.h @@ -213,6 +213,10 @@ class ComposerClientWriter { .whitePointNits.emplace(WhitePointNits{.nits = whitePointNits}); } + void setLayerBlockingRegion(int64_t display, int64_t layer, const std::vector& blocking) { + getLayerCommand(display, layer).blockingRegion.emplace(blocking.begin(), blocking.end()); + } + const std::vector& getPendingCommands() { flushLayerCommand(); flushDisplayCommand();