From: "Lazar, Lijo" <lijo.lazar@amd.com>
To: Emily Deng <Emily.Deng@amd.com>, amd-gfx@lists.freedesktop.org
Subject: Re: [PATCH v3 2/2] drm/amdgpu: set CP_HQD_PQ_DOORBELL_CONTROL.DOORBELL_MODE to 1 for sriov multiple vf.
Date: Fri, 7 Feb 2025 14:05:50 +0530 [thread overview]
Message-ID: <09430e08-e291-4745-9b64-a38ca719b4d7@amd.com> (raw)
In-Reply-To: <20250207060320.1564404-2-Emily.Deng@amd.com>
On 2/7/2025 11:33 AM, Emily Deng wrote:
> In sriov multiple vf, Set CP_HQD_PQ_DOORBELL_CONTROL.DOORBELL_MODE to 1 to read WPTR from MQD.
>
> Signed-off-by: Emily Deng <Emily.Deng@amd.com>
Acked-by: Lijo Lazar <lijo.lazar@amd.com>
Thanks,
Lijo
> ---
> drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c | 2 +-
> .../gpu/drm/amd/amdkfd/kfd_mqd_manager_v9.c | 23 +++++++++++++++++--
> 2 files changed, 22 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c b/drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c
> index 2ba185875baa..42251f2b9741 100644
> --- a/drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c
> +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c
> @@ -1857,7 +1857,7 @@ static int gfx_v9_4_3_xcc_mqd_init(struct amdgpu_ring *ring, int xcc_id)
> DOORBELL_SOURCE, 0);
> tmp = REG_SET_FIELD(tmp, CP_HQD_PQ_DOORBELL_CONTROL,
> DOORBELL_HIT, 0);
> - if (amdgpu_sriov_vf(adev))
> + if (amdgpu_sriov_multi_vf_mode(adev))
> tmp = REG_SET_FIELD(tmp, CP_HQD_PQ_DOORBELL_CONTROL,
> DOORBELL_MODE, 1);
> } else {
> diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v9.c b/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v9.c
> index ff417d5361c4..9e08bcfa37d3 100644
> --- a/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v9.c
> +++ b/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v9.c
> @@ -551,7 +551,7 @@ static void init_mqd_hiq_v9_4_3(struct mqd_manager *mm, void **mqd,
> m->cp_hqd_pq_control |= CP_HQD_PQ_CONTROL__NO_UPDATE_RPTR_MASK |
> 1 << CP_HQD_PQ_CONTROL__PRIV_STATE__SHIFT |
> 1 << CP_HQD_PQ_CONTROL__KMD_QUEUE__SHIFT;
> - if (amdgpu_sriov_vf(mm->dev->adev))
> + if (amdgpu_sriov_multi_vf_mode(mm->dev->adev))
> m->cp_hqd_pq_doorbell_control |= 1 <<
> CP_HQD_PQ_DOORBELL_CONTROL__DOORBELL_MODE__SHIFT;
> m->cp_mqd_stride_size = kfd_hiq_mqd_stride(mm->dev);
> @@ -724,6 +724,9 @@ static void update_mqd_v9_4_3(struct mqd_manager *mm, void *mqd,
> m = get_mqd(mqd + size * xcc);
> update_mqd(mm, m, q, minfo);
>
> + if (amdgpu_sriov_multi_vf_mode(mm->dev->adev))
> + m->cp_hqd_pq_doorbell_control |= 1 <<
> + CP_HQD_PQ_DOORBELL_CONTROL__DOORBELL_MODE__SHIFT;
> update_cu_mask(mm, m, minfo, xcc);
>
> if (q->format == KFD_QUEUE_FORMAT_AQL) {
> @@ -746,6 +749,21 @@ static void update_mqd_v9_4_3(struct mqd_manager *mm, void *mqd,
> }
> }
>
> +static void restore_mqd_v9_4_3(struct mqd_manager *mm, void **mqd,
> + struct kfd_mem_obj *mqd_mem_obj, uint64_t *gart_addr,
> + struct queue_properties *qp,
> + const void *mqd_src,
> + const void *ctl_stack_src, u32 ctl_stack_size)
> +{
> + restore_mqd(mm, mqd, mqd_mem_obj, gart_addr, qp, mqd_src, ctl_stack_src, ctl_stack_size);
> + if (amdgpu_sriov_multi_vf_mode(mm->dev->adev)) {
> + struct v9_mqd *m;
> +
> + m = (struct v9_mqd *) mqd_mem_obj->cpu_ptr;
> + m->cp_hqd_pq_doorbell_control |= 1 <<
> + CP_HQD_PQ_DOORBELL_CONTROL__DOORBELL_MODE__SHIFT;
> + }
> +}
> static int destroy_mqd_v9_4_3(struct mqd_manager *mm, void *mqd,
> enum kfd_preempt_type type, unsigned int timeout,
> uint32_t pipe_id, uint32_t queue_id)
> @@ -880,7 +898,6 @@ struct mqd_manager *mqd_manager_init_v9(enum KFD_MQD_TYPE type,
> mqd->is_occupied = kfd_is_occupied_cp;
> mqd->get_checkpoint_info = get_checkpoint_info;
> mqd->checkpoint_mqd = checkpoint_mqd;
> - mqd->restore_mqd = restore_mqd;
> mqd->mqd_size = sizeof(struct v9_mqd);
> mqd->mqd_stride = mqd_stride_v9;
> #if defined(CONFIG_DEBUG_FS)
> @@ -892,12 +909,14 @@ struct mqd_manager *mqd_manager_init_v9(enum KFD_MQD_TYPE type,
> mqd->init_mqd = init_mqd_v9_4_3;
> mqd->load_mqd = load_mqd_v9_4_3;
> mqd->update_mqd = update_mqd_v9_4_3;
> + mqd->restore_mqd = restore_mqd_v9_4_3;
> mqd->destroy_mqd = destroy_mqd_v9_4_3;
> mqd->get_wave_state = get_wave_state_v9_4_3;
> } else {
> mqd->init_mqd = init_mqd;
> mqd->load_mqd = load_mqd;
> mqd->update_mqd = update_mqd;
> + mqd->restore_mqd = restore_mqd;
> mqd->destroy_mqd = kfd_destroy_mqd_cp;
> mqd->get_wave_state = get_wave_state;
> }
next prev parent reply other threads:[~2025-02-07 8:46 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-07 6:03 [PATCH v3 1/2] drm/amdgpu: Add amdgpu_sriov_multi_vf_mode function Emily Deng
2025-02-07 6:03 ` [PATCH v3 2/2] drm/amdgpu: set CP_HQD_PQ_DOORBELL_CONTROL.DOORBELL_MODE to 1 for sriov multiple vf Emily Deng
2025-02-07 8:35 ` Lazar, Lijo [this message]
2025-02-07 8:06 ` [PATCH v3 1/2] drm/amdgpu: Add amdgpu_sriov_multi_vf_mode function Lazar, Lijo
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=09430e08-e291-4745-9b64-a38ca719b4d7@amd.com \
--to=lijo.lazar@amd.com \
--cc=Emily.Deng@amd.com \
--cc=amd-gfx@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 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.