Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drm/amd: define gc ip version local variable

For better readability. Also leftover orphaned code.

Signed-off-by: Alex Sierra <alex.sierra@amd.com>
Reviewed-by: Felix Kuehling <felix.kuehling@amd.com>
Reviewed-by: Harish Kasiviswanathan <harish.kasiviswanathan@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Alex Sierra and committed by
Alex Deucher
9bfe4caa 3f1e050c

+6 -7
+3 -5
drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c
··· 1138 1138 bool uncached = bo->flags & AMDGPU_GEM_CREATE_UNCACHED; 1139 1139 struct amdgpu_vm *vm = mapping->bo_va->base.vm; 1140 1140 unsigned int mtype_local, mtype; 1141 + uint32_t gc_ip_version = amdgpu_ip_version(adev, GC_HWIP, 0); 1141 1142 bool snoop = false; 1142 1143 bool is_local; 1143 1144 1144 1145 dma_resv_assert_held(bo->tbo.base.resv); 1145 1146 1146 - switch (amdgpu_ip_version(adev, GC_HWIP, 0)) { 1147 + switch (gc_ip_version) { 1147 1148 case IP_VERSION(9, 4, 1): 1148 1149 case IP_VERSION(9, 4, 2): 1149 1150 if (is_vram) { ··· 1158 1157 /* FIXME: is this still needed? Or does 1159 1158 * amdgpu_ttm_tt_pde_flags already handle this? 1160 1159 */ 1161 - if ((amdgpu_ip_version(adev, GC_HWIP, 0) == 1162 - IP_VERSION(9, 4, 2) || 1163 - amdgpu_ip_version(adev, GC_HWIP, 0) == 1164 - IP_VERSION(9, 4, 3)) && 1160 + if (gc_ip_version == IP_VERSION(9, 4, 2) && 1165 1161 adev->gmc.xgmi.connected_to_cpu) 1166 1162 snoop = true; 1167 1163 } else {
+3 -2
drivers/gpu/drm/amd/amdkfd/kfd_svm.c
··· 1195 1195 struct kfd_node *bo_node; 1196 1196 uint32_t flags = prange->flags; 1197 1197 uint32_t mapping_flags = 0; 1198 + uint32_t gc_ip_version = KFD_GC_VERSION(node); 1198 1199 uint64_t pte_flags; 1199 1200 bool snoop = (domain != SVM_RANGE_VRAM_DOMAIN); 1200 1201 bool coherent = flags & (KFD_IOCTL_SVM_FLAG_COHERENT | KFD_IOCTL_SVM_FLAG_EXT_COHERENT); ··· 1205 1204 if (domain == SVM_RANGE_VRAM_DOMAIN) 1206 1205 bo_node = prange->svm_bo->node; 1207 1206 1208 - switch (amdgpu_ip_version(node->adev, GC_HWIP, 0)) { 1207 + switch (gc_ip_version) { 1209 1208 case IP_VERSION(9, 4, 1): 1210 1209 if (domain == SVM_RANGE_VRAM_DOMAIN) { 1211 1210 if (bo_node == node) { ··· 1300 1299 pte_flags = AMDGPU_PTE_VALID; 1301 1300 pte_flags |= (domain == SVM_RANGE_VRAM_DOMAIN) ? 0 : AMDGPU_PTE_SYSTEM; 1302 1301 pte_flags |= snoop ? AMDGPU_PTE_SNOOPED : 0; 1303 - if (KFD_GC_VERSION(node) >= IP_VERSION(12, 0, 0)) 1302 + if (gc_ip_version >= IP_VERSION(12, 0, 0)) 1304 1303 pte_flags |= AMDGPU_PTE_IS_PTE; 1305 1304 1306 1305 pte_flags |= amdgpu_gem_va_map_flags(node->adev, mapping_flags);