AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Kuehling, Felix" <Felix.Kuehling-5C7GfCeVMHo@public.gmane.org>
To: "Zhao, Yong" <Yong.Zhao-5C7GfCeVMHo@public.gmane.org>,
	"amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org"
	<amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org>
Subject: Re: [PATCH 2/4] drm/amdgpu: Add last_non_cp in amdgpu_doorbell_index
Date: Thu, 14 Feb 2019 19:38:07 +0000	[thread overview]
Message-ID: <1babebd6-7528-e245-c475-cb40b71041ac@amd.com> (raw)
In-Reply-To: <20190213181837.9999-2-Yong.Zhao-5C7GfCeVMHo@public.gmane.org>

Please add a patch description.

It may make sense to define a first_non_cp doorbell index too. In patch 
3 you have this, which is a bit inconsistent:

+		gpu_resources.non_cp_doorbells_start =
+				adev->doorbell_index.sdma_engine[0];
+		gpu_resources.non_cp_doorbells_end =
+				adev->doorbell_index.last_non_cp;

You avoid hard-coding an assumption that the last non-CP doorbell is the 
same as VCE ring 6/7. But you still hard code an assumption that the 
first non-CP doorbell is SDMA0.

Regards,
   Felix

On 2019-02-13 1:19 p.m., Zhao, Yong wrote:
> Change-Id: Icc9167771ad9539d8e31b40058e3b22be825a585
> Signed-off-by: Yong Zhao <Yong.Zhao@amd.com>
> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_doorbell.h | 6 ++++++
>   drivers/gpu/drm/amd/amdgpu/vega10_reg_init.c | 3 +++
>   drivers/gpu/drm/amd/amdgpu/vega20_reg_init.c | 3 +++
>   3 files changed, 12 insertions(+)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_doorbell.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_doorbell.h
> index 43546500ec26..1ccc10741ad8 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_doorbell.h
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_doorbell.h
> @@ -69,6 +69,7 @@ struct amdgpu_doorbell_index {
>   			uint32_t vce_ring6_7;
>   		} uvd_vce;
>   	};
> +	uint32_t last_non_cp;
>   	uint32_t max_assignment;
>   	/* Per engine SDMA doorbell size in dword */
>   	uint32_t sdma_doorbell_range;
> @@ -139,6 +140,9 @@ typedef enum _AMDGPU_VEGA20_DOORBELL_ASSIGNMENT
>   	AMDGPU_VEGA20_DOORBELL64_VCE_RING2_3             = 0x18D,
>   	AMDGPU_VEGA20_DOORBELL64_VCE_RING4_5             = 0x18E,
>   	AMDGPU_VEGA20_DOORBELL64_VCE_RING6_7             = 0x18F,
> +
> +	AMDGPU_VEGA20_DOORBELL64_LAST_NON_CP             = AMDGPU_VEGA20_DOORBELL64_VCE_RING6_7,
> +
>   	AMDGPU_VEGA20_DOORBELL_MAX_ASSIGNMENT            = 0x18F,
>   	AMDGPU_VEGA20_DOORBELL_INVALID                   = 0xFFFF
>   } AMDGPU_VEGA20_DOORBELL_ASSIGNMENT;
> @@ -214,6 +218,8 @@ typedef enum _AMDGPU_DOORBELL64_ASSIGNMENT
>   	AMDGPU_DOORBELL64_VCE_RING4_5             = 0xFE,
>   	AMDGPU_DOORBELL64_VCE_RING6_7             = 0xFF,
>   
> +	AMDGPU_DOORBELL64_LAST_NON_CP             = AMDGPU_DOORBELL64_VCE_RING6_7,
> +
>   	AMDGPU_DOORBELL64_MAX_ASSIGNMENT          = 0xFF,
>   	AMDGPU_DOORBELL64_INVALID                 = 0xFFFF
>   } AMDGPU_DOORBELL64_ASSIGNMENT;
> diff --git a/drivers/gpu/drm/amd/amdgpu/vega10_reg_init.c b/drivers/gpu/drm/amd/amdgpu/vega10_reg_init.c
> index 62f49c895314..ffe0e0593207 100644
> --- a/drivers/gpu/drm/amd/amdgpu/vega10_reg_init.c
> +++ b/drivers/gpu/drm/amd/amdgpu/vega10_reg_init.c
> @@ -79,6 +79,9 @@ void vega10_doorbell_index_init(struct amdgpu_device *adev)
>   	adev->doorbell_index.uvd_vce.vce_ring2_3 = AMDGPU_DOORBELL64_VCE_RING2_3;
>   	adev->doorbell_index.uvd_vce.vce_ring4_5 = AMDGPU_DOORBELL64_VCE_RING4_5;
>   	adev->doorbell_index.uvd_vce.vce_ring6_7 = AMDGPU_DOORBELL64_VCE_RING6_7;
> +
> +	adev->doorbell_index.last_non_cp = AMDGPU_DOORBELL64_LAST_NON_CP;
> +
>   	/* In unit of dword doorbell */
>   	adev->doorbell_index.max_assignment = AMDGPU_DOORBELL64_MAX_ASSIGNMENT << 1;
>   	adev->doorbell_index.sdma_doorbell_range = 4;
> diff --git a/drivers/gpu/drm/amd/amdgpu/vega20_reg_init.c b/drivers/gpu/drm/amd/amdgpu/vega20_reg_init.c
> index 1271e1702ad4..700ff8aec999 100644
> --- a/drivers/gpu/drm/amd/amdgpu/vega20_reg_init.c
> +++ b/drivers/gpu/drm/amd/amdgpu/vega20_reg_init.c
> @@ -83,6 +83,9 @@ void vega20_doorbell_index_init(struct amdgpu_device *adev)
>   	adev->doorbell_index.uvd_vce.vce_ring2_3 = AMDGPU_VEGA20_DOORBELL64_VCE_RING2_3;
>   	adev->doorbell_index.uvd_vce.vce_ring4_5 = AMDGPU_VEGA20_DOORBELL64_VCE_RING4_5;
>   	adev->doorbell_index.uvd_vce.vce_ring6_7 = AMDGPU_VEGA20_DOORBELL64_VCE_RING6_7;
> +
> +	adev->doorbell_index.last_non_cp = AMDGPU_VEGA20_DOORBELL64_LAST_NON_CP;
> +
>   	adev->doorbell_index.max_assignment = AMDGPU_VEGA20_DOORBELL_MAX_ASSIGNMENT << 1;
>   	adev->doorbell_index.sdma_doorbell_range = 20;
>   }
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

  parent reply	other threads:[~2019-02-14 19:38 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-13 18:19 [PATCH 1/4] drm/amdkfd: Move a constant definition around Zhao, Yong
     [not found] ` <20190213181837.9999-1-Yong.Zhao-5C7GfCeVMHo@public.gmane.org>
2019-02-13 18:19   ` [PATCH 2/4] drm/amdgpu: Add last_non_cp in amdgpu_doorbell_index Zhao, Yong
     [not found]     ` <20190213181837.9999-2-Yong.Zhao-5C7GfCeVMHo@public.gmane.org>
2019-02-14 19:38       ` Kuehling, Felix [this message]
2019-02-13 18:19   ` [PATCH 3/4] drm/amdkfd: Fix bugs regarding CP queue doorbell mask on SOC15 Zhao, Yong
2019-02-13 18:19   ` [PATCH 4/4] drm/amdkfd: Optimize out sdma doorbell array in kgd2kfd_shared_resources Zhao, Yong

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=1babebd6-7528-e245-c475-cb40b71041ac@amd.com \
    --to=felix.kuehling-5c7gfcevmho@public.gmane.org \
    --cc=Yong.Zhao-5C7GfCeVMHo@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox