From 832258e9315bfd50ec560b38c6381fbc180f4c28 Mon Sep 17 00:00:00 2001 From: Ady Abraham Date: Thu, 14 Oct 2021 16:44:58 -0700 Subject: [PATCH 1/2] composer: remove getClientTargetSupport getClientTargetSupport is not used anyware Bug: 203093280 Test: build Change-Id: I8b48188d34c1b0c3eed02e1e5d94ff5be3413ae2 --- .../graphics/composer3/IComposerClient.aidl | 1 - .../graphics/composer3/IComposerClient.aidl | 19 ------------------- 2 files changed, 20 deletions(-) diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/IComposerClient.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/IComposerClient.aidl index 8824f5a80f..5c37018910 100644 --- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/IComposerClient.aidl +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/IComposerClient.aidl @@ -40,7 +40,6 @@ interface IComposerClient { void destroyVirtualDisplay(long display); android.hardware.graphics.composer3.ExecuteCommandsStatus executeCommands(int inLength, in android.hardware.common.NativeHandle[] inHandles); int getActiveConfig(long display); - void getClientTargetSupport(long display, int width, int height, in android.hardware.graphics.composer3.ClientTargetProperty clientTargetProperty); android.hardware.graphics.composer3.ColorMode[] getColorModes(long display); float[] getDataspaceSaturationMatrix(android.hardware.graphics.common.Dataspace dataspace); int getDisplayAttribute(long display, int config, android.hardware.graphics.composer3.DisplayAttribute attribute); diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerClient.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerClient.aidl index 20a6ffc934..2a9545dfdd 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerClient.aidl +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerClient.aidl @@ -188,25 +188,6 @@ interface IComposerClient { */ int getActiveConfig(long display); - /** - * Returns whether a client target with the given properties can be - * handled by the device. - * - * This function must return true for a client target with width and - * height equal to the active display configuration dimensions, - * PixelFormat::RGBA_8888, and Dataspace::UNKNOWN. It is not required to - * return true for any other configuration. - * - * @param display is the display to query. - * @param width is the client target width in pixels. - * @param height is the client target height in pixels. - * @param clientTargetProperty is the client target format and dataspace. - * @exception EX_BAD_DISPLAY when an invalid display handle was passed in. - * @exception EX_UNSUPPORTED when the given configuration is not supported. - */ - void getClientTargetSupport( - long display, int width, int height, in ClientTargetProperty clientTargetProperty); - /** * Returns the color modes supported on this display. * From 4e001df750535757fc782d058e4ad7f46821eb04 Mon Sep 17 00:00:00 2001 From: Ady Abraham Date: Fri, 15 Oct 2021 12:26:48 -0700 Subject: [PATCH 2/2] composer: add SKIP_VALIDATE to AIDL HWC2_CAPABILITY_SKIP_VALIDATE was never defined for HIDL, and instead there was a hack to just pass the value to the client (see commit 6a05e9113ab93976fa1e7af9f41aa0af7832b56e). Test: build Bug: 198690211 Change-Id: I2b06ad792237eb99e4dfe6b5c1ef808d5de45bd7 --- .../hardware/graphics/composer3/Capability.aidl | 1 + .../hardware/graphics/composer3/Capability.aidl | 11 +++++++++++ .../hardware/graphics/composer3/translate-ndk.cpp | 3 +++ 3 files changed, 15 insertions(+) diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/Capability.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/Capability.aidl index 557b3f8b77..9c49583fd2 100644 --- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/Capability.aidl +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/Capability.aidl @@ -38,4 +38,5 @@ enum Capability { SIDEBAND_STREAM = 1, SKIP_CLIENT_COLOR_TRANSFORM = 2, PRESENT_FENCE_IS_NOT_RELIABLE = 3, + SKIP_VALIDATE = 4, } diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/Capability.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/Capability.aidl index 028b6f58d4..ea619aeaf3 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/Capability.aidl +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/Capability.aidl @@ -46,4 +46,15 @@ enum Capability { * representation of the actual present time of a frame. */ PRESENT_FENCE_IS_NOT_RELIABLE = 3, + /** + * Specifies that a device is able to skip the validateDisplay call before + * receiving a call to presentDisplay. The client will always skip + * validateDisplay and try to call presentDisplay regardless of the changes + * in the properties of the layers. If the device returns anything else than + * no error, it will call validateDisplay then presentDisplay again. + * For this capability to be worthwhile the device implementation of + * presentDisplay should fail as fast as possible in the case a + * validateDisplay step is needed. + */ + SKIP_VALIDATE = 4, } diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/translate-ndk.cpp b/graphics/composer/aidl/android/hardware/graphics/composer3/translate-ndk.cpp index a593e906b8..d59190d811 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/translate-ndk.cpp +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/translate-ndk.cpp @@ -70,6 +70,9 @@ static_assert( static_cast( ::android::hardware::graphics::composer::V2_1::IComposer::Capability:: PRESENT_FENCE_IS_NOT_RELIABLE)); +// HWC2_CAPABILITY_SKIP_VALIDATE was never defined for HIDL, so we just hardcode its value +static_assert(aidl::android::hardware::graphics::composer3::Capability::SKIP_VALIDATE == + static_cast(4)); static_assert(aidl::android::hardware::graphics::composer3::LayerRequest::CLEAR_CLIENT_TARGET == static_cast(