Merge "fix [2545826] calling into gralloc with external lock held"
This commit is contained in:
commit
ba5b381d01
@ -86,7 +86,6 @@ private:
|
|||||||
GraphicBufferAllocator();
|
GraphicBufferAllocator();
|
||||||
~GraphicBufferAllocator();
|
~GraphicBufferAllocator();
|
||||||
|
|
||||||
mutable Mutex mLock;
|
|
||||||
alloc_device_t *mAllocDev;
|
alloc_device_t *mAllocDev;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -78,8 +78,6 @@ static inline uint32_t clamp(uint32_t c) {
|
|||||||
status_t GraphicBufferAllocator::alloc(uint32_t w, uint32_t h, PixelFormat format,
|
status_t GraphicBufferAllocator::alloc(uint32_t w, uint32_t h, PixelFormat format,
|
||||||
int usage, buffer_handle_t* handle, int32_t* stride)
|
int usage, buffer_handle_t* handle, int32_t* stride)
|
||||||
{
|
{
|
||||||
Mutex::Autolock _l(mLock);
|
|
||||||
|
|
||||||
// make sure to not allocate a 0 x 0 buffer
|
// make sure to not allocate a 0 x 0 buffer
|
||||||
w = clamp(w);
|
w = clamp(w);
|
||||||
h = clamp(h);
|
h = clamp(h);
|
||||||
@ -118,8 +116,6 @@ status_t GraphicBufferAllocator::alloc(uint32_t w, uint32_t h, PixelFormat forma
|
|||||||
|
|
||||||
status_t GraphicBufferAllocator::free(buffer_handle_t handle)
|
status_t GraphicBufferAllocator::free(buffer_handle_t handle)
|
||||||
{
|
{
|
||||||
Mutex::Autolock _l(mLock);
|
|
||||||
|
|
||||||
status_t err;
|
status_t err;
|
||||||
if (sw_gralloc_handle_t::validate(handle) < 0) {
|
if (sw_gralloc_handle_t::validate(handle) < 0) {
|
||||||
err = mAllocDev->free(mAllocDev, handle);
|
err = mAllocDev->free(mAllocDev, handle);
|
||||||
|
Loading…
Reference in New Issue
Block a user