composer: DisplayCommand.colorTransform is just a matrix

Remove the hint from DisplayCommand.colorTransform as currently
we only use ColorTransform::IDENTITY and ColorTransform::ARBITRARY_MATRIX,
which both can be expressed using a matrix.

Bug: 208879711
Test: VTS
Change-Id: Ibb24593e3d0af5afdc8f3f79de2fc22eeccfcea8
This commit is contained in:
Ady Abraham
2021-12-21 14:04:33 -08:00
parent 72c5b503e5
commit 8de9885800
6 changed files with 9 additions and 86 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 ColorTransformPayload {
float[] matrix;
android.hardware.graphics.common.ColorTransform hint;
}

View File

@@ -36,7 +36,7 @@ package android.hardware.graphics.composer3;
parcelable DisplayCommand {
long display;
android.hardware.graphics.composer3.LayerCommand[] layers;
@nullable android.hardware.graphics.composer3.ColorTransformPayload colorTransform;
@nullable float[] colorTransformMatrix;
@nullable android.hardware.graphics.composer3.ClientTarget clientTarget;
@nullable android.hardware.graphics.composer3.Buffer virtualDisplayOutputBuffer;
@nullable android.hardware.graphics.composer3.ClockMonotonicTimestamp expectedPresentTime;

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.common.ColorTransform;
@VintfStability
parcelable ColorTransformPayload {
/**
* 4x4 transform matrix (16 floats) as described in DisplayCommand.colorTransform.
*/
float[] matrix;
/**
* Hint value which may be used instead of the given matrix unless it
* is ColorTransform.ARBITRARY.
*/
ColorTransform hint;
}

View File

@@ -19,7 +19,6 @@ package android.hardware.graphics.composer3;
import android.hardware.graphics.composer3.Buffer;
import android.hardware.graphics.composer3.ClientTarget;
import android.hardware.graphics.composer3.ClockMonotonicTimestamp;
import android.hardware.graphics.composer3.ColorTransformPayload;
import android.hardware.graphics.composer3.LayerCommand;
@VintfStability
@@ -39,11 +38,7 @@ parcelable DisplayCommand {
/**
* Sets a color transform which will be applied after composition.
*
* If hint is not ColorTransform.ARBITRARY, then the device may use the
* hint to apply the desired color transform instead of using the color
* matrix directly.
*
* If the device is not capable of either using the hint or the matrix to
* If the device is not capable of either using the matrix to
* apply the desired color transform, it must force all layers to client
* composition during VALIDATE_DISPLAY.
*
@@ -71,7 +66,7 @@ parcelable DisplayCommand {
* B_out = R_in * r.b + G_in * g.b + B_in * b.b + Tb
*
*/
@nullable ColorTransformPayload colorTransform;
@nullable float[] colorTransformMatrix;
/**
* Sets the buffer handle which will receive the output of client

View File

@@ -1503,7 +1503,7 @@ class GraphicsComposerAidlCommandTest : public GraphicsComposerAidlTest {
};
TEST_P(GraphicsComposerAidlCommandTest, SET_COLOR_TRANSFORM) {
mWriter.setColorTransform(mPrimaryDisplay, kIdentity.data(), ColorTransform::IDENTITY);
mWriter.setColorTransform(mPrimaryDisplay, kIdentity.data());
execute();
}

View File

@@ -75,11 +75,11 @@ class ComposerClientWriter {
mCommands.clear();
}
void setColorTransform(int64_t display, const float* matrix, ColorTransform hint) {
ColorTransformPayload colorTransformPayload;
colorTransformPayload.matrix.assign(matrix, matrix + 16);
colorTransformPayload.hint = hint;
getDisplayCommand(display).colorTransform.emplace(std::move(colorTransformPayload));
void setColorTransform(int64_t display, const float* matrix) {
std::vector<float> matVec;
matVec.reserve(16);
matVec.assign(matrix, matrix + 16);
getDisplayCommand(display).colorTransformMatrix.emplace(std::move(matVec));
}
void setClientTarget(int64_t display, uint32_t slot, const native_handle_t* target,