gallium/radeon: disallow exports of sparse and suballocated BOs

I think it's unsafe, because the slabs can reuse exported storage.

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
This commit is contained in:
Marek Olšák
2017-06-27 19:32:48 +02:00
parent 047c34f0ac
commit 03c5ef195d
2 changed files with 6 additions and 8 deletions
+3 -4
View File
@@ -1365,10 +1365,9 @@ static bool amdgpu_bo_get_handle(struct pb_buffer *buffer,
enum amdgpu_bo_handle_type type;
int r;
if (!bo->bo) {
offset += bo->va - bo->u.slab.real->va;
bo = bo->u.slab.real;
}
/* Don't allow exports of slab entries and sparse buffers. */
if (!bo->bo)
return false;
bo->u.real.use_reusable_pool = false;
@@ -1290,10 +1290,9 @@ static bool radeon_winsys_bo_get_handle(struct pb_buffer *buffer,
struct radeon_bo *bo = radeon_bo(buffer);
struct radeon_drm_winsys *ws = bo->rws;
if (!bo->handle) {
offset += bo->va - bo->u.slab.real->va;
bo = bo->u.slab.real;
}
/* Don't allow exports of slab entries. */
if (!bo->handle)
return false;
memset(&flink, 0, sizeof(flink));