Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5b2858b7 authored by Ady Abraham's avatar Ady Abraham Committed by Android (Google) Code Review
Browse files

Merge changes from topics "b_208879711", "hwc_present_time"

* changes:
  composer: DisplayCommand.colorTransform is just a matrix
  composer: pass expetcedPresentTime
parents fc6bf750 8de98858
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -33,7 +33,6 @@

package android.hardware.graphics.composer3;
@VintfStability
parcelable ColorTransformPayload {
  float[] matrix;
  android.hardware.graphics.common.ColorTransform hint;
parcelable ClockMonotonicTimestamp {
  long timestamp;
}
+2 −1
Original line number Diff line number Diff line
@@ -36,9 +36,10 @@ 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;
  boolean validateDisplay;
  boolean acceptDisplayChanges;
  boolean presentDisplay;
+5 −13
Original line number Diff line number Diff line
@@ -16,18 +16,10 @@

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.
 * Represents a nanoseconds timestamp in CLOCK_MONOTONIC.
 */
    ColorTransform hint;
@VintfStability
parcelable ClockMonotonicTimestamp {
    long timestamp;
}
+11 −7
Original line number Diff line number Diff line
@@ -18,7 +18,7 @@ package android.hardware.graphics.composer3;

import android.hardware.graphics.composer3.Buffer;
import android.hardware.graphics.composer3.ClientTarget;
import android.hardware.graphics.composer3.ColorTransformPayload;
import android.hardware.graphics.composer3.ClockMonotonicTimestamp;
import android.hardware.graphics.composer3.LayerCommand;

@VintfStability
@@ -38,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.
     *
@@ -70,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
@@ -114,6 +110,14 @@ parcelable DisplayCommand {
     */
    @nullable Buffer virtualDisplayOutputBuffer;

    /**
     * Sets the expected present time to present the current content on screen.
     * The implementation should try to present the display as close as possible
     * to the given expectedPresentTime. If expectedPresentTime is 0, the
     * implementation should present the display as soon as possible.
     */
    @nullable ClockMonotonicTimestamp expectedPresentTime;

    /**
     * Instructs the device to inspect all of the layer state and determine if
     * there are any composition type changes necessary before presenting the
+17 −17
Original line number Diff line number Diff line
@@ -258,7 +258,7 @@ TEST_P(GraphicsCompositionTest, SingleSolidColorLayer) {

        writeLayers(layers);
        ASSERT_TRUE(mReader.takeErrors().empty());
        mWriter.validateDisplay(mPrimaryDisplay);
        mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp);
        execute();
        // if hwc cannot handle and asks for composition change,
        // just succeed the test
@@ -317,7 +317,7 @@ TEST_P(GraphicsCompositionTest, SetLayerBuffer) {

        writeLayers(layers);
        ASSERT_TRUE(mReader.takeErrors().empty());
        mWriter.validateDisplay(mPrimaryDisplay);
        mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp);
        execute();

        std::vector<int64_t> changedCompositionLayers;
@@ -377,7 +377,7 @@ TEST_P(GraphicsCompositionTest, SetLayerBufferNoEffect) {
                                      mDisplayWidth, mDisplayHeight, mPixelFormat, mDataspace);
        ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());

        mWriter.validateDisplay(mPrimaryDisplay);
        mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp);
        execute();

        std::vector<int64_t> changedCompositionLayers;
@@ -492,7 +492,7 @@ TEST_P(GraphicsCompositionTest, ClientComposition) {
        ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());
        writeLayers(layers);
        ASSERT_TRUE(mReader.takeErrors().empty());
        mWriter.validateDisplay(mPrimaryDisplay);
        mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp);
        execute();

        std::vector<int64_t> changedCompositionLayers;
@@ -606,7 +606,7 @@ TEST_P(GraphicsCompositionTest, DeviceAndClientComposition) {
        clientLayer->setDisplayFrame(clientFrame);
        clientLayer->setZOrder(0);
        clientLayer->write(mWriter);
        mWriter.validateDisplay(mPrimaryDisplay);
        mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp);
        execute();

        std::vector<int64_t> changedCompositionLayers;
@@ -685,7 +685,7 @@ TEST_P(GraphicsCompositionTest, SetLayerDamage) {

        writeLayers(layers);
        ASSERT_TRUE(mReader.takeErrors().empty());
        mWriter.validateDisplay(mPrimaryDisplay);
        mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp);
        execute();
        std::vector<int64_t> changedCompositionLayers;
        std::vector<Composition> changedCompositionTypes;
@@ -715,7 +715,7 @@ TEST_P(GraphicsCompositionTest, SetLayerDamage) {

        writeLayers(layers);
        ASSERT_TRUE(mReader.takeErrors().empty());
        mWriter.validateDisplay(mPrimaryDisplay);
        mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp);
        execute();
        ASSERT_TRUE(mReader.takeErrors().empty());
        mReader.takeChangedCompositionTypes(mPrimaryDisplay, &changedCompositionLayers,
@@ -756,7 +756,7 @@ TEST_P(GraphicsCompositionTest, SetLayerPlaneAlpha) {

        writeLayers(layers);
        ASSERT_TRUE(mReader.takeErrors().empty());
        mWriter.validateDisplay(mPrimaryDisplay);
        mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp);
        execute();
        std::vector<int64_t> changedCompositionLayers;
        std::vector<Composition> changedCompositionTypes;
@@ -819,7 +819,7 @@ TEST_P(GraphicsCompositionTest, SetLayerSourceCrop) {
        ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());
        writeLayers(layers);
        ASSERT_TRUE(mReader.takeErrors().empty());
        mWriter.validateDisplay(mPrimaryDisplay);
        mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp);
        execute();
        std::vector<int64_t> changedCompositionLayers;
        std::vector<Composition> changedCompositionTypes;
@@ -877,7 +877,7 @@ TEST_P(GraphicsCompositionTest, SetLayerZOrder) {

        writeLayers(layers);
        ASSERT_TRUE(mReader.takeErrors().empty());
        mWriter.validateDisplay(mPrimaryDisplay);
        mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp);
        execute();
        std::vector<int64_t> changedCompositionLayers;
        std::vector<Composition> changedCompositionTypes;
@@ -902,7 +902,7 @@ TEST_P(GraphicsCompositionTest, SetLayerZOrder) {

        writeLayers(layers);
        ASSERT_TRUE(mReader.takeErrors().empty());
        mWriter.validateDisplay(mPrimaryDisplay);
        mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp);
        execute();
        mReader.takeChangedCompositionTypes(mPrimaryDisplay, &changedCompositionLayers,
                                            &changedCompositionTypes);
@@ -1027,7 +1027,7 @@ TEST_P(GraphicsBlendModeCompositionTest, None) {
        ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());
        writeLayers(mLayers);
        ASSERT_TRUE(mReader.takeErrors().empty());
        mWriter.validateDisplay(mPrimaryDisplay);
        mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp);
        execute();
        std::vector<int64_t> changedCompositionLayers;
        std::vector<Composition> changedCompositionTypes;
@@ -1072,7 +1072,7 @@ TEST_P(GraphicsBlendModeCompositionTest, Coverage) {
        ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());
        writeLayers(mLayers);
        ASSERT_TRUE(mReader.takeErrors().empty());
        mWriter.validateDisplay(mPrimaryDisplay);
        mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp);
        execute();
        std::vector<int64_t> changedCompositionLayers;
        std::vector<Composition> changedCompositionTypes;
@@ -1112,7 +1112,7 @@ TEST_P(GraphicsBlendModeCompositionTest, Premultiplied) {
        ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());
        writeLayers(mLayers);
        ASSERT_TRUE(mReader.takeErrors().empty());
        mWriter.validateDisplay(mPrimaryDisplay);
        mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp);
        execute();
        std::vector<int64_t> changedCompositionLayers;
        std::vector<Composition> changedCompositionTypes;
@@ -1195,7 +1195,7 @@ TEST_P(GraphicsTransformCompositionTest, FLIP_H) {

        writeLayers(mLayers);
        ASSERT_TRUE(mReader.takeErrors().empty());
        mWriter.validateDisplay(mPrimaryDisplay);
        mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp);
        execute();
        std::vector<int64_t> changedCompositionLayers;
        std::vector<Composition> changedCompositionTypes;
@@ -1241,7 +1241,7 @@ TEST_P(GraphicsTransformCompositionTest, FLIP_V) {

        writeLayers(mLayers);
        ASSERT_TRUE(mReader.takeErrors().empty());
        mWriter.validateDisplay(mPrimaryDisplay);
        mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp);
        execute();
        std::vector<int64_t> changedCompositionLayers;
        std::vector<Composition> changedCompositionTypes;
@@ -1287,7 +1287,7 @@ TEST_P(GraphicsTransformCompositionTest, ROT_180) {

        writeLayers(mLayers);
        ASSERT_TRUE(mReader.takeErrors().empty());
        mWriter.validateDisplay(mPrimaryDisplay);
        mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp);
        execute();
        std::vector<int64_t> layers;
        std::vector<Composition> types;
Loading