All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alex Deucher <alexander.deucher@amd.com>
To: <amd-gfx@lists.freedesktop.org>
Cc: Alex Deucher <alexander.deucher@amd.com>,
	Felix Kuehling <Felix.Kuehling@amd.com>,
	Graham Sider <Graham.Sider@amd.com>
Subject: [PATCH] drm/amdgpu: Implement get_vmid_pasid_mapping for gfx11
Date: Thu, 5 May 2022 16:07:49 -0400	[thread overview]
Message-ID: <20220505200750.1293725-13-alexander.deucher@amd.com> (raw)
In-Reply-To: <20220505200750.1293725-1-alexander.deucher@amd.com>

From: Graham Sider <Graham.Sider@amd.com>

Implement gmc_v11_0_get_vmid_pasid_mapping_info to fix
gmc_v11_0_flush_gpu_tlb_pasid logic. Change from gfx10 to use
IH_VMID_*_LUT registers for VMID -> PASID mapping.

Signed-off-by: Graham Sider <Graham.Sider@amd.com>
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/gmc_v11_0.c | 16 ++++------------
 1 file changed, 4 insertions(+), 12 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v11_0.c b/drivers/gpu/drm/amd/amdgpu/gmc_v11_0.c
index 8d733eeac556..477f67d9b07c 100644
--- a/drivers/gpu/drm/amd/amdgpu/gmc_v11_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gmc_v11_0.c
@@ -155,21 +155,13 @@ static bool gmc_v11_0_use_invalidate_semaphore(struct amdgpu_device *adev,
 		(!amdgpu_sriov_vf(adev)));
 }
 
-static bool gmc_v11_0_get_atc_vmid_pasid_mapping_info(
+static bool gmc_v11_0_get_vmid_pasid_mapping_info(
 					struct amdgpu_device *adev,
 					uint8_t vmid, uint16_t *p_pasid)
 {
-#if 0 // TODO:
-	uint32_t value;
+	*p_pasid = RREG32(SOC15_REG_OFFSET(OSSSYS, 0, regIH_VMID_0_LUT) + vmid) & 0xffff;
 
-	value = RREG32(SOC15_REG_OFFSET(ATHUB, 0, mmATC_VMID0_PASID_MAPPING)
-		     + vmid);
-	*p_pasid = value & ATC_VMID0_PASID_MAPPING__PASID_MASK;
-
-	return !!(value & ATC_VMID0_PASID_MAPPING__VALID_MASK);
-#else
-	return 0;
-#endif
+	return !!(*p_pasid);
 }
 
 /*
@@ -340,7 +332,7 @@ static int gmc_v11_0_flush_gpu_tlb_pasid(struct amdgpu_device *adev,
 
 	for (vmid = 1; vmid < 16; vmid++) {
 
-		ret = gmc_v11_0_get_atc_vmid_pasid_mapping_info(adev, vmid,
+		ret = gmc_v11_0_get_vmid_pasid_mapping_info(adev, vmid,
 				&queried_pasid);
 		if (ret	&& queried_pasid == pasid) {
 			if (all_hub) {
-- 
2.35.1


  parent reply	other threads:[~2022-05-05 20:08 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-05 20:07 [PATCH] drm/amd/pm: enable lclk dpm/ds and BACO features for SMU 13.0.0 Alex Deucher
2022-05-05 20:07 ` [PATCH] drm/amd/pm: enable BACO support " Alex Deucher
2022-05-05 20:07 ` [PATCH] drm/amd/pm: enable UCLK DPM " Alex Deucher
2022-05-05 20:07 ` [PATCH] drm/amd/pm: correct the check for current link status Alex Deucher
2022-05-05 20:07 ` [PATCH] drm/amd/pm: correct the way for retrieving current uclk frequency Alex Deucher
2022-05-05 20:07 ` [PATCH] drm/amd/pm: correct the way for retrieving current fclk frequency Alex Deucher
2022-05-05 20:07 ` [PATCH] drm/amd/pm: enable FCLK DPM support for SMU 13.0.0 Alex Deucher
2022-05-05 20:07 ` [PATCH] drm/amd/pm: disable the gfxoff feature temporarily " Alex Deucher
2022-05-05 20:07 ` [PATCH] drm/amd/pm: disable ac/dc on smu_v13_0_7 Alex Deucher
2022-05-05 20:07 ` [PATCH] drm/amd/pm: enable gfxoff control " Alex Deucher
2022-05-05 20:07 ` [PATCH] drm/amdgpu: Disable SDMA WPTR_POLL_ENABLE for sdma_v6_0 Alex Deucher
2022-05-05 20:07 ` [PATCH] drm/amdkfd: Update event_interrupt_isr_v11 return Alex Deucher
2022-05-05 20:07 ` Alex Deucher [this message]
2022-05-05 20:07 ` [PATCH] drm/amdgpu/gmc11: avoid cpu accessing registers to flush VM Alex Deucher

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=20220505200750.1293725-13-alexander.deucher@amd.com \
    --to=alexander.deucher@amd.com \
    --cc=Felix.Kuehling@amd.com \
    --cc=Graham.Sider@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.