Lines Matching full:mc
200 * @mc: memory controller structure holding memory information
206 void amdgpu_gmc_vram_location(struct amdgpu_device *adev, struct amdgpu_gmc *mc, in amdgpu_gmc_vram_location() argument
212 mc->vram_start = base; in amdgpu_gmc_vram_location()
213 mc->vram_end = mc->vram_start + mc->mc_vram_size - 1; in amdgpu_gmc_vram_location()
214 if (limit < mc->real_vram_size) in amdgpu_gmc_vram_location()
215 mc->real_vram_size = limit; in amdgpu_gmc_vram_location()
217 if (vis_limit && vis_limit < mc->visible_vram_size) in amdgpu_gmc_vram_location()
218 mc->visible_vram_size = vis_limit; in amdgpu_gmc_vram_location()
220 if (mc->real_vram_size < mc->visible_vram_size) in amdgpu_gmc_vram_location()
221 mc->visible_vram_size = mc->real_vram_size; in amdgpu_gmc_vram_location()
223 if (mc->xgmi.num_physical_nodes == 0) { in amdgpu_gmc_vram_location()
224 mc->fb_start = mc->vram_start; in amdgpu_gmc_vram_location()
225 mc->fb_end = mc->vram_end; in amdgpu_gmc_vram_location()
228 mc->mc_vram_size >> 20, mc->vram_start, in amdgpu_gmc_vram_location()
229 mc->vram_end, mc->real_vram_size >> 20); in amdgpu_gmc_vram_location()
235 * @mc: memory controller structure holding memory information
248 void amdgpu_gmc_sysvm_location(struct amdgpu_device *adev, struct amdgpu_gmc *mc) in amdgpu_gmc_sysvm_location() argument
251 u64 hive_vram_end = mc->xgmi.node_segment_size * mc->xgmi.num_physical_nodes - 1; in amdgpu_gmc_sysvm_location()
252 mc->vram_start = mc->xgmi.node_segment_size * mc->xgmi.physical_node_id; in amdgpu_gmc_sysvm_location()
253 mc->vram_end = mc->vram_start + mc->xgmi.node_segment_size - 1; in amdgpu_gmc_sysvm_location()
254 mc->gart_start = hive_vram_end + 1; in amdgpu_gmc_sysvm_location()
255 mc->gart_end = mc->gart_start + mc->gart_size - 1; in amdgpu_gmc_sysvm_location()
256 mc->fb_start = hive_vram_start; in amdgpu_gmc_sysvm_location()
257 mc->fb_end = hive_vram_end; in amdgpu_gmc_sysvm_location()
259 mc->mc_vram_size >> 20, mc->vram_start, in amdgpu_gmc_sysvm_location()
260 mc->vram_end, mc->real_vram_size >> 20); in amdgpu_gmc_sysvm_location()
262 mc->gart_size >> 20, mc->gart_start, mc->gart_end); in amdgpu_gmc_sysvm_location()
269 * @mc: memory controller structure holding memory information
276 void amdgpu_gmc_gart_location(struct amdgpu_device *adev, struct amdgpu_gmc *mc, in amdgpu_gmc_gart_location() argument
281 /*To avoid the hole, limit the max mc address to AMDGPU_GMC_HOLE_START*/ in amdgpu_gmc_gart_location()
287 size_bf = mc->fb_start; in amdgpu_gmc_gart_location()
288 size_af = max_mc_address + 1 - ALIGN(mc->fb_end + 1, four_gb); in amdgpu_gmc_gart_location()
290 if (mc->gart_size > max(size_bf, size_af)) { in amdgpu_gmc_gart_location()
292 mc->gart_size = max(size_bf, size_af); in amdgpu_gmc_gart_location()
297 mc->gart_start = max_mc_address - mc->gart_size + 1; in amdgpu_gmc_gart_location()
300 mc->gart_start = 0; in amdgpu_gmc_gart_location()
304 if ((size_bf >= mc->gart_size && size_bf < size_af) || in amdgpu_gmc_gart_location()
305 (size_af < mc->gart_size)) in amdgpu_gmc_gart_location()
306 mc->gart_start = 0; in amdgpu_gmc_gart_location()
308 mc->gart_start = max_mc_address - mc->gart_size + 1; in amdgpu_gmc_gart_location()
312 mc->gart_start &= ~(four_gb - 1); in amdgpu_gmc_gart_location()
313 mc->gart_end = mc->gart_start + mc->gart_size - 1; in amdgpu_gmc_gart_location()
315 mc->gart_size >> 20, mc->gart_start, mc->gart_end); in amdgpu_gmc_gart_location()
321 * @mc: memory controller structure holding memory information
323 * Function will place try to find a place for the AGP BAR in the MC address
329 void amdgpu_gmc_agp_location(struct amdgpu_device *adev, struct amdgpu_gmc *mc) in amdgpu_gmc_agp_location() argument
335 if (mc->fb_start > mc->gart_start) { in amdgpu_gmc_agp_location()
336 size_bf = (mc->fb_start & sixteen_gb_mask) - in amdgpu_gmc_agp_location()
337 ALIGN(mc->gart_end + 1, sixteen_gb); in amdgpu_gmc_agp_location()
338 size_af = mc->mc_mask + 1 - ALIGN(mc->fb_end + 1, sixteen_gb); in amdgpu_gmc_agp_location()
340 size_bf = mc->fb_start & sixteen_gb_mask; in amdgpu_gmc_agp_location()
341 size_af = (mc->gart_start & sixteen_gb_mask) - in amdgpu_gmc_agp_location()
342 ALIGN(mc->fb_end + 1, sixteen_gb); in amdgpu_gmc_agp_location()
346 mc->agp_start = (mc->fb_start - size_bf) & sixteen_gb_mask; in amdgpu_gmc_agp_location()
347 mc->agp_size = size_bf; in amdgpu_gmc_agp_location()
349 mc->agp_start = ALIGN(mc->fb_end + 1, sixteen_gb); in amdgpu_gmc_agp_location()
350 mc->agp_size = size_af; in amdgpu_gmc_agp_location()
353 mc->agp_end = mc->agp_start + mc->agp_size - 1; in amdgpu_gmc_agp_location()
355 mc->agp_size >> 20, mc->agp_start, mc->agp_end); in amdgpu_gmc_agp_location()
361 * @mc: memory controller structure holding memory information
370 struct amdgpu_gmc *mc) in amdgpu_gmc_set_agp_default() argument
372 mc->agp_start = 0xffffffffffff; in amdgpu_gmc_set_agp_default()
373 mc->agp_end = 0; in amdgpu_gmc_set_agp_default()
374 mc->agp_size = 0; in amdgpu_gmc_set_agp_default()
1045 * amdgpu_gmc_vram_mc2pa - calculate vram buffer's physical address from MC
1049 * @mc_addr: MC address of buffer