Merge "Remove GenericMetadata from composer3"

This commit is contained in:
Ady Abraham
2021-12-23 00:28:11 +00:00
committed by Android (Google) Code Review
12 changed files with 0 additions and 232 deletions

View File

@@ -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;
@VintfStability
parcelable GenericMetadata {
android.hardware.graphics.composer3.LayerGenericMetadataKey key;
byte[] value;
}

View File

@@ -52,7 +52,6 @@ interface IComposerClient {
android.hardware.graphics.composer3.DisplayContentSample getDisplayedContentSample(long display, long maxFrames, long timestamp);
android.hardware.graphics.composer3.DisplayContentSamplingAttributes getDisplayedContentSamplingAttributes(long display);
android.hardware.graphics.composer3.HdrCapabilities getHdrCapabilities(long display);
android.hardware.graphics.composer3.LayerGenericMetadataKey[] getLayerGenericMetadataKeys();
int getMaxVirtualDisplayCount();
android.hardware.graphics.composer3.PerFrameMetadataKey[] getPerFrameMetadataKeys(long display);
android.hardware.graphics.composer3.ReadbackBufferAttributes getReadbackBufferAttributes(long display);

View File

@@ -52,7 +52,6 @@ parcelable LayerCommand {
@nullable android.hardware.graphics.composer3.ZOrder z;
@nullable float[] colorTransform;
@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;
}

View File

@@ -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;
@VintfStability
parcelable LayerGenericMetadataKey {
String name;
boolean mandatory;
}

View File

@@ -1,33 +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;
import android.hardware.graphics.composer3.LayerGenericMetadataKey;
@VintfStability
parcelable GenericMetadata {
/**
* Indicates which metadata value should be set.
*/
LayerGenericMetadataKey key;
/**
* The binary representation of a AIDL struct corresponding to
* the key as described above.
* TODO(b/209691612): revisit the use of byte[]
*/
byte[] value;
}

View File

@@ -30,7 +30,6 @@ import android.hardware.graphics.composer3.DisplayIdentification;
import android.hardware.graphics.composer3.FormatColorComponent;
import android.hardware.graphics.composer3.HdrCapabilities;
import android.hardware.graphics.composer3.IComposerCallback;
import android.hardware.graphics.composer3.LayerGenericMetadataKey;
import android.hardware.graphics.composer3.PerFrameMetadataKey;
import android.hardware.graphics.composer3.PowerMode;
import android.hardware.graphics.composer3.ReadbackBufferAttributes;
@@ -368,20 +367,6 @@ interface IComposerClient {
*/
HdrCapabilities getHdrCapabilities(long display);
/**
* Retrieves the set of keys that may be passed into setLayerGenericMetadata
*
* Key names must meet the following requirements:
* - Must be specified in reverse domain name notation
* - Must not start with 'com.android' or 'android'
* - Must be unique within the returned vector
* - Must correspond to a matching HIDL struct type, which defines the
* structure of its values. For example, the key 'com.example.V1-3.Foo'
* should correspond to a value of type com.example@1.3::Foo, which is
* defined in a vendor HAL extension
*/
LayerGenericMetadataKey[] getLayerGenericMetadataKeys();
/**
* Returns the maximum number of virtual displays supported by this device
* (which may be 0). The client must not attempt to create more than this

View File

@@ -23,7 +23,6 @@ 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;
@@ -246,33 +245,6 @@ parcelable LayerCommand {
*/
@nullable WhitePointNits whitePointNits;
/**
* Sets a piece of generic metadata for the given layer. If this
* function is called twice with the same key but different values, the
* newer value must override the older one. Calling this function with a
* 0-length value must reset that key's metadata as if it had not been
* set.
*
* A given piece of metadata may either be mandatory or a hint
* (non-mandatory) as indicated by the second parameter. Mandatory
* metadata may affect the composition result, which is to say that it
* may cause a visible change in the final image. By contrast, hints may
* only affect the composition strategy, such as which layers are
* composited by the client, but must not cause a visible change in the
* final image. The value of the mandatory flag shall match the value
* returned from getLayerGenericMetadataKeys for the given key.
*
* Only keys which have been returned from getLayerGenericMetadataKeys()
* shall be accepted. Any other keys must result in an UNSUPPORTED error.
*
* The value passed into this function shall be the binary
* representation of a stable AIDL type corresponding to the given key. For
* example, a key of 'com.example.Foo-V2' shall be paired with a
* value of type com.exampleFoo-V2, which would be defined in a
* vendor HAL extension.
*/
@nullable GenericMetadata genericMetadata;
/**
* Sets the PerFrameMetadata for the display. This metadata must be used
* by the implementation to better tone map content to that display.

View File

@@ -1,31 +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;
@VintfStability
parcelable LayerGenericMetadataKey {
/**
* Key names must comply with the requirements specified for
* getLayerGenericMetadataKeys below
*/
String name;
/**
* The mandatory flag is defined in the description of
* setLayerGenericMetadata above
*/
boolean mandatory;
}

View File

@@ -445,13 +445,4 @@ __attribute__((warn_unused_result)) bool translate(
return true;
}
__attribute__((warn_unused_result)) bool translate(
const ::android::hardware::graphics::composer::V2_4::IComposerClient::
LayerGenericMetadataKey& in,
aidl::android::hardware::graphics::composer3::LayerGenericMetadataKey* out) {
out->name = in.name;
out->mandatory = static_cast<bool>(in.mandatory);
return true;
}
} // namespace android::h2a

View File

@@ -841,28 +841,6 @@ TEST_P(GraphicsComposerAidlTest, setGameContentType) {
Test_setContentType(ContentType::GAME, "GAME");
}
TEST_P(GraphicsComposerAidlTest, getLayerGenericMetadataKeys) {
std::vector<LayerGenericMetadataKey> keys;
EXPECT_TRUE(mComposerClient->getLayerGenericMetadataKeys(&keys).isOk());
std::regex reverseDomainName("^[a-zA-Z-]{2,}(\\.[a-zA-Z0-9-]+)+$");
std::unordered_set<std::string> uniqueNames;
for (const auto& key : keys) {
std::string name(key.name);
// Keys must not start with 'android' or 'com.android'
EXPECT_FALSE(name.find("android") == 0);
EXPECT_FALSE(name.find("com.android") == 0);
// Keys must be in reverse domain name format
EXPECT_TRUE(std::regex_match(name, reverseDomainName));
// Keys must be unique within this list
const auto& [iter, inserted] = uniqueNames.insert(name);
EXPECT_TRUE(inserted);
}
}
TEST_P(GraphicsComposerAidlTest, CreateVirtualDisplay) {
int32_t maxVirtualDisplayCount;
EXPECT_TRUE(mComposerClient->getMaxVirtualDisplayCount(&maxVirtualDisplayCount).isOk());

View File

@@ -211,15 +211,6 @@ class ComposerClientWriter {
getLayerCommand(display, layer).floatColor.emplace(color);
}
void setLayerGenericMetadata(int64_t display, int64_t layer, const std::string& key,
const bool mandatory, const std::vector<uint8_t>& value) {
GenericMetadata metadata;
metadata.key.name = key;
metadata.key.mandatory = mandatory;
metadata.value.assign(value.begin(), value.end());
getLayerCommand(display, layer).genericMetadata.emplace(std::move(metadata));
}
void setLayerWhitePointNits(int64_t display, int64_t layer, float whitePointNits) {
getLayerCommand(display, layer)
.whitePointNits.emplace(WhitePointNits{.nits = whitePointNits});

View File

@@ -32,7 +32,6 @@
#include "aidl/android/hardware/graphics/composer3/FormatColorComponent.h"
#include "aidl/android/hardware/graphics/composer3/HandleIndex.h"
#include "aidl/android/hardware/graphics/composer3/IComposer.h"
#include "aidl/android/hardware/graphics/composer3/LayerGenericMetadataKey.h"
#include "aidl/android/hardware/graphics/composer3/PerFrameMetadata.h"
#include "aidl/android/hardware/graphics/composer3/PerFrameMetadataBlob.h"
#include "aidl/android/hardware/graphics/composer3/PerFrameMetadataKey.h"
@@ -79,9 +78,5 @@ __attribute__((warn_unused_result)) bool translate(
const ::android::hardware::graphics::composer::V2_4::IComposerClient::ClientTargetProperty&
in,
aidl::android::hardware::graphics::composer3::ClientTargetProperty* out);
__attribute__((warn_unused_result)) bool translate(
const ::android::hardware::graphics::composer::V2_4::IComposerClient::
LayerGenericMetadataKey& in,
aidl::android::hardware::graphics::composer3::LayerGenericMetadataKey* out);
} // namespace android::h2a