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

Commit f2ac155c authored by Steve Kondik's avatar Steve Kondik
Browse files

surfaceflinger: Clean up use of QC extended API

gui: only support tertiary display if QTI_BSP is defined

Non-caf display HALs crap out with this

surfaceflinger: Correct QTI_BSP ifdef

* Should be #ifdef, not #if

REF: CRACKLING-938

sf: Fix blending mode for legacy BSP

 * After 0c5f3af3, glitches when blending is observed on
   A family devices. Modify ifdef to not include QCOM_BSP_LEGACY.

surfaceflinger: Fix the fix of the opaque check fix

 * Use the right define.

Change-Id: I45deaffc0d5efd8ffa643120b0dea3aab461d70f
parent aee75f71
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -61,7 +61,9 @@ public:
    enum {
        eDisplayIdMain = 0,
        eDisplayIdHdmi = 1,
#ifdef QTI_BSP
        eDisplayIdTertiary = 2
#endif
    };

    enum Rotation {
+9 −7
Original line number Diff line number Diff line
@@ -38,11 +38,7 @@ LOCAL_SRC_FILES := \
    RenderEngine/GLES10RenderEngine.cpp \
    RenderEngine/GLES11RenderEngine.cpp \
    RenderEngine/GLES20RenderEngine.cpp \
    DisplayUtils.cpp \
    ExSurfaceFlinger/ExLayer.cpp \
    ExSurfaceFlinger/ExSurfaceFlinger.cpp \
    ExSurfaceFlinger/ExVirtualDisplaySurface.cpp \
    ExSurfaceFlinger/ExHWComposer.cpp
    DisplayUtils.cpp

LOCAL_C_INCLUDES := \
	frameworks/native/vulkan/include \
@@ -144,9 +140,15 @@ ifeq ($(TARGET_USES_QCOM_BSP), true)
  else
    LOCAL_C_INCLUDES += $(call project-path-for,qcom-display)/libgralloc
    LOCAL_C_INCLUDES += $(call project-path-for,qcom-display)/libqdutils
  endif
  LOCAL_SHARED_LIBRARIES += libqdutils
  LOCAL_SHARED_LIBRARIES += libqdMetaData
  LOCAL_CFLAGS += -DQTI_BSP
  endif
  LOCAL_SRC_FILES += \
    ExSurfaceFlinger/ExLayer.cpp \
    ExSurfaceFlinger/ExSurfaceFlinger.cpp \
    ExSurfaceFlinger/ExVirtualDisplaySurface.cpp \
    ExSurfaceFlinger/ExHWComposer.cpp
endif

LOCAL_MODULE := libsurfaceflinger
+2 −0
Original line number Diff line number Diff line
@@ -72,7 +72,9 @@ class VirtualDisplaySurface : public DisplaySurface,
                              public BnGraphicBufferProducer,
                              private ConsumerBase {
public:
#ifdef QTI_BSP
    friend class ExVirtualDisplaySurface;
#endif

    VirtualDisplaySurface(HWComposer& hwc, int32_t dispId,
            const sp<IGraphicBufferProducer>& sink,
+17 −12
Original line number Diff line number Diff line
@@ -40,16 +40,12 @@
#include "RenderEngine/RenderEngine.h"
#include "DisplayHardware/FramebufferSurface.h"
#include "DisplayUtils.h"
#if QTI_BSP
#include <ExSurfaceFlinger/ExSurfaceFlinger.h>
#include <ExSurfaceFlinger/ExLayer.h>
#include <ExSurfaceFlinger/ExHWComposer.h>
#include <ExSurfaceFlinger/ExVirtualDisplaySurface.h>
#include <dlfcn.h>
#if QTI_BSP
#include <gralloc_priv.h>
#endif

#if QTI_BSP
#include <gralloc_priv.h>
#endif

@@ -73,31 +69,34 @@ DisplayUtils* DisplayUtils::getInstance() {
}

SurfaceFlinger* DisplayUtils::getSFInstance() {
#ifdef QTI_BSP
    if(sUseExtendedImpls) {
        return new ExSurfaceFlinger();
    } else {
        return new SurfaceFlinger();
    }
#endif
    return new SurfaceFlinger();
}

Layer* DisplayUtils::getLayerInstance(SurfaceFlinger* flinger,
                            const sp<Client>& client, const String8& name,
                            uint32_t w, uint32_t h, uint32_t flags) {
#ifdef QTI_BSP
    if(sUseExtendedImpls) {
        return new ExLayer(flinger, client, name, w, h, flags);
    } else {
        return new Layer(flinger, client, name, w, h, flags);
    }
#endif
    return new Layer(flinger, client, name, w, h, flags);
}

HWComposer* DisplayUtils::getHWCInstance(
                        const sp<SurfaceFlinger>& flinger,
                        HWComposer::EventHandler& handler) {
#ifdef QTI_BSP
    if(sUseExtendedImpls) {
        return new ExHWComposer(flinger, handler);
    } else {
        return new HWComposer(flinger,handler);
    }
#endif
    return new HWComposer(flinger,handler);
}

void DisplayUtils::initVDSInstance(HWComposer* hwc, int32_t hwcDisplayId,
@@ -106,6 +105,7 @@ void DisplayUtils::initVDSInstance(HWComposer* hwc, int32_t hwcDisplayId,
        sp<IGraphicBufferConsumer> bqConsumer, String8 currentStateDisplayName,
        bool currentStateIsSecure, int currentStateType)
{
#ifdef QTI_BSP
    if(sUseExtendedImpls) {
        if(hwc->isVDSEnabled()) {
            VirtualDisplaySurface* vds = new ExVirtualDisplaySurface(*hwc, hwcDisplayId,
@@ -121,11 +121,16 @@ void DisplayUtils::initVDSInstance(HWComposer* hwc, int32_t hwcDisplayId,
            producer = vds;
        }
    } else {
#endif
        (void)currentStateIsSecure;
        (void)currentStateType;
        VirtualDisplaySurface* vds = new VirtualDisplaySurface(*hwc, hwcDisplayId,
                currentStateSurface, bqProducer, bqConsumer, currentStateDisplayName);
        dispSurface = vds;
        producer = vds;
#ifdef QTI_BSP
    }
#endif
}

bool DisplayUtils::createV4L2BasedVirtualDisplay(HWComposer* hwc, int32_t &hwcDisplayId,
@@ -173,7 +178,7 @@ bool DisplayUtils::canAllocateHwcDisplayIdForVDS(int usage) {
    property_get("debug.vds.allow_hwc", value, "0");
    int allowHwcForVDS = atoi(value);

#if QTI_BSP
#ifdef QTI_BSP
    // Do not allow hardware acceleration
    flag_mask = GRALLOC_USAGE_PRIVATE_WFD;
#endif
+1 −1
Original line number Diff line number Diff line
@@ -542,7 +542,7 @@ void Layer::setGeometry(
                " %s (%d)", mName.string(), to_string(blendMode).c_str(),
                to_string(error).c_str(), static_cast<int32_t>(error));
    }
#else
#elif defined(QTI_BSP) && !defined(QCOM_BSP_LEGACY)
    if (!isOpaque(s)) {
        layer.setBlending(mPremultipliedAlpha ?
                HWC_BLENDING_PREMULT :
Loading