]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
drm/amdgpu: fix pin domain compatibility check
authorChristian König <christian.koenig@amd.com>
Mon, 23 Oct 2017 15:29:36 +0000 (17:29 +0200)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 4 Dec 2017 21:33:16 +0000 (16:33 -0500)
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>
drivers/gpu/drm/amd/amdgpu/amdgpu_object.c

index 6f876deaafc694f2e2d50e46eb69de38d4517ab4..6d4b22fdc1b4e23afe0517a6b8ea3b8ce31b1e1c 100644 (file)
@@ -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++;