[PATCH 2/8] drm/amdkfd: Correct SDMA ring buffer size
Oded Gabbay
oded.gabbay at gmail.com
Thu Nov 2 15:06:16 UTC 2017
On Thu, Nov 2, 2017 at 1:21 AM, Felix Kuehling <Felix.Kuehling at amd.com> wrote:
> From: shaoyunl <Shaoyun.Liu at amd.com>
>
> ffs function return the position of the first bit set on 1 based.
> (bit zero returns 1).
>
> Signed-off-by: shaoyun liu <shaoyun.liu at amd.com>
> Signed-off-by: Felix Kuehling <Felix.Kuehling at amd.com>
> ---
> drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_cik.c | 4 ++--
> 1 file 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 4859d26..4728fad 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,
> struct cik_sdma_rlc_registers *m;
>
> m = get_sdma_mqd(mqd);
> - m->sdma_rlc_rb_cntl = ffs(q->queue_size / sizeof(unsigned int)) <<
> - SDMA0_RLC0_RB_CNTL__RB_SIZE__SHIFT |
> + m->sdma_rlc_rb_cntl = (ffs(q->queue_size / sizeof(unsigned int)) - 1)
> + << SDMA0_RLC0_RB_CNTL__RB_SIZE__SHIFT |
> q->vmid << SDMA0_RLC0_RB_CNTL__RB_VMID__SHIFT |
> 1 << SDMA0_RLC0_RB_CNTL__RPTR_WRITEBACK_ENABLE__SHIFT |
> 6 << SDMA0_RLC0_RB_CNTL__RPTR_WRITEBACK_TIMER__SHIFT;
> --
> 2.7.4
>
As Felix promised a cleanup later for all the sizeof(unsigned int)
things, this patch is:
Reviewed-by: Oded Gabbay <oded.gabbay at gmail.com>
More information about the amd-gfx
mailing list