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

Commit c3b18f73 authored by Ricardo Cerqueira's avatar Ricardo Cerqueira Committed by Michael Bestas
Browse files

hax: Add back the SURFACE_SKIP_FIRST_DEQUEUE legacy EGL workaround

Set BOARD_EGL_SKIP_FIRST_DEQUEUE to use

Change-Id: I46257a7e9e6b6e093a5cb92eaaaef4bdd0435a12
parent 38deda9d
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: