Lines Matching refs:grdma

270     gralloc_dmaregion_t* grdma = init_gralloc_dmaregion(rcEnc);  in get_gralloc_region()  local
272 pthread_mutex_lock(&grdma->lock); in get_gralloc_region()
273 grdma->refcount++; in get_gralloc_region()
274 D("%s: call. refcount: %u\n", __func__, grdma->refcount); in get_gralloc_region()
275 pthread_mutex_unlock(&grdma->lock); in get_gralloc_region()
278 static void resize_gralloc_dmaregion_locked(gralloc_dmaregion_t* grdma, uint32_t new_sz) { in resize_gralloc_dmaregion_locked() argument
279 grdma->sz = new_sz; in resize_gralloc_dmaregion_locked()
285 static bool put_gralloc_region_direct_mem_locked(gralloc_dmaregion_t* grdma, uint32_t /* sz, unused… in put_gralloc_region_direct_mem_locked() argument
286 const bool shouldDelete = !grdma->refcount; in put_gralloc_region_direct_mem_locked()
288 grdma->host_memory_allocator.hostFree(&grdma->address_space_block); in put_gralloc_region_direct_mem_locked()
294 static bool put_gralloc_region_dma_locked(gralloc_dmaregion_t* grdma, uint32_t sz) { in put_gralloc_region_dma_locked() argument
295 D("%s: call. refcount before: %u\n", __func__, grdma->refcount); in put_gralloc_region_dma_locked()
296 grdma->refcount--; in put_gralloc_region_dma_locked()
297 if (sz > MAX_DMA_SIZE && grdma->bigbufCount) { in put_gralloc_region_dma_locked()
298 grdma->bigbufCount--; in put_gralloc_region_dma_locked()
300 bool shouldDelete = !grdma->refcount; in put_gralloc_region_dma_locked()
303 resize_gralloc_dmaregion_locked(grdma, INITIAL_DMA_REGION_SIZE); in put_gralloc_region_dma_locked()
313 gralloc_dmaregion_t* grdma = init_gralloc_dmaregion(rcEnc); in put_gralloc_region() local
314 pthread_mutex_lock(&grdma->lock); in put_gralloc_region()
316 shouldDelete = put_gralloc_region_direct_mem_locked(grdma, sz); in put_gralloc_region()
318 shouldDelete = put_gralloc_region_dma_locked(grdma, sz); in put_gralloc_region()
322 pthread_mutex_unlock(&grdma->lock); in put_gralloc_region()
327 static void gralloc_dmaregion_register_ashmem_direct_mem_locked(gralloc_dmaregion_t* grdma, uint32_… in gralloc_dmaregion_register_ashmem_direct_mem_locked() argument
328 if (new_sz == grdma->sz) return; in gralloc_dmaregion_register_ashmem_direct_mem_locked()
330 GoldfishAddressSpaceHostMemoryAllocator* allocator = &grdma->host_memory_allocator; in gralloc_dmaregion_register_ashmem_direct_mem_locked()
331 GoldfishAddressSpaceBlock* block = &grdma->address_space_block; in gralloc_dmaregion_register_ashmem_direct_mem_locked()
334 grdma->sz = new_sz; in gralloc_dmaregion_register_ashmem_direct_mem_locked()
337 static void gralloc_dmaregion_register_ashmem_dma_locked(gralloc_dmaregion_t* grdma, uint32_t new_s… in gralloc_dmaregion_register_ashmem_dma_locked() argument
338 if (new_sz != grdma->sz) { in gralloc_dmaregion_register_ashmem_dma_locked()
342 grdma->bigbufCount++; in gralloc_dmaregion_register_ashmem_dma_locked()
344 D("%s: change sz from %u to %u", __func__, grdma->sz, new_sz); in gralloc_dmaregion_register_ashmem_dma_locked()
345 resize_gralloc_dmaregion_locked(grdma, new_sz); in gralloc_dmaregion_register_ashmem_dma_locked()
351 gralloc_dmaregion_t* grdma = init_gralloc_dmaregion(rcEnc); in gralloc_dmaregion_register_ashmem() local
353 pthread_mutex_lock(&grdma->lock); in gralloc_dmaregion_register_ashmem()
354 D("%s: for sz %u, refcount %u", __func__, sz, grdma->refcount); in gralloc_dmaregion_register_ashmem()
355 const uint32_t new_sz = std::max(grdma->sz, sz); in gralloc_dmaregion_register_ashmem()
358 gralloc_dmaregion_register_ashmem_direct_mem_locked(grdma, new_sz); in gralloc_dmaregion_register_ashmem()
360 gralloc_dmaregion_register_ashmem_dma_locked(grdma, new_sz); in gralloc_dmaregion_register_ashmem()
365 pthread_mutex_unlock(&grdma->lock); in gralloc_dmaregion_register_ashmem()
503 gralloc_dmaregion_t* grdma = init_gralloc_dmaregion(rcEnc); in updateHostColorBuffer() local
530 if (hasDMA && grdma->bigbufCount) { in updateHostColorBuffer()
532 grdma->bigbufCount); in updateHostColorBuffer()
535 if (hasDMA && !grdma->bigbufCount) { in updateHostColorBuffer()
546 if (grdma->address_space_block.guestPtr()) { in updateHostColorBuffer()
547 rcEnc->bindDmaDirectly(grdma->address_space_block.guestPtr(), in updateHostColorBuffer()
548 grdma->address_space_block.physAddr()); in updateHostColorBuffer()
554 pthread_mutex_lock(&grdma->lock); in updateHostColorBuffer()
559 pthread_mutex_unlock(&grdma->lock); in updateHostColorBuffer()