radeonsi: allow DMABUF exports for local buffers

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>
(cherry picked from commit 010214b403)
[Emil Velikov: s/sscreen/rscreen/]
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>

Conflicts:
	src/gallium/drivers/radeon/r600_texture.c
This commit is contained in:
Marek Olšák 2017-11-30 22:49:10 +01:00 committed by Emil Velikov
parent b6fd93f8dc
commit d92f520e1f

View file

@ -662,8 +662,11 @@ static boolean r600_texture_get_handle(struct pipe_screen* screen,
slice_size = rtex->surface.u.legacy.level[0].slice_size;
}
} else {
/* Buffer exports are for the OpenCL interop. */
/* Move a suballocated buffer into a non-suballocated allocation. */
if (rscreen->ws->buffer_is_suballocated(res->buf)) {
if (rscreen->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. */