Browse Source

drm/amdgpu: fix pin domain compatibility check

We need to test if any domain fits, not all of them.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Christian König 7 years ago
parent
commit
f5318959b5
1 changed files with 1 additions and 1 deletions
  1. 1 1
      drivers/gpu/drm/amd/amdgpu/amdgpu_object.c

+ 1 - 1
drivers/gpu/drm/amd/amdgpu/amdgpu_object.c

@@ -647,7 +647,7 @@ int amdgpu_bo_pin_restricted(struct amdgpu_bo *bo, u32 domain,
 	if (bo->pin_count) {
 	if (bo->pin_count) {
 		uint32_t mem_type = bo->tbo.mem.mem_type;
 		uint32_t mem_type = bo->tbo.mem.mem_type;
 
 
-		if (domain != amdgpu_mem_type_to_domain(mem_type))
+		if (!(domain & amdgpu_mem_type_to_domain(mem_type)))
 			return -EINVAL;
 			return -EINVAL;
 
 
 		bo->pin_count++;
 		bo->pin_count++;