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

Commit 13f09bb5 authored by Ricardo Cerqueira's avatar Ricardo Cerqueira Committed by Gerrit Code Review
Browse files

Merge "hax: Add back the SURFACE_SKIP_FIRST_DEQUEUE legacy EGL workaround" into cm-11.0

parents 8604c8f1 c3b18f73
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -260,6 +260,10 @@ private:

    // must be accessed from lock/unlock thread only
    Region mDirtyRegion;

#ifdef SURFACE_SKIP_FIRST_DEQUEUE
    bool                        mDequeuedOnce;
#endif
};

}; // namespace android
+4 −0
Original line number Diff line number Diff line
@@ -49,6 +49,10 @@ endif
    LOCAL_CFLAGS += -DQCOM_BSP
endif

ifeq ($(BOARD_EGL_SKIP_FIRST_DEQUEUE),true)
    LOCAL_CFLAGS += -DSURFACE_SKIP_FIRST_DEQUEUE
endif

LOCAL_MODULE:= libgui

ifeq ($(TARGET_BOARD_PLATFORM), tegra)
+18 −5
Original line number Diff line number Diff line
@@ -79,6 +79,9 @@ Surface::Surface(
    mConnectedToCpu = false;
    mProducerControlledByApp = controlledByApp;
    mSwapIntervalZero = false;
#ifdef SURFACE_SKIP_FIRST_DEQUEUE
    mDequeuedOnce = false;
#endif
}

Surface::~Surface() {
@@ -229,6 +232,9 @@ int Surface::dequeueBuffer(android_native_buffer_t** buffer, int* fenceFd) {
    }

    *buffer = gbuf.get();
#ifdef SURFACE_SKIP_FIRST_DEQUEUE
    if (!mDequeuedOnce) mDequeuedOnce = true;
#endif
    return OK;
}

@@ -319,6 +325,12 @@ int Surface::query(int what, int* value) const {
                }
                break;
            case NATIVE_WINDOW_QUEUES_TO_WINDOW_COMPOSER: {
#ifdef SURFACE_SKIP_FIRST_DEQUEUE
                if (!mDequeuedOnce) {
                    *value = 0;
                } else
#endif
                {
                    sp<ISurfaceComposer> composer(
                            ComposerService::getComposerService());
                    if (composer->authenticateSurfaceTexture(mGraphicBufferProducer)) {
@@ -326,6 +338,7 @@ int Surface::query(int what, int* value) const {
                    } else {
                        *value = 0;
                    }
                }
                return NO_ERROR;
            }
            case NATIVE_WINDOW_CONCRETE_TYPE: