diff options
Diffstat (limited to 'services/surfaceflinger/SurfaceFlinger.cpp')
-rw-r--r-- | services/surfaceflinger/SurfaceFlinger.cpp | 56 |
1 files changed, 14 insertions, 42 deletions
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp index d5a8d08..39f0f40 100644 --- a/services/surfaceflinger/SurfaceFlinger.cpp +++ b/services/surfaceflinger/SurfaceFlinger.cpp @@ -34,8 +34,6 @@ #include <binder/MemoryHeapBase.h> #include <binder/PermissionCache.h> -#include <gui/IDisplayEventConnection.h> - #include <utils/String8.h> #include <utils/String16.h> #include <utils/StopWatch.h> @@ -48,8 +46,6 @@ #include <GLES/gl.h> #include "clz.h" -#include "DisplayEventConnection.h" -#include "EventThread.h" #include "GLExtensions.h" #include "DdmConnection.h" #include "Layer.h" @@ -297,16 +293,12 @@ status_t SurfaceFlinger::readyToRun() // put the origin in the left-bottom corner glOrthof(0, w, 0, h, 0, 1); // l=0, r=w ; b=0, t=h - - // start the EventThread - mEventThread = new EventThread(this); + mReadyToRunBarrier.open(); /* * We're now ready to accept clients... */ - mReadyToRunBarrier.open(); - // start boot animation property_set("ctl.start", "bootanim"); @@ -327,22 +319,6 @@ void SurfaceFlinger::signalEvent() { mEventQueue.invalidate(); } -status_t SurfaceFlinger::postMessageAsync(const sp<MessageBase>& msg, - nsecs_t reltime, uint32_t flags) { - return mEventQueue.postMessage(msg, reltime); -} - -status_t SurfaceFlinger::postMessageSync(const sp<MessageBase>& msg, - nsecs_t reltime, uint32_t flags) { - status_t res = mEventQueue.postMessage(msg, reltime); - if (res == NO_ERROR) { - msg->wait(); - } - return res; -} - -// ---------------------------------------------------------------------------- - bool SurfaceFlinger::authenticateSurfaceTexture( const sp<ISurfaceTexture>& surfaceTexture) const { Mutex::Autolock _l(mStateLock); @@ -384,17 +360,20 @@ bool SurfaceFlinger::authenticateSurfaceTexture( return false; } -// ---------------------------------------------------------------------------- - -sp<IDisplayEventConnection> SurfaceFlinger::createDisplayEventConnection() { - sp<DisplayEventConnection> result(new DisplayEventConnection(this)); - mEventThread->registerDisplayEventConnection(result); - return result; +status_t SurfaceFlinger::postMessageAsync(const sp<MessageBase>& msg, + nsecs_t reltime, uint32_t flags) +{ + return mEventQueue.postMessage(msg, reltime, flags); } -void SurfaceFlinger::cleanupDisplayEventConnection( - const wp<DisplayEventConnection>& connection) { - mEventThread->unregisterDisplayEventConnection(connection); +status_t SurfaceFlinger::postMessageSync(const sp<MessageBase>& msg, + nsecs_t reltime, uint32_t flags) +{ + status_t res = mEventQueue.postMessage(msg, reltime, flags); + if (res == NO_ERROR) { + msg->wait(); + } + return res; } // ---------------------------------------------------------------------------- @@ -453,7 +432,7 @@ bool SurfaceFlinger::threadLoop() } else { // pretend we did the post hw.compositionComplete(); - hw.waitForVSync(); + usleep(16667); // 60 fps period } return true; } @@ -1593,16 +1572,9 @@ status_t SurfaceFlinger::dump(int fd, const Vector<String16>& args) } /* - * VSYNC state - */ - mEventThread->dump(result, buffer, SIZE); - - /* * Dump HWComposer state */ HWComposer& hwc(hw.getHwComposer()); - snprintf(buffer, SIZE, "h/w composer state:\n"); - result.append(buffer); snprintf(buffer, SIZE, " h/w composer %s and %s\n", hwc.initCheck()==NO_ERROR ? "present" : "not present", (mDebugDisableHWC || mDebugRegion) ? "disabled" : "enabled"); |