Lines Matching defs:hnd
61 private_handle_t* hnd = (private_handle_t*)handle;
63 if (!(hnd->flags & private_handle_t::PRIV_FLAGS_FRAMEBUFFER) &&
64 !(hnd->flags & private_handle_t::PRIV_FLAGS_SECURE_BUFFER)) {
65 size_t size = hnd->size;
66 IMemAlloc* memalloc = getAllocator(hnd->flags) ;
68 hnd->offset, hnd->fd);
71 handle, hnd->fd, strerror(errno));
72 hnd->base = 0;
76 hnd->base = intptr_t(mappedAddress) + hnd->offset;
80 hnd->offset_metadata, hnd->fd_metadata);
83 handle, hnd->fd_metadata, strerror(errno));
84 hnd->base_metadata = 0;
87 hnd->base_metadata = intptr_t(mappedAddress) + hnd->offset_metadata;
95 private_handle_t* hnd = (private_handle_t*)handle;
96 if (!(hnd->flags & private_handle_t::PRIV_FLAGS_FRAMEBUFFER)) {
98 void* base = (void*)hnd->base;
99 size_t size = hnd->size;
100 IMemAlloc* memalloc = getAllocator(hnd->flags) ;
102 err = memalloc->unmap_buffer(base, size, hnd->offset);
106 base = (void*)hnd->base_metadata;
108 err = memalloc->unmap_buffer(base, size, hnd->offset_metadata);
116 hnd->base = 0;
117 hnd->base_metadata = 0;
142 private_handle_t* hnd = (private_handle_t*)handle;
143 hnd->base = 0;
144 hnd->base_metadata = 0;
166 private_handle_t* hnd = (private_handle_t*)handle;
168 if (hnd->base != 0) {
171 hnd->base = 0;
172 hnd->base_metadata = 0;
177 private_handle_t* hnd)
184 if (hnd->base != 0) {
186 if (hnd->flags & (private_handle_t::PRIV_FLAGS_USES_PMEM |
190 gralloc_unmap(module, hnd);
193 hnd->flags);
194 gralloc_unmap(module, hnd);
209 private_handle_t* hnd = (private_handle_t*)handle;
211 if (hnd->base == 0) {
220 IMemAlloc* memalloc = getAllocator(hnd->flags) ;
221 err = memalloc->clean_buffer((void*)hnd->base,
222 hnd->size, hnd->offset, hnd->fd,
225 !(hnd->flags & private_handle_t::PRIV_FLAGS_FRAMEBUFFER)) {
227 hnd->flags |= private_handle_t::PRIV_FLAGS_NEEDS_FLUSH;
230 hnd->flags |= private_handle_t::PRIV_FLAGS_DO_NOT_FLUSH;
240 private_handle_t* hnd = (private_handle_t*)handle;
243 *vaddr = (void*)hnd->base;
252 private_handle_t* hnd = (private_handle_t*)handle;
256 //hnd->format holds our implementation defined format
258 switch (hnd->format) {
260 ystride = ALIGN(hnd->width, 16);
261 ycbcr->y = (void*)hnd->base;
262 ycbcr->cr = (void*)(hnd->base + ystride * hnd->height);
263 ycbcr->cb = (void*)(hnd->base + ystride * hnd->height + 1);
271 hnd->format);
284 private_handle_t* hnd = (private_handle_t*)handle;
285 IMemAlloc* memalloc = getAllocator(hnd->flags);
287 if (hnd->flags & private_handle_t::PRIV_FLAGS_NEEDS_FLUSH) {
288 err = memalloc->clean_buffer((void*)hnd->base,
289 hnd->size, hnd->offset, hnd->fd,
291 hnd->flags &= ~private_handle_t::PRIV_FLAGS_NEEDS_FLUSH;
292 } else if(hnd->flags & private_handle_t::PRIV_FLAGS_DO_NOT_FLUSH) {
293 hnd->flags &= ~private_handle_t::PRIV_FLAGS_DO_NOT_FLUSH;
297 err = memalloc->clean_buffer((void*)hnd->base,
298 hnd->size, hnd->offset, hnd->fd,
326 private_handle_t* hnd = (private_handle_t*)native_handle_create(
328 hnd->magic = private_handle_t::sMagic;
329 hnd->fd = fd;
330 hnd->flags = private_handle_t::PRIV_FLAGS_USES_ION;
331 hnd->size = size;
332 hnd->offset = offset;
333 hnd->base = intptr_t(base) + offset;
334 hnd->gpuaddr = 0;
335 hnd->width = width;
336 hnd->height = height;
337 hnd->format = format;
338 *handle = (native_handle_t *)hnd;
349 private_handle_t* hnd = va_arg(args, private_handle_t*);
350 if (private_handle_t::validate(hnd)) {
353 hnd->width = width;
354 hnd->height = height;
355 hnd->format = format;