Lines Matching refs:hnd
42 private_handle_t* hnd = (private_handle_t*)handle; in gralloc_map() local
44 void* mappedAddress = mmap(0, hnd->size, PROT_READ|PROT_WRITE, MAP_SHARED, in gralloc_map()
45 hnd->fd, 0); in gralloc_map()
50 ALOGV("%s: base %p %d %d %d %d\n", __func__, mappedAddress, hnd->size, in gralloc_map()
51 hnd->width, hnd->height, hnd->stride); in gralloc_map()
52 hnd->base = mappedAddress; in gralloc_map()
58 private_handle_t* hnd = (private_handle_t*)handle; in gralloc_unmap() local
60 if (!hnd->base) in gralloc_unmap()
63 if (munmap(hnd->base, hnd->size) < 0) { in gralloc_unmap()
65 hnd->base, hnd->size); in gralloc_unmap()
67 ALOGV("%s: base %p %d %d %d %d\n", __func__, hnd->base, hnd->size, in gralloc_unmap()
68 hnd->width, hnd->height, hnd->stride); in gralloc_unmap()
69 hnd->base = 0; in gralloc_unmap()
93 private_handle_t* hnd = (private_handle_t*)handle; in gralloc_register_buffer() local
94 ALOGV("%s: base %p %d %d %d %d\n", __func__, hnd->base, hnd->size, in gralloc_register_buffer()
95 hnd->width, hnd->height, hnd->stride); in gralloc_register_buffer()
98 ret = ion_import(getIonFd(module), hnd->fd, &hnd->handle); in gralloc_register_buffer()
100 ALOGE("error importing handle %d %x\n", hnd->fd, hnd->format); in gralloc_register_buffer()
101 if (hnd->fd1 >= 0) { in gralloc_register_buffer()
102 ret = ion_import(getIonFd(module), hnd->fd1, &hnd->handle1); in gralloc_register_buffer()
104 ALOGE("error importing handle1 %d %x\n", hnd->fd1, hnd->format); in gralloc_register_buffer()
106 if (hnd->fd2 >= 0) { in gralloc_register_buffer()
107 ret = ion_import(getIonFd(module), hnd->fd2, &hnd->handle2); in gralloc_register_buffer()
109 ALOGE("error importing handle2 %d %x\n", hnd->fd2, hnd->format); in gralloc_register_buffer()
121 private_handle_t* hnd = (private_handle_t*)handle; in gralloc_unregister_buffer() local
122 ALOGV("%s: base %p %d %d %d %d\n", __func__, hnd->base, hnd->size, in gralloc_unregister_buffer()
123 hnd->width, hnd->height, hnd->stride); in gralloc_unregister_buffer()
127 if (hnd->handle) in gralloc_unregister_buffer()
128 ion_free(getIonFd(module), hnd->handle); in gralloc_unregister_buffer()
129 if (hnd->handle1) in gralloc_unregister_buffer()
130 ion_free(getIonFd(module), hnd->handle1); in gralloc_unregister_buffer()
131 if (hnd->handle2) in gralloc_unregister_buffer()
132 ion_free(getIonFd(module), hnd->handle2); in gralloc_unregister_buffer()
153 private_handle_t* hnd = (private_handle_t*)handle; in gralloc_lock() local
154 if (!hnd->base) in gralloc_lock()
155 gralloc_map(module, hnd); in gralloc_lock()
156 *vaddr = (void*)hnd->base; in gralloc_lock()
165 private_handle_t* hnd = (private_handle_t*)handle; in gralloc_unlock() local
166 ion_sync_fd(getIonFd(module), hnd->fd); in gralloc_unlock()
167 if (hnd->fd1 >= 0) in gralloc_unlock()
168 ion_sync_fd(getIonFd(module), hnd->fd1); in gralloc_unlock()
169 if (hnd->fd2 >= 0) in gralloc_unlock()
170 ion_sync_fd(getIonFd(module), hnd->fd2); in gralloc_unlock()