Lines Matching refs:hnd

61     private_handle_t* hnd = (private_handle_t*)handle;  in gralloc_map()  local
63 if (!(hnd->flags & private_handle_t::PRIV_FLAGS_FRAMEBUFFER) && in gralloc_map()
64 !(hnd->flags & private_handle_t::PRIV_FLAGS_SECURE_BUFFER)) { in gralloc_map()
65 unsigned int size = hnd->size; in gralloc_map()
66 IMemAlloc* memalloc = getAllocator(hnd->flags) ; in gralloc_map()
68 hnd->offset, hnd->fd); in gralloc_map()
71 handle, hnd->fd, strerror(errno)); in gralloc_map()
72 hnd->base = 0; in gralloc_map()
76 hnd->base = uint64_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 = uint64_t(mappedAddress) + hnd->offset_metadata; in gralloc_map()
98 private_handle_t* hnd = (private_handle_t*)handle; in gralloc_unmap() local
99 if (!(hnd->flags & private_handle_t::PRIV_FLAGS_FRAMEBUFFER)) { in gralloc_unmap()
101 void* base = (void*)hnd->base; in gralloc_unmap()
102 unsigned int size = hnd->size; in gralloc_unmap()
103 IMemAlloc* memalloc = getAllocator(hnd->flags) ; in gralloc_unmap()
105 err = memalloc->unmap_buffer(base, size, hnd->offset); in gralloc_unmap()
109 base = (void*)hnd->base_metadata; in gralloc_unmap()
111 err = memalloc->unmap_buffer(base, size, hnd->offset_metadata); in gralloc_unmap()
119 hnd->base = 0; in gralloc_unmap()
120 hnd->base_metadata = 0; in gralloc_unmap()
145 private_handle_t* hnd = (private_handle_t*)handle; in gralloc_register_buffer() local
146 hnd->base = 0; in gralloc_register_buffer()
147 hnd->base_metadata = 0; in gralloc_register_buffer()
169 private_handle_t* hnd = (private_handle_t*)handle; in gralloc_unregister_buffer() local
171 if (hnd->base != 0) { in gralloc_unregister_buffer()
174 hnd->base = 0; in gralloc_unregister_buffer()
175 hnd->base_metadata = 0; in gralloc_unregister_buffer()
180 private_handle_t* hnd) in terminateBuffer() argument
190 if (hnd->base != 0) { in terminateBuffer()
192 if (hnd->flags & (private_handle_t::PRIV_FLAGS_USES_PMEM | in terminateBuffer()
196 gralloc_unmap(module, hnd); in terminateBuffer()
199 hnd->flags); in terminateBuffer()
200 gralloc_unmap(module, hnd); in terminateBuffer()
214 private_handle_t* hnd = (private_handle_t*)handle; in gralloc_map_and_invalidate() local
216 if (hnd->base == 0) { in gralloc_map_and_invalidate()
223 if (hnd->flags & private_handle_t::PRIV_FLAGS_USES_ION) { in gralloc_map_and_invalidate()
226 IMemAlloc* memalloc = getAllocator(hnd->flags) ; in gralloc_map_and_invalidate()
227 err = memalloc->clean_buffer((void*)hnd->base, in gralloc_map_and_invalidate()
228 hnd->size, hnd->offset, hnd->fd, in gralloc_map_and_invalidate()
232 hnd->flags |= private_handle_t::PRIV_FLAGS_NEEDS_FLUSH; in gralloc_map_and_invalidate()
236 hnd->flags |= private_handle_t::PRIV_FLAGS_DO_NOT_FLUSH; in gralloc_map_and_invalidate()
246 private_handle_t* hnd = (private_handle_t*)handle; in gralloc_lock() local
249 *vaddr = (void*)hnd->base; in gralloc_lock()
258 private_handle_t* hnd = (private_handle_t*)handle; in gralloc_lock_ycbcr() local
261 err = getYUVPlaneInfo(hnd, ycbcr); in gralloc_lock_ycbcr()
272 private_handle_t* hnd = (private_handle_t*)handle; in gralloc_unlock() local
274 if (hnd->flags & private_handle_t::PRIV_FLAGS_USES_ION) { in gralloc_unlock()
275 IMemAlloc* memalloc = getAllocator(hnd->flags); in gralloc_unlock()
276 if (hnd->flags & private_handle_t::PRIV_FLAGS_NEEDS_FLUSH) { in gralloc_unlock()
277 err = memalloc->clean_buffer((void*)hnd->base, in gralloc_unlock()
278 hnd->size, hnd->offset, hnd->fd, in gralloc_unlock()
280 hnd->flags &= ~private_handle_t::PRIV_FLAGS_NEEDS_FLUSH; in gralloc_unlock()
281 } else if(hnd->flags & private_handle_t::PRIV_FLAGS_DO_NOT_FLUSH) { in gralloc_unlock()
282 hnd->flags &= ~private_handle_t::PRIV_FLAGS_DO_NOT_FLUSH; in gralloc_unlock()
286 err = memalloc->clean_buffer((void*)hnd->base, in gralloc_unlock()
287 hnd->size, hnd->offset, hnd->fd, in gralloc_unlock()
318 private_handle_t* hnd = (private_handle_t*)native_handle_create( in gralloc_perform() local
320 hnd->magic = private_handle_t::sMagic; in gralloc_perform()
321 hnd->fd = fd; in gralloc_perform()
322 hnd->flags = private_handle_t::PRIV_FLAGS_USES_ION; in gralloc_perform()
323 hnd->size = size; in gralloc_perform()
324 hnd->offset = offset; in gralloc_perform()
325 hnd->base = uint64_t(base) + offset; in gralloc_perform()
326 hnd->gpuaddr = 0; in gralloc_perform()
327 hnd->width = width; in gralloc_perform()
328 hnd->height = height; in gralloc_perform()
329 hnd->format = format; in gralloc_perform()
330 *handle = (native_handle_t *)hnd; in gralloc_perform()
341 private_handle_t* hnd = va_arg(args, private_handle_t*); in gralloc_perform() local
342 if (private_handle_t::validate(hnd)) { in gralloc_perform()
345 hnd->width = width; in gralloc_perform()
346 hnd->height = height; in gralloc_perform()
347 hnd->format = format; in gralloc_perform()
366 private_handle_t* hnd = va_arg(args, private_handle_t*); in gralloc_perform() local
368 if (private_handle_t::validate(hnd)) { in gralloc_perform()
371 MetaData_t *metadata = (MetaData_t *)hnd->base_metadata; in gralloc_perform()
375 *stride = hnd->width; in gralloc_perform()
382 private_handle_t* hnd = va_arg(args, private_handle_t*); in gralloc_perform() local
385 if (private_handle_t::validate(hnd)) { in gralloc_perform()
388 MetaData_t *metadata = (MetaData_t *)hnd->base_metadata; in gralloc_perform()
393 *stride = hnd->width; in gralloc_perform()
394 *height = hnd->height; in gralloc_perform()
417 private_handle_t* hnd = va_arg(args, private_handle_t*); in gralloc_perform() local
419 if (private_handle_t::validate(hnd)) { in gralloc_perform()
422 MetaData_t *metadata = (MetaData_t *)hnd->base_metadata; in gralloc_perform()
430 private_handle_t* hnd = va_arg(args, private_handle_t*); in gralloc_perform() local
432 if (!private_handle_t::validate(hnd)) { in gralloc_perform()
433 res = getYUVPlaneInfo(hnd, ycbcr); in gralloc_perform()