Lines Matching refs:hnd
57 private_handle_t* hnd = (private_handle_t*)handle; in gralloc_map() local
58 if (!(hnd->flags & private_handle_t::PRIV_FLAGS_FRAMEBUFFER)) { in gralloc_map()
59 size_t size = hnd->size; in gralloc_map()
61 size += hnd->offset; in gralloc_map()
64 PROT_READ|PROT_WRITE, MAP_SHARED, hnd->fd, 0); in gralloc_map()
67 handle, hnd->fd, strerror(errno)); in gralloc_map()
68 hnd->base = 0; in gralloc_map()
71 hnd->base = intptr_t(mappedAddress) + hnd->offset; in gralloc_map()
75 *vaddr = (void*)hnd->base; in gralloc_map()
82 private_handle_t* hnd = (private_handle_t*)handle; in gralloc_unmap() local
83 if (!(hnd->flags & private_handle_t::PRIV_FLAGS_FRAMEBUFFER)) { in gralloc_unmap()
84 void* base = (void*)hnd->base; in gralloc_unmap()
85 size_t size = hnd->size; in gralloc_unmap()
87 base = (void*)(intptr_t(base) - hnd->offset); in gralloc_unmap()
88 size += hnd->offset; in gralloc_unmap()
95 hnd->base = 0; in gralloc_unmap()
113 private_handle_t* hnd = (private_handle_t*)handle; in gralloc_register_buffer() local
114 if (hnd->pid != getpid()) { in gralloc_register_buffer()
115 hnd->base = NULL; in gralloc_register_buffer()
116 if (!(hnd->flags & private_handle_t::PRIV_FLAGS_USES_GPU)) { in gralloc_register_buffer()
131 private_handle_t* hnd = (private_handle_t*)handle; in gralloc_unregister_buffer() local
132 if (hnd->pid != getpid()) { in gralloc_unregister_buffer()
133 if (hnd->base) { in gralloc_unregister_buffer()
141 private_handle_t* hnd) in mapBuffer() argument
144 return gralloc_map(module, hnd, &vaddr); in mapBuffer()
148 private_handle_t* hnd) in terminateBuffer() argument
150 if (hnd->base) { in terminateBuffer()
152 if (hnd->flags & private_handle_t::PRIV_FLAGS_USES_PMEM) { in terminateBuffer()
153 if (hnd->pid != getpid()) { in terminateBuffer()
157 gralloc_unmap(module, hnd); in terminateBuffer()
159 } else if (hnd->flags & private_handle_t::PRIV_FLAGS_USES_GPU) { in terminateBuffer()
162 gralloc_unmap(module, hnd); in terminateBuffer()
185 private_handle_t* hnd = (private_handle_t*)handle; in gralloc_lock() local
186 *vaddr = (void*)hnd->base; in gralloc_lock()