Skip to contentSkip to conversation

drm/amdgpu/vcn: Enable VCN 4.0.6 Support

PATCH In review Alex Deucher 2 participants 5 messages Feb 21, 2024

Subsystems (2)
lore
Share & tools
lore

Alex Deucher

author maintainer
#0 lore raw

PATCH 1/4 drm/amdgpu/vcn: Enable VCN 4.0.6 Support

From: Veerabadhran Gopalakrishnan <[email protected]>

Modified driver to use the appropriate FW files and instance.

v2: squash in fixes (Alex)

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c | 2 ++
 drivers/gpu/drm/amd/amdgpu/vcn_v4_0_5.c | 3 +++
 2 files changed, 5 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c +2 -0
index eb2a88991206..b2535023764f 100644
@@ -59,6 +59,7 @@
 #define FIRMWARE_VCN4_0_3		"amdgpu/vcn_4_0_3.bin"
 #define FIRMWARE_VCN4_0_4		"amdgpu/vcn_4_0_4.bin"
 #define FIRMWARE_VCN4_0_5		"amdgpu/vcn_4_0_5.bin"
+#define FIRMWARE_VCN4_0_6		"amdgpu/vcn_4_0_6.bin"
 #define FIRMWARE_VCN5_0_0		"amdgpu/vcn_5_0_0.bin"
 
 MODULE_FIRMWARE(FIRMWARE_RAVEN);
@@ -83,6 +84,7 @@ MODULE_FIRMWARE(FIRMWARE_VCN4_0_2);
 MODULE_FIRMWARE(FIRMWARE_VCN4_0_3);
 MODULE_FIRMWARE(FIRMWARE_VCN4_0_4);
 MODULE_FIRMWARE(FIRMWARE_VCN4_0_5);
+MODULE_FIRMWARE(FIRMWARE_VCN4_0_6);
 MODULE_FIRMWARE(FIRMWARE_VCN5_0_0);
 
 static void amdgpu_vcn_idle_work_handler(struct work_struct *work);
drivers/gpu/drm/amd/amdgpu/vcn_v4_0_5.c +3 -0
index 49e4c3c09aca..0468955338b7 100644
@@ -1684,6 +1684,9 @@ static int vcn_v4_0_5_process_interrupt(struct amdgpu_device *adev, struct amdgp
 	case SOC15_IH_CLIENTID_VCN:
 		ip_instance = 0;
 		break;
+	case SOC15_IH_CLIENTID_VCN1:
+		ip_instance = 1;
+		break;
 	default:
 		DRM_ERROR("Unhandled client id: %d\n", entry->client_id);
 		return 0;
Signature · 1 line
2.43.2
author maintainer
#1 lore raw

PATCH 2/4 drm/amdgpu/soc21: Added Video Capabilities for VCN 406

From: Veerabadhran Gopalakrishnan <[email protected]>

Updated Query Video codecs for VCN 406

---
 drivers/gpu/drm/amd/amdgpu/soc21.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/gpu/drm/amd/amdgpu/soc21.c +6 -0
index 2c812701592b..c663cf3a169d 100644
@@ -185,6 +185,12 @@ static int soc21_query_video_codecs(struct amdgpu_device *adev, bool encode,
 			}
 		}
 		return 0;
+	case IP_VERSION(4, 0, 6):
+		if (encode)
+			*codecs = &vcn_4_0_0_video_codecs_encode_vcn0;
+		else
+			*codecs = &vcn_4_0_0_video_codecs_decode_vcn0;
+		return 0;
 	default:
 		return -EINVAL;
 	}
Signature · 1 line
2.43.2
author maintainer
#2 lore raw

PATCH 3/4 drm/amdgpu/soc21: Enabling PG and CG flags for VCN 4.0.6

In reply to Alex Deucher

From: Veerabadhran Gopalakrishnan <[email protected]>

Enabled the VCN Power Gating and Clock Gating flags for VCN 4.0.6.

---
 drivers/gpu/drm/amd/amdgpu/soc21.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/soc21.c +7 -2
index c663cf3a169d..b92fd6760fa9 100644
@@ -742,9 +742,14 @@ static int soc21_common_early_init(void *handle)
 			AMD_CG_SUPPORT_ATHUB_LS |
 			AMD_CG_SUPPORT_IH_CG |
 			AMD_CG_SUPPORT_BIF_MGCG |
-			AMD_CG_SUPPORT_BIF_LS;
+			AMD_CG_SUPPORT_BIF_LS |
+			AMD_CG_SUPPORT_VCN_MGCG |
+			AMD_CG_SUPPORT_JPEG_MGCG;
 		adev->pg_flags =
-			AMD_PG_SUPPORT_GFX_PG;
+			AMD_PG_SUPPORT_GFX_PG |
+			AMD_PG_SUPPORT_VCN |
+			AMD_PG_SUPPORT_VCN_DPG |
+			AMD_PG_SUPPORT_JPEG;
 		adev->external_rev_id = adev->rev_id + 0xc1;
 		break;
 	default:
Signature · 1 line
2.43.2
author maintainer
#3 lore raw

PATCH 4/4 drm/amdgpu: add vcn 4.0.6 discovery support

In reply to Alex Deucher

From: Yifan Zhang <[email protected]>

This patch is to add vcn 4.0.6 support

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c +1 -0
index 704b7820c47c..6e4d26753aac 100644
@@ -2140,6 +2140,7 @@ static int amdgpu_discovery_set_mm_ip_blocks(struct amdgpu_device *adev)
 			amdgpu_device_ip_block_add(adev, &jpeg_v4_0_3_ip_block);
 			break;
 		case IP_VERSION(4, 0, 5):
+		case IP_VERSION(4, 0, 6):
 			amdgpu_device_ip_block_add(adev, &vcn_v4_0_5_ip_block);
 			amdgpu_device_ip_block_add(adev, &jpeg_v4_0_5_ip_block);
 			break;
Signature · 1 line
2.43.2
Reviewed-by on v1 4/4
#4 lore raw

RE: [PATCH 4/4] drm/amdgpu: add vcn 4.0.6 discovery support

[AMD Official Use Only - General]

The series of 4 patches are:

Quoted 38 lines

-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Alex Deucher
Sent: Wednesday, February 21, 2024 12:00 PM
To: [email protected]
Cc: Zhang, Yifan <[email protected]>; Deucher, Alexander <[email protected]>
Subject: [PATCH 4/4] drm/amdgpu: add vcn 4.0.6 discovery support

From: Yifan Zhang <[email protected]>

This patch is to add vcn 4.0.6 support

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c +1 -0
index 704b7820c47c..6e4d26753aac 100644
@@ -2140,6 +2140,7 @@ static int
 amdgpu_discovery_set_mm_ip_blocks(struct amdgpu_device *adev)
                      amdgpu_device_ip_block_add(adev,
 &jpeg_v4_0_3_ip_block);
                      break;
              case IP_VERSION(4, 0, 5):
+             case IP_VERSION(4, 0, 6):
                      amdgpu_device_ip_block_add(adev,

&vcn_v4_0_5_ip_block);
amdgpu_device_ip_block_add(adev,

&jpeg_v4_0_5_ip_block);
                      break;

--
2.43.2