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

Commit 4f089f88 authored by Arun Kumar K.R's avatar Arun Kumar K.R Committed by Steve Kondik
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

Change-Id: I1cb44389a05c9ec049d7f0d39c288feccb11a91c
parent a0fc6cea
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -796,6 +796,11 @@ status_t HWComposer::prepare() {
                    if (l.compositionType == HWC_FRAMEBUFFER) {
                        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) {
                        disp.hasOvComp = true;
                    }
@@ -1325,6 +1330,7 @@ void HWComposer::dump(String8& result) const {
                            "HWC",
                            "BACKGROUND",
                            "FB TARGET",
                            "FB_BLIT",
                            "UNKNOWN"};
                    if (type >= NELEM(compositionTypeName))
                        type = NELEM(compositionTypeName) - 1;
+2 −1
Original line number Diff line number Diff line
@@ -444,7 +444,8 @@ void Layer::setAcquireFence(const sp<const DisplayDevice>& hw,
    // 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.

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