From 010214b403de1b5e25a549372ba6192b89e05d06 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Thu, 30 Nov 2017 22:49:10 +0100 Subject: [PATCH] radeonsi: allow DMABUF exports for local buffers MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Cc: 17.3 Tested-by: Dieter Nützel Reviewed-by: Nicolai Hähnle --- src/gallium/drivers/radeon/r600_texture.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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. */ -- 2.30.2