Skip to contentSkip to conversation

drm/amdgpu/umsch: declare umsch firmware

PATCH In review Alex Deucher 2 participants 4 messages Feb 12, 2025 – Feb 13, 2025 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore

Alex Deucher

author maintainer
#0 lore raw

PATCH 1/3 drm/amdgpu/umsch: declare umsch firmware

Needed to be properly picked up for the initrd, etc.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_umsch_mm.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_umsch_mm.c +2 -0
index ba550c7e2118e..bbf16e7b5ab9c 100644
@@ -32,6 +32,8 @@
 #include "amdgpu_umsch_mm.h"
 #include "umsch_mm_v4_0.h"
 
+MODULE_FIRMWARE("amdgpu/umsch_mm_4_0_0.bin");
+
 struct umsch_mm_test_ctx_data {
 	uint8_t process_csa[PAGE_SIZE];
 	uint8_t vpe_ctx_csa[PAGE_SIZE];
Signature · 1 line
2.48.1
author maintainer
#1 lore raw

PATCH 2/3 drm/amdgpu/umsch: fix ucode check

Return an error if the IP version doesn't match otherwise we end up passing a NULL string to amdgpu_ucode_request. We should never hit this in practice today since we only enable the umsch code on the supported IP versions, but add a check to be safe.

Fixes 020620424b27 ("drm/amd: Use a constant format string for amdgpu_ucode_request")
Cc Arnd Bergmann <[email protected]>
Cc Lang Yu <[email protected]>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_umsch_mm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_umsch_mm.c +1 -1
index bbf16e7b5ab9c..e0e27f7ada395 100644
@@ -586,7 +586,7 @@ int amdgpu_umsch_mm_init_microcode(struct amdgpu_umsch_mm *umsch)
 		fw_name = "amdgpu/umsch_mm_4_0_0.bin";
 		break;
 	default:
-		break;
+		return -EINVAL;
 	}
 
 	r = amdgpu_ucode_request(adev, &adev->umsch_mm.fw, AMDGPU_UCODE_REQUIRED,
Signature · 1 line
2.48.1
author maintainer
#2 lore raw

PATCH 3/3 drm/amdgpu/umsch: tidy up the ucode name string handling

In reply to Alex Deucher

Make the constant parts of the name part of the string we pass to amdgpu_ucode_request(). Only the version number varies from IP to IP.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_umsch_mm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_umsch_mm.c +2 -2
index e0e27f7ada395..27279708a1e21 100644
@@ -583,14 +583,14 @@ int amdgpu_umsch_mm_init_microcode(struct amdgpu_umsch_mm *umsch)
 	switch (amdgpu_ip_version(adev, VCN_HWIP, 0)) {
 	case IP_VERSION(4, 0, 5):
 	case IP_VERSION(4, 0, 6):
-		fw_name = "amdgpu/umsch_mm_4_0_0.bin";
+		fw_name = "4_0_0";
 		break;
 	default:
 		return -EINVAL;
 	}
 
 	r = amdgpu_ucode_request(adev, &adev->umsch_mm.fw, AMDGPU_UCODE_REQUIRED,
-				 "%s", fw_name);
+				 "amdgpu/umsch_mm_%s.bin", fw_name);
 	if (r) {
 		release_firmware(adev->umsch_mm.fw);
 		adev->umsch_mm.fw = NULL;
Signature · 1 line
2.48.1

A message that is not in the archive (sent off-list or not yet received): CY5PR12MB6130D813E6E37328D4D120E7E3FF2@CY5PR12MB6130.namprd12.prod.outlook.com

#4 lore raw

Hi,

Changes looks good to me.

Series is Reviewed-by: Saleemkhan Jamadar <[email protected]>

Regards,
Saleem

Quoted 33 lines

[AMD Official Use Only - AMD Internal Distribution Only]

-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Alex Deucher
Sent: Thursday, February 13, 2025 3:18 AM
To: [email protected]
Cc: Deucher, Alexander <[email protected]>; Yu, Lang <[email protected]>
Subject: [PATCH 1/3] drm/amdgpu/umsch: declare umsch firmware

Needed to be properly picked up for the initrd, etc.

---
  drivers/gpu/drm/amd/amdgpu/amdgpu_umsch_mm.c | 2 ++
  1 file changed, 2 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_umsch_mm.c +2 -1
index ba550c7e2118e..bbf16e7b5ab9c 100644
@@ -32,6 +32,8 @@
  #include "amdgpu_umsch_mm.h"
  #include "umsch_mm_v4_0.h"
 
+MODULE_FIRMWARE("amdgpu/umsch_mm_4_0_0.bin");
+
  struct umsch_mm_test_ctx_data {
         uint8_t process_csa[PAGE_SIZE];
         uint8_t vpe_ctx_csa[PAGE_SIZE];
--

2.48.1