From: Marek Olšák Date: Thu, 30 Nov 2017 21:49:10 +0000 (+0100) Subject: radeonsi: allow DMABUF exports for local buffers X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=010214b403de1b5e25a549372ba6192b89e05d06;p=mesa.git radeonsi: allow DMABUF exports for local buffers Cc: 17.3 Tested-by: Dieter Nützel Reviewed-by: Nicolai Hähnle --- diff --git a/src/gallium/drivers/radeon/r600_texture.c b/src/gallium/drivers/radeon/r600_texture.c index 2aa47b55d59..cb69398e6af 100644 --- a/src/gallium/drivers/radeon/r600_texture.c +++ b/src/gallium/drivers/radeon/r600_texture.c @@ -746,8 +746,11 @@ static boolean r600_texture_get_handle(struct pipe_screen* screen, slice_size = (uint64_t)rtex->surface.u.legacy.level[0].slice_size_dw * 4; } } else { + /* Buffer exports are for the OpenCL interop. */ /* Move a suballocated buffer into a non-suballocated allocation. */ - if (sscreen->ws->buffer_is_suballocated(res->buf)) { + if (sscreen->ws->buffer_is_suballocated(res->buf) || + /* A DMABUF export always fails if the BO is local. */ + rtex->resource.flags & RADEON_FLAG_NO_INTERPROCESS_SHARING) { assert(!res->b.is_shared); /* Allocate a new buffer with PIPE_BIND_SHARED. */