[PATCH] drm/amdgpu/sriov/vcn: add new vcn ip revision check case for Navi21 SRIOV

Bokun Zhang Bokun.Zhang at amd.com
Tue Nov 30 20:09:45 UTC 2021


Under SRIOV, there will be dynamic VCN assignment controlled by the host
driver. The VCN assignment information is passed using IP discovery data
and VCN revision. The revision ID can be 64, 128 and 192.

The swIP code (vcn_v3_0.c) will handle the initialization according to the
revision ID of each VCN instance. In the common code path (amdgpu_discovery.c
and amdgpu_vcn.c), we will simply add the IP block for above mentioned
revision ID.

Note that, we actually support decode under SRIOV, but we decide to disable
it for now.

Signed-off-by: Bokun Zhang <Bokun.Zhang at amd.com>
Change-Id: I2bb44d590fc01ed413efb0e689c491079628454b
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c | 3 ++-
 drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c       | 1 +
 drivers/gpu/drm/amd/amdgpu/nv.c               | 1 +
 3 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c
index ee19548cf22c..02644abcfc06 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c
@@ -915,9 +915,10 @@ static int amdgpu_discovery_set_mm_ip_blocks(struct amdgpu_device *adev)
 			break;
 		case IP_VERSION(3, 0, 0):
 		case IP_VERSION(3, 0, 16):
-		case IP_VERSION(3, 0, 64):
 		case IP_VERSION(3, 1, 1):
 		case IP_VERSION(3, 0, 2):
+		case IP_VERSION(3, 0, 64):
+		case IP_VERSION(3, 0, 128):
 		case IP_VERSION(3, 0, 192):
 			amdgpu_device_ip_block_add(adev, &vcn_v3_0_ip_block);
 			if (!amdgpu_sriov_vf(adev))
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c
index 585961c2f5f2..6d1eb7eabc90 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c
@@ -135,6 +135,7 @@ int amdgpu_vcn_sw_init(struct amdgpu_device *adev)
 		break;
 	case IP_VERSION(3, 0, 0):
 	case IP_VERSION(3, 0, 64):
+	case IP_VERSION(3, 0, 128):
 	case IP_VERSION(3, 0, 192):
 		if (adev->ip_versions[GC_HWIP][0] == IP_VERSION(10, 3, 0))
 			fw_name = FIRMWARE_SIENNA_CICHLID;
diff --git a/drivers/gpu/drm/amd/amdgpu/nv.c b/drivers/gpu/drm/amd/amdgpu/nv.c
index 2ec1ffb36b1f..f236fa233b9a 100644
--- a/drivers/gpu/drm/amd/amdgpu/nv.c
+++ b/drivers/gpu/drm/amd/amdgpu/nv.c
@@ -183,6 +183,7 @@ static int nv_query_video_codecs(struct amdgpu_device *adev, bool encode,
 	switch (adev->ip_versions[UVD_HWIP][0]) {
 	case IP_VERSION(3, 0, 0):
 	case IP_VERSION(3, 0, 64):
+	case IP_VERSION(3, 0, 128):
 	case IP_VERSION(3, 0, 192):
 		if (amdgpu_sriov_vf(adev)) {
 			if (encode)
-- 
2.25.1



More information about the amd-gfx mailing list