]> git.baikalelectronics.ru Git - kernel.git/commit
drm/amdgpu: restrict the hw sched jobs number to power of two
authorKevin Wang <kevin1.wang@amd.com>
Sun, 19 Jan 2020 09:20:43 +0000 (17:20 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 1 Jul 2020 05:59:23 +0000 (01:59 -0400)
commit03c3c8949c9f1f8e732f12e1a66b99f9c087a056
tree3e0aeb5846435539815c364b48a98a991136e35a
parentcf10cf7e35bc5e6d247e90d0ef2d0988b63b5899
drm/amdgpu: restrict the hw sched jobs number to power of two

the module parameter sched_hw_submission is probably from user mode,
and the kernel need to check whether it is legal.

1. align hw sched jobs to power of 2 and set minimum number is 2.
2. use kernel api is_power_of_2() to simplify driver code.

Signed-off-by: Kevin Wang <kevin1.wang@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c