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

Commit 3141dc73 authored by Steve Kondik's avatar Steve Kondik Committed by Ethan Chen
Browse files

surfaceflinger: Clean up use of QC extended API

Change-Id: I1256605e63e90f3baaa213453246fb0e44e0c770
parent 0bef28f4
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -106,11 +106,10 @@ LOCAL_SHARED_LIBRARIES := \
    libgui \
    libpowermanager

LOCAL_WHOLE_STATIC_LIBRARIES += libexsurfaceflinger

LOCAL_C_INCLUDES += $(ANDROID_BUILD_TOP)/vendor/qcom/opensource/display-frameworks/native/services/surfaceflinger/

ifeq ($(TARGET_USES_QCOM_BSP), true)
    LOCAL_WHOLE_STATIC_LIBRARIES += libexsurfaceflinger
    LOCAL_C_INCLUDES += $(ANDROID_BUILD_TOP)/vendor/qcom/opensource/display-frameworks/native/services/surfaceflinger/
    LOCAL_C_INCLUDES += $(call project-path-for,qcom-display)/libgralloc
    LOCAL_C_INCLUDES += $(call project-path-for,qcom-display)/libqdutils
    LOCAL_SHARED_LIBRARIES += libqdutils
+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,
+18 −6
Original line number Diff line number Diff line
@@ -39,11 +39,14 @@
#include "RenderEngine/RenderEngine.h"
#include "DisplayHardware/FramebufferSurface.h"
#include "DisplayUtils.h"
#ifdef QTI_BSP
#include <ExSurfaceFlinger.h>
#include <ExLayer.h>
#include <DisplayHardware/ExHWComposer.h>
#include <DisplayHardware/ExVirtualDisplaySurface.h>
#endif
#include <dlfcn.h>
#include <cutils/properties.h>

namespace android {

@@ -64,31 +67,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,
@@ -97,6 +103,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,
@@ -112,11 +119,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,
+2 −0
Original line number Diff line number Diff line
@@ -71,7 +71,9 @@ class Layer : public SurfaceFlingerConsumer::ContentsChangedListener {
    static int32_t sSequence;

public:
#ifdef QTI_BSP
    friend class ExLayer;
#endif
    mutable bool contentDirty;
    // regions below are in window-manager space
    Region visibleRegion;
+2 −0
Original line number Diff line number Diff line
@@ -84,7 +84,9 @@ class SurfaceFlinger : public BnSurfaceComposer,
                       private HWComposer::EventHandler
{
public:
#ifdef QTI_BSP
    friend class ExSurfaceFlinger;
#endif

    static char const* getServiceName() ANDROID_API {
        return "SurfaceFlinger";