Lines Matching full:mc

141  * @mc: memory controller structure holding memory information
147 void amdgpu_gmc_vram_location(struct amdgpu_device *adev, struct amdgpu_gmc *mc, in amdgpu_gmc_vram_location() argument
152 mc->vram_start = base; in amdgpu_gmc_vram_location()
153 mc->vram_end = mc->vram_start + mc->mc_vram_size - 1; in amdgpu_gmc_vram_location()
154 if (limit && limit < mc->real_vram_size) in amdgpu_gmc_vram_location()
155 mc->real_vram_size = limit; in amdgpu_gmc_vram_location()
157 if (mc->xgmi.num_physical_nodes == 0) { in amdgpu_gmc_vram_location()
158 mc->fb_start = mc->vram_start; in amdgpu_gmc_vram_location()
159 mc->fb_end = mc->vram_end; in amdgpu_gmc_vram_location()
162 mc->mc_vram_size >> 20, mc->vram_start, in amdgpu_gmc_vram_location()
163 mc->vram_end, mc->real_vram_size >> 20); in amdgpu_gmc_vram_location()
170 * @mc: memory controller structure holding memory information
177 void amdgpu_gmc_gart_location(struct amdgpu_device *adev, struct amdgpu_gmc *mc) in amdgpu_gmc_gart_location() argument
181 /*To avoid the hole, limit the max mc address to AMDGPU_GMC_HOLE_START*/ in amdgpu_gmc_gart_location()
184 mc->gart_size += adev->pm.smu_prv_buffer_size; in amdgpu_gmc_gart_location()
189 size_bf = mc->fb_start; in amdgpu_gmc_gart_location()
190 size_af = max_mc_address + 1 - ALIGN(mc->fb_end + 1, four_gb); in amdgpu_gmc_gart_location()
192 if (mc->gart_size > max(size_bf, size_af)) { in amdgpu_gmc_gart_location()
194 mc->gart_size = max(size_bf, size_af); in amdgpu_gmc_gart_location()
197 if ((size_bf >= mc->gart_size && size_bf < size_af) || in amdgpu_gmc_gart_location()
198 (size_af < mc->gart_size)) in amdgpu_gmc_gart_location()
199 mc->gart_start = 0; in amdgpu_gmc_gart_location()
201 mc->gart_start = max_mc_address - mc->gart_size + 1; in amdgpu_gmc_gart_location()
203 mc->gart_start &= ~(four_gb - 1); in amdgpu_gmc_gart_location()
204 mc->gart_end = mc->gart_start + mc->gart_size - 1; in amdgpu_gmc_gart_location()
206 mc->gart_size >> 20, mc->gart_start, mc->gart_end); in amdgpu_gmc_gart_location()
212 * @mc: memory controller structure holding memory information
214 * Function will place try to find a place for the AGP BAR in the MC address
220 void amdgpu_gmc_agp_location(struct amdgpu_device *adev, struct amdgpu_gmc *mc) in amdgpu_gmc_agp_location() argument
227 mc->agp_start = 0xffffffffffff; in amdgpu_gmc_agp_location()
228 mc->agp_end = 0x0; in amdgpu_gmc_agp_location()
229 mc->agp_size = 0; in amdgpu_gmc_agp_location()
234 if (mc->fb_start > mc->gart_start) { in amdgpu_gmc_agp_location()
235 size_bf = (mc->fb_start & sixteen_gb_mask) - in amdgpu_gmc_agp_location()
236 ALIGN(mc->gart_end + 1, sixteen_gb); in amdgpu_gmc_agp_location()
237 size_af = mc->mc_mask + 1 - ALIGN(mc->fb_end + 1, sixteen_gb); in amdgpu_gmc_agp_location()
239 size_bf = mc->fb_start & sixteen_gb_mask; in amdgpu_gmc_agp_location()
240 size_af = (mc->gart_start & sixteen_gb_mask) - in amdgpu_gmc_agp_location()
241 ALIGN(mc->fb_end + 1, sixteen_gb); in amdgpu_gmc_agp_location()
245 mc->agp_start = (mc->fb_start - size_bf) & sixteen_gb_mask; in amdgpu_gmc_agp_location()
246 mc->agp_size = size_bf; in amdgpu_gmc_agp_location()
248 mc->agp_start = ALIGN(mc->fb_end + 1, sixteen_gb); in amdgpu_gmc_agp_location()
249 mc->agp_size = size_af; in amdgpu_gmc_agp_location()
252 mc->agp_end = mc->agp_start + mc->agp_size - 1; in amdgpu_gmc_agp_location()
254 mc->agp_size >> 20, mc->agp_start, mc->agp_end); in amdgpu_gmc_agp_location()