diff options
author | Christian König <christian.koenig@amd.com> | 2016-03-15 14:52:26 +0100 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2016-03-16 17:59:12 -0400 |
commit | e6151a08bbb3c85cd0b23813432690939e143131 (patch) | |
tree | 26f58e9030f2d31d635d27ce981ec835933c84d1 /drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c | |
parent | 189e0fb763045aecc39c43100cd489c8756f3413 (diff) | |
download | talos-obmc-linux-e6151a08bbb3c85cd0b23813432690939e143131.tar.gz talos-obmc-linux-e6151a08bbb3c85cd0b23813432690939e143131.zip |
drm/amdgpu: add number of hardware submissions to amdgpu_fence_driver_init_ring
Make this a parameter instead of using the global variable directly.
Signed-off-by: Christian König <christian.koenig@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Chunming Zhou <david1.zhou@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c index ec73ab1c177d..4654113ecfae 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c @@ -355,15 +355,21 @@ int amdgpu_fence_driver_start_ring(struct amdgpu_ring *ring, * for the requested ring. * * @ring: ring to init the fence driver on + * @num_hw_submission: number of entries on the hardware queue * * Init the fence driver for the requested ring (all asics). * Helper function for amdgpu_fence_driver_init(). */ -int amdgpu_fence_driver_init_ring(struct amdgpu_ring *ring) +int amdgpu_fence_driver_init_ring(struct amdgpu_ring *ring, + unsigned num_hw_submission) { long timeout; int r; + /* Check that num_hw_submission is a power of two */ + if ((num_hw_submission & (num_hw_submission - 1)) != 0) + return -EINVAL; + ring->fence_drv.cpu_addr = NULL; ring->fence_drv.gpu_addr = 0; ring->fence_drv.sync_seq = 0; @@ -387,7 +393,7 @@ int amdgpu_fence_driver_init_ring(struct amdgpu_ring *ring) timeout = MAX_SCHEDULE_TIMEOUT; } r = amd_sched_init(&ring->sched, &amdgpu_sched_ops, - amdgpu_sched_hw_submission, + num_hw_submission, timeout, ring->name); if (r) { DRM_ERROR("Failed to create scheduler on ring %s.\n", |