diff options
author | shaoyunl <Shaoyun.Liu@amd.com> | 2017-11-01 19:21:56 -0400 |
---|---|---|
committer | Oded Gabbay <oded.gabbay@gmail.com> | 2017-11-26 04:31:32 -0500 |
commit | d12fb13f23199faa7e536acec1db49068e5a067d (patch) | |
tree | 0429d7ee902374ab60be9ffb8538ea874b4af320 | |
parent | cf21654b40968609779751b34e7923180968fe5b (diff) |
drm/amdkfd: Fix SDMA ring buffer size calculation
ffs function return the position of the first bit set on 1 based.
(bit zero returns 1).
Signed-off-by: shaoyun liu <shaoyun.liu@amd.com>
Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
Reviewed-by: Oded Gabbay <oded.gabbay@gmail.com>
Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
-rw-r--r-- | drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_cik.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_cik.c b/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_cik.c index 4859d263fa2a..4728fad3fd74 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_cik.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_cik.c | |||
@@ -202,8 +202,8 @@ static int update_mqd_sdma(struct mqd_manager *mm, void *mqd, | |||
202 | struct cik_sdma_rlc_registers *m; | 202 | struct cik_sdma_rlc_registers *m; |
203 | 203 | ||
204 | m = get_sdma_mqd(mqd); | 204 | m = get_sdma_mqd(mqd); |
205 | m->sdma_rlc_rb_cntl = ffs(q->queue_size / sizeof(unsigned int)) << | 205 | m->sdma_rlc_rb_cntl = (ffs(q->queue_size / sizeof(unsigned int)) - 1) |
206 | SDMA0_RLC0_RB_CNTL__RB_SIZE__SHIFT | | 206 | << SDMA0_RLC0_RB_CNTL__RB_SIZE__SHIFT | |
207 | q->vmid << SDMA0_RLC0_RB_CNTL__RB_VMID__SHIFT | | 207 | q->vmid << SDMA0_RLC0_RB_CNTL__RB_VMID__SHIFT | |
208 | 1 << SDMA0_RLC0_RB_CNTL__RPTR_WRITEBACK_ENABLE__SHIFT | | 208 | 1 << SDMA0_RLC0_RB_CNTL__RPTR_WRITEBACK_ENABLE__SHIFT | |
209 | 6 << SDMA0_RLC0_RB_CNTL__RPTR_WRITEBACK_TIMER__SHIFT; | 209 | 6 << SDMA0_RLC0_RB_CNTL__RPTR_WRITEBACK_TIMER__SHIFT; |