All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Zhang, Jerry (Junwei)" <Jerry.Zhang-5C7GfCeVMHo@public.gmane.org>
To: christian.koenig-5C7GfCeVMHo@public.gmane.org,
	amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Cc: Qingqing.Wang-5C7GfCeVMHo@public.gmane.org
Subject: Re: [PATCH] drm/amdgpu/gfx9: fix ngg enablement to clear gds reserved memory
Date: Wed, 10 Jan 2018 17:19:41 +0800	[thread overview]
Message-ID: <5A55DAAD.5030702@amd.com> (raw)
In-Reply-To: <16496903-a459-48f5-b534-fca0e6e0a5fe-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>

On 01/10/2018 04:57 PM, Christian König wrote:
> Am 10.01.2018 um 09:18 schrieb Junwei Zhang:
>> Signed-off-by: Junwei Zhang <Jerry.Zhang@amd.com>
>> ---
>>   drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 8 +++++---
>>   1 file changed, 5 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
>> b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
>> index ae976e3..5f2ae77 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
>> @@ -1069,7 +1069,7 @@ static int gfx_v9_0_ngg_init(struct amdgpu_device *adev)
>>       adev->gds.mem.total_size -= adev->gfx.ngg.gds_reserve_size;
>>       adev->gds.mem.gfx_partition_size -= adev->gfx.ngg.gds_reserve_size;
>>       adev->gfx.ngg.gds_reserve_addr = SOC15_REG_OFFSET(GC, 0, mmGDS_VMID0_BASE);
>> -    adev->gfx.ngg.gds_reserve_addr += adev->gds.mem.gfx_partition_size;
>> +    adev->gfx.ngg.gds_reserve_addr += SOC15_REG_OFFSET(GC, 0, mmGDS_VMID0_SIZE);
>
> Both the old and the new code looks strongly incorrect to me.
>
> SOC15_REG_OFFSET gives you the register offset, not the content of the register.
>
> So adding two register offsets or doesn't seem to make any sense at all.

Thanks to point it out.
It's typo from the very beginning.
Going to correct it with RREG32_SOC15().

Jerry

>
> Regards,
> Christian.
>
>>       /* Primitive Buffer */
>>       r = gfx_v9_0_ngg_create_buf(adev, &adev->gfx.ngg.buf[NGG_PRIM],
>> @@ -1181,13 +1181,15 @@ static int gfx_v9_0_ngg_en(struct amdgpu_device *adev)
>>       amdgpu_ring_write(ring, PACKET3(PACKET3_DMA_DATA, 5));
>>       amdgpu_ring_write(ring, (PACKET3_DMA_DATA_CP_SYNC |
>> +                PACKET3_DMA_DATA_DST_SEL(0) |
>>                   PACKET3_DMA_DATA_SRC_SEL(2)));
>>       amdgpu_ring_write(ring, 0);
>>       amdgpu_ring_write(ring, 0);
>>       amdgpu_ring_write(ring, adev->gfx.ngg.gds_reserve_addr);
>>       amdgpu_ring_write(ring, 0);
>> -    amdgpu_ring_write(ring, adev->gfx.ngg.gds_reserve_size);
>> -
>> +    amdgpu_ring_write(ring, PACKET3_DMA_DATA_CMD_DAS |
>> +                PACKET3_DMA_DATA_CMD_RAW_WAIT |
>> +                adev->gfx.ngg.gds_reserve_size);
>>       gfx_v9_0_write_data_to_reg(ring, 0, false,
>>                      SOC15_REG_OFFSET(GC, 0, mmGDS_VMID0_SIZE), 0);
>
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

      parent reply	other threads:[~2018-01-10  9:19 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-10  8:18 [PATCH] drm/amdgpu/gfx9: fix ngg enablement to clear gds reserved memory Junwei Zhang
     [not found] ` <1515572310-31508-1-git-send-email-Jerry.Zhang-5C7GfCeVMHo@public.gmane.org>
2018-01-10  8:21   ` Wang, Ken
2018-01-10  8:57   ` Christian König
     [not found]     ` <16496903-a459-48f5-b534-fca0e6e0a5fe-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2018-01-10  9:19       ` Zhang, Jerry (Junwei) [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=5A55DAAD.5030702@amd.com \
    --to=jerry.zhang-5c7gfcevmho@public.gmane.org \
    --cc=Qingqing.Wang-5C7GfCeVMHo@public.gmane.org \
    --cc=amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    --cc=christian.koenig-5C7GfCeVMHo@public.gmane.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.