Lines Matching refs:hnd
59 private_handle_t* hnd = (private_handle_t*)handle; in gralloc_map() local
61 if (!(hnd->flags & private_handle_t::PRIV_FLAGS_FRAMEBUFFER) && in gralloc_map()
62 !(hnd->flags & private_handle_t::PRIV_FLAGS_SECURE_BUFFER)) { in gralloc_map()
63 size_t size = hnd->size; in gralloc_map()
64 IMemAlloc* memalloc = getAllocator(hnd->flags) ; in gralloc_map()
66 hnd->offset, hnd->fd); in gralloc_map()
69 handle, hnd->fd, strerror(errno)); in gralloc_map()
70 hnd->base = 0; in gralloc_map()
74 hnd->base = intptr_t(mappedAddress) + hnd->offset; in gralloc_map()
80 hnd->offset_metadata, hnd->fd_metadata); in gralloc_map()
83 handle, hnd->fd_metadata, strerror(errno)); in gralloc_map()
84 hnd->base_metadata = 0; in gralloc_map()
87 hnd->base_metadata = intptr_t(mappedAddress) + hnd->offset_metadata; in gralloc_map()
89 *vaddr = (void*)hnd->base; in gralloc_map()
96 private_handle_t* hnd = (private_handle_t*)handle; in gralloc_unmap() local
97 if (!(hnd->flags & private_handle_t::PRIV_FLAGS_FRAMEBUFFER)) { in gralloc_unmap()
99 void* base = (void*)hnd->base; in gralloc_unmap()
100 size_t size = hnd->size; in gralloc_unmap()
101 IMemAlloc* memalloc = getAllocator(hnd->flags) ; in gralloc_unmap()
103 err = memalloc->unmap_buffer(base, size, hnd->offset); in gralloc_unmap()
107 base = (void*)hnd->base_metadata; in gralloc_unmap()
109 err = memalloc->unmap_buffer(base, size, hnd->offset_metadata); in gralloc_unmap()
117 hnd->base = 0; in gralloc_unmap()
118 hnd->base_metadata = 0; in gralloc_unmap()
143 private_handle_t* hnd = (private_handle_t*)handle; in gralloc_register_buffer() local
144 hnd->base = 0; in gralloc_register_buffer()
145 hnd->base_metadata = 0; in gralloc_register_buffer()
168 private_handle_t* hnd = (private_handle_t*)handle; in gralloc_unregister_buffer() local
170 if (hnd->base != 0) { in gralloc_unregister_buffer()
173 hnd->base = 0; in gralloc_unregister_buffer()
174 hnd->base_metadata = 0; in gralloc_unregister_buffer()
179 private_handle_t* hnd) in terminateBuffer() argument
186 if (hnd->base != 0) { in terminateBuffer()
188 if (hnd->flags & (private_handle_t::PRIV_FLAGS_USES_PMEM | in terminateBuffer()
192 gralloc_unmap(module, hnd); in terminateBuffer()
195 hnd->flags); in terminateBuffer()
196 gralloc_unmap(module, hnd); in terminateBuffer()
212 private_handle_t* hnd = (private_handle_t*)handle; in gralloc_lock() local
214 if (hnd->base == 0) { in gralloc_lock()
221 *vaddr = (void*)hnd->base; in gralloc_lock()
222 if (hnd->flags & private_handle_t::PRIV_FLAGS_USES_ION) { in gralloc_lock()
225 IMemAlloc* memalloc = getAllocator(hnd->flags) ; in gralloc_lock()
226 err = memalloc->clean_buffer((void*)hnd->base, in gralloc_lock()
227 hnd->size, hnd->offset, hnd->fd, in gralloc_lock()
231 hnd->flags |= private_handle_t::PRIV_FLAGS_NEEDS_FLUSH; in gralloc_lock()
235 hnd->flags |= private_handle_t::PRIV_FLAGS_DO_NOT_FLUSH; in gralloc_lock()
246 private_handle_t* hnd = (private_handle_t*)handle; in gralloc_unlock() local
248 if (hnd->flags & private_handle_t::PRIV_FLAGS_USES_ION) { in gralloc_unlock()
249 IMemAlloc* memalloc = getAllocator(hnd->flags); in gralloc_unlock()
250 if (hnd->flags & private_handle_t::PRIV_FLAGS_NEEDS_FLUSH) { in gralloc_unlock()
251 err = memalloc->clean_buffer((void*)hnd->base, in gralloc_unlock()
252 hnd->size, hnd->offset, hnd->fd, in gralloc_unlock()
254 hnd->flags &= ~private_handle_t::PRIV_FLAGS_NEEDS_FLUSH; in gralloc_unlock()
255 } else if(hnd->flags & private_handle_t::PRIV_FLAGS_DO_NOT_FLUSH) { in gralloc_unlock()
256 hnd->flags &= ~private_handle_t::PRIV_FLAGS_DO_NOT_FLUSH; in gralloc_unlock()
260 err = memalloc->clean_buffer((void*)hnd->base, in gralloc_unlock()
261 hnd->size, hnd->offset, hnd->fd, in gralloc_unlock()
290 private_handle_t* hnd = (private_handle_t*)native_handle_create( in gralloc_perform() local
292 hnd->magic = private_handle_t::sMagic; in gralloc_perform()
293 hnd->fd = fd; in gralloc_perform()
294 hnd->flags = private_handle_t::PRIV_FLAGS_USES_ION; in gralloc_perform()
295 hnd->size = size; in gralloc_perform()
296 hnd->offset = offset; in gralloc_perform()
297 hnd->base = intptr_t(base) + offset; in gralloc_perform()
298 hnd->gpuaddr = 0; in gralloc_perform()
299 hnd->width = width; in gralloc_perform()
300 hnd->height = height; in gralloc_perform()
301 hnd->format = format; in gralloc_perform()
302 *handle = (native_handle_t *)hnd; in gralloc_perform()
313 private_handle_t* hnd = va_arg(args, private_handle_t*); in gralloc_perform() local
314 if (private_handle_t::validate(hnd)) { in gralloc_perform()
317 hnd->width = width; in gralloc_perform()
318 hnd->height = height; in gralloc_perform()
319 hnd->format = format; in gralloc_perform()
338 private_handle_t* hnd = va_arg(args, private_handle_t*); in gralloc_perform() local
340 if (private_handle_t::validate(hnd)) { in gralloc_perform()
343 MetaData_t *metadata = (MetaData_t *)hnd->base_metadata; in gralloc_perform()
347 *stride = hnd->width; in gralloc_perform()
370 private_handle_t* hnd = va_arg(args, private_handle_t*); in gralloc_perform() local
372 if (private_handle_t::validate(hnd)) { in gralloc_perform()
375 MetaData_t *metadata = (MetaData_t *)hnd->base_metadata; in gralloc_perform()