diff --git a/compatibility_matrices/exclude/fcm_exclude.cpp b/compatibility_matrices/exclude/fcm_exclude.cpp index 720a76769c..2aa4bb2a22 100644 --- a/compatibility_matrices/exclude/fcm_exclude.cpp +++ b/compatibility_matrices/exclude/fcm_exclude.cpp @@ -56,7 +56,6 @@ bool ShouldCheckMissingHalsInFcm(const std::string& package) { "android.hardware.common", "android.hardware.common.fmq", "android.hardware.graphics.common", - "android.hardware.graphics.composer3.command", "android.hardware.keymaster", "android.hardware.radio", "android.hardware.uwb.fira_android", diff --git a/graphics/composer/aidl/Android.bp b/graphics/composer/aidl/Android.bp index 903413886a..5f5b54ec7c 100644 --- a/graphics/composer/aidl/Android.bp +++ b/graphics/composer/aidl/Android.bp @@ -33,7 +33,6 @@ aidl_interface { }, srcs: [ "android/hardware/graphics/composer3/*.aidl", - "android/hardware/graphics/composer3/command/*.aidl", ], stability: "vintf", imports: [ diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/Buffer.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/Buffer.aidl similarity index 97% rename from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/Buffer.aidl rename to graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/Buffer.aidl index cead848efd..a33ad23323 100644 --- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/Buffer.aidl +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/Buffer.aidl @@ -31,7 +31,7 @@ // 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.command; +package android.hardware.graphics.composer3; @VintfStability parcelable Buffer { int slot; diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ChangedCompositionLayer.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ChangedCompositionLayer.aidl new file mode 100644 index 0000000000..7e47ba8b5e --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ChangedCompositionLayer.aidl @@ -0,0 +1,39 @@ +/** + * Copyright (c) 2021, 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 ChangedCompositionLayer { + long layer; + android.hardware.graphics.composer3.Composition composition; +} diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ChangedCompositionTypes.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ChangedCompositionTypes.aidl new file mode 100644 index 0000000000..9a5ca9700d --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ChangedCompositionTypes.aidl @@ -0,0 +1,39 @@ +/** + * Copyright (c) 2021, 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 ChangedCompositionTypes { + long display; + android.hardware.graphics.composer3.ChangedCompositionLayer[] layers; +} diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/ClientTarget.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ClientTarget.aidl similarity index 94% rename from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/ClientTarget.aidl rename to graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ClientTarget.aidl index c3f4700c55..7632707ec2 100644 --- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/ClientTarget.aidl +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ClientTarget.aidl @@ -31,10 +31,10 @@ // 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.command; +package android.hardware.graphics.composer3; @VintfStability parcelable ClientTarget { - android.hardware.graphics.composer3.command.Buffer buffer; + android.hardware.graphics.composer3.Buffer buffer; android.hardware.graphics.common.Dataspace dataspace; android.hardware.graphics.common.Rect[] damage; } diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/ClientTargetPropertyWithNits.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ClientTargetPropertyWithNits.aidl similarity index 97% rename from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/ClientTargetPropertyWithNits.aidl rename to graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ClientTargetPropertyWithNits.aidl index b690a57596..f0fb22eb15 100644 --- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/ClientTargetPropertyWithNits.aidl +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ClientTargetPropertyWithNits.aidl @@ -31,7 +31,7 @@ // 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.command; +package android.hardware.graphics.composer3; @VintfStability parcelable ClientTargetPropertyWithNits { long display; diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/ColorTransformPayload.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ColorTransformPayload.aidl similarity index 97% rename from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/ColorTransformPayload.aidl rename to graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ColorTransformPayload.aidl index 0b3071c0fd..df07c9ca71 100644 --- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/ColorTransformPayload.aidl +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ColorTransformPayload.aidl @@ -31,7 +31,7 @@ // 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.command; +package android.hardware.graphics.composer3; @VintfStability parcelable ColorTransformPayload { float[] matrix; diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/Error.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/CommandError.aidl similarity index 96% rename from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/Error.aidl rename to graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/CommandError.aidl index 1726ea5bb1..103bfdc689 100644 --- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/Error.aidl +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/CommandError.aidl @@ -31,9 +31,9 @@ // 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.command; +package android.hardware.graphics.composer3; @VintfStability -parcelable Error { +parcelable CommandError { int commandIndex; int errorCode; } diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/ChangedCompositionTypes.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/CommandResultPayload.aidl similarity index 74% rename from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/ChangedCompositionTypes.aidl rename to graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/CommandResultPayload.aidl index 1377c6c00d..ebbb31e59f 100644 --- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/ChangedCompositionTypes.aidl +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/CommandResultPayload.aidl @@ -31,14 +31,14 @@ // 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.command; +package android.hardware.graphics.composer3; @VintfStability -parcelable ChangedCompositionTypes { - long display; - android.hardware.graphics.composer3.command.ChangedCompositionTypes.Layer[] layers; - @VintfStability - parcelable Layer { - long layer; - android.hardware.graphics.composer3.Composition composition; - } +union CommandResultPayload { + android.hardware.graphics.composer3.CommandError error; + android.hardware.graphics.composer3.ChangedCompositionTypes changedCompositionTypes; + android.hardware.graphics.composer3.DisplayRequest displayRequest; + android.hardware.graphics.composer3.PresentFence presentFence; + android.hardware.graphics.composer3.ReleaseFences releaseFences; + android.hardware.graphics.composer3.PresentOrValidate presentOrValidateResult; + android.hardware.graphics.composer3.ClientTargetPropertyWithNits clientTargetProperty; } diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/DisplayCommand.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/DisplayCommand.aidl similarity index 84% rename from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/DisplayCommand.aidl rename to graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/DisplayCommand.aidl index 7446db02ad..2f5d00f698 100644 --- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/DisplayCommand.aidl +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/DisplayCommand.aidl @@ -31,13 +31,14 @@ // 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.command; +package android.hardware.graphics.composer3; @VintfStability parcelable DisplayCommand { long display; - @nullable android.hardware.graphics.composer3.command.ColorTransformPayload colorTransform; - @nullable android.hardware.graphics.composer3.command.ClientTarget clientTarget; - @nullable android.hardware.graphics.composer3.command.Buffer virtualDisplayOutputBuffer; + android.hardware.graphics.composer3.LayerCommand[] layers; + @nullable android.hardware.graphics.composer3.ColorTransformPayload colorTransform; + @nullable android.hardware.graphics.composer3.ClientTarget clientTarget; + @nullable android.hardware.graphics.composer3.Buffer virtualDisplayOutputBuffer; boolean validateDisplay; boolean acceptDisplayChanges; boolean presentDisplay; diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/DisplayRequest.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/DisplayRequest.aidl similarity index 93% rename from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/DisplayRequest.aidl rename to graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/DisplayRequest.aidl index 7f413a9b62..13462ce298 100644 --- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/DisplayRequest.aidl +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/DisplayRequest.aidl @@ -31,12 +31,12 @@ // 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.command; +package android.hardware.graphics.composer3; @VintfStability parcelable DisplayRequest { long display; int mask; - android.hardware.graphics.composer3.command.DisplayRequest.LayerRequest[] layerRequests; + android.hardware.graphics.composer3.DisplayRequest.LayerRequest[] layerRequests; const int FLIP_CLIENT_TARGET = 1; const int WRITE_CLIENT_TARGET_TO_OUTPUT = 2; @VintfStability diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/GenericMetadata.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/GenericMetadata.aidl similarity index 97% rename from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/GenericMetadata.aidl rename to graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/GenericMetadata.aidl index be889d8d44..c18529bb3f 100644 --- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/GenericMetadata.aidl +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/GenericMetadata.aidl @@ -31,7 +31,7 @@ // 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.command; +package android.hardware.graphics.composer3; @VintfStability parcelable GenericMetadata { android.hardware.graphics.composer3.LayerGenericMetadataKey key; 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 65cf86ccca..471721897e 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 @@ -38,7 +38,7 @@ interface IComposerClient { android.hardware.graphics.composer3.VirtualDisplay createVirtualDisplay(int width, int height, android.hardware.graphics.common.PixelFormat formatHint, int outputBufferSlotCount); void destroyLayer(long display, long layer); void destroyVirtualDisplay(long display); - android.hardware.graphics.composer3.command.CommandResultPayload[] executeCommands(in android.hardware.graphics.composer3.command.CommandPayload[] commands); + android.hardware.graphics.composer3.CommandResultPayload[] executeCommands(in android.hardware.graphics.composer3.DisplayCommand[] commands); int getActiveConfig(long display); android.hardware.graphics.composer3.ColorMode[] getColorModes(long display); float[] getDataspaceSaturationMatrix(android.hardware.graphics.common.Dataspace dataspace); diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/LayerCommand.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerCommand.aidl similarity index 75% rename from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/LayerCommand.aidl rename to graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerCommand.aidl index b5adbc307d..bad72fcb5a 100644 --- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/LayerCommand.aidl +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerCommand.aidl @@ -31,29 +31,28 @@ // 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.command; +package android.hardware.graphics.composer3; @VintfStability parcelable LayerCommand { - long display; long layer; @nullable android.hardware.graphics.common.Point cursorPosition; - @nullable android.hardware.graphics.composer3.command.Buffer buffer; + @nullable android.hardware.graphics.composer3.Buffer buffer; @nullable android.hardware.graphics.common.Rect[] damage; - @nullable android.hardware.graphics.composer3.command.ParcelableBlendMode blendMode; + @nullable android.hardware.graphics.composer3.ParcelableBlendMode blendMode; @nullable android.hardware.graphics.composer3.Color color; @nullable android.hardware.graphics.composer3.FloatColor floatColor; - @nullable android.hardware.graphics.composer3.command.ParcelableComposition composition; - @nullable android.hardware.graphics.composer3.command.ParcelableDataspace dataspace; + @nullable android.hardware.graphics.composer3.ParcelableComposition composition; + @nullable android.hardware.graphics.composer3.ParcelableDataspace dataspace; @nullable android.hardware.graphics.common.Rect displayFrame; - @nullable android.hardware.graphics.composer3.command.PlaneAlpha planeAlpha; + @nullable android.hardware.graphics.composer3.PlaneAlpha planeAlpha; @nullable android.hardware.common.NativeHandle sidebandStream; @nullable android.hardware.graphics.common.FRect sourceCrop; - @nullable android.hardware.graphics.composer3.command.ParcelableTransform transform; + @nullable android.hardware.graphics.composer3.ParcelableTransform transform; @nullable android.hardware.graphics.common.Rect[] visibleRegion; - @nullable android.hardware.graphics.composer3.command.ZOrder z; + @nullable android.hardware.graphics.composer3.ZOrder z; @nullable float[] colorTransform; - @nullable android.hardware.graphics.composer3.command.WhitePointNits whitePointNits; - @nullable android.hardware.graphics.composer3.command.GenericMetadata genericMetadata; + @nullable android.hardware.graphics.composer3.WhitePointNits whitePointNits; + @nullable android.hardware.graphics.composer3.GenericMetadata genericMetadata; @nullable android.hardware.graphics.composer3.PerFrameMetadata[] perFrameMetadata; @nullable android.hardware.graphics.composer3.PerFrameMetadataBlob[] perFrameMetadataBlob; } diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/ParcelableBlendMode.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ParcelableBlendMode.aidl similarity index 97% rename from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/ParcelableBlendMode.aidl rename to graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ParcelableBlendMode.aidl index 5e6d212c65..f1fee5f376 100644 --- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/ParcelableBlendMode.aidl +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ParcelableBlendMode.aidl @@ -31,7 +31,7 @@ // 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.command; +package android.hardware.graphics.composer3; @VintfStability parcelable ParcelableBlendMode { android.hardware.graphics.common.BlendMode blendMode; diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/ParcelableComposition.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ParcelableComposition.aidl similarity index 97% rename from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/ParcelableComposition.aidl rename to graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ParcelableComposition.aidl index 40637a9f57..98fbb665e2 100644 --- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/ParcelableComposition.aidl +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ParcelableComposition.aidl @@ -31,7 +31,7 @@ // 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.command; +package android.hardware.graphics.composer3; @VintfStability parcelable ParcelableComposition { android.hardware.graphics.composer3.Composition composition; diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/ParcelableDataspace.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ParcelableDataspace.aidl similarity index 97% rename from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/ParcelableDataspace.aidl rename to graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ParcelableDataspace.aidl index 8f06079421..76ecf85b9f 100644 --- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/ParcelableDataspace.aidl +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ParcelableDataspace.aidl @@ -31,7 +31,7 @@ // 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.command; +package android.hardware.graphics.composer3; @VintfStability parcelable ParcelableDataspace { android.hardware.graphics.common.Dataspace dataspace; diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/ParcelableTransform.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ParcelableTransform.aidl similarity index 97% rename from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/ParcelableTransform.aidl rename to graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ParcelableTransform.aidl index 6d6fe5b89f..b673656438 100644 --- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/ParcelableTransform.aidl +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ParcelableTransform.aidl @@ -31,7 +31,7 @@ // 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.command; +package android.hardware.graphics.composer3; @VintfStability parcelable ParcelableTransform { android.hardware.graphics.common.Transform transform; diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/PlaneAlpha.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/PlaneAlpha.aidl similarity index 97% rename from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/PlaneAlpha.aidl rename to graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/PlaneAlpha.aidl index 97f5329817..c48c2a8a34 100644 --- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/PlaneAlpha.aidl +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/PlaneAlpha.aidl @@ -31,7 +31,7 @@ // 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.command; +package android.hardware.graphics.composer3; @VintfStability parcelable PlaneAlpha { float alpha; diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/PresentFence.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/PresentFence.aidl similarity index 97% rename from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/PresentFence.aidl rename to graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/PresentFence.aidl index 906f20c74c..3bb09cdb34 100644 --- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/PresentFence.aidl +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/PresentFence.aidl @@ -31,7 +31,7 @@ // 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.command; +package android.hardware.graphics.composer3; @VintfStability parcelable PresentFence { long display; diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/PresentOrValidate.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/PresentOrValidate.aidl similarity index 93% rename from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/PresentOrValidate.aidl rename to graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/PresentOrValidate.aidl index 66f1c0356b..3514e5355a 100644 --- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/PresentOrValidate.aidl +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/PresentOrValidate.aidl @@ -31,11 +31,11 @@ // 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.command; +package android.hardware.graphics.composer3; @VintfStability parcelable PresentOrValidate { long display; - android.hardware.graphics.composer3.command.PresentOrValidate.Result result; + android.hardware.graphics.composer3.PresentOrValidate.Result result; @VintfStability enum Result { Presented = 0, diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/ReleaseFences.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ReleaseFences.aidl similarity index 93% rename from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/ReleaseFences.aidl rename to graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ReleaseFences.aidl index b7d258652d..d623661250 100644 --- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/ReleaseFences.aidl +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ReleaseFences.aidl @@ -31,11 +31,11 @@ // 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.command; +package android.hardware.graphics.composer3; @VintfStability parcelable ReleaseFences { long display; - android.hardware.graphics.composer3.command.ReleaseFences.Layer[] layers; + android.hardware.graphics.composer3.ReleaseFences.Layer[] layers; @VintfStability parcelable Layer { long layer; diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/WhitePointNits.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/WhitePointNits.aidl similarity index 97% rename from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/WhitePointNits.aidl rename to graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/WhitePointNits.aidl index 2b251677ab..c3925d2153 100644 --- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/WhitePointNits.aidl +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/WhitePointNits.aidl @@ -31,7 +31,7 @@ // 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.command; +package android.hardware.graphics.composer3; @VintfStability parcelable WhitePointNits { float nits; diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/ZOrder.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ZOrder.aidl similarity index 97% rename from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/ZOrder.aidl rename to graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ZOrder.aidl index 69b68c49b4..ea96ea3a69 100644 --- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/ZOrder.aidl +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ZOrder.aidl @@ -31,7 +31,7 @@ // 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.command; +package android.hardware.graphics.composer3; @VintfStability parcelable ZOrder { int z; diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/CommandPayload.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/CommandPayload.aidl deleted file mode 100644 index 984830630a..0000000000 --- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/CommandPayload.aidl +++ /dev/null @@ -1,39 +0,0 @@ -/** - * Copyright (c) 2021, 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.command; -@VintfStability -union CommandPayload { - android.hardware.graphics.composer3.command.DisplayCommand displayCommand; - android.hardware.graphics.composer3.command.LayerCommand layerCommand; -} diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/CommandResultPayload.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/CommandResultPayload.aidl deleted file mode 100644 index 1b3cae83e6..0000000000 --- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/CommandResultPayload.aidl +++ /dev/null @@ -1,44 +0,0 @@ -/** - * Copyright (c) 2021, 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.command; -@VintfStability -union CommandResultPayload { - android.hardware.graphics.composer3.command.Error error; - android.hardware.graphics.composer3.command.ChangedCompositionTypes changedCompositionType; - android.hardware.graphics.composer3.command.DisplayRequest displayRequest; - android.hardware.graphics.composer3.command.PresentFence presentFence; - android.hardware.graphics.composer3.command.ReleaseFences releaseFences; - android.hardware.graphics.composer3.command.PresentOrValidate presentOrValidateResult; - android.hardware.graphics.composer3.command.ClientTargetPropertyWithNits clientTargetProperty; -} diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/command/Buffer.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/Buffer.aidl similarity index 96% rename from graphics/composer/aidl/android/hardware/graphics/composer3/command/Buffer.aidl rename to graphics/composer/aidl/android/hardware/graphics/composer3/Buffer.aidl index 3a08d3b522..415a9b61c1 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/command/Buffer.aidl +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/Buffer.aidl @@ -14,7 +14,7 @@ * limitations under the License. */ -package android.hardware.graphics.composer3.command; +package android.hardware.graphics.composer3; import android.hardware.common.NativeHandle; diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/ChangedCompositionLayer.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/ChangedCompositionLayer.aidl new file mode 100644 index 0000000000..fb25163aa4 --- /dev/null +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/ChangedCompositionLayer.aidl @@ -0,0 +1,33 @@ +/** + * Copyright (c) 2021, 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; + +import android.hardware.graphics.composer3.Composition; + +@VintfStability +parcelable ChangedCompositionLayer { + /** + * The layer which this commands refers to. + * @see IComposer.createLayer + */ + long layer; + + /** + * The new composition type. + */ + Composition composition; +} diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/command/ChangedCompositionTypes.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/ChangedCompositionTypes.aidl similarity index 72% rename from graphics/composer/aidl/android/hardware/graphics/composer3/command/ChangedCompositionTypes.aidl rename to graphics/composer/aidl/android/hardware/graphics/composer3/ChangedCompositionTypes.aidl index 3800efffd8..ddd45b7fdd 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/command/ChangedCompositionTypes.aidl +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/ChangedCompositionTypes.aidl @@ -14,8 +14,9 @@ * limitations under the License. */ -package android.hardware.graphics.composer3.command; +package android.hardware.graphics.composer3; +import android.hardware.graphics.composer3.ChangedCompositionLayer; import android.hardware.graphics.composer3.Composition; @VintfStability @@ -26,22 +27,8 @@ parcelable ChangedCompositionTypes { */ long display; - @VintfStability - parcelable Layer { - /** - * The layer which this commands refers to. - * @see IComposer.createLayer - */ - long layer; - - /** - * The new composition type. - */ - Composition composition; - } - /** * Indicates which layers has composition changes */ - Layer[] layers; + ChangedCompositionLayer[] layers; } diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/command/ClientTarget.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/ClientTarget.aidl similarity index 90% rename from graphics/composer/aidl/android/hardware/graphics/composer3/command/ClientTarget.aidl rename to graphics/composer/aidl/android/hardware/graphics/composer3/ClientTarget.aidl index d8d45a1ccf..56488d56c3 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/command/ClientTarget.aidl +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/ClientTarget.aidl @@ -14,11 +14,11 @@ * limitations under the License. */ -package android.hardware.graphics.composer3.command; +package android.hardware.graphics.composer3; import android.hardware.graphics.common.Dataspace; import android.hardware.graphics.common.Rect; -import android.hardware.graphics.composer3.command.Buffer; +import android.hardware.graphics.composer3.Buffer; @VintfStability parcelable ClientTarget { diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/command/ClientTargetPropertyWithNits.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/ClientTargetPropertyWithNits.aidl similarity index 95% rename from graphics/composer/aidl/android/hardware/graphics/composer3/command/ClientTargetPropertyWithNits.aidl rename to graphics/composer/aidl/android/hardware/graphics/composer3/ClientTargetPropertyWithNits.aidl index c80e4ce1c7..50376519d8 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/command/ClientTargetPropertyWithNits.aidl +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/ClientTargetPropertyWithNits.aidl @@ -14,7 +14,7 @@ * limitations under the License. */ -package android.hardware.graphics.composer3.command; +package android.hardware.graphics.composer3; import android.hardware.graphics.composer3.ClientTargetProperty; diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/command/ColorTransformPayload.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/ColorTransformPayload.aidl similarity index 95% rename from graphics/composer/aidl/android/hardware/graphics/composer3/command/ColorTransformPayload.aidl rename to graphics/composer/aidl/android/hardware/graphics/composer3/ColorTransformPayload.aidl index 9cc8fa742a..8bb0711350 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/command/ColorTransformPayload.aidl +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/ColorTransformPayload.aidl @@ -14,7 +14,7 @@ * limitations under the License. */ -package android.hardware.graphics.composer3.command; +package android.hardware.graphics.composer3; import android.hardware.graphics.common.ColorTransform; diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/command/Error.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/CommandError.aidl similarity index 92% rename from graphics/composer/aidl/android/hardware/graphics/composer3/command/Error.aidl rename to graphics/composer/aidl/android/hardware/graphics/composer3/CommandError.aidl index 19843b97b5..ea48600bf9 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/command/Error.aidl +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/CommandError.aidl @@ -14,10 +14,10 @@ * limitations under the License. */ -package android.hardware.graphics.composer3.command; +package android.hardware.graphics.composer3; @VintfStability -parcelable Error { +parcelable CommandError { /** * The index in the command payload array. */ diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/command/CommandResultPayload.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/CommandResultPayload.aidl similarity index 85% rename from graphics/composer/aidl/android/hardware/graphics/composer3/command/CommandResultPayload.aidl rename to graphics/composer/aidl/android/hardware/graphics/composer3/CommandResultPayload.aidl index b6086ca826..f2de68e025 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/command/CommandResultPayload.aidl +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/CommandResultPayload.aidl @@ -14,22 +14,22 @@ * limitations under the License. */ -package android.hardware.graphics.composer3.command; +package android.hardware.graphics.composer3; -import android.hardware.graphics.composer3.command.ChangedCompositionTypes; -import android.hardware.graphics.composer3.command.ClientTargetPropertyWithNits; -import android.hardware.graphics.composer3.command.DisplayRequest; -import android.hardware.graphics.composer3.command.Error; -import android.hardware.graphics.composer3.command.PresentFence; -import android.hardware.graphics.composer3.command.PresentOrValidate; -import android.hardware.graphics.composer3.command.ReleaseFences; +import android.hardware.graphics.composer3.ChangedCompositionTypes; +import android.hardware.graphics.composer3.ClientTargetPropertyWithNits; +import android.hardware.graphics.composer3.CommandError; +import android.hardware.graphics.composer3.DisplayRequest; +import android.hardware.graphics.composer3.PresentFence; +import android.hardware.graphics.composer3.PresentOrValidate; +import android.hardware.graphics.composer3.ReleaseFences; @VintfStability union CommandResultPayload { /** * Indicates an error generated by a command. */ - Error error; + CommandError error; /** * Sets the layers for which the device requires a different composition @@ -38,7 +38,7 @@ union CommandResultPayload { * ACCEPT_DISPLAY_CHANGES, or must set new types and attempt to validate * the display again. */ - ChangedCompositionTypes changedCompositionType; + ChangedCompositionTypes changedCompositionTypes; /** * Sets the display requests and the layer requests required for the last diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/command/DisplayCommand.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/DisplayCommand.aidl similarity index 93% rename from graphics/composer/aidl/android/hardware/graphics/composer3/command/DisplayCommand.aidl rename to graphics/composer/aidl/android/hardware/graphics/composer3/DisplayCommand.aidl index 7295adab7c..cdc4759fd3 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/command/DisplayCommand.aidl +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/DisplayCommand.aidl @@ -14,11 +14,12 @@ * limitations under the License. */ -package android.hardware.graphics.composer3.command; +package android.hardware.graphics.composer3; -import android.hardware.graphics.composer3.command.Buffer; -import android.hardware.graphics.composer3.command.ClientTarget; -import android.hardware.graphics.composer3.command.ColorTransformPayload; +import android.hardware.graphics.composer3.Buffer; +import android.hardware.graphics.composer3.ClientTarget; +import android.hardware.graphics.composer3.ColorTransformPayload; +import android.hardware.graphics.composer3.LayerCommand; @VintfStability parcelable DisplayCommand { @@ -28,6 +29,12 @@ parcelable DisplayCommand { */ long display; + /** + * Sets layer commands for this display. + * @see LayerCommand. + */ + LayerCommand[] layers; + /** * Sets a color transform which will be applied after composition. * diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/command/DisplayRequest.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/DisplayRequest.aidl similarity index 97% rename from graphics/composer/aidl/android/hardware/graphics/composer3/command/DisplayRequest.aidl rename to graphics/composer/aidl/android/hardware/graphics/composer3/DisplayRequest.aidl index 10bd10c789..ea7745d3ae 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/command/DisplayRequest.aidl +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/DisplayRequest.aidl @@ -14,7 +14,7 @@ * limitations under the License. */ -package android.hardware.graphics.composer3.command; +package android.hardware.graphics.composer3; @VintfStability parcelable DisplayRequest { diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/command/GenericMetadata.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/GenericMetadata.aidl similarity index 95% rename from graphics/composer/aidl/android/hardware/graphics/composer3/command/GenericMetadata.aidl rename to graphics/composer/aidl/android/hardware/graphics/composer3/GenericMetadata.aidl index a4e1fe8d28..d0254ddf48 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/command/GenericMetadata.aidl +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/GenericMetadata.aidl @@ -14,7 +14,7 @@ * limitations under the License. */ -package android.hardware.graphics.composer3.command; +package android.hardware.graphics.composer3; import android.hardware.graphics.composer3.LayerGenericMetadataKey; diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerClient.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerClient.aidl index f661f8b919..570d5d9e7f 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerClient.aidl +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerClient.aidl @@ -18,9 +18,11 @@ package android.hardware.graphics.composer3; import android.hardware.graphics.composer3.ClientTargetProperty; import android.hardware.graphics.composer3.ColorMode; +import android.hardware.graphics.composer3.CommandResultPayload; 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.DisplayConnectionType; import android.hardware.graphics.composer3.DisplayContentSample; import android.hardware.graphics.composer3.DisplayContentSamplingAttributes; @@ -36,8 +38,6 @@ import android.hardware.graphics.composer3.RenderIntent; import android.hardware.graphics.composer3.VirtualDisplay; import android.hardware.graphics.composer3.VsyncPeriodChangeConstraints; import android.hardware.graphics.composer3.VsyncPeriodChangeTimeline; -import android.hardware.graphics.composer3.command.CommandPayload; -import android.hardware.graphics.composer3.command.CommandResultPayload; @VintfStability interface IComposerClient { @@ -163,7 +163,7 @@ interface IComposerClient { * * @return are the command statuses. */ - CommandResultPayload[] executeCommands(in CommandPayload[] commands); + CommandResultPayload[] executeCommands(in DisplayCommand[] commands); /** * Retrieves which display configuration is currently active. diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/command/LayerCommand.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/LayerCommand.aidl similarity index 93% rename from graphics/composer/aidl/android/hardware/graphics/composer3/command/LayerCommand.aidl rename to graphics/composer/aidl/android/hardware/graphics/composer3/LayerCommand.aidl index eac051bb0e..130e3b15b4 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/command/LayerCommand.aidl +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/LayerCommand.aidl @@ -14,34 +14,28 @@ * limitations under the License. */ -package android.hardware.graphics.composer3.command; +package android.hardware.graphics.composer3; import android.hardware.common.NativeHandle; import android.hardware.graphics.common.FRect; import android.hardware.graphics.common.Point; import android.hardware.graphics.common.Rect; +import android.hardware.graphics.composer3.Buffer; import android.hardware.graphics.composer3.Color; import android.hardware.graphics.composer3.FloatColor; +import android.hardware.graphics.composer3.GenericMetadata; +import android.hardware.graphics.composer3.ParcelableBlendMode; +import android.hardware.graphics.composer3.ParcelableComposition; +import android.hardware.graphics.composer3.ParcelableDataspace; +import android.hardware.graphics.composer3.ParcelableTransform; import android.hardware.graphics.composer3.PerFrameMetadata; import android.hardware.graphics.composer3.PerFrameMetadataBlob; -import android.hardware.graphics.composer3.command.Buffer; -import android.hardware.graphics.composer3.command.GenericMetadata; -import android.hardware.graphics.composer3.command.ParcelableBlendMode; -import android.hardware.graphics.composer3.command.ParcelableComposition; -import android.hardware.graphics.composer3.command.ParcelableDataspace; -import android.hardware.graphics.composer3.command.ParcelableTransform; -import android.hardware.graphics.composer3.command.PlaneAlpha; -import android.hardware.graphics.composer3.command.WhitePointNits; -import android.hardware.graphics.composer3.command.ZOrder; +import android.hardware.graphics.composer3.PlaneAlpha; +import android.hardware.graphics.composer3.WhitePointNits; +import android.hardware.graphics.composer3.ZOrder; @VintfStability parcelable LayerCommand { - /** - * The display which this commands refers to. - * @see IComposer.createDisplay - */ - long display; - /** * The layer which this commands refers to. * @see IComposer.createLayer diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/command/ParcelableBlendMode.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/ParcelableBlendMode.aidl similarity index 93% rename from graphics/composer/aidl/android/hardware/graphics/composer3/command/ParcelableBlendMode.aidl rename to graphics/composer/aidl/android/hardware/graphics/composer3/ParcelableBlendMode.aidl index f91285379c..a6c016ab4b 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/command/ParcelableBlendMode.aidl +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/ParcelableBlendMode.aidl @@ -14,7 +14,7 @@ * limitations under the License. */ -package android.hardware.graphics.composer3.command; +package android.hardware.graphics.composer3; import android.hardware.graphics.common.BlendMode; diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/command/ParcelableComposition.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/ParcelableComposition.aidl similarity index 93% rename from graphics/composer/aidl/android/hardware/graphics/composer3/command/ParcelableComposition.aidl rename to graphics/composer/aidl/android/hardware/graphics/composer3/ParcelableComposition.aidl index 91979d8de5..0946ce75cd 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/command/ParcelableComposition.aidl +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/ParcelableComposition.aidl @@ -14,7 +14,7 @@ * limitations under the License. */ -package android.hardware.graphics.composer3.command; +package android.hardware.graphics.composer3; import android.hardware.graphics.composer3.Composition; diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/command/ParcelableDataspace.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/ParcelableDataspace.aidl similarity index 93% rename from graphics/composer/aidl/android/hardware/graphics/composer3/command/ParcelableDataspace.aidl rename to graphics/composer/aidl/android/hardware/graphics/composer3/ParcelableDataspace.aidl index 6be750d978..528cdf96c9 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/command/ParcelableDataspace.aidl +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/ParcelableDataspace.aidl @@ -14,7 +14,7 @@ * limitations under the License. */ -package android.hardware.graphics.composer3.command; +package android.hardware.graphics.composer3; import android.hardware.graphics.common.Dataspace; diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/command/ParcelableTransform.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/ParcelableTransform.aidl similarity index 93% rename from graphics/composer/aidl/android/hardware/graphics/composer3/command/ParcelableTransform.aidl rename to graphics/composer/aidl/android/hardware/graphics/composer3/ParcelableTransform.aidl index 910d014b67..75f9f7e319 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/command/ParcelableTransform.aidl +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/ParcelableTransform.aidl @@ -14,7 +14,7 @@ * limitations under the License. */ -package android.hardware.graphics.composer3.command; +package android.hardware.graphics.composer3; import android.hardware.graphics.common.Transform; diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/command/PlaneAlpha.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/PlaneAlpha.aidl similarity index 94% rename from graphics/composer/aidl/android/hardware/graphics/composer3/command/PlaneAlpha.aidl rename to graphics/composer/aidl/android/hardware/graphics/composer3/PlaneAlpha.aidl index fa1889b5e5..347dc19a15 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/command/PlaneAlpha.aidl +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/PlaneAlpha.aidl @@ -14,7 +14,7 @@ * limitations under the License. */ -package android.hardware.graphics.composer3.command; +package android.hardware.graphics.composer3; @VintfStability parcelable PlaneAlpha { diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/command/PresentFence.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/PresentFence.aidl similarity index 94% rename from graphics/composer/aidl/android/hardware/graphics/composer3/command/PresentFence.aidl rename to graphics/composer/aidl/android/hardware/graphics/composer3/PresentFence.aidl index 0c144068e9..244b4e5af3 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/command/PresentFence.aidl +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/PresentFence.aidl @@ -14,7 +14,7 @@ * limitations under the License. */ -package android.hardware.graphics.composer3.command; +package android.hardware.graphics.composer3; @VintfStability parcelable PresentFence { diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/command/PresentOrValidate.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/PresentOrValidate.aidl similarity index 94% rename from graphics/composer/aidl/android/hardware/graphics/composer3/command/PresentOrValidate.aidl rename to graphics/composer/aidl/android/hardware/graphics/composer3/PresentOrValidate.aidl index 7fc60c4875..f3153bdeca 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/command/PresentOrValidate.aidl +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/PresentOrValidate.aidl @@ -14,7 +14,7 @@ * limitations under the License. */ -package android.hardware.graphics.composer3.command; +package android.hardware.graphics.composer3; @VintfStability parcelable PresentOrValidate { diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/command/ReleaseFences.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/ReleaseFences.aidl similarity index 95% rename from graphics/composer/aidl/android/hardware/graphics/composer3/command/ReleaseFences.aidl rename to graphics/composer/aidl/android/hardware/graphics/composer3/ReleaseFences.aidl index 762f5ebc75..459a04265f 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/command/ReleaseFences.aidl +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/ReleaseFences.aidl @@ -14,7 +14,7 @@ * limitations under the License. */ -package android.hardware.graphics.composer3.command; +package android.hardware.graphics.composer3; @VintfStability parcelable ReleaseFences { diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/command/WhitePointNits.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/WhitePointNits.aidl similarity index 95% rename from graphics/composer/aidl/android/hardware/graphics/composer3/command/WhitePointNits.aidl rename to graphics/composer/aidl/android/hardware/graphics/composer3/WhitePointNits.aidl index ec46cdf01c..2a1d1c666c 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/command/WhitePointNits.aidl +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/WhitePointNits.aidl @@ -14,7 +14,7 @@ * limitations under the License. */ -package android.hardware.graphics.composer3.command; +package android.hardware.graphics.composer3; @VintfStability parcelable WhitePointNits { diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/command/ZOrder.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/ZOrder.aidl similarity index 94% rename from graphics/composer/aidl/android/hardware/graphics/composer3/command/ZOrder.aidl rename to graphics/composer/aidl/android/hardware/graphics/composer3/ZOrder.aidl index 68120b0e6f..56cc2000ac 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/command/ZOrder.aidl +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/ZOrder.aidl @@ -14,7 +14,7 @@ * limitations under the License. */ -package android.hardware.graphics.composer3.command; +package android.hardware.graphics.composer3; @VintfStability parcelable ZOrder { diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/command/CommandPayload.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/command/CommandPayload.aidl deleted file mode 100644 index c1555e632b..0000000000 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/command/CommandPayload.aidl +++ /dev/null @@ -1,30 +0,0 @@ -/** - * Copyright (c) 2021, 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.command; - -import android.hardware.graphics.composer3.command.DisplayCommand; -import android.hardware.graphics.composer3.command.LayerCommand; - -/** - * Type of commands that can be used in IComposerClient.executeCommands. - * Note that this is a union and each command can only have one type. - */ -@VintfStability -union CommandPayload { - DisplayCommand displayCommand; - LayerCommand layerCommand; -} 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 5bda15a449..a3c81765a1 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/translate-ndk.cpp +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/translate-ndk.cpp @@ -74,7 +74,7 @@ static_assert( static_assert(aidl::android::hardware::graphics::composer3::Capability::SKIP_VALIDATE == static_cast(4)); -static_assert(aidl::android::hardware::graphics::composer3::command::DisplayRequest::LayerRequest:: +static_assert(aidl::android::hardware::graphics::composer3::DisplayRequest::LayerRequest:: CLEAR_CLIENT_TARGET == static_cast(::android::hardware::graphics::composer::V2_1::IComposerClient:: LayerRequest::CLEAR_CLIENT_TARGET)); @@ -121,11 +121,10 @@ static_assert(aidl::android::hardware::graphics::composer3::Composition::SIDEBAN ::android::hardware::graphics::composer::V2_1::IComposerClient::Composition:: SIDEBAND)); -static_assert( - aidl::android::hardware::graphics::composer3::command::DisplayRequest::FLIP_CLIENT_TARGET == - static_cast(::android::hardware::graphics::composer::V2_1::IComposerClient:: - DisplayRequest::FLIP_CLIENT_TARGET)); -static_assert(aidl::android::hardware::graphics::composer3::command::DisplayRequest:: +static_assert(aidl::android::hardware::graphics::composer3::DisplayRequest::FLIP_CLIENT_TARGET == + static_cast(::android::hardware::graphics::composer::V2_1::IComposerClient:: + DisplayRequest::FLIP_CLIENT_TARGET)); +static_assert(aidl::android::hardware::graphics::composer3::DisplayRequest:: WRITE_CLIENT_TARGET_TO_OUTPUT == static_cast(::android::hardware::graphics::composer::V2_1::IComposerClient:: DisplayRequest::WRITE_CLIENT_TARGET_TO_OUTPUT)); diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_ReadbackTest.cpp b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_ReadbackTest.cpp index 717b60cd61..8726043cf2 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_ReadbackTest.cpp +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_ReadbackTest.cpp @@ -140,7 +140,7 @@ class GraphicsCompositionTestBase : public ::testing::Test { return; } - std::vector results; + std::vector results; const auto status = mComposerClient->executeCommands(commands, &results); ASSERT_TRUE(status.isOk()) << "executeCommands failed " << status.getDescription(); diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp index 7a20a53e3b..17b0ebd0ea 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp @@ -1168,7 +1168,7 @@ class GraphicsComposerAidlCommandTest : public GraphicsComposerAidlTest { return; } - std::vector results; + std::vector results; const auto status = mComposerClient->executeCommands(commands, &results); ASSERT_TRUE(status.isOk()) << "executeCommands failed " << status.getDescription(); diff --git a/graphics/composer/aidl/include/android/hardware/graphics/composer3/command-buffer.h b/graphics/composer/aidl/include/android/hardware/graphics/composer3/command-buffer.h index b586e7fbec..fcf2a34602 100644 --- a/graphics/composer/aidl/include/android/hardware/graphics/composer3/command-buffer.h +++ b/graphics/composer/aidl/include/android/hardware/graphics/composer3/command-buffer.h @@ -37,8 +37,8 @@ #include #include -#include -#include +#include +#include #include #include @@ -79,14 +79,14 @@ class CommandWriterBase { } void setError(int32_t index, int32_t errorCode) { - command::Error error; + CommandError error; error.commandIndex = index; error.errorCode = errorCode; mCommandsResults.emplace_back(std::move(error)); } - void setPresentOrValidateResult(int64_t display, command::PresentOrValidate::Result result) { - command::PresentOrValidate presentOrValidate; + void setPresentOrValidateResult(int64_t display, PresentOrValidate::Result result) { + PresentOrValidate presentOrValidate; presentOrValidate.display = display; presentOrValidate.result = result; mCommandsResults.emplace_back(std::move(presentOrValidate)); @@ -94,12 +94,11 @@ class CommandWriterBase { void setChangedCompositionTypes(int64_t display, const std::vector& layers, const std::vector& types) { - command::ChangedCompositionTypes changedCompositionTypes; + ChangedCompositionTypes changedCompositionTypes; changedCompositionTypes.display = display; changedCompositionTypes.layers.reserve(layers.size()); for (int i = 0; i < layers.size(); i++) { - auto layer = command::ChangedCompositionTypes::Layer{.layer = layers[i], - .composition = types[i]}; + auto layer = ChangedCompositionLayer{.layer = layers[i], .composition = types[i]}; changedCompositionTypes.layers.emplace_back(std::move(layer)); } mCommandsResults.emplace_back(std::move(changedCompositionTypes)); @@ -108,13 +107,13 @@ class CommandWriterBase { void setDisplayRequests(int64_t display, int32_t displayRequestMask, const std::vector& layers, const std::vector& layerRequestMasks) { - command::DisplayRequest displayRequest; + DisplayRequest displayRequest; displayRequest.display = display; displayRequest.mask = displayRequestMask; displayRequest.layerRequests.reserve(layers.size()); for (int i = 0; i < layers.size(); i++) { - auto layerRequest = command::DisplayRequest::LayerRequest{.layer = layers[i], - .mask = layerRequestMasks[i]}; + auto layerRequest = + DisplayRequest::LayerRequest{.layer = layers[i], .mask = layerRequestMasks[i]}; displayRequest.layerRequests.emplace_back(std::move(layerRequest)); } mCommandsResults.emplace_back(std::move(displayRequest)); @@ -122,7 +121,7 @@ class CommandWriterBase { void setPresentFence(int64_t display, ::ndk::ScopedFileDescriptor presentFence) { if (presentFence.get() >= 0) { - command::PresentFence presentFenceCommand; + PresentFence presentFenceCommand; presentFenceCommand.fence = std::move(presentFence); presentFenceCommand.display = display; mCommandsResults.emplace_back(std::move(presentFenceCommand)); @@ -133,11 +132,11 @@ class CommandWriterBase { void setReleaseFences(int64_t display, const std::vector& layers, std::vector<::ndk::ScopedFileDescriptor> releaseFences) { - command::ReleaseFences releaseFencesCommand; + ReleaseFences releaseFencesCommand; releaseFencesCommand.display = display; for (int i = 0; i < layers.size(); i++) { if (releaseFences[i].get() >= 0) { - command::ReleaseFences::Layer layer; + ReleaseFences::Layer layer; layer.layer = layers[i]; layer.fence = std::move(releaseFences[i]); releaseFencesCommand.layers.emplace_back(std::move(layer)); @@ -150,7 +149,7 @@ class CommandWriterBase { void setClientTargetProperty(int64_t display, const ClientTargetProperty& clientTargetProperty, float whitePointNits) { - command::ClientTargetPropertyWithNits clientTargetPropertyWithNits; + ClientTargetPropertyWithNits clientTargetPropertyWithNits; clientTargetPropertyWithNits.display = display; clientTargetPropertyWithNits.clientTargetProperty = clientTargetProperty; clientTargetPropertyWithNits.whitePointNits = whitePointNits; @@ -158,7 +157,7 @@ class CommandWriterBase { } void setColorTransform(int64_t display, const float* matrix, ColorTransform hint) { - command::ColorTransformPayload colorTransformPayload; + ColorTransformPayload colorTransformPayload; colorTransformPayload.matrix.assign(matrix, matrix + 16); colorTransformPayload.hint = hint; getDisplayCommand(display).colorTransform.emplace(std::move(colorTransformPayload)); @@ -166,7 +165,7 @@ class CommandWriterBase { void setClientTarget(int64_t display, uint32_t slot, const native_handle_t* target, int acquireFence, Dataspace dataspace, const std::vector& damage) { - command::ClientTarget clientTargetCommand; + ClientTarget clientTargetCommand; clientTargetCommand.buffer = getBuffer(slot, target, acquireFence); clientTargetCommand.dataspace = dataspace; clientTargetCommand.damage.assign(damage.begin(), damage.end()); @@ -208,7 +207,7 @@ class CommandWriterBase { } void setLayerBlendMode(int64_t display, int64_t layer, BlendMode mode) { - command::ParcelableBlendMode parcelableBlendMode; + ParcelableBlendMode parcelableBlendMode; parcelableBlendMode.blendMode = mode; getLayerCommand(display, layer).blendMode.emplace(std::move(parcelableBlendMode)); } @@ -218,13 +217,13 @@ class CommandWriterBase { } void setLayerCompositionType(int64_t display, int64_t layer, Composition type) { - command::ParcelableComposition compositionPayload; + ParcelableComposition compositionPayload; compositionPayload.composition = type; getLayerCommand(display, layer).composition.emplace(std::move(compositionPayload)); } void setLayerDataspace(int64_t display, int64_t layer, Dataspace dataspace) { - command::ParcelableDataspace dataspacePayload; + ParcelableDataspace dataspacePayload; dataspacePayload.dataspace = dataspace; getLayerCommand(display, layer).dataspace.emplace(std::move(dataspacePayload)); } @@ -234,7 +233,7 @@ class CommandWriterBase { } void setLayerPlaneAlpha(int64_t display, int64_t layer, float alpha) { - command::PlaneAlpha planeAlpha; + PlaneAlpha planeAlpha; planeAlpha.alpha = alpha; getLayerCommand(display, layer).planeAlpha.emplace(std::move(planeAlpha)); } @@ -250,7 +249,7 @@ class CommandWriterBase { } void setLayerTransform(int64_t display, int64_t layer, Transform transform) { - command::ParcelableTransform transformPayload; + ParcelableTransform transformPayload; transformPayload.transform = transform; getLayerCommand(display, layer).transform.emplace(std::move(transformPayload)); } @@ -260,7 +259,7 @@ class CommandWriterBase { } void setLayerZOrder(int64_t display, int64_t layer, uint32_t z) { - command::ZOrder zorder; + ZOrder zorder; zorder.z = z; getLayerCommand(display, layer).z.emplace(std::move(zorder)); } @@ -287,7 +286,7 @@ class CommandWriterBase { void setLayerGenericMetadata(int64_t display, int64_t layer, const std::string& key, const bool mandatory, const std::vector& value) { - command::GenericMetadata metadata; + GenericMetadata metadata; metadata.key.name = key; metadata.key.mandatory = mandatory; metadata.value.assign(value.begin(), value.end()); @@ -296,60 +295,64 @@ class CommandWriterBase { void setLayerWhitePointNits(int64_t display, int64_t layer, float whitePointNits) { getLayerCommand(display, layer) - .whitePointNits.emplace(command::WhitePointNits{.nits = whitePointNits}); + .whitePointNits.emplace(WhitePointNits{.nits = whitePointNits}); } - const std::vector& getPendingCommands() { - if (mLayerCommand.has_value()) { - mCommands.emplace_back(std::move(*mLayerCommand)); - mLayerCommand.reset(); - } - if (mDisplayCommand.has_value()) { - mCommands.emplace_back(std::move(*mDisplayCommand)); - mDisplayCommand.reset(); - } + const std::vector& getPendingCommands() { + flushLayerCommand(); + flushDisplayCommand(); return mCommands; } - std::vector getPendingCommandResults() { + std::vector getPendingCommandResults() { return std::move(mCommandsResults); } protected: - command::Buffer getBuffer(int slot, const native_handle_t* bufferHandle, int fence) { - command::Buffer bufferCommand; + Buffer getBuffer(int slot, const native_handle_t* bufferHandle, int fence) { + Buffer bufferCommand; bufferCommand.slot = slot; if (bufferHandle) bufferCommand.handle.emplace(::android::dupToAidl(bufferHandle)); if (fence > 0) bufferCommand.fence = ::ndk::ScopedFileDescriptor(fence); return bufferCommand; } - std::optional mDisplayCommand; - std::optional mLayerCommand; - std::vector mCommands; - std::vector mCommandsResults; + std::optional mDisplayCommand; + std::optional mLayerCommand; + std::vector mCommands; + std::vector mCommandsResults; private: - // std::vector mTemporaryHandles; + void flushLayerCommand() { + if (mLayerCommand.has_value()) { + mDisplayCommand->layers.emplace_back(std::move(*mLayerCommand)); + mLayerCommand.reset(); + } + } - command::DisplayCommand& getDisplayCommand(int64_t display) { + void flushDisplayCommand() { + if (mDisplayCommand.has_value()) { + mCommands.emplace_back(std::move(*mDisplayCommand)); + mDisplayCommand.reset(); + } + } + + DisplayCommand& getDisplayCommand(int64_t display) { if (!mDisplayCommand.has_value() || mDisplayCommand->display != display) { - if (mDisplayCommand.has_value()) mCommands.emplace_back(std::move(*mDisplayCommand)); + flushLayerCommand(); + flushDisplayCommand(); mDisplayCommand.emplace(); mDisplayCommand->display = display; - return *mDisplayCommand; } return *mDisplayCommand; } - command::LayerCommand& getLayerCommand(int64_t display, int64_t layer) { - if (!mLayerCommand.has_value() || mLayerCommand->display != display || - mLayerCommand->layer != layer) { - if (mLayerCommand.has_value()) mCommands.emplace_back(std::move(*mLayerCommand)); + LayerCommand& getLayerCommand(int64_t display, int64_t layer) { + getDisplayCommand(display); + if (!mLayerCommand.has_value() || mLayerCommand->layer != layer) { + flushLayerCommand(); mLayerCommand.emplace(); - mLayerCommand->display = display; mLayerCommand->layer = layer; - return *mLayerCommand; } return *mLayerCommand; } @@ -361,45 +364,41 @@ class CommandReaderBase { // Parse and execute commands from the command queue. The commands are // actually return values from the server and will be saved in ReturnData. - void parse(const std::vector& results) { + void parse(const std::vector& results) { resetData(); for (const auto& result : results) { switch (result.getTag()) { - case command::CommandResultPayload::Tag::error: - parseSetError(result.get()); + case CommandResultPayload::Tag::error: + parseSetError(result.get()); break; - case command::CommandResultPayload::Tag::changedCompositionType: + case CommandResultPayload::Tag::changedCompositionTypes: parseSetChangedCompositionTypes( - result.get< - command::CommandResultPayload::Tag::changedCompositionType>()); + result.get()); break; - case command::CommandResultPayload::Tag::displayRequest: + case CommandResultPayload::Tag::displayRequest: parseSetDisplayRequests( - result.get()); + result.get()); break; - case command::CommandResultPayload::Tag::presentFence: - parseSetPresentFence( - result.get()); + case CommandResultPayload::Tag::presentFence: + parseSetPresentFence(result.get()); break; - case command::CommandResultPayload::Tag::releaseFences: - parseSetReleaseFences( - result.get()); + case CommandResultPayload::Tag::releaseFences: + parseSetReleaseFences(result.get()); break; - case command::CommandResultPayload::Tag::presentOrValidateResult: + case CommandResultPayload::Tag::presentOrValidateResult: parseSetPresentOrValidateDisplayResult( - result.get< - command::CommandResultPayload::Tag::presentOrValidateResult>()); + result.get()); break; - case command::CommandResultPayload::Tag::clientTargetProperty: + case CommandResultPayload::Tag::clientTargetProperty: parseSetClientTargetProperty( - result.get()); + result.get()); break; } } } - std::vector takeErrors() { return std::move(mErrors); } + std::vector takeErrors() { return std::move(mErrors); } bool hasChanges(int64_t display, uint32_t* outNumChangedCompositionTypes, uint32_t* outNumLayerRequestMasks) const { @@ -530,10 +529,9 @@ class CommandReaderBase { mReturnData.clear(); } - void parseSetError(const command::Error& error) { mErrors.emplace_back(error); } + void parseSetError(const CommandError& error) { mErrors.emplace_back(error); } - void parseSetChangedCompositionTypes( - const command::ChangedCompositionTypes& changedCompositionTypes) { + void parseSetChangedCompositionTypes(const ChangedCompositionTypes& changedCompositionTypes) { auto& data = mReturnData[changedCompositionTypes.display]; data.changedLayers.reserve(changedCompositionTypes.layers.size()); @@ -544,7 +542,7 @@ class CommandReaderBase { } } - void parseSetDisplayRequests(const command::DisplayRequest& displayRequest) { + void parseSetDisplayRequests(const DisplayRequest& displayRequest) { auto& data = mReturnData[displayRequest.display]; data.displayRequests = displayRequest.mask; @@ -556,7 +554,7 @@ class CommandReaderBase { } } - void parseSetPresentFence(const command::PresentFence& presentFence) { + void parseSetPresentFence(const PresentFence& presentFence) { auto& data = mReturnData[presentFence.display]; if (data.presentFence >= 0) { close(data.presentFence); @@ -564,7 +562,7 @@ class CommandReaderBase { data.presentFence = dup(presentFence.fence.get()); } - void parseSetReleaseFences(const command::ReleaseFences& releaseFences) { + void parseSetReleaseFences(const ReleaseFences& releaseFences) { auto& data = mReturnData[releaseFences.display]; data.releasedLayers.reserve(releaseFences.layers.size()); data.releaseFences.reserve(releaseFences.layers.size()); @@ -574,15 +572,13 @@ class CommandReaderBase { } } - void parseSetPresentOrValidateDisplayResult( - const command::PresentOrValidate& presentOrValidate) { + void parseSetPresentOrValidateDisplayResult(const PresentOrValidate& presentOrValidate) { auto& data = mReturnData[presentOrValidate.display]; data.presentOrValidateState = - presentOrValidate.result == command::PresentOrValidate::Result::Presented ? 1 : 0; + presentOrValidate.result == PresentOrValidate::Result::Presented ? 1 : 0; } - void parseSetClientTargetProperty( - const command::ClientTargetPropertyWithNits& clientTargetProperty) { + void parseSetClientTargetProperty(const ClientTargetPropertyWithNits& clientTargetProperty) { auto& data = mReturnData[clientTargetProperty.display]; data.clientTargetProperty.pixelFormat = clientTargetProperty.clientTargetProperty.pixelFormat; @@ -611,7 +607,7 @@ class CommandReaderBase { float clientTargetWhitePointNits = -1.f; }; - std::vector mErrors; + std::vector mErrors; std::unordered_map mReturnData; };