OSDN Git Service

surfaceflinger: Clean up use of QC extended API
authorSteve Kondik <steve@cyngn.com>
Mon, 12 Oct 2015 23:44:11 +0000 (13:44 -1000)
committerSteve Kondik <steve@cyngn.com>
Sun, 4 Sep 2016 06:40:32 +0000 (23:40 -0700)
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 0c5f3af, 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

include/gui/ISurfaceComposer.h
services/surfaceflinger/Android.mk
services/surfaceflinger/DisplayHardware/VirtualDisplaySurface.h
services/surfaceflinger/DisplayUtils.cpp
services/surfaceflinger/Layer.cpp
services/surfaceflinger/Layer.h
services/surfaceflinger/SurfaceFlinger.h

index 29f491f..962a033 100644 (file)
@@ -59,9 +59,11 @@ public:
     };
 
     enum {
-        eDisplayIdMain     = 0,
-        eDisplayIdHdmi     = 1,
+        eDisplayIdMain = 0,
+        eDisplayIdHdmi = 1,
+#ifdef QTI_BSP
         eDisplayIdTertiary = 2
+#endif
     };
 
     enum Rotation {
index a3bd661..2594e79 100644 (file)
@@ -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
-    LOCAL_SHARED_LIBRARIES += libqdutils
-    LOCAL_CFLAGS += -DQTI_BSP
   endif
+  LOCAL_SHARED_LIBRARIES += libqdutils
+  LOCAL_SHARED_LIBRARIES += libqdMetaData
+  LOCAL_CFLAGS += -DQTI_BSP
+  LOCAL_SRC_FILES += \
+    ExSurfaceFlinger/ExLayer.cpp \
+    ExSurfaceFlinger/ExSurfaceFlinger.cpp \
+    ExSurfaceFlinger/ExVirtualDisplaySurface.cpp \
+    ExSurfaceFlinger/ExHWComposer.cpp
 endif
 
 LOCAL_MODULE := libsurfaceflinger
index fd6a621..03480ea 100644 (file)
@@ -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,
index 6f99d10..5dc4fa4 100644 (file)
 #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
index 7287cb7..1a6806a 100644 (file)
@@ -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 :
index 98eb929..653dede 100644 (file)
@@ -76,7 +76,9 @@ class Layer : public SurfaceFlingerConsumer::ContentsChangedListener {
     friend class LayerBlur;
 
 public:
+#ifdef QTI_BSP
     friend class ExLayer;
+#endif
     mutable bool contentDirty;
     // regions below are in window-manager space
     Region visibleRegion;
index d0deb6b..7afbf32 100644 (file)
@@ -88,7 +88,9 @@ class SurfaceFlinger : public BnSurfaceComposer,
                        private HWComposer::EventHandler
 {
 public:
+#ifdef QTI_BSP
     friend class ExSurfaceFlinger;
+#endif
 
     static char const* getServiceName() ANDROID_API {
         return "SurfaceFlinger";