radeonsi: allow DMABUF exports for local buffers
authorMarek Olšák <marek.olsak@amd.com>
Thu, 30 Nov 2017 21:49:10 +0000 (22:49 +0100)
committerMarek Olšák <marek.olsak@amd.com>
Wed, 6 Dec 2017 14:19:02 +0000 (15:19 +0100)
Cc: 17.3 <mesa-stable@lists.freedesktop.org>
Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
src/gallium/drivers/radeon/r600_texture.c

index 2aa47b55d592bacd78485e35c295b5ccef3592d8..cb69398e6af3ffcceff363b34ae6d0e13ce41a7e 100644 (file)
@@ -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. */