All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Zeng, Oak" <Oak.Zeng-5C7GfCeVMHo@public.gmane.org>
To: "Deucher,
	Alexander" <Alexander.Deucher-5C7GfCeVMHo@public.gmane.org>,
	Alex Deucher
	<alexdeucher-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	"Koenig,
	Christian" <Christian.Koenig-5C7GfCeVMHo@public.gmane.org>
Cc: amd-gfx list <amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org>
Subject: RE: [PATCH 7/7] drm/amdgpu: Use new doorbell layout for vega20 and future asic
Date: Fri, 23 Nov 2018 19:38:15 +0000	[thread overview]
Message-ID: <BN6PR12MB165194EF202C47EE0C8487BE80D40@BN6PR12MB1651.namprd12.prod.outlook.com> (raw)
In-Reply-To: <BN6PR12MB180946F99B5AA562E542C4EBF7D40-/b2+HYfkarSEx6ez0IUAagdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>


[-- Attachment #1.1: Type: text/plain, Size: 10800 bytes --]

Hi Alex,

It is strange I didn't get your email on Wednesday. I will add one patch to move all the doorbell definitions to a separate amdgpu_doorbell.h

Regards,
Oak

From: Deucher, Alexander <Alexander.Deucher-5C7GfCeVMHo@public.gmane.org>
Sent: Friday, November 23, 2018 1:57 PM
To: Alex Deucher <alexdeucher-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>; Zeng, Oak <Oak.Zeng-5C7GfCeVMHo@public.gmane.org>; Koenig, Christian <Christian.Koenig-5C7GfCeVMHo@public.gmane.org>
Cc: amd-gfx list <amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org>
Subject: Re: [PATCH 7/7] drm/amdgpu: Use new doorbell layout for vega20 and future asic


The main idea is to be able to use different layouts on different asics that may share the same IP code.



Alex

________________________________
From: amd-gfx <amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org<mailto:amd-gfx-bounces@lists.freedesktop.org>> on behalf of Christian König <ckoenig.leichtzumerken-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org<mailto:ckoenig.leichtzumerken-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>>
Sent: Thursday, November 22, 2018 4:26:53 AM
To: Alex Deucher; Zeng, Oak
Cc: amd-gfx list
Subject: Re: [PATCH 7/7] drm/amdgpu: Use new doorbell layout for vega20 and future asic

Am 21.11.18 um 17:39 schrieb Alex Deucher:
> On Wed, Nov 21, 2018 at 11:37 AM Zeng, Oak <Oak.Zeng-5C7GfCeVMHo@public.gmane.org<mailto:Oak.Zeng-5C7GfCeVMHo@public.gmane.org>> wrote:
>>> No need to add a new file for this.  Just add this to vega20_reg_init.c.
>> Agreed.
>>
>>> Also, please use the doorbell enums rather than hardcoding the numbers.
>> Ok. Where should I put the doorbell enums for vega20? In amdgpu.h or in vega20_reg_init.c?
> Maybe add amdgpu_doorbell.h and move all of the enums there?

Mhm, isn't part of the goal of this work to get rid of the enums?

I mean when we have a structure to hold the indexes to we really need
the enums any more? I don't think so.

Christian.

>
> Alex
>
>> thanks,
>> Oak
>>
>> -----Original Message-----
>> From: amd-gfx <amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org<mailto:amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org>> On Behalf Of Alex Deucher
>> Sent: Wednesday, November 21, 2018 11:22 AM
>> To: Zeng, Oak <Oak.Zeng-5C7GfCeVMHo@public.gmane.org<mailto:Oak.Zeng-5C7GfCeVMHo@public.gmane.org>>
>> Cc: Zeng, Oak <Oak.Zeng-5C7GfCeVMHo@public.gmane.org<mailto:Oak.Zeng-5C7GfCeVMHo@public.gmane.org>>; amd-gfx list <amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org<mailto:amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org>>
>> Subject: Re: [PATCH 7/7] drm/amdgpu: Use new doorbell layout for vega20 and future asic
>>
>> On Wed, Nov 21, 2018 at 10:52 AM Oak Zeng <ozeng-5C7GfCeVMHo@public.gmane.org<mailto:ozeng@amd.com>> wrote:
>>> Change-Id: I04d22fb717ac50483c0835f160a2e860e344f358
>>> Signed-off-by: Oak Zeng <ozeng-5C7GfCeVMHo@public.gmane.org<mailto:ozeng-5C7GfCeVMHo@public.gmane.org>>
>>> Suggested-by: Felix Kuehling <Felix.Kuehling-5C7GfCeVMHo@public.gmane.org<mailto:Felix.Kuehling-5C7GfCeVMHo@public.gmane.org>>
>>> Suggested-by: Alex Deucher <alexander.deucher-5C7GfCeVMHo@public.gmane.org<mailto:alexander.deucher-5C7GfCeVMHo@public.gmane.org>>
>>> ---
>>>   drivers/gpu/drm/amd/amdgpu/Makefile                |  4 +-
>>>   drivers/gpu/drm/amd/amdgpu/amdgpu_device.c         |  4 +-
>>>   drivers/gpu/drm/amd/amdgpu/soc15.h                 |  1 +
>>>   .../drm/amd/amdgpu/vega20_doorbell_index_init.c    | 64 ++++++++++++++++++++++
>>>   4 files changed, 70 insertions(+), 3 deletions(-)  create mode 100644
>>> drivers/gpu/drm/amd/amdgpu/vega20_doorbell_index_init.c
>>>
>>> diff --git a/drivers/gpu/drm/amd/amdgpu/Makefile
>>> b/drivers/gpu/drm/amd/amdgpu/Makefile
>>> index 3ab8eba..b3b150b 100644
>>> --- a/drivers/gpu/drm/amd/amdgpu/Makefile
>>> +++ b/drivers/gpu/drm/amd/amdgpu/Makefile
>>> @@ -63,8 +63,8 @@ amdgpu-$(CONFIG_DRM_AMDGPU_SI)+= si.o gmc_v6_0.o
>>> gfx_v6_0.o si_ih.o si_dma.o dce
>>>
>>>   amdgpu-y += \
>>>          vi.o mxgpu_vi.o nbio_v6_1.o soc15.o emu_soc.o mxgpu_ai.o nbio_v7_0.o vega10_reg_init.o \
>>> -       vega20_reg_init.o nbio_v7_4.o vega10_doorbell_index_init.o vega12_doorbell_index_init.o \
>>> -       vi_doorbell_index_init.o
>>> +       vega20_reg_init.o nbio_v7_4.o vi_doorbell_index_init.o vega10_doorbell_index_init.o \
>>> +       vega12_doorbell_index_init.o vega20_doorbell_index_init.o
>>>
>>>   # add DF block
>>>   amdgpu-y += \
>>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
>>> b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
>>> index 3ffd8f5..19f2149 100644
>>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
>>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
>>> @@ -517,8 +517,10 @@ static int amdgpu_device_doorbell_init(struct amdgpu_device *adev)
>>>                  vi_doorbell_index_init(adev);
>>>          else if (adev->asic_type == CHIP_VEGA10)
>>>                  vega10_doorbell_index_init(adev);
>>> -       else
>>> +       else if (adev->asic_type == CHIP_VEGA12 || adev->asic_type ==
>>> + CHIP_RAVEN)
>>>                  vega12_doorbell_index_init(adev);
>>> +       else
>>> +               vega20_doorbell_index_init(adev);
>>>
>>>          /* No doorbell on SI hardware generation */
>>>          if (adev->asic_type < CHIP_BONAIRE) { diff --git
>>> a/drivers/gpu/drm/amd/amdgpu/soc15.h
>>> b/drivers/gpu/drm/amd/amdgpu/soc15.h
>>> index 939c0e8..6ba0d26 100644
>>> --- a/drivers/gpu/drm/amd/amdgpu/soc15.h
>>> +++ b/drivers/gpu/drm/amd/amdgpu/soc15.h
>>> @@ -60,4 +60,5 @@ int vega20_reg_base_init(struct amdgpu_device
>>> *adev);
>>>
>>>   void vega10_doorbell_index_init(struct amdgpu_device *adev);  void
>>> vega12_doorbell_index_init(struct amdgpu_device *adev);
>>> +void vega20_doorbell_index_init(struct amdgpu_device *adev);
>>>   #endif
>>> diff --git a/drivers/gpu/drm/amd/amdgpu/vega20_doorbell_index_init.c
>>> b/drivers/gpu/drm/amd/amdgpu/vega20_doorbell_index_init.c
>>> new file mode 100644
>>> index 0000000..dcaef7f
>>> --- /dev/null
>>> +++ b/drivers/gpu/drm/amd/amdgpu/vega20_doorbell_index_init.c
>>> @@ -0,0 +1,64 @@
>>> +/*
>>> + * Copyright 2018 Advanced Micro Devices, Inc.
>>> + *
>>> + * Permission is hereby granted, free of charge, to any person
>>> +obtaining a
>>> + * copy of this software and associated documentation files (the
>>> +"Software"),
>>> + * to deal in the Software without restriction, including without
>>> +limitation
>>> + * the rights to use, copy, modify, merge, publish, distribute,
>>> +sublicense,
>>> + * and/or sell copies of the Software, and to permit persons to whom
>>> +the
>>> + * Software is furnished to do so, subject to the following conditions:
>>> + *
>>> + * The above copyright notice and this permission notice shall be
>>> +included in
>>> + * all copies or substantial portions of the Software.
>>> + *
>>> + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
>>> +EXPRESS OR
>>> + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
>>> +MERCHANTABILITY,
>>> + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT
>>> +SHALL
>>> + * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM,
>>> +DAMAGES OR
>>> + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
>>> +OTHERWISE,
>>> + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
>>> +OR
>>> + * OTHER DEALINGS IN THE SOFTWARE.
>>> + *
>>> + */
>>> +
>>> +#include "amdgpu.h"
>>> +
>>> +void vega20_doorbell_index_init(struct amdgpu_device *adev) {
>>> +       /* Compute + GFX: 0~255 */
>>> +       adev->doorbell_index.kiq = 0x00;
>>> +       adev->doorbell_index.mec_ring0 = 0x03;
>>> +       adev->doorbell_index.mec_ring1 = 0x04;
>>> +       adev->doorbell_index.mec_ring2 = 0x05;
>>> +       adev->doorbell_index.mec_ring3 = 0x06;
>>> +       adev->doorbell_index.mec_ring4 = 0x07;
>>> +       adev->doorbell_index.mec_ring5 = 0x08;
>>> +       adev->doorbell_index.mec_ring6 = 0x09;
>>> +       adev->doorbell_index.mec_ring7 = 0x0a;
>>> +       adev->doorbell_index.userqueue_start = 0x0b;
>>> +       adev->doorbell_index.userqueue_end = 0x8a;
>>> +       adev->doorbell_index.gfx_ring0 = 0x8b;
>>> +       /* SDMA:256~335*/
>>> +       adev->doorbell_index.sdma_engine0 = 0x100;
>>> +       adev->doorbell_index.sdma_engine1 = 0x10a;
>>> +       adev->doorbell_index.sdma_engine2 = 0x114;
>>> +       adev->doorbell_index.sdma_engine3 = 0x11e;
>>> +       adev->doorbell_index.sdma_engine4 = 0x128;
>>> +       adev->doorbell_index.sdma_engine5 = 0x132;
>>> +       adev->doorbell_index.sdma_engine6 = 0x13C;
>>> +       adev->doorbell_index.sdma_engine7 = 0x146;
>>> +       /* IH: 376~391 */
>>> +       adev->doorbell_index.ih = 0x178;
>>> +       /* MMSCH: 392~407 */
>>> +       adev->doorbell_index.uvd_vce.uvd_ring0_1 = 0x188;
>>> +       adev->doorbell_index.uvd_vce.uvd_ring2_3 = 0x189;
>>> +       adev->doorbell_index.uvd_vce.uvd_ring4_5 = 0x18a;
>>> +       adev->doorbell_index.uvd_vce.uvd_ring6_7 = 0x18b;
>>> +       adev->doorbell_index.uvd_vce.vce_ring0_1 = 0x18c;
>>> +       adev->doorbell_index.uvd_vce.vce_ring2_3 = 0x18d;
>>> +       adev->doorbell_index.uvd_vce.vce_ring4_5 = 0x18e;
>>> +       adev->doorbell_index.uvd_vce.vce_ring6_7 = 0x18f;
>>> +       /* In unit of dword doorbell */
>>> +       adev->doorbell_index.max_assignment = 0x18f << 1; }
>> No need to add a new file for this.  Just add this to vega20_reg_init.c.  Also, please use the doorbell enums rather than hardcoding the numbers.
>>
>> Alex
>>
>>> +
>>> --
>>> 2.7.4
>>>
>>> _______________________________________________
>>> amd-gfx mailing list
>>> amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org<mailto:amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org>
>>> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
>> _______________________________________________
>> amd-gfx mailing list
>> amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org<mailto:amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org>
>> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
> _______________________________________________
> amd-gfx mailing list
> amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org<mailto:amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org>
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org<mailto:amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org>
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

[-- Attachment #1.2: Type: text/html, Size: 19580 bytes --]

[-- Attachment #2: Type: text/plain, Size: 154 bytes --]

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

  parent reply	other threads:[~2018-11-23 19:38 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-21 15:52 [PATCH 1/7] drm/amdgpu: Add field in amdgpu_dev to hold reserved doorbell index Oak Zeng
     [not found] ` <1542815518-8124-1-git-send-email-ozeng-5C7GfCeVMHo@public.gmane.org>
2018-11-21 15:52   ` [PATCH 2/7] drm/amdgpu: Vega10 doorbell index initialization Oak Zeng
     [not found]     ` <1542815518-8124-2-git-send-email-ozeng-5C7GfCeVMHo@public.gmane.org>
2018-11-21 16:14       ` Alex Deucher
2018-11-21 15:52   ` [PATCH 3/7] drm/amdgpu: Vega12 " Oak Zeng
     [not found]     ` <1542815518-8124-3-git-send-email-ozeng-5C7GfCeVMHo@public.gmane.org>
2018-11-21 16:16       ` Alex Deucher
     [not found]         ` <CADnq5_PjTtoyYDROkVA8DVytBv2sdwS4_z840xzWCdL=RwXbrw@mail.gmail.com>
     [not found]           ` <CADnq5_PjTtoyYDROkVA8DVytBv2sdwS4_z840xzWCdL=RwXbrw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-11-26 15:06             ` Zeng, Oak
2018-11-21 15:52   ` [PATCH 4/7] drm/amdgpu: Doorbell index initialization for ASICs before vega10 Oak Zeng
     [not found]     ` <1542815518-8124-4-git-send-email-ozeng-5C7GfCeVMHo@public.gmane.org>
2018-11-21 16:17       ` Alex Deucher
2018-11-21 15:52   ` [PATCH 5/7] drm/amdgpu: Call doorbell index init on device initialization Oak Zeng
     [not found]     ` <1542815518-8124-5-git-send-email-ozeng-5C7GfCeVMHo@public.gmane.org>
2018-11-21 16:21       ` Alex Deucher
     [not found]         ` <CADnq5_O-ajV9xMFF5BsKUei48LLY1dGV3C_i+oDy+5J+Y2VwHA@mail.gmail.com>
     [not found]           ` <CADnq5_O-ajV9xMFF5BsKUei48LLY1dGV3C_i+oDy+5J+Y2VwHA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-11-26 15:31             ` Zeng, Oak
     [not found]               ` <BN6PR12MB165183EC3AAC7436C0E6846C80D70-/b2+HYfkarRSqX7PDniLCgdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2018-11-26 15:59                 ` Deucher, Alexander
     [not found]                   ` <BN6PR12MB1809D7A7892DC1A246F47750F7D70-/b2+HYfkarSEx6ez0IUAagdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2018-11-26 16:02                     ` Deucher, Alexander
     [not found]                       ` <BN6PR12MB180989D8B99769C89F6F710FF7D70-/b2+HYfkarSEx6ez0IUAagdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2018-11-26 16:20                         ` Zeng, Oak
2018-11-21 15:52   ` [PATCH 6/7] drm/amdgpu: Use asic specific doorbell index instead of macro definition Oak Zeng
2018-11-21 15:52   ` [PATCH 7/7] drm/amdgpu: Use new doorbell layout for vega20 and future asic Oak Zeng
     [not found]     ` <1542815518-8124-7-git-send-email-ozeng-5C7GfCeVMHo@public.gmane.org>
2018-11-21 16:10       ` Liu, Shaoyun
     [not found]         ` <76e4deda-4539-4fdb-3e96-3a3b6f668ec7-5C7GfCeVMHo@public.gmane.org>
2018-11-21 16:32           ` Zeng, Oak
2018-11-21 16:22       ` Alex Deucher
     [not found]         ` <CADnq5_M6+jQpJGF0wscUP917QWbDSwCQTF4TYMTtTXp2vsKXEQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-11-21 16:37           ` Zeng, Oak
     [not found]             ` <BN6PR12MB1651198C70B58BE69A44EBFF80DA0-/b2+HYfkarRSqX7PDniLCgdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2018-11-21 16:39               ` Alex Deucher
     [not found]                 ` <CADnq5_Omgd=yLKuqpb8-ZsrBJdjkEord0OL0WwVpXXcntQaB1A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-11-22  9:26                   ` Christian König
     [not found]                     ` <5a171836-f0bc-4edf-db9d-51746e8c9c4e-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2018-11-23 18:56                       ` Deucher, Alexander
     [not found]                         ` <BN6PR12MB180946F99B5AA562E542C4EBF7D40-/b2+HYfkarSEx6ez0IUAagdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2018-11-23 19:38                           ` Zeng, Oak [this message]
2018-11-21 22:00 [PATCH 1/7] drm/amdgpu: Add field in amdgpu_dev to hold reserved doorbell index Oak Zeng
     [not found] ` <1542837620-13571-1-git-send-email-ozeng-5C7GfCeVMHo@public.gmane.org>
2018-11-21 22:00   ` [PATCH 7/7] drm/amdgpu: Use new doorbell layout for vega20 and future asic Oak Zeng
     [not found]     ` <1542837620-13571-7-git-send-email-ozeng-5C7GfCeVMHo@public.gmane.org>
2018-11-21 22:34       ` Alex Deucher
2018-11-22 19:19       ` Zeng, Oak

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=BN6PR12MB165194EF202C47EE0C8487BE80D40@BN6PR12MB1651.namprd12.prod.outlook.com \
    --to=oak.zeng-5c7gfcevmho@public.gmane.org \
    --cc=Alexander.Deucher-5C7GfCeVMHo@public.gmane.org \
    --cc=Christian.Koenig-5C7GfCeVMHo@public.gmane.org \
    --cc=alexdeucher-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@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.