Lines Matching refs:m

68 	private_module_t *m = reinterpret_cast<private_module_t *>(dev->common.module);  in fb_set_swap_interval()  local
69 m->swapInterval = interval; in fb_set_swap_interval()
91 private_module_t *m = reinterpret_cast<private_module_t *>(dev->common.module); in fb_post() local
93 if (m->currentBuffer) in fb_post()
95 mali_gralloc_unlock(m, m->currentBuffer); in fb_post()
96 m->currentBuffer = 0; in fb_post()
101 mali_gralloc_lock(m, buffer, private_module_t::PRIV_USAGE_LOCKED_FOR_POST, -1, -1, -1, -1, NULL); in fb_post()
104 m->info.activate = FB_ACTIVATE_VBL; in fb_post()
105 m->info.yoffset = hnd->offset / m->finfo.line_length; in fb_post()
109 if (ioctl(m->framebuffer->fd, FBIOPAN_DISPLAY, &m->info) == -1) in fb_post()
111 AERR("FBIOPAN_DISPLAY failed for fd: %d", m->framebuffer->fd); in fb_post()
112 mali_gralloc_unlock(m, buffer); in fb_post()
118 if (ioctl(m->framebuffer->fd, FBIOPUT_VSCREENINFO, &m->info) == -1) in fb_post()
120 AERR("FBIOPUT_VSCREENINFO failed for fd: %d", m->framebuffer->fd); in fb_post()
121 mali_gralloc_unlock(m, buffer); in fb_post()
129 AERR("Gralloc wait for vsync failed for fd: %d", m->framebuffer->fd); in fb_post()
130 mali_gralloc_unlock(m, buffer); in fb_post()
134 m->currentBuffer = buffer; in fb_post()
141 mali_gralloc_lock(m, m->framebuffer, GRALLOC_USAGE_SW_WRITE_RARELY, -1, -1, -1, -1, &fb_vaddr); in fb_post()
143 mali_gralloc_lock(m, buffer, GRALLOC_USAGE_SW_READ_RARELY, -1, -1, -1, -1, &buffer_vaddr); in fb_post()
147 if (hnd->byte_stride == (int)m->finfo.line_length) in fb_post()
149 memcpy(fb_vaddr, buffer_vaddr, m->finfo.line_length * m->info.yres); in fb_post()
157 for (i = 0; i < m->info.yres; i++) in fb_post()
160 m->finfo.line_length); in fb_post()
162 fb_offset += m->finfo.line_length; in fb_post()
167 mali_gralloc_unlock(m, buffer); in fb_post()
168 mali_gralloc_unlock(m, m->framebuffer); in fb_post()
402 static int fb_alloc_framebuffer_dmabuf(private_module_t *m, private_handle_t *hnd) in fb_alloc_framebuffer_dmabuf() argument
406 res = ioctl(m->framebuffer->fd, FBIOGET_DMABUF, &fb_dma_buf); in fb_alloc_framebuffer_dmabuf()
422 static int fb_alloc_from_ion_module(mali_gralloc_module *m, size_t buffer_size, uint64_t consumer_u… in fb_alloc_from_ion_module() argument
435 err = mali_gralloc_ion_allocate(m, gralloc_buffer_descriptor, 1, pHandle, &shared); in fb_alloc_from_ion_module()
440 static int fb_alloc_framebuffer_locked(mali_gralloc_module *m, uint64_t consumer_usage, uint64_t pr… in fb_alloc_framebuffer_locked() argument
444 if (m->framebuffer == NULL) in fb_alloc_framebuffer_locked()
447 int err = init_frame_buffer_locked(m); in fb_alloc_framebuffer_locked()
455 uint32_t bufferMask = m->bufferMask; in fb_alloc_framebuffer_locked()
456 const uint32_t numBuffers = m->numBuffers; in fb_alloc_framebuffer_locked()
461 const size_t framebufferSize = m->finfo.line_length * m->info.yres; in fb_alloc_framebuffer_locked()
462 const size_t alignedFramebufferSize = GRALLOC_ALIGN(m->finfo.line_length, 64) * m->info.yres; in fb_alloc_framebuffer_locked()
464 *stride = m->info.xres; in fb_alloc_framebuffer_locked()
473 AWAR("fallback to single buffering. Virtual Y-res too small %d", m->info.yres); in fb_alloc_framebuffer_locked()
474 *byte_stride = GRALLOC_ALIGN(m->finfo.line_length, 64); in fb_alloc_framebuffer_locked()
475 …return fb_alloc_from_ion_module(m, alignedFramebufferSize, newConsumerUsage, newProducerUsage, pHa… in fb_alloc_framebuffer_locked()
482 m->bufferMask = 0; in fb_alloc_framebuffer_locked()
485 uintptr_t framebufferVaddr = (uintptr_t)m->framebuffer->base; in fb_alloc_framebuffer_locked()
492 m->bufferMask |= (1LU << i); in fb_alloc_framebuffer_locked()
502 producer_usage, dup(m->framebuffer->fd), (framebufferVaddr - (uintptr_t)m->framebuffer->base)); in fb_alloc_framebuffer_locked()
508 if (fb_alloc_framebuffer_dmabuf(m, hnd) == -1) in fb_alloc_framebuffer_locked()
514 *byte_stride = GRALLOC_ALIGN(m->finfo.line_length, 64); in fb_alloc_framebuffer_locked()
515 …return fb_alloc_from_ion_module(m, alignedFramebufferSize, newConsumerUsage, newProducerUsage, pHa… in fb_alloc_framebuffer_locked()
519 *byte_stride = m->finfo.line_length; in fb_alloc_framebuffer_locked()
524 int fb_alloc_framebuffer(mali_gralloc_module *m, uint64_t consumer_usage, uint64_t producer_usage, in fb_alloc_framebuffer() argument
527 pthread_mutex_lock(&m->lock); in fb_alloc_framebuffer()
528 …int err = fb_alloc_framebuffer_locked(m, consumer_usage, producer_usage, pHandle, stride, byte_str… in fb_alloc_framebuffer()
529 pthread_mutex_unlock(&m->lock); in fb_alloc_framebuffer()
587 private_module_t *m = (private_module_t *)module; in framebuffer_device_open() local
588 status = init_frame_buffer(m); in framebuffer_device_open()
630 int stride = m->finfo.line_length / (m->info.bits_per_pixel >> 3); in framebuffer_device_open()
632 const_cast<uint32_t &>(dev->width) = m->info.xres; in framebuffer_device_open()
633 const_cast<uint32_t &>(dev->height) = m->info.yres; in framebuffer_device_open()
640 const_cast<float &>(dev->xdpi) = m->xdpi; in framebuffer_device_open()
641 const_cast<float &>(dev->ydpi) = m->ydpi; in framebuffer_device_open()
642 const_cast<float &>(dev->fps) = m->fps; in framebuffer_device_open()