Lines Matching full:mc
207 * @mc: memory controller structure holding memory information
213 void amdgpu_gmc_vram_location(struct amdgpu_device *adev, struct amdgpu_gmc *mc, in amdgpu_gmc_vram_location() argument
219 mc->vram_start = base; in amdgpu_gmc_vram_location()
220 mc->vram_end = mc->vram_start + mc->mc_vram_size - 1; in amdgpu_gmc_vram_location()
221 if (limit < mc->real_vram_size) in amdgpu_gmc_vram_location()
222 mc->real_vram_size = limit; in amdgpu_gmc_vram_location()
224 if (vis_limit && vis_limit < mc->visible_vram_size) in amdgpu_gmc_vram_location()
225 mc->visible_vram_size = vis_limit; in amdgpu_gmc_vram_location()
227 if (mc->real_vram_size < mc->visible_vram_size) in amdgpu_gmc_vram_location()
228 mc->visible_vram_size = mc->real_vram_size; in amdgpu_gmc_vram_location()
230 if (mc->xgmi.num_physical_nodes == 0) { in amdgpu_gmc_vram_location()
231 mc->fb_start = mc->vram_start; in amdgpu_gmc_vram_location()
232 mc->fb_end = mc->vram_end; in amdgpu_gmc_vram_location()
235 mc->mc_vram_size >> 20, mc->vram_start, in amdgpu_gmc_vram_location()
236 mc->vram_end, mc->real_vram_size >> 20); in amdgpu_gmc_vram_location()
242 * @mc: memory controller structure holding memory information
255 void amdgpu_gmc_sysvm_location(struct amdgpu_device *adev, struct amdgpu_gmc *mc) in amdgpu_gmc_sysvm_location() argument
258 u64 hive_vram_end = mc->xgmi.node_segment_size * mc->xgmi.num_physical_nodes - 1; in amdgpu_gmc_sysvm_location()
259 mc->vram_start = mc->xgmi.node_segment_size * mc->xgmi.physical_node_id; in amdgpu_gmc_sysvm_location()
260 mc->vram_end = mc->vram_start + mc->xgmi.node_segment_size - 1; in amdgpu_gmc_sysvm_location()
262 mc->gart_start = ALIGN(hive_vram_end + 1, four_gb); in amdgpu_gmc_sysvm_location()
263 mc->gart_end = mc->gart_start + mc->gart_size - 1; in amdgpu_gmc_sysvm_location()
265 /* set mc->vram_start to 0 to switch the returned GPU address of in amdgpu_gmc_sysvm_location()
268 mc->vram_start = 0; in amdgpu_gmc_sysvm_location()
269 mc->vram_end = mc->vram_start + mc->mc_vram_size - 1; in amdgpu_gmc_sysvm_location()
270 mc->visible_vram_size = min(mc->visible_vram_size, mc->real_vram_size); in amdgpu_gmc_sysvm_location()
272 mc->fb_start = hive_vram_start; in amdgpu_gmc_sysvm_location()
273 mc->fb_end = hive_vram_end; in amdgpu_gmc_sysvm_location()
276 mc->mc_vram_size >> 20, mc->vram_start, in amdgpu_gmc_sysvm_location()
277 mc->vram_end, mc->real_vram_size >> 20); in amdgpu_gmc_sysvm_location()
279 mc->gart_size >> 20, mc->gart_start, mc->gart_end); in amdgpu_gmc_sysvm_location()
286 * @mc: memory controller structure holding memory information
293 void amdgpu_gmc_gart_location(struct amdgpu_device *adev, struct amdgpu_gmc *mc, in amdgpu_gmc_gart_location() argument
297 /*To avoid the hole, limit the max mc address to AMDGPU_GMC_HOLE_START*/ in amdgpu_gmc_gart_location()
303 size_bf = mc->fb_start; in amdgpu_gmc_gart_location()
304 size_af = max_mc_address + 1 - ALIGN(mc->fb_end + 1, four_gb); in amdgpu_gmc_gart_location()
306 if (mc->gart_size > max(size_bf, size_af)) { in amdgpu_gmc_gart_location()
308 mc->gart_size = max(size_bf, size_af); in amdgpu_gmc_gart_location()
313 mc->gart_start = max_mc_address - mc->gart_size + 1; in amdgpu_gmc_gart_location()
316 mc->gart_start = 0; in amdgpu_gmc_gart_location()
320 if ((size_bf >= mc->gart_size && size_bf < size_af) || in amdgpu_gmc_gart_location()
321 (size_af < mc->gart_size)) in amdgpu_gmc_gart_location()
322 mc->gart_start = 0; in amdgpu_gmc_gart_location()
324 mc->gart_start = max_mc_address - mc->gart_size + 1; in amdgpu_gmc_gart_location()
328 mc->gart_start &= ~(four_gb - 1); in amdgpu_gmc_gart_location()
329 mc->gart_end = mc->gart_start + mc->gart_size - 1; in amdgpu_gmc_gart_location()
331 mc->gart_size >> 20, mc->gart_start, mc->gart_end); in amdgpu_gmc_gart_location()
337 * @mc: memory controller structure holding memory information
339 * Function will place try to find a place for the AGP BAR in the MC address
345 void amdgpu_gmc_agp_location(struct amdgpu_device *adev, struct amdgpu_gmc *mc) in amdgpu_gmc_agp_location() argument
351 if (mc->fb_start > mc->gart_start) { in amdgpu_gmc_agp_location()
352 size_bf = (mc->fb_start & sixteen_gb_mask) - in amdgpu_gmc_agp_location()
353 ALIGN(mc->gart_end + 1, sixteen_gb); in amdgpu_gmc_agp_location()
354 size_af = mc->mc_mask + 1 - ALIGN(mc->fb_end + 1, sixteen_gb); in amdgpu_gmc_agp_location()
356 size_bf = mc->fb_start & sixteen_gb_mask; in amdgpu_gmc_agp_location()
357 size_af = (mc->gart_start & sixteen_gb_mask) - in amdgpu_gmc_agp_location()
358 ALIGN(mc->fb_end + 1, sixteen_gb); in amdgpu_gmc_agp_location()
362 mc->agp_start = (mc->fb_start - size_bf) & sixteen_gb_mask; in amdgpu_gmc_agp_location()
363 mc->agp_size = size_bf; in amdgpu_gmc_agp_location()
365 mc->agp_start = ALIGN(mc->fb_end + 1, sixteen_gb); in amdgpu_gmc_agp_location()
366 mc->agp_size = size_af; in amdgpu_gmc_agp_location()
369 mc->agp_end = mc->agp_start + mc->agp_size - 1; in amdgpu_gmc_agp_location()
371 mc->agp_size >> 20, mc->agp_start, mc->agp_end); in amdgpu_gmc_agp_location()
377 * @mc: memory controller structure holding memory information
386 struct amdgpu_gmc *mc) in amdgpu_gmc_set_agp_default() argument
388 mc->agp_start = 0xffffffffffff; in amdgpu_gmc_set_agp_default()
389 mc->agp_end = 0; in amdgpu_gmc_set_agp_default()
390 mc->agp_size = 0; in amdgpu_gmc_set_agp_default()
1099 * amdgpu_gmc_vram_mc2pa - calculate vram buffer's physical address from MC
1103 * @mc_addr: MC address of buffer