Lines Matching full:mc
198 * @mc: memory controller structure holding memory information
204 void amdgpu_gmc_vram_location(struct amdgpu_device *adev, struct amdgpu_gmc *mc, in amdgpu_gmc_vram_location() argument
209 mc->vram_start = base; in amdgpu_gmc_vram_location()
210 mc->vram_end = mc->vram_start + mc->mc_vram_size - 1; in amdgpu_gmc_vram_location()
211 if (limit && limit < mc->real_vram_size) in amdgpu_gmc_vram_location()
212 mc->real_vram_size = limit; in amdgpu_gmc_vram_location()
214 if (mc->xgmi.num_physical_nodes == 0) { in amdgpu_gmc_vram_location()
215 mc->fb_start = mc->vram_start; in amdgpu_gmc_vram_location()
216 mc->fb_end = mc->vram_end; in amdgpu_gmc_vram_location()
219 mc->mc_vram_size >> 20, mc->vram_start, in amdgpu_gmc_vram_location()
220 mc->vram_end, mc->real_vram_size >> 20); in amdgpu_gmc_vram_location()
226 * @mc: memory controller structure holding memory information
239 void amdgpu_gmc_sysvm_location(struct amdgpu_device *adev, struct amdgpu_gmc *mc) in amdgpu_gmc_sysvm_location() argument
242 u64 hive_vram_end = mc->xgmi.node_segment_size * mc->xgmi.num_physical_nodes - 1; in amdgpu_gmc_sysvm_location()
243 mc->vram_start = mc->xgmi.node_segment_size * mc->xgmi.physical_node_id; in amdgpu_gmc_sysvm_location()
244 mc->vram_end = mc->vram_start + mc->xgmi.node_segment_size - 1; in amdgpu_gmc_sysvm_location()
245 mc->gart_start = hive_vram_end + 1; in amdgpu_gmc_sysvm_location()
246 mc->gart_end = mc->gart_start + mc->gart_size - 1; in amdgpu_gmc_sysvm_location()
247 mc->fb_start = hive_vram_start; in amdgpu_gmc_sysvm_location()
248 mc->fb_end = hive_vram_end; in amdgpu_gmc_sysvm_location()
250 mc->mc_vram_size >> 20, mc->vram_start, in amdgpu_gmc_sysvm_location()
251 mc->vram_end, mc->real_vram_size >> 20); in amdgpu_gmc_sysvm_location()
253 mc->gart_size >> 20, mc->gart_start, mc->gart_end); in amdgpu_gmc_sysvm_location()
260 * @mc: memory controller structure holding memory information
266 void amdgpu_gmc_gart_location(struct amdgpu_device *adev, struct amdgpu_gmc *mc) in amdgpu_gmc_gart_location() argument
270 /*To avoid the hole, limit the max mc address to AMDGPU_GMC_HOLE_START*/ in amdgpu_gmc_gart_location()
276 size_bf = mc->fb_start; in amdgpu_gmc_gart_location()
277 size_af = max_mc_address + 1 - ALIGN(mc->fb_end + 1, four_gb); in amdgpu_gmc_gart_location()
279 if (mc->gart_size > max(size_bf, size_af)) { in amdgpu_gmc_gart_location()
281 mc->gart_size = max(size_bf, size_af); in amdgpu_gmc_gart_location()
284 if ((size_bf >= mc->gart_size && size_bf < size_af) || in amdgpu_gmc_gart_location()
285 (size_af < mc->gart_size)) in amdgpu_gmc_gart_location()
286 mc->gart_start = 0; in amdgpu_gmc_gart_location()
288 mc->gart_start = max_mc_address - mc->gart_size + 1; in amdgpu_gmc_gart_location()
290 mc->gart_start &= ~(four_gb - 1); in amdgpu_gmc_gart_location()
291 mc->gart_end = mc->gart_start + mc->gart_size - 1; in amdgpu_gmc_gart_location()
293 mc->gart_size >> 20, mc->gart_start, mc->gart_end); in amdgpu_gmc_gart_location()
299 * @mc: memory controller structure holding memory information
301 * Function will place try to find a place for the AGP BAR in the MC address
307 void amdgpu_gmc_agp_location(struct amdgpu_device *adev, struct amdgpu_gmc *mc) in amdgpu_gmc_agp_location() argument
314 mc->agp_start = 0xffffffffffff; in amdgpu_gmc_agp_location()
315 mc->agp_end = 0x0; in amdgpu_gmc_agp_location()
316 mc->agp_size = 0; in amdgpu_gmc_agp_location()
321 if (mc->fb_start > mc->gart_start) { in amdgpu_gmc_agp_location()
322 size_bf = (mc->fb_start & sixteen_gb_mask) - in amdgpu_gmc_agp_location()
323 ALIGN(mc->gart_end + 1, sixteen_gb); in amdgpu_gmc_agp_location()
324 size_af = mc->mc_mask + 1 - ALIGN(mc->fb_end + 1, sixteen_gb); in amdgpu_gmc_agp_location()
326 size_bf = mc->fb_start & sixteen_gb_mask; in amdgpu_gmc_agp_location()
327 size_af = (mc->gart_start & sixteen_gb_mask) - in amdgpu_gmc_agp_location()
328 ALIGN(mc->fb_end + 1, sixteen_gb); in amdgpu_gmc_agp_location()
332 mc->agp_start = (mc->fb_start - size_bf) & sixteen_gb_mask; in amdgpu_gmc_agp_location()
333 mc->agp_size = size_bf; in amdgpu_gmc_agp_location()
335 mc->agp_start = ALIGN(mc->fb_end + 1, sixteen_gb); in amdgpu_gmc_agp_location()
336 mc->agp_size = size_af; in amdgpu_gmc_agp_location()
339 mc->agp_end = mc->agp_start + mc->agp_size - 1; in amdgpu_gmc_agp_location()
341 mc->agp_size >> 20, mc->agp_start, mc->agp_end); in amdgpu_gmc_agp_location()
776 * amdgpu_gmc_vram_mc2pa - calculate vram buffer's physical address from MC
780 * @mc_addr: MC address of buffer