[2/6] drm/amdgpu: disallow foreign BOs for CS w/o GPUVM mapping

Submitted by Kuehling, Felix on July 12, 2017, 5:29 a.m.

Details

Message ID 1499837367-8368-3-git-send-email-Felix.Kuehling@amd.com
State New
Headers show
Series "Experimental P2P buffer sharing" ( rev: 3 2 ) in AMD X.Org drivers

Not browsing as part of any series.

Commit Message

Kuehling, Felix July 12, 2017, 5:29 a.m.
From: Christian König <christian.koenig@amd.com>

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
index 44ec11d..aef0389 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
@@ -1397,7 +1397,8 @@  struct amdgpu_bo_va_mapping *
 		struct amdgpu_bo_list_entry *lobj;
 
 		lobj = &parser->bo_list->array[i];
-		if (!lobj->bo_va)
+		if (!lobj->bo_va ||
+		    amdgpu_ttm_adev(lobj->bo_va->bo->tbo.bdev) != parser->adev)
 			continue;
 
 		list_for_each_entry(mapping, &lobj->bo_va->valids, list) {