From: Oded Gabbay <oded.gabbay@amd.com>
To: "Zhou, Jammy" <Jammy.Zhou@amd.com>,
"dri-devel@lists.freedesktop.org"
<dri-devel@lists.freedesktop.org>
Subject: Re: [PATCH] drm/amdkfd: Fix bug in pipelines initialization
Date: Thu, 22 Jan 2015 12:36:31 +0200 [thread overview]
Message-ID: <54C0D2AF.3040205@amd.com> (raw)
In-Reply-To: <FD5696F5CDD4B04D92C97DB96167DECA16035C7E@SCYBEXDAG04.amd.com>
On 01/22/2015 12:22 PM, Zhou, Jammy wrote:
> Hi Oded,
>
> - pipe_hpd_addr = dqm->pipelines_addr + i * CIK_HPD_EOP_BYTES;
> + pipe_hpd_addr = dqm->pipelines_addr + inx * CIK_HPD_EOP_BYTES;
> I think 'i' should still be used here, because it is the real index in the buffer
>
I guess that 'i' can still be used here, because we allocate the HPD buffer in
GART (which pipelines_addr points to). I'll change that.
However, this made me re-check the entire call path, and I found that in the
init_pipeline interface function we automatically increase the pipe_id parameter
(which is 'inx' here) by 1. That is definitely wrong on all levels, as
first_pipe might not be 1 and also we should pass the correct pipe_id to the
function. So I'm going to fix that as well.
> Besides, for the code below in init_scheduler(), it looks like the KFD_DQM_FIRST_PIPE is not correct, and we probably need to use get_first_pipe(dqm) instead.
>
> retval = init_pipelines(dqm, get_pipes_num(dqm), KFD_DQM_FIRST_PIPE);
>
Yes, it seems you are correct. I'll fix it.
Thanks for the comments.
Oded
> Regards,
> Jammy
>
> -----Original Message-----
> From: dri-devel [mailto:dri-devel-bounces@lists.freedesktop.org] On Behalf Of Gabbay, Oded
> Sent: Thursday, January 22, 2015 5:07 PM
> To: dri-devel@lists.freedesktop.org
> Subject: [PATCH] drm/amdkfd: Fix bug in pipelines initialization
>
> This patch fixes a bug when calling to init_pipeline() interface.
> The index that was passed to that function didn't take into account the first_pipe value, which represents the first pipe index that is under amdkfd's responsibility.
>
> Signed-off-by: Oded Gabbay <oded.gabbay@amd.com>
> ---
> drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c b/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c
> index b9626ae..fbb353f 100644
> --- a/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c
> +++ b/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c
> @@ -565,10 +565,10 @@ static int init_pipelines(struct device_queue_manager *dqm,
>
> for (i = 0; i < pipes_num; i++) {
> inx = i + first_pipe;
> - pipe_hpd_addr = dqm->pipelines_addr + i * CIK_HPD_EOP_BYTES;
> + pipe_hpd_addr = dqm->pipelines_addr + inx * CIK_HPD_EOP_BYTES;
> pr_debug("kfd: pipeline address %llX\n", pipe_hpd_addr);
> /* = log2(bytes/4)-1 */
> - kfd2kgd->init_pipeline(dqm->dev->kgd, i,
> + kfd2kgd->init_pipeline(dqm->dev->kgd, inx,
> CIK_HPD_EOP_BYTES_LOG2 - 3, pipe_hpd_addr);
> }
>
> --
> 1.9.1
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel
>
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel
prev parent reply other threads:[~2015-01-22 10:37 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-22 9:06 [PATCH] drm/amdkfd: Fix bug in pipelines initialization Oded Gabbay
2015-01-22 10:22 ` Zhou, Jammy
2015-01-22 10:36 ` Oded Gabbay [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=54C0D2AF.3040205@amd.com \
--to=oded.gabbay@amd.com \
--cc=Jammy.Zhou@amd.com \
--cc=dri-devel@lists.freedesktop.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox