diff options
author | Jamie Gennis <jgennis@google.com> | 2012-06-13 16:34:11 -0700 |
---|---|---|
committer | Jesse Hall <jessehall@google.com> | 2012-06-19 09:52:23 -0700 |
commit | cd919a177f2b25af1b304dd4d79f0a768fed342f (patch) | |
tree | 8a84d52a614f7a01e36ab6de08decd327ddf81b7 | |
parent | ac779b3384075352158b6bceec311e13769ba746 (diff) | |
download | rs-cd919a177f2b25af1b304dd4d79f0a768fed342f.tar.gz |
Update ANativeWindow clients for sync
This change updates the uses of ANativeWindow to use the new ANW functions that
accept and return Sync HAL fence file descriptors.
Change-Id: I701729e34e00944709c4477acf9d63ca6a2ab0f6
-rw-r--r-- | Android.mk | 4 | ||||
-rw-r--r-- | driver/rsdAllocation.cpp | 13 |
2 files changed, 5 insertions, 12 deletions
@@ -34,7 +34,7 @@ LOCAL_SRC_FILES:= \ driver/rsdVertexArray.cpp LOCAL_SHARED_LIBRARIES += libcutils libutils libEGL libGLESv1_CM libGLESv2 -LOCAL_SHARED_LIBRARIES += libbcc libbcinfo libgui +LOCAL_SHARED_LIBRARIES += libbcc libbcinfo libgui libsync LOCAL_C_INCLUDES += frameworks/compile/libbcc/include @@ -143,7 +143,7 @@ LOCAL_SRC_FILES:= \ rsType.cpp LOCAL_SHARED_LIBRARIES += libcutils libutils libEGL libGLESv1_CM libGLESv2 libbcc -LOCAL_SHARED_LIBRARIES += libui libbcinfo libgui +LOCAL_SHARED_LIBRARIES += libui libbcinfo libgui libsync LOCAL_STATIC_LIBRARIES := libft2 libRSDriver diff --git a/driver/rsdAllocation.cpp b/driver/rsdAllocation.cpp index 4eb5a460..20c2165f 100644 --- a/driver/rsdAllocation.cpp +++ b/driver/rsdAllocation.cpp @@ -399,19 +399,12 @@ int32_t rsdAllocationInitSurfaceTexture(const Context *rsc, const Allocation *al static bool IoGetBuffer(const Context *rsc, Allocation *alloc, ANativeWindow *nw) { DrvAllocation *drv = (DrvAllocation *)alloc->mHal.drv; - int32_t r = nw->dequeueBuffer(nw, &drv->wndBuffer); + int32_t r = native_window_dequeue_buffer_and_wait(nw, &drv->wndBuffer); if (r) { rsc->setError(RS_ERROR_DRIVER, "Error getting next IO output buffer."); return false; } - // This lock is implicitly released by the queue buffer in IoSend - r = nw->lockBuffer(nw, drv->wndBuffer); - if (r) { - rsc->setError(RS_ERROR_DRIVER, "Error locking next IO output buffer."); - return false; - } - // Must lock the whole surface GraphicBufferMapper &mapper = GraphicBufferMapper::get(); Rect bounds(drv->wndBuffer->width, drv->wndBuffer->height); @@ -443,7 +436,7 @@ void rsdAllocationSetSurfaceTexture(const Context *rsc, Allocation *alloc, ANati ANativeWindow *old = alloc->mHal.state.wndSurface; GraphicBufferMapper &mapper = GraphicBufferMapper::get(); mapper.unlock(drv->wndBuffer->handle); - old->queueBuffer(old, drv->wndBuffer); + old->queueBuffer(old, drv->wndBuffer, -1); } if (nw != NULL) { @@ -492,7 +485,7 @@ void rsdAllocationIoSend(const Context *rsc, Allocation *alloc) { if (alloc->mHal.state.usageFlags & RS_ALLOCATION_USAGE_SCRIPT) { GraphicBufferMapper &mapper = GraphicBufferMapper::get(); mapper.unlock(drv->wndBuffer->handle); - int32_t r = nw->queueBuffer(nw, drv->wndBuffer); + int32_t r = nw->queueBuffer(nw, drv->wndBuffer, -1); if (r) { rsc->setError(RS_ERROR_DRIVER, "Error sending IO output buffer."); return; |