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

Commit df23af1b authored by Ricardo Cerqueira's avatar Ricardo Cerqueira
Browse files

hax: Split the exynos4/tegra legacy code paths

They hang up at different places, and require different fixes.
Tested on t3 and e4

Change-Id: I46257a7e9e6b6e093a5cb92eaaaef4bdd0435a12
parent d8c98bf7
Loading
Loading
Loading
Loading
+4 −0
Original line number Original line Diff line number Diff line
@@ -252,6 +252,10 @@ private:


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

#ifdef SURFACE_SKIP_FIRST_DEQUEUE
    bool                        mDequeuedOnce;
#endif
};
};


}; // namespace android
}; // namespace android
+3 −0
Original line number Original line Diff line number Diff line
@@ -45,6 +45,9 @@ endif


ifeq ($(BOARD_EGL_NEEDS_LEGACY_FB),true)
ifeq ($(BOARD_EGL_NEEDS_LEGACY_FB),true)
    LOCAL_CFLAGS += -DBOARD_EGL_NEEDS_LEGACY_FB
    LOCAL_CFLAGS += -DBOARD_EGL_NEEDS_LEGACY_FB
    ifneq ($(TARGET_BOARD_PLATFORM),exynos4)
        LOCAL_CFLAGS += -DSURFACE_SKIP_FIRST_DEQUEUE
    endif
endif
endif


LOCAL_MODULE:= libgui
LOCAL_MODULE:= libgui
+18 −5
Original line number Original line Diff line number Diff line
@@ -72,6 +72,9 @@ Surface::Surface(
    mTransformHint = 0;
    mTransformHint = 0;
    mConsumerRunningBehind = false;
    mConsumerRunningBehind = false;
    mConnectedToCpu = false;
    mConnectedToCpu = false;
#ifdef SURFACE_SKIP_FIRST_DEQUEUE
    mDequeuedOnce = false;
#endif
}
}


Surface::~Surface() {
Surface::~Surface() {
@@ -218,6 +221,9 @@ int Surface::dequeueBuffer(android_native_buffer_t** buffer,
    }
    }


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


@@ -306,6 +312,12 @@ int Surface::query(int what, int* value) const {
                }
                }
                break;
                break;
            case NATIVE_WINDOW_QUEUES_TO_WINDOW_COMPOSER: {
            case NATIVE_WINDOW_QUEUES_TO_WINDOW_COMPOSER: {
#ifdef SURFACE_SKIP_FIRST_DEQUEUE
                if (!mDequeuedOnce) {
                    *value = 0;
                } else
#endif
                {
                    sp<ISurfaceComposer> composer(
                    sp<ISurfaceComposer> composer(
                            ComposerService::getComposerService());
                            ComposerService::getComposerService());
                    if (composer->authenticateSurfaceTexture(mGraphicBufferProducer)) {
                    if (composer->authenticateSurfaceTexture(mGraphicBufferProducer)) {
@@ -313,6 +325,7 @@ int Surface::query(int what, int* value) const {
                    } else {
                    } else {
                        *value = 0;
                        *value = 0;
                    }
                    }
                }
                return NO_ERROR;
                return NO_ERROR;
            }
            }
            case NATIVE_WINDOW_CONCRETE_TYPE:
            case NATIVE_WINDOW_CONCRETE_TYPE:
+3 −0
Original line number Original line Diff line number Diff line
@@ -36,6 +36,9 @@ endif


ifeq ($(BOARD_EGL_NEEDS_LEGACY_FB),true)
ifeq ($(BOARD_EGL_NEEDS_LEGACY_FB),true)
	LOCAL_CFLAGS += -DBOARD_EGL_NEEDS_LEGACY_FB
	LOCAL_CFLAGS += -DBOARD_EGL_NEEDS_LEGACY_FB
        ifeq ($(TARGET_BOARD_PLATFORM),exynos4)
	    LOCAL_CFLAGS += -DEGL_NEEDS_FNW
        endif
endif
endif


ifneq ($(NUM_FRAMEBUFFER_SURFACE_BUFFERS),)
ifneq ($(NUM_FRAMEBUFFER_SURFACE_BUFFERS),)
+2 −2
Original line number Original line Diff line number Diff line
@@ -29,7 +29,7 @@


#include <gui/Surface.h>
#include <gui/Surface.h>


#ifdef BOARD_EGL_NEEDS_LEGACY_FB
#ifdef EGL_NEEDS_FNW
#include <ui/FramebufferNativeWindow.h>
#include <ui/FramebufferNativeWindow.h>
#endif
#endif


@@ -96,7 +96,7 @@ DisplayDevice::DisplayDevice(
      mOrientation()
      mOrientation()
{
{
    mNativeWindow = new Surface(mDisplaySurface->getIGraphicBufferProducer());
    mNativeWindow = new Surface(mDisplaySurface->getIGraphicBufferProducer());
#ifndef BOARD_EGL_NEEDS_LEGACY_FB
#ifndef EGL_NEEDS_FNW
    ANativeWindow* const window = mNativeWindow.get();
    ANativeWindow* const window = mNativeWindow.get();
#else
#else
    ANativeWindow* const window = new FramebufferNativeWindow();
    ANativeWindow* const window = new FramebufferNativeWindow();