diff options
| author | Chunming Zhou <[email protected]> | 2015-12-10 09:34:33 +0000 |
|---|---|---|
| committer | Alex Deucher <[email protected]> | 2015-12-18 22:29:44 +0000 |
| commit | 5b0112356cf9a735632b26ff5f3450e1716c8598 (patch) | |
| tree | 12bc09ab704fa9a8e6118f8f83fbab14cf4dc436 /drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | |
| parent | drm/amdgpu: limit visible vram if it's smaller than the BAR (diff) | |
| download | kernel-5b0112356cf9a735632b26ff5f3450e1716c8598.tar.gz kernel-5b0112356cf9a735632b26ff5f3450e1716c8598.zip | |
drm/amdgpu: restrict the sched jobs number to power of two
Signed-off-by: Chunming Zhou <[email protected]>
Reviewed-by: Christian König <[email protected]>
CC: [email protected]
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_device.c')
| -rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c index 54af6ce7901f..587ff7145361 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c @@ -949,6 +949,15 @@ static bool amdgpu_check_pot_argument(int arg) */ static void amdgpu_check_arguments(struct amdgpu_device *adev) { + if (amdgpu_sched_jobs < 4) { + dev_warn(adev->dev, "sched jobs (%d) must be at least 4\n", + amdgpu_sched_jobs); + amdgpu_sched_jobs = 4; + } else if (!amdgpu_check_pot_argument(amdgpu_sched_jobs)){ + dev_warn(adev->dev, "sched jobs (%d) must be a power of 2\n", + amdgpu_sched_jobs); + amdgpu_sched_jobs = roundup_pow_of_two(amdgpu_sched_jobs); + } /* vramlimit must be a power of two */ if (!amdgpu_check_pot_argument(amdgpu_vram_limit)) { dev_warn(adev->dev, "vram limit (%d) must be a power of 2\n", |
