AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Alex Deucher <alexdeucher-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Cc: Alex Deucher <alexander.deucher-5C7GfCeVMHo@public.gmane.org>,
	Huang Rui <ray.huang-5C7GfCeVMHo@public.gmane.org>,
	Aaron Liu <aaron.liu-5C7GfCeVMHo@public.gmane.org>
Subject: [PATCH 25/27] drm/amdgpu: use direct loading on renoir vcn for the moment
Date: Fri,  9 Aug 2019 10:53:00 -0500	[thread overview]
Message-ID: <20190809155302.4733-25-alexander.deucher@amd.com> (raw)
In-Reply-To: <20190809155302.4733-1-alexander.deucher-5C7GfCeVMHo@public.gmane.org>

From: Huang Rui <ray.huang@amd.com>

PSP has issue for renoir, that will cause VCN fw failed to be loaded. So use
direct loading for the moment till the issue is addressed.

Signed-off-by: Huang Rui <ray.huang@amd.com>
Reviewed-by: Aaron Liu <aaron.liu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c | 9 ++++++---
 drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c   | 9 ++++++---
 2 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c
index 8566a264961f..d9c2f42b2dc7 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c
@@ -99,7 +99,8 @@ int amdgpu_vcn_sw_init(struct amdgpu_device *adev)
 	case CHIP_NAVI14:
 		fw_name = FIRMWARE_NAVI14;
 		if ((adev->firmware.load_type == AMDGPU_FW_LOAD_PSP) &&
-		    (adev->pg_flags & AMD_PG_SUPPORT_VCN_DPG))
+		    (adev->pg_flags & AMD_PG_SUPPORT_VCN_DPG) &&
+		    adev->asic_type != CHIP_RENOIR) /* to be removed while vcn psp loading works */
 			adev->vcn.indirect_sram = true;
 		break;
 	case CHIP_NAVI12:
@@ -159,7 +160,8 @@ int amdgpu_vcn_sw_init(struct amdgpu_device *adev)
 	}
 
 	bo_size = AMDGPU_VCN_STACK_SIZE + AMDGPU_VCN_CONTEXT_SIZE;
-	if (adev->firmware.load_type != AMDGPU_FW_LOAD_PSP)
+	if (adev->firmware.load_type != AMDGPU_FW_LOAD_PSP ||
+	    adev->asic_type == CHIP_RENOIR)
 		bo_size += AMDGPU_GPU_PAGE_ALIGN(le32_to_cpu(hdr->ucode_size_bytes) + 8);
 
 	for (i = 0; i < adev->vcn.num_vcn_inst; i++) {
@@ -270,7 +272,8 @@ int amdgpu_vcn_resume(struct amdgpu_device *adev)
 			unsigned offset;
 
 			hdr = (const struct common_firmware_header *)adev->vcn.fw->data;
-			if (adev->firmware.load_type != AMDGPU_FW_LOAD_PSP) {
+			if (adev->firmware.load_type != AMDGPU_FW_LOAD_PSP ||
+			    adev->asic_type == CHIP_RENOIR) {
 				offset = le32_to_cpu(hdr->ucode_array_offset_bytes);
 				memcpy_toio(adev->vcn.inst[i].cpu_addr, adev->vcn.fw->data + offset,
 					    le32_to_cpu(hdr->ucode_size_bytes));
diff --git a/drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c b/drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c
index 7528b1b562e1..e200cbc8139f 100644
--- a/drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c
@@ -142,7 +142,8 @@ static int vcn_v2_0_sw_init(void *handle)
 	if (r)
 		return r;
 
-	if (adev->firmware.load_type == AMDGPU_FW_LOAD_PSP) {
+	if (adev->firmware.load_type == AMDGPU_FW_LOAD_PSP &&
+	    adev->asic_type != CHIP_RENOIR) {
 		const struct common_firmware_header *hdr;
 		hdr = (const struct common_firmware_header *)adev->vcn.fw->data;
 		adev->firmware.ucode[AMDGPU_UCODE_ID_VCN].ucode_id = AMDGPU_UCODE_ID_VCN;
@@ -366,7 +367,8 @@ static void vcn_v2_0_mc_resume(struct amdgpu_device *adev)
 	uint32_t offset;
 
 	/* cache window 0: fw */
-	if (adev->firmware.load_type == AMDGPU_FW_LOAD_PSP) {
+	if (adev->firmware.load_type == AMDGPU_FW_LOAD_PSP &&
+	    adev->asic_type != CHIP_RENOIR) {
 		WREG32_SOC15(UVD, 0, mmUVD_LMI_VCPU_CACHE_64BIT_BAR_LOW,
 			(adev->firmware.ucode[AMDGPU_UCODE_ID_VCN].tmr_mc_addr_lo));
 		WREG32_SOC15(UVD, 0, mmUVD_LMI_VCPU_CACHE_64BIT_BAR_HIGH,
@@ -411,7 +413,8 @@ static void vcn_v2_0_mc_resume_dpg_mode(struct amdgpu_device *adev, bool indirec
 	uint32_t offset;
 
 	/* cache window 0: fw */
-	if (adev->firmware.load_type == AMDGPU_FW_LOAD_PSP) {
+	if (adev->firmware.load_type == AMDGPU_FW_LOAD_PSP &&
+	    adev->asic_type != CHIP_RENOIR) {
 		if (!indirect) {
 			WREG32_SOC15_DPG_MODE_2_0(SOC15_DPG_MODE_OFFSET_2_0(
 				UVD, 0, mmUVD_LMI_VCPU_CACHE_64BIT_BAR_LOW),
-- 
2.20.1

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

  parent reply	other threads:[~2019-08-09 15:53 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-09 15:52 [PATCH 00/27] Add Renoir APU support Alex Deucher
     [not found] ` <20190809155302.4733-1-alexander.deucher-5C7GfCeVMHo@public.gmane.org>
2019-08-09 15:52   ` [PATCH 02/27] drm/amdgpu: add renoir asic_type enum Alex Deucher
2019-08-09 15:52   ` [PATCH 03/27] drm/amdgpu: add renoir support for gpu_info and ip block setting Alex Deucher
2019-08-09 15:52   ` [PATCH 04/27] drm/amdgpu: add soc15 common ip block support for renoir Alex Deucher
2019-08-09 15:52   ` [PATCH 05/27] drm/amdgpu: add gmc v9 supports " Alex Deucher
2019-08-09 15:52   ` [PATCH 06/27] drm/amdgpu: set fw load type " Alex Deucher
2019-08-09 15:52   ` [PATCH 07/27] drm/amdgpu: add gfx support " Alex Deucher
2019-08-09 15:52   ` [PATCH 08/27] drm/amdgpu: add sdma " Alex Deucher
2019-08-09 15:52   ` [PATCH 09/27] drm/amdgpu: set ip blocks " Alex Deucher
2019-08-09 15:52   ` [PATCH 10/27] drm/amdgpu: add renoir pci id Alex Deucher
2019-08-09 15:52   ` [PATCH 11/27] drm/amdgpu: fix no interrupt issue for renoir emu Alex Deucher
2019-08-09 15:52   ` [PATCH 12/27] drm/amdgpu: enable dce virtual ip module for Renoir Alex Deucher
2019-08-09 15:52   ` [PATCH 13/27] drm/amdgpu: add asic funcs for renoir Alex Deucher
2019-08-09 15:52   ` [PATCH 14/27] drm/amdgpu: set rlc " Alex Deucher
2019-08-09 15:52   ` [PATCH 15/27] drm/amdgpu: add psp_v12_0 for renoir (v2) Alex Deucher
2019-08-09 15:52   ` [PATCH 16/27] drm/amdgpu: add gfx golden settings " Alex Deucher
2019-08-09 15:52   ` [PATCH 17/27] drm/amdgpu: add sdma golden settings for renoir Alex Deucher
2019-08-09 15:52   ` [PATCH 18/27] drm/amdgpu: enable Renoir VCN firmware loading Alex Deucher
2019-08-09 15:52   ` [PATCH 19/27] drm/amdgpu: enable Doorbell support for Renoir (v2) Alex Deucher
2019-08-09 15:52   ` [PATCH 20/27] drm/amdgpu: add VCN2.0 to Renoir IP blocks Alex Deucher
2019-08-09 15:52   ` [PATCH 21/27] drm/amdgpu: enable clock gating for renoir Alex Deucher
2019-08-09 15:52   ` [PATCH 22/27] drm/amdgpu: enable power " Alex Deucher
2019-08-09 15:52   ` [PATCH 23/27] drm/amdgpu: update lbpw " Alex Deucher
2019-08-09 15:52   ` [PATCH 24/27] drm/amdgpu: set fw default loading by psp " Alex Deucher
2019-08-09 15:53   ` Alex Deucher [this message]
2019-08-09 15:53   ` [PATCH 26/27] drm/amdgpu: skip mec2 jump table loading " Alex Deucher
2019-08-09 15:53   ` [PATCH 27/27] drm/amdgpu: flag renoir as experimental for now Alex Deucher
     [not found]     ` <20190809155302.4733-27-alexander.deucher-5C7GfCeVMHo@public.gmane.org>
2019-08-12  3:57       ` Huang, Ray
2019-08-12  3:58   ` [PATCH 00/27] Add Renoir APU support Huang, Ray

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=20190809155302.4733-25-alexander.deucher@amd.com \
    --to=alexdeucher-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=aaron.liu-5C7GfCeVMHo@public.gmane.org \
    --cc=alexander.deucher-5C7GfCeVMHo@public.gmane.org \
    --cc=amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    --cc=ray.huang-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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox