diff options
author | Marek Olšák <[email protected]> | 2018-03-15 15:58:57 -0400 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2018-03-26 19:22:12 -0400 |
commit | 769603564ececf8edc6424ba500090bee661dadb (patch) | |
tree | 524c6537143940c65daea3aa142c2e5a5cb2d6a4 /src/gallium | |
parent | 56b867395dee1a48594b27987d3bf68a4e745dda (diff) |
radeonsi: don't reallocate on DMABUF export if local BOs are disabled
Diffstat (limited to 'src/gallium')
-rw-r--r-- | src/gallium/drivers/radeon/r600_texture.c | 4 | ||||
-rw-r--r-- | src/gallium/winsys/amdgpu/drm/amdgpu_bo.c | 7 |
2 files changed, 6 insertions, 5 deletions
diff --git a/src/gallium/drivers/radeon/r600_texture.c b/src/gallium/drivers/radeon/r600_texture.c index 3a0a79187b8..1614df63c98 100644 --- a/src/gallium/drivers/radeon/r600_texture.c +++ b/src/gallium/drivers/radeon/r600_texture.c @@ -701,6 +701,7 @@ static boolean r600_texture_get_handle(struct pipe_screen* screen, if (sscreen->ws->buffer_is_suballocated(res->buf) || rtex->surface.tile_swizzle || (rtex->resource.flags & RADEON_FLAG_NO_INTERPROCESS_SHARING && + sscreen->info.has_local_buffers && whandle->type != DRM_API_HANDLE_TYPE_KMS)) { assert(!res->b.is_shared); r600_reallocate_texture_inplace(rctx, rtex, @@ -762,7 +763,8 @@ static boolean r600_texture_get_handle(struct pipe_screen* screen, /* Move a suballocated buffer into a non-suballocated allocation. */ 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) { + (rtex->resource.flags & RADEON_FLAG_NO_INTERPROCESS_SHARING && + sscreen->info.has_local_buffers)) { assert(!res->b.is_shared); /* Allocate a new buffer with PIPE_BIND_SHARED. */ diff --git a/src/gallium/winsys/amdgpu/drm/amdgpu_bo.c b/src/gallium/winsys/amdgpu/drm/amdgpu_bo.c index 12d497d2921..7740b46b7b9 100644 --- a/src/gallium/winsys/amdgpu/drm/amdgpu_bo.c +++ b/src/gallium/winsys/amdgpu/drm/amdgpu_bo.c @@ -423,10 +423,9 @@ static struct amdgpu_winsys_bo *amdgpu_create_bo(struct amdgpu_winsys *ws, request.flags |= AMDGPU_GEM_CREATE_NO_CPU_ACCESS; if (flags & RADEON_FLAG_GTT_WC) request.flags |= AMDGPU_GEM_CREATE_CPU_GTT_USWC; - /* TODO: Enable this once the kernel handles it efficiently. */ - /*if (flags & RADEON_FLAG_NO_INTERPROCESS_SHARING && - ws->info.drm_minor >= 20) - request.flags |= AMDGPU_GEM_CREATE_VM_ALWAYS_VALID;*/ + if (flags & RADEON_FLAG_NO_INTERPROCESS_SHARING && + ws->info.has_local_buffers) + request.flags |= AMDGPU_GEM_CREATE_VM_ALWAYS_VALID; r = amdgpu_bo_alloc(ws->dev, &request, &buf_handle); if (r) { |