* Perform allocator specific actions. If these fail we fall back to a regular buffer
* which will be memcpy'ed to the main screen when fb_post is called.
*/
- if (alloc_backend_alloc_framebuffer(private_t, hnd) == -1)
+ uint32_t index = (framebufferVaddr - (uintptr_t)m->framebuffer->base) / framebufferSize;
+ if (alloc_backend_alloc_framebuffer(private_t, hnd, index) == -1)
{
delete hnd;
int newUsage = (usage & ~GRALLOC_USAGE_HW_FB) | GRALLOC_USAGE_HW_2D;
int alloc_backend_alloc(alloc_device_t* dev, size_t size, int usage, buffer_handle_t* pHandle);
-int alloc_backend_alloc_framebuffer(struct private_module_t* m, struct private_handle_t* hnd);
+int alloc_backend_alloc_framebuffer(struct private_module_t* m, struct private_handle_t* hnd, uint32_t idx);
void alloc_backend_alloc_free(struct private_handle_t const* hnd, struct private_module_t* m);
return -1;
}
-int alloc_backend_alloc_framebuffer(private_module_t* m, private_handle_t* hnd)
+int alloc_backend_alloc_framebuffer(private_module_t* m, private_handle_t* hnd, uint32_t idx)
{
framebuffer_mapper_t* m_fb = NULL;
struct fb_dmabuf_export fb_dma_buf;
int res;
+
+ fb_dma_buf.buffer_idx = idx;
res = ioctl( m_fb->framebuffer->fd, FBIOGET_DMABUF, &fb_dma_buf );
if (res == 0)
{
}
}
-int alloc_backend_alloc_framebuffer(private_module_t* m, private_handle_t* hnd)
+int alloc_backend_alloc_framebuffer(private_module_t* m, private_handle_t* hnd, uint32_t idx)
{
hnd->ump_id = m->framebuffer->ump_id;
/* create a backing ump memory handle if the framebuffer is exposed as a secure ID */
#if GRALLOC_ARM_DMA_BUF_MODULE
struct fb_dmabuf_export
{
+ __u32 buffer_idx;
__u32 fd;
__u32 flags;
};