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

Commit 439cf857 authored by Mathias Agopian's avatar Mathias Agopian
Browse files

Fix build.

Revert "Add support for sending VSYNC events to the framework"

This reverts commit f3918c5bd4bc9f02f74da42995564150ca2dd382.

Change-Id: I998e3e1aa3fa310829ae973b64fe11b01f6f468f
parent 4a0994e4
Loading
Loading
Loading
Loading
+1 −9
Original line number Diff line number Diff line
@@ -33,9 +33,8 @@
namespace android {
// ----------------------------------------------------------------------------

class ComposerState;
class IDisplayEventConnection;
class IMemoryHeap;
class ComposerState;

class ISurfaceComposer : public IInterface
{
@@ -125,19 +124,13 @@ public:
            uint32_t reqWidth, uint32_t reqHeight,
            uint32_t minLayerZ, uint32_t maxLayerZ) = 0;

    /* triggers screen off animation */
    virtual status_t turnElectronBeamOff(int32_t mode) = 0;

    /* triggers screen on animation */
    virtual status_t turnElectronBeamOn(int32_t mode) = 0;

    /* verify that an ISurfaceTexture was created by SurfaceFlinger.
     */
    virtual bool authenticateSurfaceTexture(
            const sp<ISurfaceTexture>& surface) const = 0;

    /* return an IDisplayEventConnection */
    virtual sp<IDisplayEventConnection> createDisplayEventConnection() = 0;
};

// ----------------------------------------------------------------------------
@@ -158,7 +151,6 @@ public:
        TURN_ELECTRON_BEAM_OFF,
        TURN_ELECTRON_BEAM_ON,
        AUTHENTICATE_SURFACE,
        CREATE_DISPLAY_EVENT_CONNECTION,
    };

    virtual status_t    onTransact( uint32_t code,
+0 −2
Original line number Diff line number Diff line
@@ -3,8 +3,6 @@ include $(CLEAR_VARS)

LOCAL_SRC_FILES:= \
	BitTube.cpp \
	DisplayEventReceiver.cpp \
	IDisplayEventConnection.cpp \
	ISensorEventConnection.cpp \
	ISensorServer.cpp \
	ISurfaceTexture.cpp \
+0 −32
Original line number Diff line number Diff line
@@ -29,9 +29,6 @@

#include <surfaceflinger/ISurfaceComposer.h>

#include <gui/BitTube.h>
#include <gui/IDisplayEventConnection.h>

#include <ui/DisplayInfo.h>

#include <gui/ISurfaceTexture.h>
@@ -47,8 +44,6 @@

namespace android {

class IDisplayEventConnection;

class BpSurfaceComposer : public BpInterface<ISurfaceComposer>
{
public:
@@ -179,27 +174,6 @@ public:
        }
        return result != 0;
    }

    virtual sp<IDisplayEventConnection> createDisplayEventConnection()
    {
        Parcel data, reply;
        sp<IDisplayEventConnection> result;
        int err = data.writeInterfaceToken(
                ISurfaceComposer::getInterfaceDescriptor());
        if (err != NO_ERROR) {
            return result;
        }
        err = remote()->transact(
                BnSurfaceComposer::CREATE_DISPLAY_EVENT_CONNECTION,
                data, &reply);
        if (err != NO_ERROR) {
            LOGE("ISurfaceComposer::createDisplayEventConnection: error performing "
                    "transaction: %s (%d)", strerror(-err), -err);
            return result;
        }
        result = interface_cast<IDisplayEventConnection>(reply.readStrongBinder());
        return result;
    }
};

IMPLEMENT_META_INTERFACE(SurfaceComposer, "android.ui.ISurfaceComposer");
@@ -280,12 +254,6 @@ status_t BnSurfaceComposer::onTransact(
            int32_t result = authenticateSurfaceTexture(surfaceTexture) ? 1 : 0;
            reply->writeInt32(result);
        } break;
        case CREATE_DISPLAY_EVENT_CONNECTION: {
            CHECK_INTERFACE(ISurfaceComposer, data, reply);
            sp<IDisplayEventConnection> connection(createDisplayEventConnection());
            reply->writeStrongBinder(connection->asBinder());
            return NO_ERROR;
        } break;
        default:
            return BBinder::onTransact(code, data, reply, flags);
    }
+12 −15
Original line number Diff line number Diff line
@@ -2,7 +2,6 @@ LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)

LOCAL_SRC_FILES:= \
    EventThread.cpp                         \
    Layer.cpp 								\
    LayerBase.cpp 							\
    LayerDim.cpp 							\
@@ -11,8 +10,6 @@ LOCAL_SRC_FILES:= \
    DisplayHardware/DisplayHardware.cpp 	\
    DisplayHardware/DisplayHardwareBase.cpp \
    DisplayHardware/HWComposer.cpp 			\
    DisplayHardware/VSyncBarrier.cpp        \
    DisplayEventConnection.cpp              \
    GLExtensions.cpp 						\
    MessageQueue.cpp 						\
    SurfaceFlinger.cpp 						\
+0 −34
Original line number Diff line number Diff line
@@ -140,7 +140,6 @@ void DisplayHardware::init(uint32_t dpy)
    mDpiX = mNativeWindow->xdpi;
    mDpiY = mNativeWindow->ydpi;
    mRefreshRate = fbDev->fps;
    mNextFakeVSync = 0;


/* FIXME: this is a temporary HACK until we are able to report the refresh rate
@@ -153,8 +152,6 @@ void DisplayHardware::init(uint32_t dpy)
#warning "refresh rate set via makefile to REFRESH_RATE"
#endif

    mRefreshPeriod = nsecs_t(1e9 / mRefreshRate);

    EGLint w, h, dummy;
    EGLint numConfigs=0;
    EGLSurface surface;
@@ -349,37 +346,6 @@ uint32_t DisplayHardware::getPageFlipCount() const {
    return mPageFlipCount;
}

// this needs to be thread safe
nsecs_t DisplayHardware::waitForVSync() const {
    nsecs_t timestamp;
    if (mVSync.wait(&timestamp) < 0) {
        // vsync not supported!
        usleep( getDelayToNextVSyncUs(&timestamp) );
    }
    return timestamp;
}

int32_t DisplayHardware::getDelayToNextVSyncUs(nsecs_t* timestamp) const {
    Mutex::Autolock _l(mFakeVSyncMutex);
    const nsecs_t period = mRefreshPeriod;
    const nsecs_t now = systemTime(CLOCK_MONOTONIC);
    nsecs_t next_vsync = mNextFakeVSync;
    nsecs_t sleep = next_vsync - now;
    if (sleep < 0) {
        // we missed, find where the next vsync should be
        sleep = (period - ((now - next_vsync) % period));
        next_vsync = now + sleep;
    }
    mNextFakeVSync = next_vsync + period;
    timestamp[0] = next_vsync;

    // round to next microsecond
    int32_t sleep_us = (sleep + 999LL) / 1000LL;

    // guaranteed to be > 0
    return sleep_us;
}

status_t DisplayHardware::compositionComplete() const {
    return mNativeWindow->compositionComplete();
}
Loading