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

Commit 5111ff0b authored by Arun Kumar K.R's avatar Arun Kumar K.R Committed by Linux Build Service Account
Browse files

SurfaceFlinger: Change to support framebuffer flip for 2D blitters

- Surfaceflinger does not flip framebuffers when there are
  no layers marked for HWC_FRAMEBUFFER
- This change checks for the HWC_BLIT flag and will request a flip
  to a new FB_TARGET buffer even if there are no FRAMEBUFFER layers

Conflicts:
	services/surfaceflinger/DisplayHardware/HWComposer.cpp
	services/surfaceflinger/Layer.cpp

Change-Id: I1cb44389a05c9ec049d7f0d39c288feccb11a91c
parent 6c9568a2
Loading
Loading
Loading
Loading
+6 −0
Original line number Original line Diff line number Diff line
@@ -690,6 +690,11 @@ status_t HWComposer::prepare() {
                    if (l.compositionType == HWC_FRAMEBUFFER) {
                    if (l.compositionType == HWC_FRAMEBUFFER) {
                        disp.hasFbComp = true;
                        disp.hasFbComp = true;
                    }
                    }
                    // If the composition type is BLIT, we set this to
                    // trigger a FLIP
                    if(l.compositionType == HWC_BLIT) {
                        disp.hasFbComp = true;
                    }
                    if (l.compositionType == HWC_OVERLAY) {
                    if (l.compositionType == HWC_OVERLAY) {
                        disp.hasOvComp = true;
                        disp.hasOvComp = true;
                    }
                    }
@@ -1191,6 +1196,7 @@ void HWComposer::dump(String8& result) const {
                            "FB TARGET",
                            "FB TARGET",
                            "SIDEBAND",
                            "SIDEBAND",
                            "HWC_CURSOR",
                            "HWC_CURSOR",
                            "FB_BLIT",
                            "UNKNOWN"};
                            "UNKNOWN"};
                    if (type >= NELEM(compositionTypeName))
                    if (type >= NELEM(compositionTypeName))
                        type = NELEM(compositionTypeName) - 1;
                        type = NELEM(compositionTypeName) - 1;
+2 −1
Original line number Original line Diff line number Diff line
@@ -533,7 +533,8 @@ void Layer::setAcquireFence(const sp<const DisplayDevice>& /* hw */,
    // TODO: there is a possible optimization here: we only need to set the
    // TODO: there is a possible optimization here: we only need to set the
    // acquire fence the first time a new buffer is acquired on EACH display.
    // acquire fence the first time a new buffer is acquired on EACH display.


    if (layer.getCompositionType() == HWC_OVERLAY || layer.getCompositionType() == HWC_CURSOR_OVERLAY) {
    if (layer.getCompositionType() == HWC_OVERLAY || layer.getCompositionType() == HWC_CURSOR_OVERLAY ||
            layer.getCompositionType() == HWC_BLIT) {
        sp<Fence> fence = mSurfaceFlingerConsumer->getCurrentFence();
        sp<Fence> fence = mSurfaceFlingerConsumer->getCurrentFence();
        if (fence->isValid()) {
        if (fence->isValid()) {
            fenceFd = fence->dup();
            fenceFd = fence->dup();
+3 −0
Original line number Original line Diff line number Diff line
@@ -1902,6 +1902,9 @@ bool SurfaceFlinger::doComposeSurfaces(const sp<const DisplayDevice>& hw, const
                        layer->draw(hw, clip);
                        layer->draw(hw, clip);
                        break;
                        break;
                    }
                    }
                    case HWC_BLIT:
                        //Do nothing
                        break;
                    case HWC_FRAMEBUFFER_TARGET: {
                    case HWC_FRAMEBUFFER_TARGET: {
                        // this should not happen as the iterator shouldn't
                        // this should not happen as the iterator shouldn't
                        // let us get there.
                        // let us get there.