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

Commit ca0c1357 authored by Ricardo Cerqueira's avatar Ricardo Cerqueira Committed by Steve Kondik
Browse files

hax: Add back the SURFACE_SKIP_FIRST_DEQUEUE legacy EGL workaround

Set BOARD_EGL_SKIP_FIRST_DEQUEUE to use

Change-Id: Id362e4a557f4ad167cc4774160767813192d0815
parent 0cd43b1f
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -310,6 +310,11 @@ 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
@@ -55,6 +55,10 @@ ifeq ($(BOARD_USE_MHEAP_SCREENSHOT),true)
    LOCAL_CFLAGS += -DUSE_MHEAP_SCREENSHOT
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
@@ -89,6 +89,9 @@ Surface::Surface(
    mConnectedToCpu = false;
    mProducerControlledByApp = controlledByApp;
    mSwapIntervalZero = false;
#ifdef SURFACE_SKIP_FIRST_DEQUEUE
    mDequeuedOnce = false;
#endif
}

Surface::~Surface() {
@@ -278,6 +281,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;
}

@@ -389,6 +395,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)) {
@@ -396,6 +408,7 @@ int Surface::query(int what, int* value) const {
                    } else {
                        *value = 0;
                    }
                }
                return NO_ERROR;
            }
            case NATIVE_WINDOW_CONCRETE_TYPE: