drm/amdgpu: set snooped flags only on system addresses v2
authorChristian König <christian.koenig@amd.com>
Fri, 4 Dec 2015 12:32:55 +0000 (13:32 +0100)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 4 Dec 2015 17:31:46 +0000 (12:31 -0500)
Not necessary for VRAM.

v2: no need to check if ttm is NULL.

Signed-off-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c

index 8051cb9b8c1edba63192e922a3fdf66b26cb0d5d..8a1752ff3d8e55a1d8b8ab3061f5c9c425058d0f 100644 (file)
@@ -801,11 +801,12 @@ uint32_t amdgpu_ttm_tt_pte_flags(struct amdgpu_device *adev, struct ttm_tt *ttm,
        if (mem && mem->mem_type != TTM_PL_SYSTEM)
                flags |= AMDGPU_PTE_VALID;
 
-       if (mem && mem->mem_type == TTM_PL_TT)
+       if (mem && mem->mem_type == TTM_PL_TT) {
                flags |= AMDGPU_PTE_SYSTEM;
 
-       if (!ttm || ttm->caching_state == tt_cached)
-               flags |= AMDGPU_PTE_SNOOPED;
+               if (ttm->caching_state == tt_cached)
+                       flags |= AMDGPU_PTE_SNOOPED;
+       }
 
        if (adev->asic_type >= CHIP_TOPAZ)
                flags |= AMDGPU_PTE_EXECUTABLE;