Skip to content

Commit

Permalink
drm/amdgpu: Remove unnecessary VM size calculations
Browse files Browse the repository at this point in the history
This is now handled in amdgpu_vm_adjust_size.

Change-Id: I273e5901cec0517c56bf56e7dfd7b26a1bc1385f
Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
  • Loading branch information
Felix Kuehling authored and Kent Russell committed Apr 4, 2019
1 parent 4b81218 commit e6a3037
Showing 1 changed file with 0 additions and 24 deletions.
24 changes: 0 additions & 24 deletions drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
Original file line number Diff line number Diff line change
Expand Up @@ -914,9 +914,6 @@ static void amdgpu_device_check_smu_prv_buffer_size(struct amdgpu_device *adev)
*/
static void amdgpu_device_check_arguments(struct amdgpu_device *adev)
{
struct sysinfo si;
int phys_ram_gb, amdgpu_vm_size_aligned;

if (amdgpu_sched_jobs < 4) {
dev_warn(adev->dev, "sched jobs (%d) must be at least 4\n",
amdgpu_sched_jobs);
Expand All @@ -941,27 +938,6 @@ static void amdgpu_device_check_arguments(struct amdgpu_device *adev)
amdgpu_gtt_size = -1;
}

/* Compute the GPU VM space only if the user
* hasn't changed it from the default.
*/
if (amdgpu_vm_size == -1) {
/* Computation depends on the amount of physical RAM available.
* Cannot exceed 1TB.
*/
si_meminfo(&si);
phys_ram_gb = ((uint64_t)si.totalram * si.mem_unit) >> 30;
amdgpu_vm_size = min(phys_ram_gb * 3 + 16, 1024);

/* GPUVM sizes are almost never perfect powers of two.
* Round up to nearest power of two starting from
* the minimum allowed but aligned size of 32GB */
amdgpu_vm_size_aligned = 32;
while (amdgpu_vm_size > amdgpu_vm_size_aligned)
amdgpu_vm_size_aligned *= 2;

amdgpu_vm_size = amdgpu_vm_size_aligned;
}

/* valid range is between 4 and 9 inclusive */
if (amdgpu_vm_fragment_size != -1 &&
(amdgpu_vm_fragment_size > 9 || amdgpu_vm_fragment_size < 4)) {
Expand Down

0 comments on commit e6a3037

Please sign in to comment.