OSDN Git Service

opengl: rcOpenColorBuffer must be synchronous
authorJesse Hall <jessehall@google.com>
Tue, 27 May 2014 16:25:24 +0000 (09:25 -0700)
committerJesse Hall <jessehall@google.com>
Tue, 27 May 2014 18:33:21 +0000 (11:33 -0700)
commite7fce1103c9587fe1f56a4fd63757ef874285130
treeb6a3ef32644e3f970be814107563d5aa3ed4b3eb
parent9a2f216c34966e14a8beb74f807d0af7892cf753
opengl: rcOpenColorBuffer must be synchronous

The gralloc register_buffer() function, which calls rcOpenColorBuffer,
must actually increment the reference count before returning.
Otherwise the buffer allocator may release its reference before the
client has obtained one, and the buffer will be freed prematurely.
Since rcOpenColorBuffer was just sending a message to the host without
waiting for it to be received/processed, this guarantee was not met.
Adding a return value makes the call synchronous.

Bug: 12988668
Change-Id: I8b2399cfb0f600f99b3387f630343291b59bc9a6
system/gralloc/gralloc.cpp
system/renderControl_enc/renderControl_client_context.cpp
system/renderControl_enc/renderControl_client_context.h
system/renderControl_enc/renderControl_client_proc.h
system/renderControl_enc/renderControl_enc.cpp
system/renderControl_enc/renderControl_enc.h
system/renderControl_enc/renderControl_entry.cpp
system/renderControl_enc/renderControl_ftable.h
system/renderControl_enc/renderControl_opcodes.h