diff options
| author | Mathias Agopian <mathias@google.com> | 2009-09-07 16:32:45 -0700 |
|---|---|---|
| committer | Mathias Agopian <mathias@google.com> | 2009-09-07 16:32:45 -0700 |
| commit | 9779b221e999583ff89e0dfc40e56398737adbb3 (patch) | |
| tree | 76b185d252b95b05e8d74e7a1644b843f8839725 /libs/surfaceflinger/DisplayHardware/DisplayHardware.cpp | |
| parent | a4eb91da03bd785bc91bed0d25a9efaa9baba1c1 (diff) | |
| download | frameworks_base-9779b221e999583ff89e0dfc40e56398737adbb3.zip frameworks_base-9779b221e999583ff89e0dfc40e56398737adbb3.tar.gz frameworks_base-9779b221e999583ff89e0dfc40e56398737adbb3.tar.bz2 | |
fix [2068105] implement queueBuffer/lockBuffer/dequeueBuffer properly
Rewrote SurfaceFlinger's buffer management from the ground-up.
The design now support an arbitrary number of buffers per surface, however the current implementation is limited to four. Currently only 2 buffers are used in practice.
The main new feature is to be able to dequeue all buffers at once (very important when there are only two).
A client can dequeue all buffers until there are none available, it can lock all buffers except the last one that is used for composition. The client will block then, until a new buffer is enqueued.
The current implementation requires that buffers are locked in the same order they are dequeued and enqueued in the same order they are locked. Only one buffer can be locked at a time.
eg. Allowed sequence: DQ, DQ, LOCK, Q, LOCK, Q
eg. Forbidden sequence: DQ, DQ, LOCK, LOCK, Q, Q
Diffstat (limited to 'libs/surfaceflinger/DisplayHardware/DisplayHardware.cpp')
| -rw-r--r-- | libs/surfaceflinger/DisplayHardware/DisplayHardware.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/libs/surfaceflinger/DisplayHardware/DisplayHardware.cpp b/libs/surfaceflinger/DisplayHardware/DisplayHardware.cpp index 3f607f6..651e7cf 100644 --- a/libs/surfaceflinger/DisplayHardware/DisplayHardware.cpp +++ b/libs/surfaceflinger/DisplayHardware/DisplayHardware.cpp @@ -46,22 +46,25 @@ using namespace android; static __attribute__((noinline)) void checkGLErrors() { - GLenum error = glGetError(); - if (error != GL_NO_ERROR) + do { + // there could be more than one error flag + GLenum error = glGetError(); + if (error == GL_NO_ERROR) + break; LOGE("GL error 0x%04x", int(error)); + } while(true); } static __attribute__((noinline)) void checkEGLErrors(const char* token) { EGLint error = eglGetError(); - // GLESonGL seems to be returning 0 when there is no errors? - if (error && error != EGL_SUCCESS) - LOGE("%s error 0x%04x (%s)", + if (error && error != EGL_SUCCESS) { + LOGE("%s: EGL error 0x%04x (%s)", token, int(error), EGLUtils::strerror(error)); + } } - /* * Initialize the display to the specified values. * @@ -158,7 +161,6 @@ void DisplayHardware::init(uint32_t dpy) */ surface = eglCreateWindowSurface(display, config, mNativeWindow.get(), NULL); - checkEGLErrors("eglCreateWindowSurface"); if (eglQuerySurface(display, surface, EGL_SWAP_BEHAVIOR, &dummy) == EGL_TRUE) { if (dummy == EGL_BUFFER_PRESERVED) { @@ -212,8 +214,6 @@ void DisplayHardware::init(uint32_t dpy) */ context = eglCreateContext(display, config, NULL, NULL); - //checkEGLErrors("eglCreateContext"); - /* * Gather OpenGL ES extensions |
