Skip to contentSkip to conversation

VCN 5.0 Support

PATCH New Alex Deucher 1 participant 4 messages Feb 8, 2024

Subsystems (2)
lore
Share & tools
lore

Alex Deucher

author maintainer
#0 lore raw

cover VCN 5.0 Support

This patch set adds support for VCN (Video Codec Next) 5.0.x. VCN is the multimedia codec IP in AMD SoCs.

Patch 1 adds new registers and is too large for the mailing list so it has been omitted.

Hawking Zhang (1):
drm/amdgpu: Add vcn v5_0_0 ip headers (v5)

Sonny Jiang (3):
drm/amdgpu: add VCN_5_0_0 firmware support
drm/amdgpu: add VCN_5_0_0 IP block support
amdgpu/drm: Add vcn_v5_0_0_ip_block support

 drivers/gpu/drm/amd/amdgpu/Makefile           |    1 +
 drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c |    4 +
 drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c       |    2 +
 drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h       |   42 +
 drivers/gpu/drm/amd/amdgpu/vcn_v5_0_0.c       | 1339 +++
 drivers/gpu/drm/amd/amdgpu/vcn_v5_0_0.h       |   37 +
 .../include/asic_reg/vcn/vcn_5_0_0_offset.h   | 1672 ++++
 .../include/asic_reg/vcn/vcn_5_0_0_sh_mask.h  | 7627 +++++++++++++++++
 8 files changed, 10724 insertions(+)
 create mode 100644 drivers/gpu/drm/amd/amdgpu/vcn_v5_0_0.c
 create mode 100644 drivers/gpu/drm/amd/amdgpu/vcn_v5_0_0.h
 create mode 100644 drivers/gpu/drm/amd/include/asic_reg/vcn/vcn_5_0_0_offset.h
 create mode 100644 drivers/gpu/drm/amd/include/asic_reg/vcn/vcn_5_0_0_sh_mask.h
Signature · 1 line
2.42.0
author maintainer
#1 lore raw

PATCH 2/4 drm/amdgpu: add VCN_5_0_0 firmware support

From: Sonny Jiang <[email protected]>

Add VCN5_0_0 firmware support

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c +2 -0
index f300d4a4457d..eb2a88991206 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_VCN5_0_0		"amdgpu/vcn_5_0_0.bin"
 
 MODULE_FIRMWARE(FIRMWARE_RAVEN);
 MODULE_FIRMWARE(FIRMWARE_PICASSO);
@@ -82,6 +83,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_VCN5_0_0);
 
 static void amdgpu_vcn_idle_work_handler(struct work_struct *work);
 
Signature · 1 line
2.42.0
author maintainer
#2 lore raw

PATCH 3/4 drm/amdgpu: add VCN_5_0_0 IP block support

In reply to Alex Deucher

From: Sonny Jiang <[email protected]>

Add VCN_5_0_0 IP init, ring functions, DPG support.

v2: squash in warning fixes (Alex)
v3: squash in block and ring init, boot, doorbell enablement,
DPG support (Alex)

---
 drivers/gpu/drm/amd/amdgpu/Makefile     |    1 +
 drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h |   42 +
 drivers/gpu/drm/amd/amdgpu/vcn_v5_0_0.c | 1339 +++++++++++++++++++++++
 drivers/gpu/drm/amd/amdgpu/vcn_v5_0_0.h |   37 +
 4 files changed, 1419 insertions(+)
 create mode 100644 drivers/gpu/drm/amd/amdgpu/vcn_v5_0_0.c
 create mode 100644 drivers/gpu/drm/amd/amdgpu/vcn_v5_0_0.h
drivers/gpu/drm/amd/amdgpu/Makefile +1 -0
index 87022325bbf7..84c1baf8f3cb 100644
@@ -209,6 +209,7 @@ amdgpu-y += \
 	vcn_v4_0.o \
 	vcn_v4_0_3.o \
 	vcn_v4_0_5.o \
+	vcn_v5_0_0.o \
 	amdgpu_jpeg.o \
 	jpeg_v1_0.o \
 	jpeg_v2_0.o \
drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h +42 -0

48 lines not on this page · raw message

drivers/gpu/drm/amd/amdgpu/vcn_v5_0_0.c new file +1339 -0

1,339 lines not on this page · raw message

drivers/gpu/drm/amd/amdgpu/vcn_v5_0_0.h new file +37 -0
new file mode 100644
index 000000000000..51bbccd4360f
@@ -0,0 +1,37 @@
+/*
+ * Copyright 2023 Advanced Micro Devices, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ *
+ */
+
+#ifndef __VCN_V5_0_0_H__
+#define __VCN_V5_0_0_H__
+
+#define VCN_VID_SOC_ADDRESS                        0x1FC00
+#define VCN_AON_SOC_ADDRESS                        0x1F800
+#define VCN1_VID_SOC_ADDRESS                       0x48300
+#define VCN1_AON_SOC_ADDRESS                       0x48000
+
+#define VCN_VID_IP_ADDRESS                         0x0
+#define VCN_AON_IP_ADDRESS                         0x30000
+
+extern const struct amdgpu_ip_block_version vcn_v5_0_0_ip_block;
+
+#endif /* __VCN_V5_0_0_H__ */
Signature · 1 line
2.42.0
author maintainer
#3 lore raw

PATCH 4/4 amdgpu/drm: Add vcn_v5_0_0_ip_block support

In reply to Alex Deucher

From: Sonny Jiang <[email protected]>

Enable support for vcn_v5_0_0_ip_block

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c +4 -0
index 59530fe36b6b..399428054c0d 100644
@@ -96,6 +96,7 @@
 #include "smuio_v13_0.h"
 #include "smuio_v13_0_3.h"
 #include "smuio_v13_0_6.h"
+#include "vcn_v5_0_0.h"
 
 #include "amdgpu_vpe.h"
 
@@ -2132,6 +2133,9 @@ static int amdgpu_discovery_set_mm_ip_blocks(struct amdgpu_device *adev)
 			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;
+		case IP_VERSION(5, 0, 0):
+			amdgpu_device_ip_block_add(adev, &vcn_v5_0_0_ip_block);
+			break;
 		default:
 			dev_err(adev->dev,
 				"Failed to add vcn/jpeg ip block(UVD_HWIP:0x%x)\n",
Signature · 1 line
2.42.0