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

Commit e3445e64 authored by Linux Build Service Account's avatar Linux Build Service Account
Browse files

Promotion of android-framework.lnx.2.0-00024.

CRs      Change ID                                   Subject
--------------------------------------------------------------------------------------------------------------
1094808   I68072f9a04042fd011c53ecddf9ca22c1507fa12   SurfaceFlinger: Avoid HDR layers going to GPU.

Change-Id: I3cbb3855435b0574b0cc16a587f3edde8f15f013
CRs-Fixed: 1094808
parents dc8e0de6 de60f590
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -162,6 +162,7 @@ ifeq ($(TARGET_USES_QCOM_BSP), true)
    LOCAL_SHARED_LIBRARIES += libqdutils
    LOCAL_SHARED_LIBRARIES += libqdMetaData
    LOCAL_CFLAGS += -DQTI_BSP
    LOCAL_CFLAGS += -DUSE_COLOR_METADATA
endif

LOCAL_MODULE := libsurfaceflinger
+27 −0
Original line number Diff line number Diff line
@@ -37,6 +37,7 @@
#ifdef QTI_BSP
#include <gralloc_priv.h>
#include <qdMetaData.h>
#include <color_metadata.h>
#include <hardware/display_defs.h>
#endif

@@ -162,6 +163,32 @@ bool ExLayer::isYuvLayer() const {
    return false;
}

bool ExLayer::isHDRLayer() const {
    const sp<GraphicBuffer>& activeBuffer(mActiveBuffer);
    if (activeBuffer != 0) {
#ifdef QTI_BSP
        ANativeWindowBuffer* buffer = activeBuffer->getNativeBuffer();
        if(buffer) {
            private_handle_t* hnd = static_cast<private_handle_t*>
                (const_cast<native_handle_t*>(buffer->handle));
            const MetaData_t *metaData = NULL;
            if (hnd) {
                metaData = reinterpret_cast<MetaData_t *>(hnd->base_metadata);
                if (metaData && (metaData->operation & COLOR_METADATA)) {
                    const ColorMetaData &colorData = metaData->color;
                    if (colorData.colorPrimaries == ColorPrimaries_BT2020 &&
                        (colorData.transfer == Transfer_SMPTE_ST2084 ||
                        colorData.transfer == Transfer_HLG)) {
                            return true;
                    }
                }
            }
        }
#endif
    }
    return false;
}

#ifndef USE_HWC2
void ExLayer::setPosition(const sp<const DisplayDevice>& hw,
                          HWComposer::HWCLayerInterface& layer, const State& state) {
+1 −0
Original line number Diff line number Diff line
@@ -51,6 +51,7 @@ public:
    virtual bool isIntOnly() const;
    virtual bool isSecureDisplay() const;
    virtual bool isYuvLayer() const;
    virtual bool isHDRLayer() const;
    virtual uint32_t getS3dFormat(const sp<const DisplayDevice>& hw) const;
    virtual void clearS3dFormat(const sp<const DisplayDevice>& hw) const;
#ifndef USE_HWC2
+7 −2
Original line number Diff line number Diff line
@@ -38,6 +38,12 @@
#include <utils/StopWatch.h>
#include <utils/Trace.h>

#ifdef QTI_BSP
#include <gralloc_priv.h>
#include <qdMetaData.h>
 #endif


#include <ui/GraphicBuffer.h>
#include <ui/PixelFormat.h>

@@ -942,8 +948,7 @@ void Layer::onDraw(const sp<const DisplayDevice>& hw, const Region& clip,
        // Go ahead and draw the buffer anyway; no matter what we do the screen
        // is probably going to have something visibly wrong.
    }

    bool blackOutLayer = isProtected() || (isSecure() && !hw->isSecure());
    bool blackOutLayer = isProtected() || (isSecure() && !hw->isSecure()) || isHDRLayer();

    RenderEngine& engine(mFlinger->getRenderEngine());

+1 −0
Original line number Diff line number Diff line
@@ -353,6 +353,7 @@ public:
    virtual bool isIntOnly() const { return false; }
    virtual bool isSecureDisplay() const { return false; }
    virtual bool isYuvLayer() const { return false; }
    virtual bool isHDRLayer() const { return false; }
#ifndef USE_HWC2
    virtual void setPosition(const sp<const DisplayDevice>& /*hw*/,
                             HWComposer::HWCLayerInterface& /*layer*/,