diff --git a/src/gallium/auxiliary/driver_trace/tr_screen.c b/src/gallium/auxiliary/driver_trace/tr_screen.c index bcacb1abac6..e3e973373fc 100644 --- a/src/gallium/auxiliary/driver_trace/tr_screen.c +++ b/src/gallium/auxiliary/driver_trace/tr_screen.c @@ -635,7 +635,8 @@ trace_screen_allocate_memory(struct pipe_screen *_screen, static struct pipe_memory_allocation * trace_screen_allocate_memory_fd(struct pipe_screen *_screen, uint64_t size, - int *fd) + int *fd, + bool dmabuf) { struct trace_screen *tr_scr = trace_screen(_screen); struct pipe_screen *screen = tr_scr->screen; @@ -646,8 +647,9 @@ trace_screen_allocate_memory_fd(struct pipe_screen *_screen, trace_dump_arg(ptr, screen); trace_dump_arg(uint, size); trace_dump_arg(ptr, fd); + trace_dump_arg(bool, dmabuf); - result = screen->allocate_memory_fd(screen, size, fd); + result = screen->allocate_memory_fd(screen, size, fd, dmabuf); trace_dump_ret(ptr, result); diff --git a/src/gallium/drivers/llvmpipe/lp_texture.c b/src/gallium/drivers/llvmpipe/lp_texture.c index 99710415487..d9c84df04f0 100644 --- a/src/gallium/drivers/llvmpipe/lp_texture.c +++ b/src/gallium/drivers/llvmpipe/lp_texture.c @@ -360,7 +360,7 @@ llvmpipe_memobj_create_from_handle(struct pipe_screen *pscreen, struct llvmpipe_memory_object *memobj = CALLOC_STRUCT(llvmpipe_memory_object); if (handle->type == WINSYS_HANDLE_TYPE_FD && - pscreen->import_memory_fd(pscreen, handle->handle, &memobj->data, &memobj->size)) { + pscreen->import_memory_fd(pscreen, handle->handle, &memobj->data, &memobj->size, false)) { return &memobj->b; } free(memobj); @@ -991,7 +991,8 @@ static const char *driver_id = "llvmpipe" MESA_GIT_SHA1; static struct pipe_memory_allocation * llvmpipe_allocate_memory_fd(struct pipe_screen *screen, uint64_t size, - int *fd) + int *fd, + bool dmabuf) { uint64_t alignment; if (!os_get_page_size(&alignment)) @@ -1005,7 +1006,8 @@ static bool llvmpipe_import_memory_fd(struct pipe_screen *screen, int fd, struct pipe_memory_allocation **ptr, - uint64_t *size) + uint64_t *size, + bool dmabuf) { return os_import_memory_fd(fd, (void**)ptr, size, driver_id); } diff --git a/src/gallium/frontends/lavapipe/lvp_device.c b/src/gallium/frontends/lavapipe/lvp_device.c index a513298f8fc..5ab151c396e 100644 --- a/src/gallium/frontends/lavapipe/lvp_device.c +++ b/src/gallium/frontends/lavapipe/lvp_device.c @@ -1776,7 +1776,7 @@ VKAPI_ATTR VkResult VKAPI_CALL lvp_AllocateMemory( #ifdef PIPE_MEMORY_FD else if(import_info) { uint64_t size; - if(!device->pscreen->import_memory_fd(device->pscreen, import_info->fd, &mem->pmem, &size)) { + if(!device->pscreen->import_memory_fd(device->pscreen, import_info->fd, &mem->pmem, &size, false)) { close(import_info->fd); error = VK_ERROR_INVALID_EXTERNAL_HANDLE; goto fail; @@ -1795,7 +1795,7 @@ VKAPI_ATTR VkResult VKAPI_CALL lvp_AllocateMemory( mem->memory_type = LVP_DEVICE_MEMORY_TYPE_OPAQUE_FD; } else if (export_info && export_info->handleTypes) { - mem->pmem = device->pscreen->allocate_memory_fd(device->pscreen, pAllocateInfo->allocationSize, &mem->backed_fd); + mem->pmem = device->pscreen->allocate_memory_fd(device->pscreen, pAllocateInfo->allocationSize, &mem->backed_fd, false); if (!mem->pmem || mem->backed_fd < 0) { goto fail; } diff --git a/src/gallium/include/pipe/p_screen.h b/src/gallium/include/pipe/p_screen.h index d6a24f6abc6..2d58ce058e5 100644 --- a/src/gallium/include/pipe/p_screen.h +++ b/src/gallium/include/pipe/p_screen.h @@ -667,7 +667,8 @@ struct pipe_screen { */ struct pipe_memory_allocation *(*allocate_memory_fd)(struct pipe_screen *screen, uint64_t size, - int *fd); + int *fd, + bool dmabuf); /** * Import memory from an fd-handle. @@ -675,7 +676,8 @@ struct pipe_screen { bool (*import_memory_fd)(struct pipe_screen *screen, int fd, struct pipe_memory_allocation **pmem, - uint64_t *size); + uint64_t *size, + bool dmabuf); /** * Free previously allocated fd-based memory.