Lines Matching refs:m
101 static int fb_get_framebuffer_dmabuf(private_module_t *m, private_handle_t *hnd) in fb_get_framebuffer_dmabuf() argument
105 res = ioctl(m->framebuffer->fd, FBIOGET_DMABUF, &fb_dma_buf); in fb_get_framebuffer_dmabuf()
126 private_module_t *m = reinterpret_cast<private_module_t *>(dev->common.module); in gralloc_alloc_buffer() local
149 if (m->gralloc_legacy_ion) in gralloc_alloc_buffer()
152 ret = ion_alloc(m->ion_client, size, 0, ION_HEAP_TYPE_DMA_MASK, 0, &(ion_hnd)); in gralloc_alloc_buffer()
154 ret = ion_alloc(m->ion_client, size, 0, ION_HEAP_SYSTEM_MASK, 0, &(ion_hnd)); in gralloc_alloc_buffer()
158 AERR("Failed to ion_alloc from ion_client:%d", m->ion_client); in gralloc_alloc_buffer()
162 ret = ion_share(m->ion_client, ion_hnd, &shared_fd); in gralloc_alloc_buffer()
166 AERR("ion_share( %d ) failed", m->ion_client); in gralloc_alloc_buffer()
168 if (0 != ion_free(m->ion_client, ion_hnd)) in gralloc_alloc_buffer()
170 AERR("ion_free( %d ) failed", m->ion_client); in gralloc_alloc_buffer()
177 if (0 != ion_free(m->ion_client, ion_hnd)) in gralloc_alloc_buffer()
179 AWAR("ion_free( %d ) failed", m->ion_client); in gralloc_alloc_buffer()
186 ret = ion_alloc_fd(m->ion_client, size, 0, 1 << m->cma_heap_id, 0, &(shared_fd)); in gralloc_alloc_buffer()
188 ret = ion_alloc_fd(m->ion_client, size, 0, 1 << m->system_heap_id, 0, &(shared_fd)); in gralloc_alloc_buffer()
192 AERR("Failed to ion_alloc_fd from ion_client:%d", m->ion_client); in gralloc_alloc_buffer()
210 AERR("ion_map( %d ) failed", m->ion_client); in gralloc_alloc_buffer()
228 AERR("Gralloc out of mem for ion_client:%d", m->ion_client); in gralloc_alloc_buffer()
334 private_module_t *m = reinterpret_cast<private_module_t *>(dev->common.module); in gralloc_alloc_framebuffer_locked() local
337 if (m->framebuffer == NULL) in gralloc_alloc_framebuffer_locked()
340 int err = init_frame_buffer_locked(m); in gralloc_alloc_framebuffer_locked()
348 uint32_t bufferMask = m->bufferMask; in gralloc_alloc_framebuffer_locked()
349 const uint32_t numBuffers = m->numBuffers; in gralloc_alloc_framebuffer_locked()
350 const size_t bufferSize = m->finfo.line_length * m->info.yres; in gralloc_alloc_framebuffer_locked()
358 AERR("fallback to single buffering. Virtual Y-res too small %d", m->info.yres); in gralloc_alloc_framebuffer_locked()
366 m->bufferMask = 0; in gralloc_alloc_framebuffer_locked()
369 void *vaddr = m->framebuffer->base; in gralloc_alloc_framebuffer_locked()
376 m->bufferMask |= (1LU << i); in gralloc_alloc_framebuffer_locked()
385 …0, m->framebuffer->fd, (uintptr_t)vaddr - (uintptr_t) m->framebuffer->base, m->framebuffer->fb_pad… in gralloc_alloc_framebuffer_locked()
388 hnd->ump_id = m->framebuffer->ump_id; in gralloc_alloc_framebuffer_locked()
410 if (fb_get_framebuffer_dmabuf(m, hnd) == -1) in gralloc_alloc_framebuffer_locked()
435 private_module_t *m = reinterpret_cast<private_module_t *>(dev->common.module); in gralloc_alloc_framebuffer() local
436 pthread_mutex_lock(&m->lock); in gralloc_alloc_framebuffer()
438 pthread_mutex_unlock(&m->lock); in gralloc_alloc_framebuffer()
677 private_module_t *m = reinterpret_cast<private_module_t *>(device); in alloc_device_close() local
679 if (0 != ion_close(m->ion_client)) in alloc_device_close()
681 AERR("Failed to close ion_client: %d", m->ion_client); in alloc_device_close()
684 close(m->ion_client); in alloc_device_close()
779 private_module_t *m = reinterpret_cast<private_module_t *>(dev->common.module); in alloc_device_open() local
780 m->ion_client = ion_open(); in alloc_device_open()
782 if (m->ion_client < 0) in alloc_device_open()
789 m->gralloc_legacy_ion = ion_is_legacy(m->ion_client); in alloc_device_open()
791 if (!m->gralloc_legacy_ion) in alloc_device_open()
793 m->system_heap_id = find_ion_heap_id(m->ion_client, ION_SYSTEM); in alloc_device_open()
794 m->cma_heap_id = find_ion_heap_id(m->ion_client, ION_CMA); in alloc_device_open()
795 if (m->system_heap_id < 0 || m->cma_heap_id < 0) in alloc_device_open()
798 ion_close(m->ion_client); in alloc_device_open()
799 m->ion_client = -1; in alloc_device_open()