mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git
synced 2026-04-18 03:23:53 -04:00
drm/amdgpu: cleanup visible vram size handling
Centralize the limit handling and validation in one place instead of spreading that around in different hw generations. Signed-off-by: Christian König <christian.koenig@amd.com> Acked-by: Luben Tuikov <luben.tuikov@amd.com> Acked-by: Felix Kuehling <Felix.Kuehling@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
committed by
Alex Deucher
parent
7ccfd79fdd
commit
da2f992091
@@ -201,6 +201,7 @@ uint64_t amdgpu_gmc_agp_addr(struct ttm_buffer_object *bo)
|
||||
void amdgpu_gmc_vram_location(struct amdgpu_device *adev, struct amdgpu_gmc *mc,
|
||||
u64 base)
|
||||
{
|
||||
uint64_t vis_limit = (uint64_t)amdgpu_vis_vram_limit << 20;
|
||||
uint64_t limit = (uint64_t)amdgpu_vram_limit << 20;
|
||||
|
||||
mc->vram_start = base;
|
||||
@@ -208,6 +209,12 @@ void amdgpu_gmc_vram_location(struct amdgpu_device *adev, struct amdgpu_gmc *mc,
|
||||
if (limit && limit < mc->real_vram_size)
|
||||
mc->real_vram_size = limit;
|
||||
|
||||
if (vis_limit && vis_limit < mc->visible_vram_size)
|
||||
mc->visible_vram_size = vis_limit;
|
||||
|
||||
if (mc->real_vram_size < mc->visible_vram_size)
|
||||
mc->visible_vram_size = mc->real_vram_size;
|
||||
|
||||
if (mc->xgmi.num_physical_nodes == 0) {
|
||||
mc->fb_start = mc->vram_start;
|
||||
mc->fb_end = mc->vram_end;
|
||||
|
||||
Reference in New Issue
Block a user