drm/amdgpu: set GART PTE asic specific flags
authorAlex Xie <AlexBin.Xie@amd.com>
Tue, 14 Feb 2017 17:31:36 +0000 (12:31 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 30 Mar 2017 03:53:39 +0000 (23:53 -0400)
Set asic specific gart pte flags in the gmc IP module for
each asic.

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

index 2541d7013e03782e14341b4d149456bb0b8babbe..abf2b39fd96843c52cf21d343654675e2bee929b 100644 (file)
@@ -524,6 +524,10 @@ struct amdgpu_gart {
        struct page                     **pages;
 #endif
        bool                            ready;
+
+       /* Asic default pte flags */
+       uint64_t                        gart_pte_flags;
+
        const struct amdgpu_gart_funcs *gart_funcs;
 };
 
index f2241bb679878acd2ef899b105f580c5fc2af595..987f8f02348dbf53b84f124bfc1e98bbefdbcab4 100644 (file)
@@ -1042,9 +1042,7 @@ uint64_t amdgpu_ttm_tt_pte_flags(struct amdgpu_device *adev, struct ttm_tt *ttm,
                        flags |= AMDGPU_PTE_SNOOPED;
        }
 
-       if (adev->asic_type >= CHIP_TONGA)
-               flags |= AMDGPU_PTE_EXECUTABLE;
-
+       flags |= adev->gart.gart_pte_flags;
        flags |= AMDGPU_PTE_READABLE;
 
        if (!amdgpu_ttm_tt_is_readonly(ttm))
index c3c6853051cd2a50891ea1129f683a5794102ee3..6a1f566632be31b4b1cc6f6821662f751fdb9729 100644 (file)
@@ -554,6 +554,7 @@ static int gmc_v6_0_gart_init(struct amdgpu_device *adev)
        if (r)
                return r;
        adev->gart.table_size = adev->gart.num_gpu_pages * 8;
+       adev->gart.gart_pte_flags = 0;
        return amdgpu_gart_table_vram_alloc(adev);
 }
 
index e95af8ae0ac84914e9415022a459b10bdf07fb8d..9f41d9fa5ed5e9da96a27a9e2052e215d2f9791d 100644 (file)
@@ -658,6 +658,7 @@ static int gmc_v7_0_gart_init(struct amdgpu_device *adev)
        if (r)
                return r;
        adev->gart.table_size = adev->gart.num_gpu_pages * 8;
+       adev->gart.gart_pte_flags = 0;
        return amdgpu_gart_table_vram_alloc(adev);
 }
 
index 17d19f06ce4a0838d73799a7505c8b13e7ed3571..233ac3504fe9781b5da9dbbbe73ce487da6ac15e 100644 (file)
@@ -789,6 +789,7 @@ static int gmc_v8_0_gart_init(struct amdgpu_device *adev)
        if (r)
                return r;
        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);
 }