Mesa (master): radeonsi: allow DMABUF exports for local buffers

Marek Olšák mareko at kemper.freedesktop.org
Wed Dec 6 16:09:08 UTC 2017


Module: Mesa
Branch: master
Commit: 010214b403de1b5e25a549372ba6192b89e05d06
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=010214b403de1b5e25a549372ba6192b89e05d06

Author: Marek Olšák <marek.olsak at amd.com>
Date:   Thu Nov 30 22:49:10 2017 +0100

radeonsi: allow DMABUF exports for local buffers

Cc: 17.3 <mesa-stable at lists.freedesktop.org>
Tested-by: Dieter Nützel <Dieter at nuetzel-hh.de>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle at amd.com>

---

 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 2aa47b55d5..cb69398e6a 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. */




More information about the mesa-commit mailing list