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

Commit fd216ae3 authored by Chia-I Wu's avatar Chia-I Wu Committed by android-build-merger
Browse files

surfaceflinger: silence misleading virtual display errors

am: 99b4619c

Change-Id: I0249b419b7f67b666f5276a6a168f59a577e570e
parents d12393e5 99b4619c
Loading
Loading
Loading
Loading
+13 −6
Original line number Diff line number Diff line
@@ -2180,11 +2180,15 @@ void SurfaceFlinger::postFramebuffer()
        displayDevice->onSwapBuffersCompleted();
        displayDevice->makeCurrent();
        for (auto& layer : displayDevice->getVisibleLayersSortedByZ()) {
            sp<Fence> releaseFence = Fence::NO_FENCE;

            // The layer buffer from the previous frame (if any) is released
            // by HWC only when the release fence from this frame (if any) is
            // signaled.  Always get the release fence from HWC first.
            auto hwcLayer = layer->getHwcLayer(hwcId);
            sp<Fence> releaseFence = getBE().mHwc->getLayerReleaseFence(hwcId, hwcLayer);
            if (hwcId >= 0) {
                releaseFence = getBE().mHwc->getLayerReleaseFence(hwcId, hwcLayer);
            }

            // If the layer was client composited in the previous frame, we
            // need to merge with the previous client target acquire fence.
@@ -2331,8 +2335,10 @@ sp<DisplayDevice> SurfaceFlinger::setupNewDisplayDeviceInternal(
        const sp<DisplaySurface>& dispSurface, const sp<IGraphicBufferProducer>& producer) {
    bool hasWideColorGamut = false;
    std::unordered_map<ColorMode, std::vector<RenderIntent>> hwcColorModes;
    HdrCapabilities hdrCapabilities;
    int32_t supportedPerFrameMetadata = 0;

    if (hasWideColorDisplay) {
    if (hasWideColorDisplay && hwcId >= 0) {
        std::vector<ColorMode> modes = getHwComposer().getColorModes(hwcId);
        for (ColorMode colorMode : modes) {
            switch (colorMode) {
@@ -2351,8 +2357,10 @@ sp<DisplayDevice> SurfaceFlinger::setupNewDisplayDeviceInternal(
        }
    }

    HdrCapabilities hdrCapabilities;
    if (hwcId >= 0) {
        getHwComposer().getHdrCapabilities(hwcId, &hdrCapabilities);
        supportedPerFrameMetadata = getHwComposer().getSupportedPerFrameMetadata(hwcId);
    }

    auto nativeWindowSurface = mCreateNativeWindowSurface(producer);
    auto nativeWindow = nativeWindowSurface->getNativeWindow();
@@ -2386,8 +2394,7 @@ sp<DisplayDevice> SurfaceFlinger::setupNewDisplayDeviceInternal(
            new DisplayDevice(this, state.type, hwcId, state.isSecure, display, nativeWindow,
                              dispSurface, std::move(renderSurface), displayWidth, displayHeight,
                              hasWideColorGamut, hdrCapabilities,
                              getHwComposer().getSupportedPerFrameMetadata(hwcId),
                              hwcColorModes, initialPowerMode);
                              supportedPerFrameMetadata, hwcColorModes, initialPowerMode);

    if (maxFrameBufferAcquiredBuffers >= 3) {
        nativeWindowSurface->preallocateBuffers();
+1 −2
Original line number Diff line number Diff line
@@ -658,8 +658,7 @@ using NonHwcVirtualDisplayCase =
using SimpleHwcVirtualDisplayVariant = HwcVirtualDisplayVariant<1024, 768, Secure::TRUE>;
using HwcVirtualDisplayCase =
        Case<SimpleHwcVirtualDisplayVariant, WideColorSupportNotConfiguredVariant,
             HdrNotSupportedVariant<SimpleHwcVirtualDisplayVariant>,
             NoPerFrameMetadataSupportVariant<SimpleHwcVirtualDisplayVariant>>;
             NonHwcDisplayHdrSupportVariant, NonHwcPerFrameMetadataSupportVariant>;
using WideColorP3ColorimetricDisplayCase =
        Case<PrimaryDisplayVariant, WideColorP3ColorimetricSupportedVariant<PrimaryDisplayVariant>,
             HdrNotSupportedVariant<PrimaryDisplayVariant>,