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

Commit 6cc484f5 authored by Sally Qi's avatar Sally Qi
Browse files

[Lut HAL] Move layer out of Lut interface.

- Also add setLayerLuts interface.

Bug: 329472100
Test: builds
Change-Id: I41c36fb5baf77e3a2d111eb32e289b91274eca2a
parent 690c0824
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -35,5 +35,9 @@ package android.hardware.graphics.composer3;
@VintfStability
parcelable DisplayLuts {
  long display;
  android.hardware.graphics.composer3.Lut[] luts;
  android.hardware.graphics.composer3.DisplayLuts.LayerLut[] layerLuts;
  parcelable LayerLut {
    long layer;
    android.hardware.graphics.composer3.Lut lut;
  }
}
+0 −1
Original line number Diff line number Diff line
@@ -34,7 +34,6 @@
package android.hardware.graphics.composer3;
@VintfStability
parcelable Lut {
  long layer;
  @nullable ParcelFileDescriptor pfd;
  android.hardware.graphics.composer3.LutProperties lutProperties;
}
+13 −5
Original line number Diff line number Diff line
@@ -27,12 +27,20 @@ import android.hardware.graphics.composer3.Lut;
@VintfStability
parcelable DisplayLuts {
    /**
     * The display which this commands refers to.
     * The display which the layerLuts list is for.
     */
    long display;

    parcelable LayerLut {
        /**
     * A Lut list specified by the HWC for given HDR layers that don't have Luts provided.
         * The layer that the HWC is requesting a LUT to be applied during GPU composition.
         */
    Lut[] luts;
        long layer;
        /**
         * A Lut specified by the HWC for given HDR layers that don't have Luts provided.
         */
        Lut lut;
    }

    LayerLut[] layerLuts;
}
+0 −5
Original line number Diff line number Diff line
@@ -27,11 +27,6 @@ import android.hardware.graphics.composer3.LutProperties;

@VintfStability
parcelable Lut {
    /**
     * The layer which this commands refer to.
     */
    long layer;

    /**
     * A handle to a memory region.
     * If the file descriptor is not set, this means that the HWC doesn't specify a Lut.
+8 −7
Original line number Diff line number Diff line
@@ -186,7 +186,7 @@ class ComposerClientReader {
    }

    // Get the lut(s) requested by hardware composer.
    std::vector<Lut> takeDisplayLuts(int64_t display) {
    std::vector<DisplayLuts::LayerLut> takeDisplayLuts(int64_t display) {
        LOG_ALWAYS_FATAL_IF(mDisplay && display != *mDisplay);
        auto found = mReturnData.find(display);

@@ -196,7 +196,7 @@ class ComposerClientReader {
        }

        ReturnData& data = found->second;
        return std::move(data.luts);
        return std::move(data.layerLuts);
    }

  private:
@@ -247,10 +247,11 @@ class ComposerClientReader {
    void parseSetDisplayLuts(DisplayLuts&& displayLuts) {
        LOG_ALWAYS_FATAL_IF(mDisplay && displayLuts.display != *mDisplay);
        auto& data = mReturnData[displayLuts.display];
        for (auto& lut : displayLuts.luts) {
            if (lut.pfd.get() >= 0) {
                data.luts.push_back({lut.layer, ndk::ScopedFileDescriptor(lut.pfd.release()),
                                     lut.lutProperties});
        for (auto& layerLut : displayLuts.layerLuts) {
            if (layerLut.lut.pfd.get() >= 0) {
                data.layerLuts.push_back(
                        {layerLut.layer, Lut{ndk::ScopedFileDescriptor(layerLut.lut.pfd.release()),
                                             layerLut.lut.lutProperties}});
            }
        }
    }
@@ -266,7 +267,7 @@ class ComposerClientReader {
                .clientTargetProperty = {common::PixelFormat::RGBA_8888, Dataspace::UNKNOWN},
                .brightness = 1.f,
        };
        std::vector<Lut> luts;
        std::vector<DisplayLuts::LayerLut> layerLuts;
    };

    std::vector<CommandError> mErrors;
Loading