diff options
Diffstat (limited to 'opengl')
-rw-r--r-- | opengl/libagl/Android.mk | 2 | ||||
-rw-r--r-- | opengl/libagl/egl.cpp | 30 | ||||
-rw-r--r-- | opengl/libs/EGL/egl_display.cpp | 8 | ||||
-rw-r--r-- | opengl/libs/GLES_trace/src/gltrace_context.cpp | 10 | ||||
-rw-r--r-- | opengl/libs/GLES_trace/src/gltrace_context.h | 4 | ||||
-rw-r--r-- | opengl/libs/GLES_trace/src/gltrace_fixup.cpp | 11 | ||||
-rw-r--r-- | opengl/specs/EGL_ANDROID_fence_sync.txt | 213 | ||||
-rw-r--r-- | opengl/specs/README | 5 | ||||
-rw-r--r-- | opengl/tests/hwc/hwcColorEquiv.cpp | 10 | ||||
-rw-r--r-- | opengl/tests/hwc/hwcCommit.cpp | 6 | ||||
-rw-r--r-- | opengl/tests/hwc/hwcRects.cpp | 6 | ||||
-rw-r--r-- | opengl/tests/hwc/hwcStress.cpp | 8 | ||||
-rw-r--r-- | opengl/tests/hwc/hwcTestLib.cpp | 20 | ||||
-rw-r--r-- | opengl/tests/hwc/hwcTestLib.h | 12 |
14 files changed, 298 insertions, 47 deletions
diff --git a/opengl/libagl/Android.mk b/opengl/libagl/Android.mk index 15e58f2..639c4d7 100644 --- a/opengl/libagl/Android.mk +++ b/opengl/libagl/Android.mk @@ -26,7 +26,7 @@ LOCAL_CFLAGS += -DLOG_TAG=\"libagl\" LOCAL_CFLAGS += -DGL_GLEXT_PROTOTYPES -DEGL_EGLEXT_PROTOTYPES LOCAL_CFLAGS += -fvisibility=hidden -LOCAL_SHARED_LIBRARIES := libcutils libhardware libutils libpixelflinger libETC1 +LOCAL_SHARED_LIBRARIES := libcutils libhardware libutils libpixelflinger libETC1 libui LOCAL_LDLIBS := -lpthread -ldl ifeq ($(TARGET_ARCH),arm) diff --git a/opengl/libagl/egl.cpp b/opengl/libagl/egl.cpp index c31aebf..172ef95 100644 --- a/opengl/libagl/egl.cpp +++ b/opengl/libagl/egl.cpp @@ -31,6 +31,7 @@ #include <utils/threads.h> #include <ui/ANativeObjectBase.h> +#include <ui/Fence.h> #include <EGL/egl.h> #include <EGL/eglext.h> @@ -372,7 +373,16 @@ EGLBoolean egl_window_surface_v2_t::connect() GRALLOC_USAGE_SW_READ_OFTEN | GRALLOC_USAGE_SW_WRITE_OFTEN); // dequeue a buffer - if (nativeWindow->dequeueBuffer(nativeWindow, &buffer) != NO_ERROR) { + int fenceFd = -1; + if (nativeWindow->dequeueBuffer(nativeWindow, &buffer, + &fenceFd) != NO_ERROR) { + return setError(EGL_BAD_ALLOC, EGL_FALSE); + } + + // wait for the buffer + sp<Fence> fence(new Fence(fenceFd)); + if (fence->wait(Fence::TIMEOUT_NEVER) != NO_ERROR) { + nativeWindow->cancelBuffer(nativeWindow, buffer, fenceFd); return setError(EGL_BAD_ALLOC, EGL_FALSE); } @@ -392,8 +402,6 @@ EGLBoolean egl_window_surface_v2_t::connect() // keep a reference on the buffer buffer->common.incRef(&buffer->common); - // Lock the buffer - nativeWindow->lockBuffer(nativeWindow, buffer); // pin the buffer down if (lock(buffer, GRALLOC_USAGE_SW_READ_OFTEN | GRALLOC_USAGE_SW_WRITE_OFTEN, &bits) != NO_ERROR) { @@ -412,7 +420,7 @@ void egl_window_surface_v2_t::disconnect() unlock(buffer); } // enqueue the last frame - nativeWindow->queueBuffer(nativeWindow, buffer); + nativeWindow->queueBuffer(nativeWindow, buffer, -1); if (buffer) { buffer->common.decRef(&buffer->common); buffer = 0; @@ -517,15 +525,17 @@ EGLBoolean egl_window_surface_v2_t::swapBuffers() unlock(buffer); previousBuffer = buffer; - nativeWindow->queueBuffer(nativeWindow, buffer); + nativeWindow->queueBuffer(nativeWindow, buffer, -1); buffer = 0; // dequeue a new buffer - if (nativeWindow->dequeueBuffer(nativeWindow, &buffer) == NO_ERROR) { - - // TODO: lockBuffer should rather be executed when the very first - // direct rendering occurs. - nativeWindow->lockBuffer(nativeWindow, buffer); + int fenceFd = -1; + if (nativeWindow->dequeueBuffer(nativeWindow, &buffer, &fenceFd) == NO_ERROR) { + sp<Fence> fence(new Fence(fenceFd)); + if (fence->wait(Fence::TIMEOUT_NEVER)) { + nativeWindow->cancelBuffer(nativeWindow, buffer, fenceFd); + return setError(EGL_BAD_ALLOC, EGL_FALSE); + } // reallocate the depth-buffer if needed if ((width != buffer->width) || (height != buffer->height)) { diff --git a/opengl/libs/EGL/egl_display.cpp b/opengl/libs/EGL/egl_display.cpp index a46aa38..80072ab 100644 --- a/opengl/libs/EGL/egl_display.cpp +++ b/opengl/libs/EGL/egl_display.cpp @@ -263,7 +263,13 @@ EGLBoolean egl_display_t::terminate() { Mutex::Autolock _l(lock); if (refs == 0) { - return setError(EGL_NOT_INITIALIZED, EGL_FALSE); + /* + * From the EGL spec (3.2): + * "Termination of a display that has already been terminated, + * (...), is allowed, but the only effect of such a call is + * to return EGL_TRUE (...) + */ + return EGL_TRUE; } // this is specific to Android, display termination is ref-counted. diff --git a/opengl/libs/GLES_trace/src/gltrace_context.cpp b/opengl/libs/GLES_trace/src/gltrace_context.cpp index 45dbb43..91b291e 100644 --- a/opengl/libs/GLES_trace/src/gltrace_context.cpp +++ b/opengl/libs/GLES_trace/src/gltrace_context.cpp @@ -119,7 +119,7 @@ GLTraceContext *GLTraceState::createTraceContext(int version, EGLContext eglCont const size_t DEFAULT_BUFFER_SIZE = 8192; BufferedOutputStream *stream = new BufferedOutputStream(mStream, DEFAULT_BUFFER_SIZE); - GLTraceContext *traceContext = new GLTraceContext(id, this, stream); + GLTraceContext *traceContext = new GLTraceContext(id, version, this, stream); mPerContextState[eglContext] = traceContext; return traceContext; @@ -129,8 +129,10 @@ GLTraceContext *GLTraceState::getTraceContext(EGLContext c) { return mPerContextState[c]; } -GLTraceContext::GLTraceContext(int id, GLTraceState *state, BufferedOutputStream *stream) : +GLTraceContext::GLTraceContext(int id, int version, GLTraceState *state, + BufferedOutputStream *stream) : mId(id), + mVersion(version), mState(state), mBufferedOutputStream(stream), mElementArrayBuffers(DefaultKeyedVector<GLuint, ElementArrayBuffer*>(NULL)) @@ -143,6 +145,10 @@ int GLTraceContext::getId() { return mId; } +int GLTraceContext::getVersion() { + return mVersion; +} + GLTraceState *GLTraceContext::getGlobalTraceState() { return mState; } diff --git a/opengl/libs/GLES_trace/src/gltrace_context.h b/opengl/libs/GLES_trace/src/gltrace_context.h index 323cfdc..4c38bba 100644 --- a/opengl/libs/GLES_trace/src/gltrace_context.h +++ b/opengl/libs/GLES_trace/src/gltrace_context.h @@ -50,6 +50,7 @@ public: /** GL Trace Context info associated with each EGLContext */ class GLTraceContext { int mId; /* unique context id */ + int mVersion; /* GL version, e.g: egl_connection_t::GLESv2_INDEX */ GLTraceState *mState; /* parent GL Trace state (for per process GL Trace State Info) */ void *fbcontents; /* memory area to read framebuffer contents */ @@ -65,8 +66,9 @@ class GLTraceContext { public: gl_hooks_t *hooks; - GLTraceContext(int id, GLTraceState *state, BufferedOutputStream *stream); + GLTraceContext(int id, int version, GLTraceState *state, BufferedOutputStream *stream); int getId(); + int getVersion(); GLTraceState *getGlobalTraceState(); void getCompressedFB(void **fb, unsigned *fbsize, unsigned *fbwidth, unsigned *fbheight, diff --git a/opengl/libs/GLES_trace/src/gltrace_fixup.cpp b/opengl/libs/GLES_trace/src/gltrace_fixup.cpp index 3597b26..1bd790e 100644 --- a/opengl/libs/GLES_trace/src/gltrace_fixup.cpp +++ b/opengl/libs/GLES_trace/src/gltrace_fixup.cpp @@ -15,6 +15,7 @@ */ #include <cutils/log.h> +#include <EGL/egldefs.h> #include <GLES/gl.h> #include <GLES/glext.h> #include <GLES2/gl2.h> @@ -592,6 +593,11 @@ void trace_VertexAttribPointerData(GLTraceContext *context, } void trace_VertexAttribPointerDataForGlDrawArrays(GLTraceContext *context, GLMessage *glmsg) { + if (context->getVersion() == egl_connection_t::GLESv1_INDEX) { + // only supported for GLES2 and above + return; + } + /* void glDrawArrays(GLenum mode, GLint first, GLsizei count) */ GLsizei count = glmsg->args(2).intvalue(0); @@ -604,6 +610,11 @@ void trace_VertexAttribPointerDataForGlDrawArrays(GLTraceContext *context, GLMes void trace_VertexAttribPointerDataForGlDrawElements(GLTraceContext *context, GLMessage *glmsg, GLvoid *indices) { + if (context->getVersion() == egl_connection_t::GLESv1_INDEX) { + // only supported for GLES2 and above + return; + } + /* void glDrawElements(GLenum mode, GLsizei count, GLenum type, const GLvoid* indices) */ GLsizei count = glmsg->args(1).intvalue(0); GLenum type = glmsg->args(2).intvalue(0); diff --git a/opengl/specs/EGL_ANDROID_fence_sync.txt b/opengl/specs/EGL_ANDROID_fence_sync.txt new file mode 100644 index 0000000..bb618c9 --- /dev/null +++ b/opengl/specs/EGL_ANDROID_fence_sync.txt @@ -0,0 +1,213 @@ +Name + + ANDROID_fence_sync + +Name Strings + + EGL_ANDROID_fence_sync + +Contributors + + Jamie Gennis + +Contact + + Jamie Gennis, Google Inc. (jgennis 'at' google.com) + +Status + + Draft. + +Version + + Version 1, May 29, 2012 + +Number + + EGL Extension #XXX + +Dependencies + + Requires EGL 1.1 + + This extension is written against the wording of the EGL 1.2 Specification + + EGL_KHR_fence_sync is required. + +Overview + + This extension enables the creation of EGL fence sync objects that are + associated with an Android Sync HAL fence object. These EGL fence sync + objects have nearly identical semantics to those defined by the + KHR_fence_sync extension, except that they have an additional attribute + storing the file descriptor referring to the native Android fence object. + +New Types + + None. + +New Procedures and Functions + + None. + +New Tokens + + Accepted by the <type> parameter of eglCreateSyncKHR, and returned + in <value> when eglGetSyncAttribKHR is called with <attribute> + EGL_SYNC_TYPE_KHR: + + EGL_SYNC_ANDROID_FENCE_ANDROID 0x3144 + + Accepted by the <attribute> parameter of eglGetSyncAttribKHR: + + EGL_SYNC_FENCE_FD_ANDROID 0x3145 + + Returned in <value> when eglGetSyncAttribKHR is called with <attribute> + EGL_SYNC_CONDITION_KHR: + + EGL_SYNC_ANDROID_FENCE_SIGNALED_ANDROID 0x3146 + +Changes to Chapter 3 of the EGL 1.2 Specification (EGL Functions and Errors) + + Add the following after the sixth paragraph of Section 3.8.1 (Sync + Objects), added by KHR_fence_sync + + "If <type> is EGL_SYNC_ANDROID_FENCE_ANDROID, an EGL Android fence sync + object is created. In this case the EGL_SYNC_FENCE_FD_ANDROID attribute may + optionally be specified. If this attribute is specified, it must be set to + a file descriptor that refers to a native Android fence object. + + The default values for the EGL Android fence sync object attributes are as + follows: + + Attribute Name Initial Attribute Value(s) + --------------- -------------------------- + EGL_SYNC_TYPE_KHR EGL_SYNC_ANDROID_FENCE_ANDROID + EGL_SYNC_STATUS_KHR EGL_UNSIGNALED_KHR + EGL_SYNC_CONDITION_KHR EGL_SYNC_PRIOR_COMMANDS_COMPLETE_KHR + + Upon creation of an EGL Android fence sync object, the + EGL_SYNC_FENCE_FD_ANDROID attribute is set to a newly generated file + descriptor that refers to a native Android fence object. If the + EGL_SYNC_FENCE_FD_ANDROID attribute is specified in the eglCreateSyncKHR + call then the generated file descriptor refers to the same native Android + fence object as the file descriptor passed to eglCreateSyncKHR. Note, + however, that the value of the sync object attribute is *not* the same file + descriptor as the one passed to eglCreateSyncKHR - it simply refers to the + same underlying native Android fence object. Additionally, if the + EGL_SYNC_FENCE_FD_ANDROID attribute is specified then the + EGL_SYNC_CONDITION_KHR attribute is set to + EGL_SYNC_ANDROID_FENCE_SIGNALED_ANDROID and the EGL_SYNC_STATUS_KHR + attribute is set to reflect the signal status of the native Android fence + object." + + Modify Section 3.8.1 (Sync Objects), added by KHR_fence_sync, starting at + the seventh paragraph + + "When a fence sync object is created or when an EGL Android fence sync + object is created without specifying the EGL_SYNC_FENCE_FD_ANDROID + attribute, eglCreateSyncKHR also inserts a fence command into the command + stream of the bound client API's current context (i.e., the context + returned by eglGetCurrentContext), and associates it with the newly created + sync object. + + When the condition of the sync object is satisfied by the fence command, + the sync is signaled by the associated client API context, causing any + eglClientWaitSyncKHR commands (see below) blocking on <sync> to unblock. If + the sync object is an EGL Android fence sync object then the native Android + fence object is also signaled when the condition is satisfied. The + EGL_SYNC_PRIOR_COMMANDS_COMPLETE_KHR condition is satisfied by completion + of the fence command corresponding to the sync object and all preceding + commands in the associated client API context's command stream. The sync + object will not be signaled until all effects from these commands on the + client API's internal and framebuffer state are fully realized. No other + state is affected by execution of the fence command. + + The EGL_SYNC_ANDROID_FENCE_SIGNALED_ANDROID condition is satisfied by the + signaling of the native Android fence object. When this happens any + eglClientWaitSyncKHR commands blocking on <sync> unblock." + + Modify the list of eglCreateSyncKHR errors in Section 3.8.1 (Sync Objects), + added by KHR_fence_sync + + "Errors + ------ + + * If <dpy> is not the name of a valid, initialized EGLDisplay, + EGL_NO_SYNC_KHR is returned and an EGL_BAD_DISPLAY error is + generated. + * If <type> is EGL_SYNC_FENCE_KHR and <attrib_list> is neither NULL nor + empty (containing only EGL_NONE), EGL_NO_SYNC_KHR is returned and an + EGL_BAD_ATTRIBUTE error is generated. + * If <type> is EGL_SYNC_ANDROID_FENCE_ANDROID and <attrib_list> contains + an attribute other than EGL_SYNC_FENCE_FD_ANDROID, EGL_NO_SYNC_KHR is + returned and an EGL_BAD_ATTRIBUTE error is generated. + * If <type> is not a supported type of sync object, + EGL_NO_SYNC_KHR is returned and an EGL_BAD_ATTRIBUTE error is + generated. + * If <type> is EGL_SYNC_FENCE_KHR or EGL_SYNC_ANDROID_FENCE_ANDROID and + no context is current for the bound API (i.e., eglGetCurrentContext + returns EGL_NO_CONTEXT), EGL_NO_SYNC_KHR is returned and an + EGL_BAD_MATCH error is generated. + * If <type> is EGL_SYNC_FENCE_KHR or EGL_SYNC_ANDROID_FENCE_ANDROID and + <dpy> does not match the EGLDisplay of the currently bound context for + the currently bound client API (the EGLDisplay returned by + eglGetCurrentDisplay()) then EGL_NO_SYNC_KHR is returned and an + EGL_BAD_MATCH error is generated. + * If <type> is EGL_SYNC_FENCE_KHR or EGL_SYNC_ANDROID_FENCE_ANDROID and + the currently bound client API does not support the client API + extension indicating it can place fence commands, then EGL_NO_SYNC_KHR + is returned and an EGL_BAD_MATCH error is generated." + + Modify table 3.cc in Section 3.8.1 (Sync Objects), added by KHR_fence_sync + + " + Attribute Description Supported Sync Objects + ----------------- ----------------------- ---------------------- + EGL_SYNC_TYPE_KHR Type of the sync object All + EGL_SYNC_STATUS_KHR Status of the sync object All + EGL_SYNC_CONDITION_KHR Signaling condition EGL_SYNC_FENCE_KHR and + EGL_SYNC_ANDROID_FENCE_ANDROID only + EGL_SYNC_FENCE_FD_ANDROID Native Android fence EGL_SYNC_ANDROID_FENCE_ANDROID only + object file descriptor + " + + Modify the second paragraph description of eglDestroySyncKHR in Section + 3.8.1 (Sync Objects), added by KHR_fence_sync + + "If no errors are generated, EGL_TRUE is returned, and <sync> will no + longer be the handle of a valid sync object. Additionally, if <sync> is an + EGL Android fence sync object then the file descriptor stored in the + EGL_SYNC_FENCE_FD_ANDROID attribute is closed and is no longer a valid file + descriptor." + +Issues + + 1. Should EGLSyncKHR objects that wrap Android fence objects use the + EGL_SYNC_FENCE_KHR type? + + RESOLVED: A new sync object type will be added. + + We don't want to require all EGL fence sync objects to wrap Android fence + objects, so we need some way to tell the EGL implementation at sync object + creation whether the sync object should support querying the Android fence + FD attribute. We could do this with either a new sync object type or with a + boolean attribute. It might be nice to pick up future signaling conditions + that might be added for fence sync objects, but there may be things that + get added that don't make sense in the context of Android fence objects. + + 2. Who is responsible for dup'ing the Android fence file descriptors? + + RESOLVED: The recipient of a file descriptor is responsible for dup'ing it + if it wishes to maintain a reference to the Android fence object. + + This means that when eglCreateSyncKHR is called with an existing file + descriptor, the EGL implementation must dup it. On the other hand, when + eglGetSyncAttribKHR is called to query the file descriptor, it is the + responsibility of the caller to dup the file descriptor if it wishes to + maintain a reference that will outlast the EGLSyncKHR object. + +Revision History + +#1 (Jamie Gennis, May 29, 2012) + - Initial draft. diff --git a/opengl/specs/README b/opengl/specs/README index 16b278f..af3f165 100644 --- a/opengl/specs/README +++ b/opengl/specs/README @@ -10,4 +10,7 @@ for use by Android extensions. 0x3141 (unused) 0x3142 EGL_ANDROID_recordable 0x3143 EGL_VERSION_HW_ANDROID (internal use) -0x3144 - 0x314F (unused) +0x3144 EGL_SYNC_ANDROID_FENCE_ANDROID +0x3145 EGL_SYNC_FENCE_FD_ANDROID +0x3146 EGL_SYNC_ANDROID_FENCE_SIGNALED_ANDROID +0x3147 - 0x314F (unused) diff --git a/opengl/tests/hwc/hwcColorEquiv.cpp b/opengl/tests/hwc/hwcColorEquiv.cpp index bb305dc..ab5277e 100644 --- a/opengl/tests/hwc/hwcColorEquiv.cpp +++ b/opengl/tests/hwc/hwcColorEquiv.cpp @@ -124,7 +124,7 @@ const float defaultEndDelay = 2.0; // Default delay after rendering graphics // Globals static const int texUsage = GraphicBuffer::USAGE_HW_TEXTURE | GraphicBuffer::USAGE_SW_WRITE_RARELY; -static hwc_composer_device_t *hwcDevice; +static hwc_composer_device_1_t *hwcDevice; static EGLDisplay dpy; static EGLSurface surface; static EGLint width, height; @@ -344,16 +344,16 @@ main(int argc, char *argv[]) hwcTestFillColorHBlend(equivFrame.get(), refFormat->format, startRefColor, endRefColor); - hwc_layer_list_t *list; - size_t size = sizeof(hwc_layer_list) + numFrames * sizeof(hwc_layer_t); - if ((list = (hwc_layer_list_t *) calloc(1, size)) == NULL) { + hwc_layer_list_1_t *list; + size_t size = sizeof(hwc_layer_list_1_t) + numFrames * sizeof(hwc_layer_1_t); + if ((list = (hwc_layer_list_1_t *) calloc(1, size)) == NULL) { testPrintE("Allocate list failed"); exit(11); } list->flags = HWC_GEOMETRY_CHANGED; list->numHwLayers = numFrames; - hwc_layer_t *layer = &list->hwLayers[0]; + hwc_layer_1_t *layer = &list->hwLayers[0]; layer->handle = refFrame->handle; layer->blending = HWC_BLENDING_NONE; layer->sourceCrop.left = 0; diff --git a/opengl/tests/hwc/hwcCommit.cpp b/opengl/tests/hwc/hwcCommit.cpp index efa646c..d4873d8 100644 --- a/opengl/tests/hwc/hwcCommit.cpp +++ b/opengl/tests/hwc/hwcCommit.cpp @@ -230,7 +230,7 @@ private: // Globals static const int texUsage = GraphicBuffer::USAGE_HW_TEXTURE | GraphicBuffer::USAGE_SW_WRITE_RARELY; -static hwc_composer_device_t *hwcDevice; +static hwc_composer_device_1_t *hwcDevice; static EGLDisplay dpy; static EGLSurface surface; static EGLint width, height; @@ -1397,7 +1397,7 @@ void Rational::double2Rational(double f, Range nRange, Range dRange, // Given a list of rectangles, determine how many HWC will commit to render uint32_t numOverlays(list<Rectangle>& rectList) { - hwc_layer_list_t *hwcList; + hwc_layer_list_1_t *hwcList; list<sp<GraphicBuffer> > buffers; hwcList = hwcTestCreateLayerList(rectList.size()); @@ -1406,7 +1406,7 @@ uint32_t numOverlays(list<Rectangle>& rectList) exit(30); } - hwc_layer_t *layer = &hwcList->hwLayers[0]; + hwc_layer_1_t *layer = &hwcList->hwLayers[0]; for (std::list<Rectangle>::iterator it = rectList.begin(); it != rectList.end(); ++it, ++layer) { // Allocate the texture for the source frame diff --git a/opengl/tests/hwc/hwcRects.cpp b/opengl/tests/hwc/hwcRects.cpp index 906c169..e2f0039 100644 --- a/opengl/tests/hwc/hwcRects.cpp +++ b/opengl/tests/hwc/hwcRects.cpp @@ -165,7 +165,7 @@ public: list<Rectangle> rectangle; static const int texUsage = GraphicBuffer::USAGE_HW_TEXTURE | GraphicBuffer::USAGE_SW_WRITE_RARELY; -static hwc_composer_device_t *hwcDevice; +static hwc_composer_device_1_t *hwcDevice; static EGLDisplay dpy; static EGLSurface surface; static EGLint width, height; @@ -307,14 +307,14 @@ main(int argc, char *argv[]) } // Create list of frames - hwc_layer_list_t *list; + hwc_layer_list_1_t *list; list = hwcTestCreateLayerList(rectangle.size()); if (list == NULL) { testPrintE("hwcTestCreateLayerList failed"); exit(5); } - hwc_layer_t *layer = &list->hwLayers[0]; + hwc_layer_1_t *layer = &list->hwLayers[0]; for (std::list<Rectangle>::iterator it = rectangle.begin(); it != rectangle.end(); ++it, ++layer) { layer->handle = it->texture->handle; diff --git a/opengl/tests/hwc/hwcStress.cpp b/opengl/tests/hwc/hwcStress.cpp index b02a424..ccc7328 100644 --- a/opengl/tests/hwc/hwcStress.cpp +++ b/opengl/tests/hwc/hwcStress.cpp @@ -192,7 +192,7 @@ const vector<unsigned int> vecTransformFlags(transformFlags, // File scope globals static const int texUsage = GraphicBuffer::USAGE_HW_TEXTURE | GraphicBuffer::USAGE_SW_WRITE_RARELY; -static hwc_composer_device_t *hwcDevice; +static hwc_composer_device_1_t *hwcDevice; static EGLDisplay dpy; static EGLSurface surface; static EGLint width, height; @@ -409,7 +409,7 @@ main(int argc, char *argv[]) // generated for this pass. srand48(pass); - hwc_layer_list_t *list; + hwc_layer_list_1_t *list; list = hwcTestCreateLayerList(testRandMod(frames.size()) + 1); if (list == NULL) { testPrintE("hwcTestCreateLayerList failed"); @@ -428,7 +428,7 @@ main(int argc, char *argv[]) for (unsigned int n1 = 0; n1 < list->numHwLayers; n1++) { unsigned int idx = testRandMod(selectedFrames[n1].size()); sp<GraphicBuffer> gBuf = selectedFrames[n1][idx]; - hwc_layer_t *layer = &list->hwLayers[n1]; + hwc_layer_1_t *layer = &list->hwLayers[n1]; layer->handle = gBuf->handle; layer->blending = blendingOps[testRandMod(NUMA(blendingOps))]; @@ -497,7 +497,7 @@ main(int argc, char *argv[]) for (unsigned int n1 = 0; n1 < list->numHwLayers; n1++) { unsigned int idx = testRandMod(selectedFrames[n1].size()); sp<GraphicBuffer> gBuf = selectedFrames[n1][idx]; - hwc_layer_t *layer = &list->hwLayers[n1]; + hwc_layer_1_t *layer = &list->hwLayers[n1]; layer->handle = (native_handle_t *) gBuf->handle; } diff --git a/opengl/tests/hwc/hwcTestLib.cpp b/opengl/tests/hwc/hwcTestLib.cpp index 28e0c3f..c6dbe9d 100644 --- a/opengl/tests/hwc/hwcTestLib.cpp +++ b/opengl/tests/hwc/hwcTestLib.cpp @@ -134,7 +134,7 @@ void hwcTestInitDisplay(bool verbose, EGLDisplay *dpy, EGLSurface *surface, } // Open Hardware Composer Device -void hwcTestOpenHwc(hwc_composer_device_t **hwcDevicePtr) +void hwcTestOpenHwc(hwc_composer_device_1_t **hwcDevicePtr) { int rv; hw_module_t const *hwcModule; @@ -145,7 +145,7 @@ void hwcTestOpenHwc(hwc_composer_device_t **hwcDevicePtr) perror(NULL); exit(77); } - if ((rv = hwc_open(hwcModule, hwcDevicePtr)) != 0) { + if ((rv = hwc_open_1(hwcModule, hwcDevicePtr)) != 0) { testPrintE("hwc_open failed, rv: %i", rv); errno = -rv; perror(NULL); @@ -399,12 +399,12 @@ const char *hwcTestGraphicFormat2str(uint32_t format) * Dynamically creates layer list with numLayers worth * of hwLayers entries. */ -hwc_layer_list_t *hwcTestCreateLayerList(size_t numLayers) +hwc_layer_list_1_t *hwcTestCreateLayerList(size_t numLayers) { - hwc_layer_list_t *list; + hwc_layer_list_1_t *list; - size_t size = sizeof(hwc_layer_list) + numLayers * sizeof(hwc_layer_t); - if ((list = (hwc_layer_list_t *) calloc(1, size)) == NULL) { + size_t size = sizeof(hwc_layer_list_1_t) + numLayers * sizeof(hwc_layer_1_t); + if ((list = (hwc_layer_list_1_t *) calloc(1, size)) == NULL) { return NULL; } list->flags = HWC_GEOMETRY_CHANGED; @@ -417,13 +417,13 @@ hwc_layer_list_t *hwcTestCreateLayerList(size_t numLayers) * hwcTestFreeLayerList * Frees memory previous allocated via hwcTestCreateLayerList(). */ -void hwcTestFreeLayerList(hwc_layer_list_t *list) +void hwcTestFreeLayerList(hwc_layer_list_1_t *list) { free(list); } // Display the settings of the layer list pointed to by list -void hwcTestDisplayList(hwc_layer_list_t *list) +void hwcTestDisplayList(hwc_layer_list_1_t *list) { testPrintI(" flags: %#x%s", list->flags, (list->flags & HWC_GEOMETRY_CHANGED) ? " GEOMETRY_CHANGED" : ""); @@ -494,7 +494,7 @@ void hwcTestDisplayList(hwc_layer_list_t *list) * Displays the portions of a list that are meant to be modified by * a prepare call. */ -void hwcTestDisplayListPrepareModifiable(hwc_layer_list_t *list) +void hwcTestDisplayListPrepareModifiable(hwc_layer_list_1_t *list) { uint32_t numOverlays = 0; for (unsigned int layer = 0; layer < list->numHwLayers; layer++) { @@ -522,7 +522,7 @@ void hwcTestDisplayListPrepareModifiable(hwc_layer_list_t *list) * * Displays the handles of all the graphic buffers in the list. */ -void hwcTestDisplayListHandles(hwc_layer_list_t *list) +void hwcTestDisplayListHandles(hwc_layer_list_1_t *list) { const unsigned int maxLayersPerLine = 6; diff --git a/opengl/tests/hwc/hwcTestLib.h b/opengl/tests/hwc/hwcTestLib.h index b0c3012..db3f5c1 100644 --- a/opengl/tests/hwc/hwcTestLib.h +++ b/opengl/tests/hwc/hwcTestLib.h @@ -107,17 +107,17 @@ class HwcTestDim { // Function Prototypes void hwcTestInitDisplay(bool verbose, EGLDisplay *dpy, EGLSurface *surface, EGLint *width, EGLint *height); -void hwcTestOpenHwc(hwc_composer_device_t **hwcDevicePtr); +void hwcTestOpenHwc(hwc_composer_device_1_t **hwcDevicePtr); const struct hwcTestGraphicFormat *hwcTestGraphicFormatLookup(const char *desc); const struct hwcTestGraphicFormat *hwcTestGraphicFormatLookup(uint32_t id); const char *hwcTestGraphicFormat2str(uint32_t format); std::string hwcTestRect2str(const struct hwc_rect& rect); -hwc_layer_list_t *hwcTestCreateLayerList(size_t numLayers); -void hwcTestFreeLayerList(hwc_layer_list_t *list); -void hwcTestDisplayList(hwc_layer_list_t *list); -void hwcTestDisplayListPrepareModifiable(hwc_layer_list_t *list); -void hwcTestDisplayListHandles(hwc_layer_list_t *list); +hwc_layer_list_1_t *hwcTestCreateLayerList(size_t numLayers); +void hwcTestFreeLayerList(hwc_layer_list_1_t *list); +void hwcTestDisplayList(hwc_layer_list_1_t *list); +void hwcTestDisplayListPrepareModifiable(hwc_layer_list_1_t *list); +void hwcTestDisplayListHandles(hwc_layer_list_1_t *list); uint32_t hwcTestColor2Pixel(uint32_t format, ColorFract color, float alpha); void hwcTestColorConvert(uint32_t fromFormat, uint32_t toFormat, |