Commit 4b98e0c4 authored by Alex Xie's avatar Alex Xie Committed by Alex Deucher

drm/amdgpu: set GART PTE asic specific flags

Set asic specific gart pte flags in the gmc IP module for
each asic.
Signed-off-by: default avatarAlex Xie <AlexBin.Xie@amd.com>
Reviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Reviewed-by: default avatarChristian König <christian.koenig@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent daf42c31
...@@ -524,6 +524,10 @@ struct amdgpu_gart { ...@@ -524,6 +524,10 @@ struct amdgpu_gart {
struct page **pages; struct page **pages;
#endif #endif
bool ready; bool ready;
/* Asic default pte flags */
uint64_t gart_pte_flags;
const struct amdgpu_gart_funcs *gart_funcs; const struct amdgpu_gart_funcs *gart_funcs;
}; };
......
...@@ -1042,9 +1042,7 @@ uint64_t amdgpu_ttm_tt_pte_flags(struct amdgpu_device *adev, struct ttm_tt *ttm, ...@@ -1042,9 +1042,7 @@ uint64_t amdgpu_ttm_tt_pte_flags(struct amdgpu_device *adev, struct ttm_tt *ttm,
flags |= AMDGPU_PTE_SNOOPED; flags |= AMDGPU_PTE_SNOOPED;
} }
if (adev->asic_type >= CHIP_TONGA) flags |= adev->gart.gart_pte_flags;
flags |= AMDGPU_PTE_EXECUTABLE;
flags |= AMDGPU_PTE_READABLE; flags |= AMDGPU_PTE_READABLE;
if (!amdgpu_ttm_tt_is_readonly(ttm)) if (!amdgpu_ttm_tt_is_readonly(ttm))
......
...@@ -554,6 +554,7 @@ static int gmc_v6_0_gart_init(struct amdgpu_device *adev) ...@@ -554,6 +554,7 @@ static int gmc_v6_0_gart_init(struct amdgpu_device *adev)
if (r) if (r)
return r; return r;
adev->gart.table_size = adev->gart.num_gpu_pages * 8; adev->gart.table_size = adev->gart.num_gpu_pages * 8;
adev->gart.gart_pte_flags = 0;
return amdgpu_gart_table_vram_alloc(adev); return amdgpu_gart_table_vram_alloc(adev);
} }
......
...@@ -658,6 +658,7 @@ static int gmc_v7_0_gart_init(struct amdgpu_device *adev) ...@@ -658,6 +658,7 @@ static int gmc_v7_0_gart_init(struct amdgpu_device *adev)
if (r) if (r)
return r; return r;
adev->gart.table_size = adev->gart.num_gpu_pages * 8; adev->gart.table_size = adev->gart.num_gpu_pages * 8;
adev->gart.gart_pte_flags = 0;
return amdgpu_gart_table_vram_alloc(adev); return amdgpu_gart_table_vram_alloc(adev);
} }
......
...@@ -789,6 +789,7 @@ static int gmc_v8_0_gart_init(struct amdgpu_device *adev) ...@@ -789,6 +789,7 @@ static int gmc_v8_0_gart_init(struct amdgpu_device *adev)
if (r) if (r)
return r; return r;
adev->gart.table_size = adev->gart.num_gpu_pages * 8; adev->gart.table_size = adev->gart.num_gpu_pages * 8;
adev->gart.gart_pte_flags = AMDGPU_PTE_EXECUTABLE;
return amdgpu_gart_table_vram_alloc(adev); return amdgpu_gart_table_vram_alloc(adev);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment