From d40b5667d71af5fb250c676d7570eea89d22909f Mon Sep 17 00:00:00 2001 From: ramindani Date: Tue, 23 May 2023 21:44:49 +0000 Subject: [PATCH] [Composer-HAL-AIDL] Interface changes with getDisplayConfigurations Updates to the AIDL interfaces with getDisplayConfigurations This will be replacing the getDisplayConfig api that will be deprecated in the upcoming CL's. implementations will follow in the upcoming CL's Test: device boots, atest libsurfacerflinger_unittest, atest VtsHalGraphicsComposer3_TargetTest BUG: 284866749 BUG: 287517352 Change-Id: I2b64dcaace26a297f308e8f5c2568c35c9cd38cb --- graphics/composer/aidl/Android.bp | 2 +- .../composer3/DisplayConfiguration.aidl | 47 ++++++++++++++ .../graphics/composer3/IComposerClient.aidl | 4 ++ .../composer3/DisplayConfiguration.aidl | 63 +++++++++++++++++++ .../graphics/composer3/IComposerClient.aidl | 25 +++++--- 5 files changed, 132 insertions(+), 9 deletions(-) create mode 100644 graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/DisplayConfiguration.aidl create mode 100644 graphics/composer/aidl/android/hardware/graphics/composer3/DisplayConfiguration.aidl diff --git a/graphics/composer/aidl/Android.bp b/graphics/composer/aidl/Android.bp index 40448ec43e..88abb7387c 100644 --- a/graphics/composer/aidl/Android.bp +++ b/graphics/composer/aidl/Android.bp @@ -31,7 +31,7 @@ aidl_interface { enabled: true, support_system_process: true, }, - frozen: true, + frozen: false, vndk_use_version: "1", srcs: [ "android/hardware/graphics/composer3/*.aidl", diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/DisplayConfiguration.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/DisplayConfiguration.aidl new file mode 100644 index 0000000000..908842a467 --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/DisplayConfiguration.aidl @@ -0,0 +1,47 @@ +/** + * Copyright 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 -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; +@VintfStability +parcelable DisplayConfiguration { + int configId; + int width; + int height; + @nullable android.hardware.graphics.composer3.DisplayConfiguration.Dpi dpi; + int configGroup; + int vsyncPeriod; + parcelable Dpi { + float x; + float y; + } +} 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 cb85a88995..2f08b6fbf9 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 @@ -44,6 +44,9 @@ interface IComposerClient { float[] getDataspaceSaturationMatrix(android.hardware.graphics.common.Dataspace dataspace); int getDisplayAttribute(long display, int config, android.hardware.graphics.composer3.DisplayAttribute attribute); android.hardware.graphics.composer3.DisplayCapability[] getDisplayCapabilities(long display); + /** + * @deprecated use getDisplayConfigurations instead. For legacy support getDisplayConfigs should return at least one valid config. All the configs returned from the getDisplayConfigs should also be returned from getDisplayConfigurations. + */ int[] getDisplayConfigs(long display); android.hardware.graphics.composer3.DisplayConnectionType getDisplayConnectionType(long display); android.hardware.graphics.composer3.DisplayIdentification getDisplayIdentificationData(long display); @@ -79,6 +82,7 @@ interface IComposerClient { android.hardware.graphics.common.HdrConversionCapability[] getHdrConversionCapabilities(); android.hardware.graphics.common.Hdr setHdrConversionStrategy(in android.hardware.graphics.common.HdrConversionStrategy conversionStrategy); void setRefreshRateChangedCallbackDebugEnabled(long display, boolean enabled); + android.hardware.graphics.composer3.DisplayConfiguration[] getDisplayConfigurations(long display); const int EX_BAD_CONFIG = 1; const int EX_BAD_DISPLAY = 2; const int EX_BAD_LAYER = 3; diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/DisplayConfiguration.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/DisplayConfiguration.aidl new file mode 100644 index 0000000000..b0095d2dcd --- /dev/null +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/DisplayConfiguration.aidl @@ -0,0 +1,63 @@ +/** + * Copyright 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; + +@VintfStability +parcelable DisplayConfiguration { + /** + * The config id, to be used with IComposerClient.setActiveConfig. + */ + int configId; + + /** + * Dimensions in pixels + */ + int width; + int height; + + /** + * Dots per thousand inches. + * If the DPI for a configuration is unavailable or is + * considered unreliable, the device may set null instead. + */ + parcelable Dpi { + float x; + float y; + } + @nullable Dpi dpi; + + /** + * The configuration group ID this config is associated to. + * Switching between configurations within the same group may be + * done seamlessly in some conditions via + * setActiveConfigWithConstraints. Configurations which share the + * same config group are similar in all attributes except for the + * vsync period. + */ + int configGroup; + + /** + * Vsync period in nanoseconds. This period represents the internal + * frequency of the display. IComposerCallback.onVsync is expected + * to be called on each vsync event. For non-VRR configurations, a + * frame can be presented on each vsync event. + * + * A present fence, retrieved from CommandResultPayload.presentFence + * must be signaled on a vsync boundary. + */ + int vsyncPeriod; +} diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerClient.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerClient.aidl index 4e77f86cf4..5d04a28b00 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerClient.aidl +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerClient.aidl @@ -28,6 +28,7 @@ import android.hardware.graphics.composer3.ContentType; import android.hardware.graphics.composer3.DisplayAttribute; import android.hardware.graphics.composer3.DisplayCapability; import android.hardware.graphics.composer3.DisplayCommand; +import android.hardware.graphics.composer3.DisplayConfiguration; import android.hardware.graphics.composer3.DisplayConnectionType; import android.hardware.graphics.composer3.DisplayContentSample; import android.hardware.graphics.composer3.DisplayContentSamplingAttributes; @@ -263,15 +264,12 @@ interface IComposerClient { DisplayCapability[] getDisplayCapabilities(long display); /** - * Returns handles for all of the valid display configurations on this - * display. - * This should never return INVALID_CONFIGURATION as a valid value. + * @deprecated use getDisplayConfigurations instead. + * For legacy support getDisplayConfigs should return at least one valid config. + * All the configs returned from the getDisplayConfigs should also be returned + * from getDisplayConfigurations. * - * @param display is the display to query. - * - * @return is an array of configuration handles. - * - * @exception EX_BAD_DISPLAY when an invalid display handle was passed in. + * @see getDisplayConfigurations */ int[] getDisplayConfigs(long display); @@ -864,4 +862,15 @@ interface IComposerClient { * false when refresh rate callback is disabled. */ void setRefreshRateChangedCallbackDebugEnabled(long display, boolean enabled); + + /** + * Returns all of the valid display configurations. + * getDisplayConfigurations is the superset of getDisplayConfigs and + * getDisplayConfigs should return at least one config. + * + * @param display is the display for which the configurations are requested. + * + * @see getDisplayConfigs + */ + DisplayConfiguration[] getDisplayConfigurations(long display); }