mirror of
https://github.com/Evolution-X/hardware_interfaces
synced 2026-02-01 16:50:18 +00:00
Merge "composer: move LayerCommand to be part of DisplayCommand"
This commit is contained in:
@@ -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",
|
||||
|
||||
@@ -33,7 +33,6 @@ aidl_interface {
|
||||
},
|
||||
srcs: [
|
||||
"android/hardware/graphics/composer3/*.aidl",
|
||||
"android/hardware/graphics/composer3/command/*.aidl",
|
||||
],
|
||||
stability: "vintf",
|
||||
imports: [
|
||||
|
||||
@@ -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;
|
||||
@@ -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 <name>-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;
|
||||
}
|
||||
@@ -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 <name>-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;
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
@@ -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;
|
||||
@@ -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;
|
||||
@@ -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;
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
@@ -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;
|
||||
@@ -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
|
||||
@@ -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;
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
@@ -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;
|
||||
@@ -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;
|
||||
@@ -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;
|
||||
@@ -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;
|
||||
@@ -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;
|
||||
@@ -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;
|
||||
@@ -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,
|
||||
@@ -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;
|
||||
@@ -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;
|
||||
@@ -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;
|
||||
@@ -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 <name>-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;
|
||||
}
|
||||
@@ -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 <name>-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;
|
||||
}
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package android.hardware.graphics.composer3.command;
|
||||
package android.hardware.graphics.composer3;
|
||||
|
||||
import android.hardware.common.NativeHandle;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
@@ -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 {
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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.
|
||||
*/
|
||||
@@ -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
|
||||
@@ -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.
|
||||
*
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package android.hardware.graphics.composer3.command;
|
||||
package android.hardware.graphics.composer3;
|
||||
|
||||
@VintfStability
|
||||
parcelable DisplayRequest {
|
||||
@@ -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;
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package android.hardware.graphics.composer3.command;
|
||||
package android.hardware.graphics.composer3;
|
||||
|
||||
@VintfStability
|
||||
parcelable PlaneAlpha {
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package android.hardware.graphics.composer3.command;
|
||||
package android.hardware.graphics.composer3;
|
||||
|
||||
@VintfStability
|
||||
parcelable PresentFence {
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package android.hardware.graphics.composer3.command;
|
||||
package android.hardware.graphics.composer3;
|
||||
|
||||
@VintfStability
|
||||
parcelable PresentOrValidate {
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package android.hardware.graphics.composer3.command;
|
||||
package android.hardware.graphics.composer3;
|
||||
|
||||
@VintfStability
|
||||
parcelable ReleaseFences {
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package android.hardware.graphics.composer3.command;
|
||||
package android.hardware.graphics.composer3;
|
||||
|
||||
@VintfStability
|
||||
parcelable WhitePointNits {
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package android.hardware.graphics.composer3.command;
|
||||
package android.hardware.graphics.composer3;
|
||||
|
||||
@VintfStability
|
||||
parcelable ZOrder {
|
||||
@@ -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;
|
||||
}
|
||||
@@ -74,7 +74,7 @@ static_assert(
|
||||
static_assert(aidl::android::hardware::graphics::composer3::Capability::SKIP_VALIDATE ==
|
||||
static_cast<aidl::android::hardware::graphics::composer3::Capability>(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<int>(::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<int>(::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<int>(::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<int>(::android::hardware::graphics::composer::V2_1::IComposerClient::
|
||||
DisplayRequest::WRITE_CLIENT_TARGET_TO_OUTPUT));
|
||||
|
||||
@@ -140,7 +140,7 @@ class GraphicsCompositionTestBase : public ::testing::Test {
|
||||
return;
|
||||
}
|
||||
|
||||
std::vector<command::CommandResultPayload> results;
|
||||
std::vector<CommandResultPayload> results;
|
||||
const auto status = mComposerClient->executeCommands(commands, &results);
|
||||
ASSERT_TRUE(status.isOk()) << "executeCommands failed " << status.getDescription();
|
||||
|
||||
|
||||
@@ -1168,7 +1168,7 @@ class GraphicsComposerAidlCommandTest : public GraphicsComposerAidlTest {
|
||||
return;
|
||||
}
|
||||
|
||||
std::vector<command::CommandResultPayload> results;
|
||||
std::vector<CommandResultPayload> results;
|
||||
const auto status = mComposerClient->executeCommands(commands, &results);
|
||||
ASSERT_TRUE(status.isOk()) << "executeCommands failed " << status.getDescription();
|
||||
|
||||
|
||||
@@ -37,8 +37,8 @@
|
||||
#include <aidl/android/hardware/graphics/composer3/PerFrameMetadata.h>
|
||||
#include <aidl/android/hardware/graphics/composer3/PerFrameMetadataBlob.h>
|
||||
|
||||
#include <aidl/android/hardware/graphics/composer3/command/CommandPayload.h>
|
||||
#include <aidl/android/hardware/graphics/composer3/command/CommandResultPayload.h>
|
||||
#include <aidl/android/hardware/graphics/composer3/CommandResultPayload.h>
|
||||
#include <aidl/android/hardware/graphics/composer3/DisplayCommand.h>
|
||||
|
||||
#include <aidl/android/hardware/graphics/common/ColorTransform.h>
|
||||
#include <aidl/android/hardware/graphics/common/FRect.h>
|
||||
@@ -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<int64_t>& layers,
|
||||
const std::vector<Composition>& 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<int64_t>& layers,
|
||||
const std::vector<int32_t>& 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<int64_t>& 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<Rect>& 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<uint8_t>& 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<command::CommandPayload>& 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<DisplayCommand>& getPendingCommands() {
|
||||
flushLayerCommand();
|
||||
flushDisplayCommand();
|
||||
return mCommands;
|
||||
}
|
||||
|
||||
std::vector<command::CommandResultPayload> getPendingCommandResults() {
|
||||
std::vector<CommandResultPayload> 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<command::DisplayCommand> mDisplayCommand;
|
||||
std::optional<command::LayerCommand> mLayerCommand;
|
||||
std::vector<command::CommandPayload> mCommands;
|
||||
std::vector<command::CommandResultPayload> mCommandsResults;
|
||||
std::optional<DisplayCommand> mDisplayCommand;
|
||||
std::optional<LayerCommand> mLayerCommand;
|
||||
std::vector<DisplayCommand> mCommands;
|
||||
std::vector<CommandResultPayload> mCommandsResults;
|
||||
|
||||
private:
|
||||
// std::vector<native_handle_t*> 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<command::CommandResultPayload>& results) {
|
||||
void parse(const std::vector<CommandResultPayload>& results) {
|
||||
resetData();
|
||||
|
||||
for (const auto& result : results) {
|
||||
switch (result.getTag()) {
|
||||
case command::CommandResultPayload::Tag::error:
|
||||
parseSetError(result.get<command::CommandResultPayload::Tag::error>());
|
||||
case CommandResultPayload::Tag::error:
|
||||
parseSetError(result.get<CommandResultPayload::Tag::error>());
|
||||
break;
|
||||
case command::CommandResultPayload::Tag::changedCompositionType:
|
||||
case CommandResultPayload::Tag::changedCompositionTypes:
|
||||
parseSetChangedCompositionTypes(
|
||||
result.get<
|
||||
command::CommandResultPayload::Tag::changedCompositionType>());
|
||||
result.get<CommandResultPayload::Tag::changedCompositionTypes>());
|
||||
break;
|
||||
case command::CommandResultPayload::Tag::displayRequest:
|
||||
case CommandResultPayload::Tag::displayRequest:
|
||||
parseSetDisplayRequests(
|
||||
result.get<command::CommandResultPayload::Tag::displayRequest>());
|
||||
result.get<CommandResultPayload::Tag::displayRequest>());
|
||||
break;
|
||||
case command::CommandResultPayload::Tag::presentFence:
|
||||
parseSetPresentFence(
|
||||
result.get<command::CommandResultPayload::Tag::presentFence>());
|
||||
case CommandResultPayload::Tag::presentFence:
|
||||
parseSetPresentFence(result.get<CommandResultPayload::Tag::presentFence>());
|
||||
break;
|
||||
case command::CommandResultPayload::Tag::releaseFences:
|
||||
parseSetReleaseFences(
|
||||
result.get<command::CommandResultPayload::Tag::releaseFences>());
|
||||
case CommandResultPayload::Tag::releaseFences:
|
||||
parseSetReleaseFences(result.get<CommandResultPayload::Tag::releaseFences>());
|
||||
break;
|
||||
case command::CommandResultPayload::Tag::presentOrValidateResult:
|
||||
case CommandResultPayload::Tag::presentOrValidateResult:
|
||||
parseSetPresentOrValidateDisplayResult(
|
||||
result.get<
|
||||
command::CommandResultPayload::Tag::presentOrValidateResult>());
|
||||
result.get<CommandResultPayload::Tag::presentOrValidateResult>());
|
||||
break;
|
||||
case command::CommandResultPayload::Tag::clientTargetProperty:
|
||||
case CommandResultPayload::Tag::clientTargetProperty:
|
||||
parseSetClientTargetProperty(
|
||||
result.get<command::CommandResultPayload::Tag::clientTargetProperty>());
|
||||
result.get<CommandResultPayload::Tag::clientTargetProperty>());
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
std::vector<command::Error> takeErrors() { return std::move(mErrors); }
|
||||
std::vector<CommandError> 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<command::Error> mErrors;
|
||||
std::vector<CommandError> mErrors;
|
||||
std::unordered_map<int64_t, ReturnData> mReturnData;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user