Skip to contentSkip to conversation

drm/amdgpu: fix debug level for ppt offset/size

PATCH In review Yuan, Xiaojie 2 participants 3 messages Aug 15, 2019 2 messages not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 drm/amdgpu: fix debug level for ppt offset/size

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c +2 -2
index 35fd46bdfc53..82f6b413718b 100644
@@ -83,8 +83,8 @@ void amdgpu_ucode_print_smc_hdr(const struct common_firmware_header *hdr)
 		const struct smc_firmware_header_v2_0 *v2_hdr =
 			container_of(v1_hdr, struct smc_firmware_header_v2_0, v1_0);
 
-		DRM_INFO("ppt_offset_bytes: %u\n", le32_to_cpu(v2_hdr->ppt_offset_bytes));
-		DRM_INFO("ppt_size_bytes: %u\n", le32_to_cpu(v2_hdr->ppt_size_bytes));
+		DRM_DEBUG("ppt_offset_bytes: %u\n", le32_to_cpu(v2_hdr->ppt_offset_bytes));
+		DRM_DEBUG("ppt_size_bytes: %u\n", le32_to_cpu(v2_hdr->ppt_size_bytes));
 	} else {
 		DRM_ERROR("Unknown SMC ucode version: %u.%u\n", version_major, version_minor);
 	}
Signature · 6 lines
2.20.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): [email protected]

#2 lore raw

PATCH 2/2 drm/amdgpu: add firmware header printing for psp fw loading

firmware header information is printed for direct fw loading but not added for psp fw loading yet

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 54 +++++++++++++++++++++++++
 1 file changed, 54 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +54 -0
index 4b2d2fd72dc6..7715c0da5229 100644
@@ -944,6 +944,58 @@ static int psp_get_fw_type(struct amdgpu_firmware_info *ucode,
 	return 0;
 }
 
+static void psp_print_fw_hdr(struct psp_context *psp,
+			     struct amdgpu_firmware_info *ucode)
+{
+	struct amdgpu_device *adev = psp->adev;
+	const struct sdma_firmware_header_v1_0 *sdma_hdr =
+		(const struct sdma_firmware_header_v1_0 *)
+		adev->sdma.instance[ucode->ucode_id - AMDGPU_UCODE_ID_SDMA0].fw->data;
+	const struct gfx_firmware_header_v1_0 *ce_hdr =
+		(const struct gfx_firmware_header_v1_0 *)adev->gfx.ce_fw->data;
+	const struct gfx_firmware_header_v1_0 *pfp_hdr =
+		(const struct gfx_firmware_header_v1_0 *)adev->gfx.pfp_fw->data;
+	const struct gfx_firmware_header_v1_0 *me_hdr =
+		(const struct gfx_firmware_header_v1_0 *)adev->gfx.me_fw->data;
+	const struct gfx_firmware_header_v1_0 *mec_hdr =
+		(const struct gfx_firmware_header_v1_0 *)adev->gfx.mec_fw->data;
+	const struct rlc_firmware_header_v2_0 *rlc_hdr =
+		(const struct rlc_firmware_header_v2_0 *)adev->gfx.rlc_fw->data;
+	const struct smc_firmware_header_v1_0 *smc_hdr =
+		(const struct smc_firmware_header_v1_0 *)adev->pm.fw->data;
+
+	switch (ucode->ucode_id) {
+	case AMDGPU_UCODE_ID_SDMA0:
+	case AMDGPU_UCODE_ID_SDMA1:
+	case AMDGPU_UCODE_ID_SDMA2:
+	case AMDGPU_UCODE_ID_SDMA3:
+	case AMDGPU_UCODE_ID_SDMA4:
+	case AMDGPU_UCODE_ID_SDMA5:
+	case AMDGPU_UCODE_ID_SDMA6:
+	case AMDGPU_UCODE_ID_SDMA7:
+		amdgpu_ucode_print_sdma_hdr(&sdma_hdr->header);
+		break;
+	case AMDGPU_UCODE_ID_CP_CE:
+		amdgpu_ucode_print_gfx_hdr(&ce_hdr->header);
+		break;
+	case AMDGPU_UCODE_ID_CP_PFP:
+		amdgpu_ucode_print_gfx_hdr(&pfp_hdr->header);
+		break;
+	case AMDGPU_UCODE_ID_CP_ME:
+		amdgpu_ucode_print_gfx_hdr(&me_hdr->header);
+		break;
+	case AMDGPU_UCODE_ID_CP_MEC1:
+		amdgpu_ucode_print_gfx_hdr(&mec_hdr->header);
+		break;
+	case AMDGPU_UCODE_ID_RLC_G:
+		amdgpu_ucode_print_rlc_hdr(&rlc_hdr->header);
+		break;
+	case AMDGPU_UCODE_ID_SMC:
+		amdgpu_ucode_print_smc_hdr(&smc_hdr->header);
+		break;
+	}
+}
+
 static int psp_prep_load_ip_fw_cmd_buf(struct amdgpu_firmware_info *ucode,
 				       struct psp_gfx_cmd_resp *cmd)
 {
@@ -1028,6 +1080,8 @@ static int psp_np_fw_load(struct psp_context *psp)
 		    ucode->ucode_id == AMDGPU_UCODE_ID_CP_MEC2_JT)
 			continue;
 
+		psp_print_fw_hdr(psp, ucode);
+
 		ret = psp_execute_np_fw_load(psp, ucode);
 		if (ret)
 			return ret;
Signature · 6 lines
2.20.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): [email protected]

Reviewed-by
#4 lore raw

Re: [PATCH 2/2] drm/amdgpu: add firmware header printing for psp fw loading

Series is:

________________________________
From: amd-gfx <amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org> on behalf of Yuan, Xiaojie <[email protected]>
Sent: Thursday, August 15, 2019 5:48 AM
To: [email protected] <[email protected]>
Cc: Xiao, Jack <[email protected]>; Huang, Ray <[email protected]>; Yuan, Xiaojie <[email protected]>; Zhang, Hawking <[email protected]>
Subject: [PATCH 2/2] drm/amdgpu: add firmware header printing for psp fw loading

firmware header information is printed for direct fw loading but not added for psp fw loading yet

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 54 +++++++++++++++++++++++++
 1 file changed, 54 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +54 -0
index 4b2d2fd72dc6..7715c0da5229 100644
@@ -944,6 +944,58 @@ static int psp_get_fw_type(struct amdgpu_firmware_info *ucode,
         return 0;
 }
 
+static void psp_print_fw_hdr(struct psp_context *psp,
+                            struct amdgpu_firmware_info *ucode)
+{
+       struct amdgpu_device *adev = psp->adev;
+       const struct sdma_firmware_header_v1_0 *sdma_hdr =
+               (const struct sdma_firmware_header_v1_0 *)
+               adev->sdma.instance[ucode->ucode_id - AMDGPU_UCODE_ID_SDMA0].fw->data;
+       const struct gfx_firmware_header_v1_0 *ce_hdr =
+               (const struct gfx_firmware_header_v1_0 *)adev->gfx.ce_fw->data;
+       const struct gfx_firmware_header_v1_0 *pfp_hdr =
+               (const struct gfx_firmware_header_v1_0 *)adev->gfx.pfp_fw->data;
+       const struct gfx_firmware_header_v1_0 *me_hdr =
+               (const struct gfx_firmware_header_v1_0 *)adev->gfx.me_fw->data;
+       const struct gfx_firmware_header_v1_0 *mec_hdr =
+               (const struct gfx_firmware_header_v1_0 *)adev->gfx.mec_fw->data;
+       const struct rlc_firmware_header_v2_0 *rlc_hdr =
+               (const struct rlc_firmware_header_v2_0 *)adev->gfx.rlc_fw->data;
+       const struct smc_firmware_header_v1_0 *smc_hdr =
+               (const struct smc_firmware_header_v1_0 *)adev->pm.fw->data;
+
+       switch (ucode->ucode_id) {
+       case AMDGPU_UCODE_ID_SDMA0:
+       case AMDGPU_UCODE_ID_SDMA1:
+       case AMDGPU_UCODE_ID_SDMA2:
+       case AMDGPU_UCODE_ID_SDMA3:
+       case AMDGPU_UCODE_ID_SDMA4:
+       case AMDGPU_UCODE_ID_SDMA5:
+       case AMDGPU_UCODE_ID_SDMA6:
+       case AMDGPU_UCODE_ID_SDMA7:
+               amdgpu_ucode_print_sdma_hdr(&sdma_hdr->header);
+               break;
+       case AMDGPU_UCODE_ID_CP_CE:
+               amdgpu_ucode_print_gfx_hdr(&ce_hdr->header);
+               break;
+       case AMDGPU_UCODE_ID_CP_PFP:
+               amdgpu_ucode_print_gfx_hdr(&pfp_hdr->header);
+               break;
+       case AMDGPU_UCODE_ID_CP_ME:
+               amdgpu_ucode_print_gfx_hdr(&me_hdr->header);
+               break;
+       case AMDGPU_UCODE_ID_CP_MEC1:
+               amdgpu_ucode_print_gfx_hdr(&mec_hdr->header);
+               break;
+       case AMDGPU_UCODE_ID_RLC_G:
+               amdgpu_ucode_print_rlc_hdr(&rlc_hdr->header);
+               break;
+       case AMDGPU_UCODE_ID_SMC:
+               amdgpu_ucode_print_smc_hdr(&smc_hdr->header);
+               break;
+       }
+}
+
 static int psp_prep_load_ip_fw_cmd_buf(struct amdgpu_firmware_info *ucode,
                                        struct psp_gfx_cmd_resp *cmd)
 {
@@ -1028,6 +1080,8 @@ static int psp_np_fw_load(struct psp_context *psp)
                     ucode->ucode_id == AMDGPU_UCODE_ID_CP_MEC2_JT)
                         continue;
 
+               psp_print_fw_hdr(psp, ucode);
+
                 ret = psp_execute_np_fw_load(psp, ucode);
                 if (ret)
                         return ret;

--
2.20.1

_______________________________________________
amd-gfx mailing list [email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx