Lines Matching refs:s_grdma

132 static gralloc_dmaregion_t* s_grdma = NULL;  variable
141 if (s_grdma) return; in init_gralloc_dmaregion()
143 s_grdma = new gralloc_dmaregion_t; in init_gralloc_dmaregion()
144 s_grdma->sz = INITIAL_DMA_REGION_SIZE; in init_gralloc_dmaregion()
145 s_grdma->refcount = 0; in init_gralloc_dmaregion()
147 pthread_mutex_init(&s_grdma->lock, NULL); in init_gralloc_dmaregion()
148 pthread_mutex_lock(&s_grdma->lock); in init_gralloc_dmaregion()
149 goldfish_dma_create_region(s_grdma->sz, &s_grdma->goldfish_dma); in init_gralloc_dmaregion()
150 pthread_mutex_unlock(&s_grdma->lock); in init_gralloc_dmaregion()
154 if (!s_grdma) return; in get_gralloc_dmaregion()
155 pthread_mutex_lock(&s_grdma->lock); in get_gralloc_dmaregion()
156 s_grdma->refcount++; in get_gralloc_dmaregion()
157 D("%s: call. refcount: %u\n", __FUNCTION__, s_grdma->refcount); in get_gralloc_dmaregion()
158 pthread_mutex_unlock(&s_grdma->lock); in get_gralloc_dmaregion()
162 if (!s_grdma) return; in resize_gralloc_dmaregion_locked()
163 if (s_grdma->goldfish_dma.mapped) { in resize_gralloc_dmaregion_locked()
164 goldfish_dma_unmap(&s_grdma->goldfish_dma); in resize_gralloc_dmaregion_locked()
166 close(s_grdma->goldfish_dma.fd); in resize_gralloc_dmaregion_locked()
167 goldfish_dma_create_region(new_sz, &s_grdma->goldfish_dma); in resize_gralloc_dmaregion_locked()
168 s_grdma->sz = new_sz; in resize_gralloc_dmaregion_locked()
172 if (!s_grdma) return false; in put_gralloc_dmaregion()
173 pthread_mutex_lock(&s_grdma->lock); in put_gralloc_dmaregion()
174 D("%s: call. refcount before: %u\n", __FUNCTION__, s_grdma->refcount); in put_gralloc_dmaregion()
175 s_grdma->refcount--; in put_gralloc_dmaregion()
176 bool shouldDelete = !s_grdma->refcount; in put_gralloc_dmaregion()
182 pthread_mutex_unlock(&s_grdma->lock); in put_gralloc_dmaregion()
188 if (!s_grdma) return; in gralloc_dmaregion_register_ashmem()
189 pthread_mutex_lock(&s_grdma->lock); in gralloc_dmaregion_register_ashmem()
190 D("%s: for sz %u, refcount %u", __FUNCTION__, sz, s_grdma->refcount); in gralloc_dmaregion_register_ashmem()
191 uint32_t new_sz = std::max(s_grdma->sz, sz); in gralloc_dmaregion_register_ashmem()
192 if (new_sz != s_grdma->sz) { in gralloc_dmaregion_register_ashmem()
193 D("%s: change sz from %u to %u", __FUNCTION__, s_grdma->sz, sz); in gralloc_dmaregion_register_ashmem()
196 if (!s_grdma->goldfish_dma.mapped) { in gralloc_dmaregion_register_ashmem()
197 goldfish_dma_map(&s_grdma->goldfish_dma); in gralloc_dmaregion_register_ashmem()
199 pthread_mutex_unlock(&s_grdma->lock); in gralloc_dmaregion_register_ashmem()
342 (!s_grdma && in updateHostColorBuffer()
356 if (s_grdma) { in updateHostColorBuffer()
366 rcEnc->bindDmaContext(&s_grdma->goldfish_dma); in updateHostColorBuffer()
368 pthread_mutex_lock(&s_grdma->lock); in updateHostColorBuffer()
373 pthread_mutex_unlock(&s_grdma->lock); in updateHostColorBuffer()
653 if (s_grdma) { in gralloc_alloc()