diff options
author | Hawking Zhang <Hawking.Zhang@amd.com> | 2019-04-12 19:17:24 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2019-06-20 22:35:29 -0400 |
commit | c304b9e51914d6ffe765f35eb39310d35f988a28 (patch) | |
tree | b2ebf206759b569db1cccc94dd372b33bf9c0515 | |
parent | 367adb2ad5bd738b0899edb4825b356f810fd8d8 (diff) |
drm/amdgpu: correct pte mtype field for navi
The MTYPE filed moves from bits 58:57 to 50:48 for NV10
And the size of MTYPE field is now 3bits
Signed-off-by: Hawking Zhang <Hawking.Zhang@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>
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 9 | ||||
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h | 6 |
2 files changed, 12 insertions, 3 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c index 4f10f5aba00b..568c0f61b4d6 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | |||
@@ -1574,8 +1574,13 @@ static int amdgpu_vm_bo_split_mapping(struct amdgpu_device *adev, | |||
1574 | flags &= ~AMDGPU_PTE_EXECUTABLE; | 1574 | flags &= ~AMDGPU_PTE_EXECUTABLE; |
1575 | flags |= mapping->flags & AMDGPU_PTE_EXECUTABLE; | 1575 | flags |= mapping->flags & AMDGPU_PTE_EXECUTABLE; |
1576 | 1576 | ||
1577 | flags &= ~AMDGPU_PTE_MTYPE_MASK; | 1577 | if (adev->asic_type == CHIP_NAVI10) { |
1578 | flags |= (mapping->flags & AMDGPU_PTE_MTYPE_MASK); | 1578 | flags &= ~AMDGPU_PTE_MTYPE_NV10_MASK; |
1579 | flags |= (mapping->flags & AMDGPU_PTE_MTYPE_NV10_MASK); | ||
1580 | } else { | ||
1581 | flags &= ~AMDGPU_PTE_MTYPE_MASK; | ||
1582 | flags |= (mapping->flags & AMDGPU_PTE_MTYPE_MASK); | ||
1583 | } | ||
1579 | 1584 | ||
1580 | if ((mapping->flags & AMDGPU_PTE_PRT) && | 1585 | if ((mapping->flags & AMDGPU_PTE_PRT) && |
1581 | (adev->asic_type >= CHIP_VEGA10)) { | 1586 | (adev->asic_type >= CHIP_VEGA10)) { |
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h index 91baf95212a6..c4125b477138 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h | |||
@@ -75,7 +75,7 @@ struct amdgpu_bo_list_entry; | |||
75 | 75 | ||
76 | 76 | ||
77 | /* For GFX9 */ | 77 | /* For GFX9 */ |
78 | #define AMDGPU_PTE_MTYPE(a) ((uint64_t)a << 57) | 78 | #define AMDGPU_PTE_MTYPE(a) ((uint64_t)(a) << 57) |
79 | #define AMDGPU_PTE_MTYPE_MASK AMDGPU_PTE_MTYPE(3ULL) | 79 | #define AMDGPU_PTE_MTYPE_MASK AMDGPU_PTE_MTYPE(3ULL) |
80 | 80 | ||
81 | #define AMDGPU_MTYPE_NC 0 | 81 | #define AMDGPU_MTYPE_NC 0 |
@@ -88,6 +88,10 @@ struct amdgpu_bo_list_entry; | |||
88 | | AMDGPU_PTE_WRITEABLE \ | 88 | | AMDGPU_PTE_WRITEABLE \ |
89 | | AMDGPU_PTE_MTYPE(AMDGPU_MTYPE_CC)) | 89 | | AMDGPU_PTE_MTYPE(AMDGPU_MTYPE_CC)) |
90 | 90 | ||
91 | /* NAVI10 only */ | ||
92 | #define AMDGPU_PTE_MTYPE_NV10(a) ((uint64_t)(a) << 48) | ||
93 | #define AMDGPU_PTE_MTYPE_NV10_MASK AMDGPU_PTE_MTYPE_NV10(7ULL) | ||
94 | |||
91 | /* How to programm VM fault handling */ | 95 | /* How to programm VM fault handling */ |
92 | #define AMDGPU_VM_FAULT_STOP_NEVER 0 | 96 | #define AMDGPU_VM_FAULT_STOP_NEVER 0 |
93 | #define AMDGPU_VM_FAULT_STOP_FIRST 1 | 97 | #define AMDGPU_VM_FAULT_STOP_FIRST 1 |