From: Christian König Date: Mon, 23 Oct 2017 15:29:36 +0000 (+0200) Subject: drm/amdgpu: fix pin domain compatibility check X-Git-Tag: v4.16-rc1~96^2~29^2~269 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f5318959b51274a5feea129ce472fe66cecc5241;p=thirdparty%2Fkernel%2Flinux.git 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 Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher --- diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c index 6f876deaafc69..6d4b22fdc1b4e 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c +++ b/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) { 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; bo->pin_count++;