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

drm/amdgpu: Wire up MMIO_REMAP placement and User-visible strings

Wire up the conversions and strings for the new MMIO_REMAP placement:

* amdgpu_mem_type_to_domain() maps AMDGPU_PL_MMIO_REMAP -> domain
* amdgpu_bo_placement_from_domain() accepts the new domain
* amdgpu_bo_mem_stats_placement() and amdgpu_bo_print_info() report it
* res cursor supports the new placement
* fdinfo prints "mmioremap" for the new placement

Cc: Christian König <christian.koenig@amd.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Srinivasan Shanmugam <srinivasan.shanmugam@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Srinivasan Shanmugam and committed by
Alex Deucher
11aaec35 357fe94b

+18
+1
drivers/gpu/drm/amd/amdgpu/amdgpu_fdinfo.c
··· 70 70 [AMDGPU_PL_GWS] = "gws", 71 71 [AMDGPU_PL_OA] = "oa", 72 72 [AMDGPU_PL_DOORBELL] = "doorbell", 73 + [AMDGPU_PL_MMIO_REMAP] = "mmioremap", 73 74 }; 74 75 unsigned int hw_ip, i; 75 76
+13
drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
··· 153 153 c++; 154 154 } 155 155 156 + if (domain & AMDGPU_GEM_DOMAIN_MMIO_REMAP) { 157 + places[c].fpfn = 0; 158 + places[c].lpfn = 0; 159 + places[c].mem_type = AMDGPU_PL_MMIO_REMAP; 160 + places[c].flags = 0; 161 + c++; 162 + } 163 + 156 164 if (domain & AMDGPU_GEM_DOMAIN_GTT) { 157 165 places[c].fpfn = 0; 158 166 places[c].lpfn = 0; ··· 1553 1545 return AMDGPU_PL_OA; 1554 1546 case AMDGPU_GEM_DOMAIN_DOORBELL: 1555 1547 return AMDGPU_PL_DOORBELL; 1548 + case AMDGPU_GEM_DOMAIN_MMIO_REMAP: 1549 + return AMDGPU_PL_MMIO_REMAP; 1556 1550 default: 1557 1551 return TTM_PL_SYSTEM; 1558 1552 } ··· 1637 1627 break; 1638 1628 case AMDGPU_PL_DOORBELL: 1639 1629 placement = "DOORBELL"; 1630 + break; 1631 + case AMDGPU_PL_MMIO_REMAP: 1632 + placement = "MMIO REMAP"; 1640 1633 break; 1641 1634 case TTM_PL_SYSTEM: 1642 1635 default:
+2
drivers/gpu/drm/amd/amdgpu/amdgpu_object.h
··· 167 167 return AMDGPU_GEM_DOMAIN_OA; 168 168 case AMDGPU_PL_DOORBELL: 169 169 return AMDGPU_GEM_DOMAIN_DOORBELL; 170 + case AMDGPU_PL_MMIO_REMAP: 171 + return AMDGPU_GEM_DOMAIN_MMIO_REMAP; 170 172 default: 171 173 break; 172 174 }
+2
drivers/gpu/drm/amd/amdgpu/amdgpu_res_cursor.h
··· 91 91 break; 92 92 case TTM_PL_TT: 93 93 case AMDGPU_PL_DOORBELL: 94 + case AMDGPU_PL_MMIO_REMAP: 94 95 node = to_ttm_range_mgr_node(res)->mm_nodes; 95 96 while (start >= node->size << PAGE_SHIFT) 96 97 start -= node++->size << PAGE_SHIFT; ··· 154 153 break; 155 154 case TTM_PL_TT: 156 155 case AMDGPU_PL_DOORBELL: 156 + case AMDGPU_PL_MMIO_REMAP: 157 157 node = cur->node; 158 158 159 159 cur->node = ++node;