Lines Matching refs:hnd

60     private_handle_t* hnd = (private_handle_t*)handle;  in gralloc_map()  local
62 if (!(hnd->flags & private_handle_t::PRIV_FLAGS_FRAMEBUFFER) && in gralloc_map()
63 !(hnd->flags & private_handle_t::PRIV_FLAGS_SECURE_BUFFER)) { in gralloc_map()
64 size_t size = hnd->size; in gralloc_map()
65 IMemAlloc* memalloc = getAllocator(hnd->flags) ; in gralloc_map()
67 hnd->offset, hnd->fd); in gralloc_map()
70 handle, hnd->fd, strerror(errno)); in gralloc_map()
71 hnd->base = 0; in gralloc_map()
75 hnd->base = intptr_t(mappedAddress) + hnd->offset; in gralloc_map()
79 hnd->offset_metadata, hnd->fd_metadata); in gralloc_map()
82 handle, hnd->fd_metadata, strerror(errno)); in gralloc_map()
83 hnd->base_metadata = 0; in gralloc_map()
86 hnd->base_metadata = intptr_t(mappedAddress) + hnd->offset_metadata; in gralloc_map()
94 private_handle_t* hnd = (private_handle_t*)handle; in gralloc_unmap() local
95 if (!(hnd->flags & private_handle_t::PRIV_FLAGS_FRAMEBUFFER)) { in gralloc_unmap()
97 void* base = (void*)hnd->base; in gralloc_unmap()
98 size_t size = hnd->size; in gralloc_unmap()
99 IMemAlloc* memalloc = getAllocator(hnd->flags) ; in gralloc_unmap()
101 err = memalloc->unmap_buffer(base, size, hnd->offset); in gralloc_unmap()
105 base = (void*)hnd->base_metadata; in gralloc_unmap()
107 err = memalloc->unmap_buffer(base, size, hnd->offset_metadata); in gralloc_unmap()
115 hnd->base = 0; in gralloc_unmap()
116 hnd->base_metadata = 0; in gralloc_unmap()
141 private_handle_t* hnd = (private_handle_t*)handle; in gralloc_register_buffer() local
142 hnd->base = 0; in gralloc_register_buffer()
143 hnd->base_metadata = 0; in gralloc_register_buffer()
165 private_handle_t* hnd = (private_handle_t*)handle; in gralloc_unregister_buffer() local
167 if (hnd->base != 0) { in gralloc_unregister_buffer()
170 hnd->base = 0; in gralloc_unregister_buffer()
171 hnd->base_metadata = 0; in gralloc_unregister_buffer()
176 private_handle_t* hnd) in terminateBuffer() argument
183 if (hnd->base != 0) { in terminateBuffer()
185 if (hnd->flags & (private_handle_t::PRIV_FLAGS_USES_PMEM | in terminateBuffer()
189 gralloc_unmap(module, hnd); in terminateBuffer()
192 hnd->flags); in terminateBuffer()
193 gralloc_unmap(module, hnd); in terminateBuffer()
208 private_handle_t* hnd = (private_handle_t*)handle; in gralloc_map_and_invalidate() local
210 if (hnd->base == 0) { in gralloc_map_and_invalidate()
219 IMemAlloc* memalloc = getAllocator(hnd->flags) ; in gralloc_map_and_invalidate()
220 err = memalloc->clean_buffer((void*)hnd->base, in gralloc_map_and_invalidate()
221 hnd->size, hnd->offset, hnd->fd, in gralloc_map_and_invalidate()
224 !(hnd->flags & private_handle_t::PRIV_FLAGS_FRAMEBUFFER)) { in gralloc_map_and_invalidate()
226 hnd->flags |= private_handle_t::PRIV_FLAGS_NEEDS_FLUSH; in gralloc_map_and_invalidate()
229 hnd->flags |= private_handle_t::PRIV_FLAGS_DO_NOT_FLUSH; in gralloc_map_and_invalidate()
239 private_handle_t* hnd = (private_handle_t*)handle; in gralloc_lock() local
242 *vaddr = (void*)hnd->base; in gralloc_lock()
251 private_handle_t* hnd = (private_handle_t*)handle; in gralloc_lock_ycbcr() local
257 switch (hnd->format) { in gralloc_lock_ycbcr()
259 ystride = ALIGN(hnd->width, 16); in gralloc_lock_ycbcr()
260 ycbcr->y = (void*)hnd->base; in gralloc_lock_ycbcr()
261 ycbcr->cr = (void*)(hnd->base + ystride * hnd->height); in gralloc_lock_ycbcr()
262 ycbcr->cb = (void*)(hnd->base + ystride * hnd->height + 1); in gralloc_lock_ycbcr()
270 ystride = ALIGN(hnd->width, 16); in gralloc_lock_ycbcr()
271 ycbcr->y = (void*)hnd->base; in gralloc_lock_ycbcr()
272 ycbcr->cb = (void*)(hnd->base + ystride * hnd->height); in gralloc_lock_ycbcr()
273 ycbcr->cr = (void*)(hnd->base + ystride * hnd->height + 1); in gralloc_lock_ycbcr()
281 hnd->format); in gralloc_lock_ycbcr()
294 private_handle_t* hnd = (private_handle_t*)handle; in gralloc_unlock() local
295 IMemAlloc* memalloc = getAllocator(hnd->flags); in gralloc_unlock()
297 if (hnd->flags & private_handle_t::PRIV_FLAGS_NEEDS_FLUSH) { in gralloc_unlock()
298 err = memalloc->clean_buffer((void*)hnd->base, in gralloc_unlock()
299 hnd->size, hnd->offset, hnd->fd, in gralloc_unlock()
301 hnd->flags &= ~private_handle_t::PRIV_FLAGS_NEEDS_FLUSH; in gralloc_unlock()
302 } else if(hnd->flags & private_handle_t::PRIV_FLAGS_DO_NOT_FLUSH) { in gralloc_unlock()
303 hnd->flags &= ~private_handle_t::PRIV_FLAGS_DO_NOT_FLUSH; in gralloc_unlock()
307 err = memalloc->clean_buffer((void*)hnd->base, in gralloc_unlock()
308 hnd->size, hnd->offset, hnd->fd, in gralloc_unlock()
336 private_handle_t* hnd = (private_handle_t*)native_handle_create( in gralloc_perform() local
338 hnd->magic = private_handle_t::sMagic; in gralloc_perform()
339 hnd->fd = fd; in gralloc_perform()
340 hnd->flags = private_handle_t::PRIV_FLAGS_USES_ION; in gralloc_perform()
341 hnd->size = size; in gralloc_perform()
342 hnd->offset = offset; in gralloc_perform()
343 hnd->base = intptr_t(base) + offset; in gralloc_perform()
344 hnd->gpuaddr = 0; in gralloc_perform()
345 hnd->width = width; in gralloc_perform()
346 hnd->height = height; in gralloc_perform()
347 hnd->format = format; in gralloc_perform()
348 *handle = (native_handle_t *)hnd; in gralloc_perform()
359 private_handle_t* hnd = va_arg(args, private_handle_t*); in gralloc_perform() local
360 if (private_handle_t::validate(hnd)) { in gralloc_perform()
363 hnd->width = width; in gralloc_perform()
364 hnd->height = height; in gralloc_perform()
365 hnd->format = format; in gralloc_perform()
380 private_handle_t* hnd = va_arg(args, private_handle_t*); in gralloc_perform() local
382 if (private_handle_t::validate(hnd)) { in gralloc_perform()
385 MetaData_t *metadata = (MetaData_t *)hnd->base_metadata; in gralloc_perform()
389 *stride = hnd->width; in gralloc_perform()