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

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

surfaceflinger: Add QCOM_HARDWARE ifdefs

Change-Id: I37e6600e316f9fa5dbf94db2c70faf602a70a85a
parent f9ab1f64
Loading
Loading
Loading
Loading
+2 −0
Original line number Original line Diff line number Diff line
@@ -56,7 +56,9 @@ public:
        DISPLAY_ID_INVALID = -1,
        DISPLAY_ID_INVALID = -1,
        DISPLAY_PRIMARY     = HWC_DISPLAY_PRIMARY,
        DISPLAY_PRIMARY     = HWC_DISPLAY_PRIMARY,
        DISPLAY_EXTERNAL    = HWC_DISPLAY_EXTERNAL,
        DISPLAY_EXTERNAL    = HWC_DISPLAY_EXTERNAL,
#ifdef QCOM_HARDWARE
        DISPLAY_VIRTUAL     = HWC_DISPLAY_VIRTUAL,
        DISPLAY_VIRTUAL     = HWC_DISPLAY_VIRTUAL,
#endif
        NUM_DISPLAY_TYPES   = HWC_NUM_DISPLAY_TYPES
        NUM_DISPLAY_TYPES   = HWC_NUM_DISPLAY_TYPES
    };
    };


+4 −0
Original line number Original line Diff line number Diff line
@@ -295,7 +295,11 @@ HWComposer::HWComposer(
                mNumDisplays = MAX_DISPLAYS;
                mNumDisplays = MAX_DISPLAYS;
            } else if (hwcHasApiVersion(mHwc, HWC_DEVICE_API_VERSION_1_1)) {
            } else if (hwcHasApiVersion(mHwc, HWC_DEVICE_API_VERSION_1_1)) {
                // 1.1 adds support for multiple displays
                // 1.1 adds support for multiple displays
#ifdef QCOM_HARDWARE
                mNumDisplays = MAX_DISPLAYS;
                mNumDisplays = MAX_DISPLAYS;
#else
                mNumDisplays = NUM_PHYSICAL_DISPLAYS;
#endif
            } else {
            } else {
                mNumDisplays = 1;
                mNumDisplays = 1;
            }
            }
+4 −0
Original line number Original line Diff line number Diff line
@@ -63,7 +63,11 @@ public:
    };
    };


    enum {
    enum {
#ifdef QCOM_HARDWARE
        MAX_DISPLAYS = HWC_NUM_DISPLAY_TYPES
        MAX_DISPLAYS = HWC_NUM_DISPLAY_TYPES
#else
        MAX_DISPLAYS = HWC_NUM_DISPLAY_TYPES + 1
#endif
    };
    };


    HWComposer(
    HWComposer(
+4 −0
Original line number Original line Diff line number Diff line
@@ -104,7 +104,11 @@ private:
    // protected by mLock
    // protected by mLock
    SortedVector< wp<Connection> > mDisplayEventConnections;
    SortedVector< wp<Connection> > mDisplayEventConnections;
    Vector< DisplayEventReceiver::Event > mPendingEvents;
    Vector< DisplayEventReceiver::Event > mPendingEvents;
#ifdef QCOM_HARDWARE
    DisplayEventReceiver::Event mVSyncEvent[HWC_NUM_DISPLAY_TYPES];
    DisplayEventReceiver::Event mVSyncEvent[HWC_NUM_DISPLAY_TYPES];
#else
    DisplayEventReceiver::Event mVSyncEvent[HWC_DISPLAY_TYPES_SUPPORTED];
#endif
    bool mUseSoftwareVSync;
    bool mUseSoftwareVSync;


    // for debugging
    // for debugging
+17 −5
Original line number Original line Diff line number Diff line
@@ -922,12 +922,18 @@ void SurfaceFlinger::rebuildLayerStacks() {
                for (size_t i=0 ; i<count ; i++) {
                for (size_t i=0 ; i<count ; i++) {
                    const sp<Layer>& layer(currentLayers[i]);
                    const sp<Layer>& layer(currentLayers[i]);
                    const Layer::State& s(layer->drawingState());
                    const Layer::State& s(layer->drawingState());
#ifndef QCOM_HARDWARE
                    if (s.layerStack == hw->getLayerStack()) {
#endif
                        Region drawRegion(tr.transform(
                        Region drawRegion(tr.transform(
                                layer->visibleNonTransparentRegion));
                                layer->visibleNonTransparentRegion));
                        drawRegion.andSelf(bounds);
                        drawRegion.andSelf(bounds);
                        if (!drawRegion.isEmpty()) {
                        if (!drawRegion.isEmpty()) {
                            layersSortedByZ.add(layer);
                            layersSortedByZ.add(layer);
                        }
                        }
#ifndef QCOM_HARDWARE
                    }
#endif
                }
                }
            }
            }
            hw->setVisibleLayersSortedByZ(layersSortedByZ);
            hw->setVisibleLayersSortedByZ(layersSortedByZ);
@@ -1079,6 +1085,7 @@ void SurfaceFlinger::handleTransaction(uint32_t transactionFlags)
    // here the transaction has been committed
    // here the transaction has been committed
}
}


#ifdef QCOM_HARDWARE
void SurfaceFlinger::setVirtualDisplayData(
void SurfaceFlinger::setVirtualDisplayData(
    int32_t hwcDisplayId,
    int32_t hwcDisplayId,
    const sp<IGraphicBufferProducer>& sink)
    const sp<IGraphicBufferProducer>& sink)
@@ -1098,6 +1105,7 @@ void SurfaceFlinger::setVirtualDisplayData(


    mHwc->setVirtualDisplayProperties(hwcDisplayId, w, h, format);
    mHwc->setVirtualDisplayProperties(hwcDisplayId, w, h, format);
}
}
#endif


void SurfaceFlinger::handleTransactionLocked(uint32_t transactionFlags)
void SurfaceFlinger::handleTransactionLocked(uint32_t transactionFlags)
{
{
@@ -1217,6 +1225,7 @@ void SurfaceFlinger::handleTransactionLocked(uint32_t transactionFlags)
                                    *mHwc, hwcDisplayId, state.surface,
                                    *mHwc, hwcDisplayId, state.surface,
                                    state.displayName);
                                    state.displayName);
                            } else {
                            } else {
#ifdef QCOM_HARDWARE
                                //Read virtual display properties and create a
                                //Read virtual display properties and create a
                                //rendering surface for it inorder to be handled
                                //rendering surface for it inorder to be handled
                                //by hwc.
                                //by hwc.
@@ -1224,6 +1233,7 @@ void SurfaceFlinger::handleTransactionLocked(uint32_t transactionFlags)
                                                                 state.surface);
                                                                 state.surface);
                                dispSurface = new FramebufferSurface(*mHwc,
                                dispSurface = new FramebufferSurface(*mHwc,
                                                                    state.type);
                                                                    state.type);
#endif
                            }
                            }
                        }
                        }
                    } else {
                    } else {
@@ -1427,11 +1437,13 @@ void SurfaceFlinger::computeVisibleRegions(size_t dpy,
        // Override layers created using presentation class by the layers having
        // Override layers created using presentation class by the layers having
        // ext_only flag enabled
        // ext_only flag enabled
        if(s.layerStack != layerStack && !bIgnoreLayers) {
        if(s.layerStack != layerStack && !bIgnoreLayers) {
#ifdef QCOM_HARDWARE
            // set the visible region as empty since we have removed the
            // set the visible region as empty since we have removed the
            // layerstack check in rebuildLayerStack() function.
            // layerstack check in rebuildLayerStack() function.
            Region visibleNonTransRegion;
            Region visibleNonTransRegion;
            visibleNonTransRegion.set(Rect(0,0));
            visibleNonTransRegion.set(Rect(0,0));
            layer->setVisibleNonTransparentRegion(visibleNonTransRegion);
            layer->setVisibleNonTransparentRegion(visibleNonTransRegion);
#endif
            continue;
            continue;
        }
        }
        /*
        /*
Loading