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

Commit bb9ff7f5 authored by Sally Qi's avatar Sally Qi
Browse files

Temp fix for overdimming issue in silkFX.

- disable caching if hdr/sdr ratio > 1.01f, which we uses the extended
  brightness api.

Bug: 273624686
Test: play HDR video in silkFX and make sure no overdimming obeserved;
atest libcompositionengine_test

Change-Id: Iae53c5928e4f91b4b73f9e4ee9dd7bb052e86090
parent fa823a93
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -247,6 +247,10 @@ public:

    ui::Dataspace getDataspace() const { return mOutputDataspace.get(); }

    float getHdrSdrRatio() const {
        return getOutputLayer()->getLayerFE().getCompositionState()->currentSdrHdrRatio;
    };

    wp<GraphicBuffer> getBuffer() const { return mBuffer.get(); }

    bool isProtected() const { return mIsProtected.get(); }
+4 −0
Original line number Diff line number Diff line
@@ -378,6 +378,10 @@ bool CachedSet::hasUnsupportedDataspace() const {
            // to avoid flickering/color differences.
            return true;
        }
        // TODO(b/274804887): temp fix of overdimming issue, skip caching if hsdr/sdr ratio > 1.01f
        if (layer.getState()->getHdrSdrRatio() > 1.01f) {
            return true;
        }
        return false;
    });
}
+20 −0
Original line number Diff line number Diff line
@@ -662,6 +662,26 @@ TEST_F(CachedSetTest, holePunch_requiresNonBT601_625) {
    EXPECT_FALSE(cachedSet.requiresHolePunch());
}

TEST_F(CachedSetTest, holePunch_requiresNonHdrWithExtendedBrightness) {
    const auto dataspace = static_cast<ui::Dataspace>(ui::Dataspace::STANDARD_DCI_P3 |
                                                      ui::Dataspace::TRANSFER_SRGB |
                                                      ui::Dataspace::RANGE_EXTENDED);
    mTestLayers[0]->outputLayerCompositionState.dataspace = dataspace;
    mTestLayers[0]->layerFECompositionState.currentSdrHdrRatio = 5.f;
    mTestLayers[0]->layerState->update(&mTestLayers[0]->outputLayer);

    CachedSet::Layer& layer = *mTestLayers[0]->cachedSetLayer.get();
    auto& layerFECompositionState = mTestLayers[0]->layerFECompositionState;
    layerFECompositionState.buffer = sp<GraphicBuffer>::make();
    layerFECompositionState.blendMode = hal::BlendMode::NONE;
    sp<mock::LayerFE> layerFE = mTestLayers[0]->layerFE;

    CachedSet cachedSet(layer);
    EXPECT_CALL(*layerFE, hasRoundedCorners()).WillRepeatedly(Return(true));

    EXPECT_FALSE(cachedSet.requiresHolePunch());
}

TEST_F(CachedSetTest, holePunch_requiresNoBlending) {
    CachedSet::Layer& layer = *mTestLayers[0]->cachedSetLayer.get();
    auto& layerFECompositionState = mTestLayers[0]->layerFECompositionState;