All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/amdgpu/sriov/vcn: skip ip revision check case to ip init for SIENNA_CICHLID
@ 2021-11-23 11:34 Jane Jian
  2021-11-23 15:02 ` Deucher, Alexander
  0 siblings, 1 reply; 14+ messages in thread
From: Jane Jian @ 2021-11-23 11:34 UTC (permalink / raw)
  To: amd-gfx, Alexander.Deucher, guchun.chen, jingwen.chen2; +Cc: Jane.Jian

[WHY]
for sriov odd# vf will modify vcn0 engine ip revision(due to multimedia bandwidth feature),
which will be mismatched with original vcn0 revision

[HOW]
skip ip revision match case and continue use asic type to check

Signed-off-by: Jane Jian <Jane.Jian@amd.com>
Change-Id: I1ace32acbf3a13c0baac958508da1324ec387a58
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c | 5 ++++-
 drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c       | 6 ++++++
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c
index 4e3669407518..0a91e53f520c 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c
@@ -1334,7 +1334,10 @@ int amdgpu_discovery_set_ip_blocks(struct amdgpu_device *adev)
 			return r;
 	}
 
-	r = amdgpu_discovery_set_mm_ip_blocks(adev);
+	if (adev->asic_type == CHIP_SIENNA_CICHLID && amdgpu_sriov_vf(adev))
+		r = amdgpu_device_ip_block_add(adev, &vcn_v3_0_ip_block);
+	else
+		r = amdgpu_discovery_set_mm_ip_blocks(adev);
 	if (r)
 		return r;
 
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c
index 4f7c70845785..87f56b61be53 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c
@@ -86,6 +86,10 @@ int amdgpu_vcn_sw_init(struct amdgpu_device *adev)
 	for (i = 0; i < adev->vcn.num_vcn_inst; i++)
 		atomic_set(&adev->vcn.inst[i].dpg_enc_submission_cnt, 0);
 
+	if (adev->asic_type == CHIP_SIENNA_CICHLID && amdgpu_sriov_vf(adev)) {
+		fw_name = FIRMWARE_SIENNA_CICHLID;
+		goto next;
+	}
 	switch (adev->ip_versions[UVD_HWIP][0]) {
 	case IP_VERSION(1, 0, 0):
 	case IP_VERSION(1, 0, 1):
@@ -168,6 +172,8 @@ int amdgpu_vcn_sw_init(struct amdgpu_device *adev)
 		return -EINVAL;
 	}
 
+next:
+
 	r = request_firmware(&adev->vcn.fw, fw_name, adev->dev);
 	if (r) {
 		dev_err(adev->dev, "amdgpu_vcn: Can't load firmware \"%s\"\n",
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* Re: [PATCH] drm/amdgpu/sriov/vcn: skip ip revision check case to ip init for SIENNA_CICHLID
  2021-11-23 11:34 [PATCH] drm/amdgpu/sriov/vcn: skip ip revision check case to ip init for SIENNA_CICHLID Jane Jian
@ 2021-11-23 15:02 ` Deucher, Alexander
  2021-11-24  2:53   ` Jian, Jane
  0 siblings, 1 reply; 14+ messages in thread
From: Deucher, Alexander @ 2021-11-23 15:02 UTC (permalink / raw)
  To: Jian, Jane, amd-gfx, Chen, Guchun, Chen,  JingWen

[-- Attachment #1: Type: text/plain, Size: 2818 bytes --]

[Public]

Can we just add a check for the new IP version in that case?  This looks really hacky.

Alex

________________________________
From: Jane Jian <Jane.Jian@amd.com>
Sent: Tuesday, November 23, 2021 6:34 AM
To: amd-gfx@lists.freedesktop.org <amd-gfx@lists.freedesktop.org>; Deucher, Alexander <Alexander.Deucher@amd.com>; Chen, Guchun <Guchun.Chen@amd.com>; Chen, JingWen <JingWen.Chen2@amd.com>
Cc: Jian, Jane <Jane.Jian@amd.com>
Subject: [PATCH] drm/amdgpu/sriov/vcn: skip ip revision check case to ip init for SIENNA_CICHLID

[WHY]
for sriov odd# vf will modify vcn0 engine ip revision(due to multimedia bandwidth feature),
which will be mismatched with original vcn0 revision

[HOW]
skip ip revision match case and continue use asic type to check

Signed-off-by: Jane Jian <Jane.Jian@amd.com>
Change-Id: I1ace32acbf3a13c0baac958508da1324ec387a58
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c | 5 ++++-
 drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c       | 6 ++++++
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c
index 4e3669407518..0a91e53f520c 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c
@@ -1334,7 +1334,10 @@ int amdgpu_discovery_set_ip_blocks(struct amdgpu_device *adev)
                         return r;
         }

-       r = amdgpu_discovery_set_mm_ip_blocks(adev);
+       if (adev->asic_type == CHIP_SIENNA_CICHLID && amdgpu_sriov_vf(adev))
+               r = amdgpu_device_ip_block_add(adev, &vcn_v3_0_ip_block);
+       else
+               r = amdgpu_discovery_set_mm_ip_blocks(adev);
         if (r)
                 return r;

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c
index 4f7c70845785..87f56b61be53 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c
@@ -86,6 +86,10 @@ int amdgpu_vcn_sw_init(struct amdgpu_device *adev)
         for (i = 0; i < adev->vcn.num_vcn_inst; i++)
                 atomic_set(&adev->vcn.inst[i].dpg_enc_submission_cnt, 0);

+       if (adev->asic_type == CHIP_SIENNA_CICHLID && amdgpu_sriov_vf(adev)) {
+               fw_name = FIRMWARE_SIENNA_CICHLID;
+               goto next;
+       }
         switch (adev->ip_versions[UVD_HWIP][0]) {
         case IP_VERSION(1, 0, 0):
         case IP_VERSION(1, 0, 1):
@@ -168,6 +172,8 @@ int amdgpu_vcn_sw_init(struct amdgpu_device *adev)
                 return -EINVAL;
         }

+next:
+
         r = request_firmware(&adev->vcn.fw, fw_name, adev->dev);
         if (r) {
                 dev_err(adev->dev, "amdgpu_vcn: Can't load firmware \"%s\"\n",
--
2.17.1


[-- Attachment #2: Type: text/html, Size: 5633 bytes --]

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* RE: [PATCH] drm/amdgpu/sriov/vcn: skip ip revision check case to ip init for SIENNA_CICHLID
  2021-11-23 15:02 ` Deucher, Alexander
@ 2021-11-24  2:53   ` Jian, Jane
  2021-11-24  3:10     ` Chen, Guchun
  0 siblings, 1 reply; 14+ messages in thread
From: Jian, Jane @ 2021-11-24  2:53 UTC (permalink / raw)
  To: Deucher, Alexander, Chen, Guchun, Chen, JingWen; +Cc: amd-gfx

[-- Attachment #1: Type: text/plain, Size: 3619 bytes --]

[Public]

Hi Guchun,

Per Alex's suggestion, we would better add a check for new vcn0 IP version, which is a version only owned by sriov and a way that I originally did, how do you think?

Thanks,
Jane

From: Deucher, Alexander <Alexander.Deucher@amd.com>
Sent: Tuesday, November 23, 2021 11:03 PM
To: Jian, Jane <Jane.Jian@amd.com>; amd-gfx@lists.freedesktop.org; Chen, Guchun <Guchun.Chen@amd.com>; Chen, JingWen <JingWen.Chen2@amd.com>
Subject: Re: [PATCH] drm/amdgpu/sriov/vcn: skip ip revision check case to ip init for SIENNA_CICHLID


[Public]

Can we just add a check for the new IP version in that case?  This looks really hacky.

Alex

________________________________
From: Jane Jian <Jane.Jian@amd.com<mailto:Jane.Jian@amd.com>>
Sent: Tuesday, November 23, 2021 6:34 AM
To: amd-gfx@lists.freedesktop.org<mailto:amd-gfx@lists.freedesktop.org> <amd-gfx@lists.freedesktop.org<mailto:amd-gfx@lists.freedesktop.org>>; Deucher, Alexander <Alexander.Deucher@amd.com<mailto:Alexander.Deucher@amd.com>>; Chen, Guchun <Guchun.Chen@amd.com<mailto:Guchun.Chen@amd.com>>; Chen, JingWen <JingWen.Chen2@amd.com<mailto:JingWen.Chen2@amd.com>>
Cc: Jian, Jane <Jane.Jian@amd.com<mailto:Jane.Jian@amd.com>>
Subject: [PATCH] drm/amdgpu/sriov/vcn: skip ip revision check case to ip init for SIENNA_CICHLID

[WHY]
for sriov odd# vf will modify vcn0 engine ip revision(due to multimedia bandwidth feature),
which will be mismatched with original vcn0 revision

[HOW]
skip ip revision match case and continue use asic type to check

Signed-off-by: Jane Jian <Jane.Jian@amd.com<mailto:Jane.Jian@amd.com>>
Change-Id: I1ace32acbf3a13c0baac958508da1324ec387a58
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c | 5 ++++-
 drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c       | 6 ++++++
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c
index 4e3669407518..0a91e53f520c 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c
@@ -1334,7 +1334,10 @@ int amdgpu_discovery_set_ip_blocks(struct amdgpu_device *adev)
                         return r;
         }

-       r = amdgpu_discovery_set_mm_ip_blocks(adev);
+       if (adev->asic_type == CHIP_SIENNA_CICHLID && amdgpu_sriov_vf(adev))
+               r = amdgpu_device_ip_block_add(adev, &vcn_v3_0_ip_block);
+       else
+               r = amdgpu_discovery_set_mm_ip_blocks(adev);
         if (r)
                 return r;

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c
index 4f7c70845785..87f56b61be53 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c
@@ -86,6 +86,10 @@ int amdgpu_vcn_sw_init(struct amdgpu_device *adev)
         for (i = 0; i < adev->vcn.num_vcn_inst; i++)
                 atomic_set(&adev->vcn.inst[i].dpg_enc_submission_cnt, 0);

+       if (adev->asic_type == CHIP_SIENNA_CICHLID && amdgpu_sriov_vf(adev)) {
+               fw_name = FIRMWARE_SIENNA_CICHLID;
+               goto next;
+       }
         switch (adev->ip_versions[UVD_HWIP][0]) {
         case IP_VERSION(1, 0, 0):
         case IP_VERSION(1, 0, 1):
@@ -168,6 +172,8 @@ int amdgpu_vcn_sw_init(struct amdgpu_device *adev)
                 return -EINVAL;
         }

+next:
+
         r = request_firmware(&adev->vcn.fw, fw_name, adev->dev);
         if (r) {
                 dev_err(adev->dev, "amdgpu_vcn: Can't load firmware \"%s\"\n",
--
2.17.1

[-- Attachment #2: Type: text/html, Size: 9613 bytes --]

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* RE: [PATCH] drm/amdgpu/sriov/vcn: skip ip revision check case to ip init for SIENNA_CICHLID
  2021-11-24  2:53   ` Jian, Jane
@ 2021-11-24  3:10     ` Chen, Guchun
  0 siblings, 0 replies; 14+ messages in thread
From: Chen, Guchun @ 2021-11-24  3:10 UTC (permalink / raw)
  To: Jian, Jane, Deucher, Alexander, Chen, JingWen; +Cc: amd-gfx

[-- Attachment #1: Type: text/plain, Size: 4234 bytes --]

[Public]

Hi Jane/Alex,

Adding a check of new IP in this case looks good to me.

Regards,
Guchun

From: Jian, Jane <Jane.Jian@amd.com>
Sent: Wednesday, November 24, 2021 10:54 AM
To: Deucher, Alexander <Alexander.Deucher@amd.com>; Chen, Guchun <Guchun.Chen@amd.com>; Chen, JingWen <JingWen.Chen2@amd.com>
Cc: amd-gfx@lists.freedesktop.org
Subject: RE: [PATCH] drm/amdgpu/sriov/vcn: skip ip revision check case to ip init for SIENNA_CICHLID


[Public]

Hi Guchun,

Per Alex's suggestion, we would better add a check for new vcn0 IP version, which is a version only owned by sriov and a way that I originally did, how do you think?

Thanks,
Jane

From: Deucher, Alexander <Alexander.Deucher@amd.com<mailto:Alexander.Deucher@amd.com>>
Sent: Tuesday, November 23, 2021 11:03 PM
To: Jian, Jane <Jane.Jian@amd.com<mailto:Jane.Jian@amd.com>>; amd-gfx@lists.freedesktop.org<mailto:amd-gfx@lists.freedesktop.org>; Chen, Guchun <Guchun.Chen@amd.com<mailto:Guchun.Chen@amd.com>>; Chen, JingWen <JingWen.Chen2@amd.com<mailto:JingWen.Chen2@amd.com>>
Subject: Re: [PATCH] drm/amdgpu/sriov/vcn: skip ip revision check case to ip init for SIENNA_CICHLID


[Public]

Can we just add a check for the new IP version in that case?  This looks really hacky.

Alex

________________________________
From: Jane Jian <Jane.Jian@amd.com<mailto:Jane.Jian@amd.com>>
Sent: Tuesday, November 23, 2021 6:34 AM
To: amd-gfx@lists.freedesktop.org<mailto:amd-gfx@lists.freedesktop.org> <amd-gfx@lists.freedesktop.org<mailto:amd-gfx@lists.freedesktop.org>>; Deucher, Alexander <Alexander.Deucher@amd.com<mailto:Alexander.Deucher@amd.com>>; Chen, Guchun <Guchun.Chen@amd.com<mailto:Guchun.Chen@amd.com>>; Chen, JingWen <JingWen.Chen2@amd.com<mailto:JingWen.Chen2@amd.com>>
Cc: Jian, Jane <Jane.Jian@amd.com<mailto:Jane.Jian@amd.com>>
Subject: [PATCH] drm/amdgpu/sriov/vcn: skip ip revision check case to ip init for SIENNA_CICHLID

[WHY]
for sriov odd# vf will modify vcn0 engine ip revision(due to multimedia bandwidth feature),
which will be mismatched with original vcn0 revision

[HOW]
skip ip revision match case and continue use asic type to check

Signed-off-by: Jane Jian <Jane.Jian@amd.com<mailto:Jane.Jian@amd.com>>
Change-Id: I1ace32acbf3a13c0baac958508da1324ec387a58
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c | 5 ++++-
 drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c       | 6 ++++++
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c
index 4e3669407518..0a91e53f520c 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c
@@ -1334,7 +1334,10 @@ int amdgpu_discovery_set_ip_blocks(struct amdgpu_device *adev)
                         return r;
         }

-       r = amdgpu_discovery_set_mm_ip_blocks(adev);
+       if (adev->asic_type == CHIP_SIENNA_CICHLID && amdgpu_sriov_vf(adev))
+               r = amdgpu_device_ip_block_add(adev, &vcn_v3_0_ip_block);
+       else
+               r = amdgpu_discovery_set_mm_ip_blocks(adev);
         if (r)
                 return r;

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c
index 4f7c70845785..87f56b61be53 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c
@@ -86,6 +86,10 @@ int amdgpu_vcn_sw_init(struct amdgpu_device *adev)
         for (i = 0; i < adev->vcn.num_vcn_inst; i++)
                 atomic_set(&adev->vcn.inst[i].dpg_enc_submission_cnt, 0);

+       if (adev->asic_type == CHIP_SIENNA_CICHLID && amdgpu_sriov_vf(adev)) {
+               fw_name = FIRMWARE_SIENNA_CICHLID;
+               goto next;
+       }
         switch (adev->ip_versions[UVD_HWIP][0]) {
         case IP_VERSION(1, 0, 0):
         case IP_VERSION(1, 0, 1):
@@ -168,6 +172,8 @@ int amdgpu_vcn_sw_init(struct amdgpu_device *adev)
                 return -EINVAL;
         }

+next:
+
         r = request_firmware(&adev->vcn.fw, fw_name, adev->dev);
         if (r) {
                 dev_err(adev->dev, "amdgpu_vcn: Can't load firmware \"%s\"\n",
--
2.17.1

[-- Attachment #2: Type: text/html, Size: 11234 bytes --]

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* Re: [PATCH] drm/amdgpu/sriov/vcn: skip ip revision check case to ip init for SIENNA_CICHLID
  2021-11-25  2:21     ` Chen, Guchun
@ 2021-11-29 16:53       ` Deucher, Alexander
  0 siblings, 0 replies; 14+ messages in thread
From: Deucher, Alexander @ 2021-11-29 16:53 UTC (permalink / raw)
  To: Chen, Guchun, Alex Deucher, Jian, Jane; +Cc: Chen, JingWen, amd-gfx list

[-- Attachment #1: Type: text/plain, Size: 4242 bytes --]

[Public]

Yes, that makes more sense.

Alex

________________________________
From: Chen, Guchun <Guchun.Chen@amd.com>
Sent: Wednesday, November 24, 2021 9:21 PM
To: Chen, Guchun <Guchun.Chen@amd.com>; Alex Deucher <alexdeucher@gmail.com>; Jian, Jane <Jane.Jian@amd.com>
Cc: Deucher, Alexander <Alexander.Deucher@amd.com>; Chen, JingWen <JingWen.Chen2@amd.com>; amd-gfx list <amd-gfx@lists.freedesktop.org>
Subject: RE: [PATCH] drm/amdgpu/sriov/vcn: skip ip revision check case to ip init for SIENNA_CICHLID

[Public]

A typo.

It's better to move 'case IP_VERSION(3, 0, 192)' after IP_VERSION(3, 0, 2)?

case IP_VERSION(3, 1, 1):
case IP_VERSION(3, 0, 2):
+ case IP_VERSION(3, 0, 192):
        amdgpu_device_ip_block_add(adev, &vcn_v3_0_ip_block);
        if (!amdgpu_sriov_vf(adev))
                amdgpu_device_ip_block_add(adev, &jpeg_v3_0_ip_block);
        break;

Regards,
Guchun

-----Original Message-----
From: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> On Behalf Of Chen, Guchun
Sent: Thursday, November 25, 2021 10:19 AM
To: Alex Deucher <alexdeucher@gmail.com>; Jian, Jane <Jane.Jian@amd.com>
Cc: Deucher, Alexander <Alexander.Deucher@amd.com>; Chen, JingWen <JingWen.Chen2@amd.com>; amd-gfx list <amd-gfx@lists.freedesktop.org>
Subject: RE: [PATCH] drm/amdgpu/sriov/vcn: skip ip revision check case to ip init for SIENNA_CICHLID

[Public]

It's better to move 'case IP_VERSION(3, 0, 192)' after IP_VERSION(3, 0, 192)?

case IP_VERSION(3, 1, 1):
case IP_VERSION(3, 0, 2):
+ case IP_VERSION(3, 0, 192):
        amdgpu_device_ip_block_add(adev, &vcn_v3_0_ip_block);
        if (!amdgpu_sriov_vf(adev))
                amdgpu_device_ip_block_add(adev, &jpeg_v3_0_ip_block);
        break;

Regards,
Guchun

-----Original Message-----
From: Alex Deucher <alexdeucher@gmail.com>
Sent: Wednesday, November 24, 2021 10:23 PM
To: Jian, Jane <Jane.Jian@amd.com>
Cc: Deucher, Alexander <Alexander.Deucher@amd.com>; Chen, Guchun <Guchun.Chen@amd.com>; Chen, JingWen <JingWen.Chen2@amd.com>; amd-gfx list <amd-gfx@lists.freedesktop.org>
Subject: Re: [PATCH] drm/amdgpu/sriov/vcn: skip ip revision check case to ip init for SIENNA_CICHLID

On Wed, Nov 24, 2021 at 9:20 AM Jane Jian <Jane.Jian@amd.com> wrote:
>
> [WHY]
> for sriov odd# vf will modify vcn0 engine ip revision(due to
> multimedia bandwidth feature), which will be mismatched with original
> vcn0 revision
>
> [HOW]
> add new version check for vcn0 disabled revision(3, 0, 192), typically
> modified under sriov mode
>
> Signed-off-by: Jane Jian <Jane.Jian@amd.com>

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>

> Change-Id: I1ace32acbf3a13c0baac958508da1324ec387a58
> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c | 1 +
>  drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c       | 1 +
>  2 files changed, 2 insertions(+)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c
> index 503995c7ff6c..3f9b7b0bab3c 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c
> @@ -923,6 +923,7 @@ static int amdgpu_discovery_set_mm_ip_blocks(struct amdgpu_device *adev)
>                                 amdgpu_device_ip_block_add(adev, &jpeg_v3_0_ip_block);
>                         break;
>                 case IP_VERSION(3, 0, 33):
> +               case IP_VERSION(3, 0, 192):
>                         amdgpu_device_ip_block_add(adev, &vcn_v3_0_ip_block);
>                         break;
>                 default:
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c
> index 4f7c70845785..585961c2f5f2 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, 192):
>                 if (adev->ip_versions[GC_HWIP][0] == IP_VERSION(10, 3, 0))
>                         fw_name = FIRMWARE_SIENNA_CICHLID;
>                 else
> --
> 2.17.1
>

[-- Attachment #2: Type: text/html, Size: 7715 bytes --]

^ permalink raw reply	[flat|nested] 14+ messages in thread

* RE: [PATCH] drm/amdgpu/sriov/vcn: skip ip revision check case to ip init for SIENNA_CICHLID
  2021-11-25  3:14 Jane Jian
@ 2021-11-25  3:18 ` Chen, Guchun
  0 siblings, 0 replies; 14+ messages in thread
From: Chen, Guchun @ 2021-11-25  3:18 UTC (permalink / raw)
  To: Jian, Jane, Deucher, Alexander, Chen, JingWen; +Cc: Jian, Jane, amd-gfx

[Public]

I guess you need to add this IP version in nv_query_video_codecs as well.

With above clarified/fixed, this patch is:

Reviewed-by: Guchun Chen <guchun.chen@amd.com>

Regards,
Guchun

-----Original Message-----
From: Jane Jian <Jane.Jian@amd.com> 
Sent: Thursday, November 25, 2021 11:15 AM
To: Deucher, Alexander <Alexander.Deucher@amd.com>; Chen, Guchun <Guchun.Chen@amd.com>; Chen, JingWen <JingWen.Chen2@amd.com>
Cc: amd-gfx@lists.freedesktop.org; Jian, Jane <Jane.Jian@amd.com>
Subject: [PATCH] drm/amdgpu/sriov/vcn: skip ip revision check case to ip init for SIENNA_CICHLID

[WHY]
for sriov odd# vf will modify vcn0 engine ip revision(due to multimedia bandwidth feature), which will be mismatched with original vcn0 revision

[HOW]
add new version check for vcn0 disabled revision(3, 0, 192), typically modified under sriov mode

Signed-off-by: Jane Jian <Jane.Jian@amd.com>
Change-Id: I1ace32acbf3a13c0baac958508da1324ec387a58
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c | 1 +
 drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c       | 1 +
 2 files changed, 2 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c
index 503995c7ff6c..f6fae79203ee 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c
@@ -918,6 +918,7 @@ static int amdgpu_discovery_set_mm_ip_blocks(struct amdgpu_device *adev)
 		case IP_VERSION(3, 0, 64):
 		case IP_VERSION(3, 1, 1):
 		case IP_VERSION(3, 0, 2):
+		case IP_VERSION(3, 0, 192):
 			amdgpu_device_ip_block_add(adev, &vcn_v3_0_ip_block);
 			if (!amdgpu_sriov_vf(adev))
 				amdgpu_device_ip_block_add(adev, &jpeg_v3_0_ip_block); diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c
index 4f7c70845785..585961c2f5f2 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, 192):
 		if (adev->ip_versions[GC_HWIP][0] == IP_VERSION(10, 3, 0))
 			fw_name = FIRMWARE_SIENNA_CICHLID;
 		else
--
2.17.1

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH] drm/amdgpu/sriov/vcn: skip ip revision check case to ip init for SIENNA_CICHLID
@ 2021-11-25  3:14 Jane Jian
  2021-11-25  3:18 ` Chen, Guchun
  0 siblings, 1 reply; 14+ messages in thread
From: Jane Jian @ 2021-11-25  3:14 UTC (permalink / raw)
  To: Alexander.Deucher, guchun.chen, jingwen.chen2; +Cc: Jane.Jian, amd-gfx

[WHY]
for sriov odd# vf will modify vcn0 engine ip revision(due to multimedia bandwidth feature),
which will be mismatched with original vcn0 revision

[HOW]
add new version check for vcn0 disabled revision(3, 0, 192), typically modified under
sriov mode

Signed-off-by: Jane Jian <Jane.Jian@amd.com>
Change-Id: I1ace32acbf3a13c0baac958508da1324ec387a58
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c | 1 +
 drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c       | 1 +
 2 files changed, 2 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c
index 503995c7ff6c..f6fae79203ee 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c
@@ -918,6 +918,7 @@ static int amdgpu_discovery_set_mm_ip_blocks(struct amdgpu_device *adev)
 		case IP_VERSION(3, 0, 64):
 		case IP_VERSION(3, 1, 1):
 		case IP_VERSION(3, 0, 2):
+		case IP_VERSION(3, 0, 192):
 			amdgpu_device_ip_block_add(adev, &vcn_v3_0_ip_block);
 			if (!amdgpu_sriov_vf(adev))
 				amdgpu_device_ip_block_add(adev, &jpeg_v3_0_ip_block);
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c
index 4f7c70845785..585961c2f5f2 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, 192):
 		if (adev->ip_versions[GC_HWIP][0] == IP_VERSION(10, 3, 0))
 			fw_name = FIRMWARE_SIENNA_CICHLID;
 		else
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* RE: [PATCH] drm/amdgpu/sriov/vcn: skip ip revision check case to ip init for SIENNA_CICHLID
  2021-11-25  2:18   ` Chen, Guchun
@ 2021-11-25  2:21     ` Chen, Guchun
  2021-11-29 16:53       ` Deucher, Alexander
  0 siblings, 1 reply; 14+ messages in thread
From: Chen, Guchun @ 2021-11-25  2:21 UTC (permalink / raw)
  To: Chen, Guchun, Alex Deucher, Jian, Jane
  Cc: Deucher, Alexander, Chen, JingWen, amd-gfx list

[Public]

A typo.

It's better to move 'case IP_VERSION(3, 0, 192)' after IP_VERSION(3, 0, 2)?

case IP_VERSION(3, 1, 1):
case IP_VERSION(3, 0, 2):
+ case IP_VERSION(3, 0, 192):
	amdgpu_device_ip_block_add(adev, &vcn_v3_0_ip_block);
	if (!amdgpu_sriov_vf(adev))
		amdgpu_device_ip_block_add(adev, &jpeg_v3_0_ip_block);
	break;

Regards,
Guchun

-----Original Message-----
From: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> On Behalf Of Chen, Guchun
Sent: Thursday, November 25, 2021 10:19 AM
To: Alex Deucher <alexdeucher@gmail.com>; Jian, Jane <Jane.Jian@amd.com>
Cc: Deucher, Alexander <Alexander.Deucher@amd.com>; Chen, JingWen <JingWen.Chen2@amd.com>; amd-gfx list <amd-gfx@lists.freedesktop.org>
Subject: RE: [PATCH] drm/amdgpu/sriov/vcn: skip ip revision check case to ip init for SIENNA_CICHLID

[Public]

It's better to move 'case IP_VERSION(3, 0, 192)' after IP_VERSION(3, 0, 192)?

case IP_VERSION(3, 1, 1):
case IP_VERSION(3, 0, 2):
+ case IP_VERSION(3, 0, 192):
	amdgpu_device_ip_block_add(adev, &vcn_v3_0_ip_block);
	if (!amdgpu_sriov_vf(adev))
		amdgpu_device_ip_block_add(adev, &jpeg_v3_0_ip_block);
	break;

Regards,
Guchun

-----Original Message-----
From: Alex Deucher <alexdeucher@gmail.com>
Sent: Wednesday, November 24, 2021 10:23 PM
To: Jian, Jane <Jane.Jian@amd.com>
Cc: Deucher, Alexander <Alexander.Deucher@amd.com>; Chen, Guchun <Guchun.Chen@amd.com>; Chen, JingWen <JingWen.Chen2@amd.com>; amd-gfx list <amd-gfx@lists.freedesktop.org>
Subject: Re: [PATCH] drm/amdgpu/sriov/vcn: skip ip revision check case to ip init for SIENNA_CICHLID

On Wed, Nov 24, 2021 at 9:20 AM Jane Jian <Jane.Jian@amd.com> wrote:
>
> [WHY]
> for sriov odd# vf will modify vcn0 engine ip revision(due to 
> multimedia bandwidth feature), which will be mismatched with original
> vcn0 revision
>
> [HOW]
> add new version check for vcn0 disabled revision(3, 0, 192), typically 
> modified under sriov mode
>
> Signed-off-by: Jane Jian <Jane.Jian@amd.com>

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>

> Change-Id: I1ace32acbf3a13c0baac958508da1324ec387a58
> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c | 1 +
>  drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c       | 1 +
>  2 files changed, 2 insertions(+)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c
> index 503995c7ff6c..3f9b7b0bab3c 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c
> @@ -923,6 +923,7 @@ static int amdgpu_discovery_set_mm_ip_blocks(struct amdgpu_device *adev)
>                                 amdgpu_device_ip_block_add(adev, &jpeg_v3_0_ip_block);
>                         break;
>                 case IP_VERSION(3, 0, 33):
> +               case IP_VERSION(3, 0, 192):
>                         amdgpu_device_ip_block_add(adev, &vcn_v3_0_ip_block);
>                         break;
>                 default:
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c
> index 4f7c70845785..585961c2f5f2 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, 192):
>                 if (adev->ip_versions[GC_HWIP][0] == IP_VERSION(10, 3, 0))
>                         fw_name = FIRMWARE_SIENNA_CICHLID;
>                 else
> --
> 2.17.1
>

^ permalink raw reply	[flat|nested] 14+ messages in thread

* RE: [PATCH] drm/amdgpu/sriov/vcn: skip ip revision check case to ip init for SIENNA_CICHLID
  2021-11-24 14:22 ` Alex Deucher
@ 2021-11-25  2:18   ` Chen, Guchun
  2021-11-25  2:21     ` Chen, Guchun
  0 siblings, 1 reply; 14+ messages in thread
From: Chen, Guchun @ 2021-11-25  2:18 UTC (permalink / raw)
  To: Alex Deucher, Jian, Jane; +Cc: Deucher, Alexander, Chen, JingWen, amd-gfx list

[Public]

It's better to move 'case IP_VERSION(3, 0, 192)' after IP_VERSION(3, 0, 192)?

case IP_VERSION(3, 1, 1):
case IP_VERSION(3, 0, 2):
+ case IP_VERSION(3, 0, 192):
	amdgpu_device_ip_block_add(adev, &vcn_v3_0_ip_block);
	if (!amdgpu_sriov_vf(adev))
		amdgpu_device_ip_block_add(adev, &jpeg_v3_0_ip_block);
	break;

Regards,
Guchun

-----Original Message-----
From: Alex Deucher <alexdeucher@gmail.com> 
Sent: Wednesday, November 24, 2021 10:23 PM
To: Jian, Jane <Jane.Jian@amd.com>
Cc: Deucher, Alexander <Alexander.Deucher@amd.com>; Chen, Guchun <Guchun.Chen@amd.com>; Chen, JingWen <JingWen.Chen2@amd.com>; amd-gfx list <amd-gfx@lists.freedesktop.org>
Subject: Re: [PATCH] drm/amdgpu/sriov/vcn: skip ip revision check case to ip init for SIENNA_CICHLID

On Wed, Nov 24, 2021 at 9:20 AM Jane Jian <Jane.Jian@amd.com> wrote:
>
> [WHY]
> for sriov odd# vf will modify vcn0 engine ip revision(due to 
> multimedia bandwidth feature), which will be mismatched with original 
> vcn0 revision
>
> [HOW]
> add new version check for vcn0 disabled revision(3, 0, 192), typically 
> modified under sriov mode
>
> Signed-off-by: Jane Jian <Jane.Jian@amd.com>

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>

> Change-Id: I1ace32acbf3a13c0baac958508da1324ec387a58
> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c | 1 +
>  drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c       | 1 +
>  2 files changed, 2 insertions(+)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c 
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c
> index 503995c7ff6c..3f9b7b0bab3c 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c
> @@ -923,6 +923,7 @@ static int amdgpu_discovery_set_mm_ip_blocks(struct amdgpu_device *adev)
>                                 amdgpu_device_ip_block_add(adev, &jpeg_v3_0_ip_block);
>                         break;
>                 case IP_VERSION(3, 0, 33):
> +               case IP_VERSION(3, 0, 192):
>                         amdgpu_device_ip_block_add(adev, &vcn_v3_0_ip_block);
>                         break;
>                 default:
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c 
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c
> index 4f7c70845785..585961c2f5f2 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, 192):
>                 if (adev->ip_versions[GC_HWIP][0] == IP_VERSION(10, 3, 0))
>                         fw_name = FIRMWARE_SIENNA_CICHLID;
>                 else
> --
> 2.17.1
>

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH] drm/amdgpu/sriov/vcn: skip ip revision check case to ip init for SIENNA_CICHLID
  2021-11-24 14:20 Jane Jian
@ 2021-11-24 14:22 ` Alex Deucher
  2021-11-25  2:18   ` Chen, Guchun
  0 siblings, 1 reply; 14+ messages in thread
From: Alex Deucher @ 2021-11-24 14:22 UTC (permalink / raw)
  To: Jane Jian; +Cc: Deucher, Alexander, Jingwen Chen, amd-gfx list, Chen, Guchun

On Wed, Nov 24, 2021 at 9:20 AM Jane Jian <Jane.Jian@amd.com> wrote:
>
> [WHY]
> for sriov odd# vf will modify vcn0 engine ip revision(due to multimedia bandwidth feature),
> which will be mismatched with original vcn0 revision
>
> [HOW]
> add new version check for vcn0 disabled revision(3, 0, 192), typically modified under
> sriov mode
>
> Signed-off-by: Jane Jian <Jane.Jian@amd.com>

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>

> Change-Id: I1ace32acbf3a13c0baac958508da1324ec387a58
> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c | 1 +
>  drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c       | 1 +
>  2 files changed, 2 insertions(+)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c
> index 503995c7ff6c..3f9b7b0bab3c 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c
> @@ -923,6 +923,7 @@ static int amdgpu_discovery_set_mm_ip_blocks(struct amdgpu_device *adev)
>                                 amdgpu_device_ip_block_add(adev, &jpeg_v3_0_ip_block);
>                         break;
>                 case IP_VERSION(3, 0, 33):
> +               case IP_VERSION(3, 0, 192):
>                         amdgpu_device_ip_block_add(adev, &vcn_v3_0_ip_block);
>                         break;
>                 default:
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c
> index 4f7c70845785..585961c2f5f2 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, 192):
>                 if (adev->ip_versions[GC_HWIP][0] == IP_VERSION(10, 3, 0))
>                         fw_name = FIRMWARE_SIENNA_CICHLID;
>                 else
> --
> 2.17.1
>

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH] drm/amdgpu/sriov/vcn: skip ip revision check case to ip init for SIENNA_CICHLID
@ 2021-11-24 14:20 Jane Jian
  2021-11-24 14:22 ` Alex Deucher
  0 siblings, 1 reply; 14+ messages in thread
From: Jane Jian @ 2021-11-24 14:20 UTC (permalink / raw)
  To: Alexander.Deucher, guchun.chen, jingwen.chen2; +Cc: Jane.Jian, amd-gfx

[WHY]
for sriov odd# vf will modify vcn0 engine ip revision(due to multimedia bandwidth feature),
which will be mismatched with original vcn0 revision

[HOW]
add new version check for vcn0 disabled revision(3, 0, 192), typically modified under
sriov mode

Signed-off-by: Jane Jian <Jane.Jian@amd.com>
Change-Id: I1ace32acbf3a13c0baac958508da1324ec387a58
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c | 1 +
 drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c       | 1 +
 2 files changed, 2 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c
index 503995c7ff6c..3f9b7b0bab3c 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c
@@ -923,6 +923,7 @@ static int amdgpu_discovery_set_mm_ip_blocks(struct amdgpu_device *adev)
 				amdgpu_device_ip_block_add(adev, &jpeg_v3_0_ip_block);
 			break;
 		case IP_VERSION(3, 0, 33):
+		case IP_VERSION(3, 0, 192):
 			amdgpu_device_ip_block_add(adev, &vcn_v3_0_ip_block);
 			break;
 		default:
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c
index 4f7c70845785..585961c2f5f2 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, 192):
 		if (adev->ip_versions[GC_HWIP][0] == IP_VERSION(10, 3, 0))
 			fw_name = FIRMWARE_SIENNA_CICHLID;
 		else
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* Re: [PATCH] drm/amdgpu/sriov/vcn: skip ip revision check case to ip init for SIENNA_CICHLID
  2021-11-24  9:54 Jane Jian
@ 2021-11-24 14:12 ` Alex Deucher
  0 siblings, 0 replies; 14+ messages in thread
From: Alex Deucher @ 2021-11-24 14:12 UTC (permalink / raw)
  To: Jane Jian; +Cc: Deucher, Alexander, Jingwen Chen, amd-gfx list, Chen, Guchun

On Wed, Nov 24, 2021 at 4:54 AM Jane Jian <Jane.Jian@amd.com> wrote:
>
> [WHY]
> for sriov odd# vf will modify vcn0 engine ip revision(due to multimedia bandwidth feature),
> which will be mismatched with original vcn0 revision
>
> [HOW]
> add new version check for vcn0 disabled revision
>
> Signed-off-by: Jane Jian <Jane.Jian@amd.com>
> Change-Id: I1ace32acbf3a13c0baac958508da1324ec387a58
> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c | 3 +++
>  drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c       | 4 ++++
>  2 files changed, 7 insertions(+)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c
> index 503995c7ff6c..1dabbcbc3970 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c
> @@ -925,6 +925,9 @@ static int amdgpu_discovery_set_mm_ip_blocks(struct amdgpu_device *adev)
>                 case IP_VERSION(3, 0, 33):
>                         amdgpu_device_ip_block_add(adev, &vcn_v3_0_ip_block);
>                         break;
> +               case IP_VERSION(3, 0, 192):

You can probably just add this case to the above 3.0.33 case.

> +                       amdgpu_device_ip_block_add(adev, &vcn_v3_0_ip_block);
> +                       break;
>                 default:
>                         dev_err(adev->dev,
>                                 "Failed to add vcn/jpeg ip block(UVD_HWIP:0x%x)\n",
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c
> index 4f7c70845785..27125e5e3092 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c
> @@ -143,6 +143,10 @@ int amdgpu_vcn_sw_init(struct amdgpu_device *adev)
>                     (adev->pg_flags & AMD_PG_SUPPORT_VCN_DPG))
>                         adev->vcn.indirect_sram = true;
>                 break;
> +       case IP_VERSION(3, 0, 192):
> +               if (amdgpu_sriov_vf(adev))

I think you can skip the sr-iov check here.

> +                       fw_name = FIRMWARE_SIENNA_CICHLID;
> +               break;
>         case IP_VERSION(3, 0, 2):
>                 fw_name = FIRMWARE_VANGOGH;
>                 break;
> --
> 2.17.1
>

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH] drm/amdgpu/sriov/vcn: skip ip revision check case to ip init for SIENNA_CICHLID
@ 2021-11-24  9:54 Jane Jian
  2021-11-24 14:12 ` Alex Deucher
  0 siblings, 1 reply; 14+ messages in thread
From: Jane Jian @ 2021-11-24  9:54 UTC (permalink / raw)
  To: Alexander.Deucher, guchun.chen, jingwen.chen2; +Cc: Jane.Jian, amd-gfx

[WHY]
for sriov odd# vf will modify vcn0 engine ip revision(due to multimedia bandwidth feature),
which will be mismatched with original vcn0 revision

[HOW]
add new version check for vcn0 disabled revision

Signed-off-by: Jane Jian <Jane.Jian@amd.com>
Change-Id: I1ace32acbf3a13c0baac958508da1324ec387a58
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c | 3 +++
 drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c       | 4 ++++
 2 files changed, 7 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c
index 503995c7ff6c..1dabbcbc3970 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c
@@ -925,6 +925,9 @@ static int amdgpu_discovery_set_mm_ip_blocks(struct amdgpu_device *adev)
 		case IP_VERSION(3, 0, 33):
 			amdgpu_device_ip_block_add(adev, &vcn_v3_0_ip_block);
 			break;
+		case IP_VERSION(3, 0, 192):
+			amdgpu_device_ip_block_add(adev, &vcn_v3_0_ip_block);
+			break;
 		default:
 			dev_err(adev->dev,
 				"Failed to add vcn/jpeg ip block(UVD_HWIP:0x%x)\n",
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c
index 4f7c70845785..27125e5e3092 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c
@@ -143,6 +143,10 @@ int amdgpu_vcn_sw_init(struct amdgpu_device *adev)
 		    (adev->pg_flags & AMD_PG_SUPPORT_VCN_DPG))
 			adev->vcn.indirect_sram = true;
 		break;
+	case IP_VERSION(3, 0, 192):
+		if (amdgpu_sriov_vf(adev))
+			fw_name = FIRMWARE_SIENNA_CICHLID;
+		break;
 	case IP_VERSION(3, 0, 2):
 		fw_name = FIRMWARE_VANGOGH;
 		break;
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH] drm/amdgpu/sriov/vcn: skip ip revision check case to ip init for SIENNA_CICHLID
@ 2021-11-23 11:33 Jane Jian
  0 siblings, 0 replies; 14+ messages in thread
From: Jane Jian @ 2021-11-23 11:33 UTC (permalink / raw)
  To: amd-gfx, Alexander.Deucher; +Cc: Jane.Jian

[WHY]
for sriov odd# vf will modify vcn0 engine ip revision(due to multimedia bandwidth feature),
which will be mismatched with original vcn0 revision

[HOW]
skip ip revision match case and continue use asic type to check

Signed-off-by: Jane Jian <Jane.Jian@amd.com>
Change-Id: I1ace32acbf3a13c0baac958508da1324ec387a58
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c | 5 ++++-
 drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c       | 6 ++++++
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c
index 4e3669407518..0a91e53f520c 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c
@@ -1334,7 +1334,10 @@ int amdgpu_discovery_set_ip_blocks(struct amdgpu_device *adev)
 			return r;
 	}
 
-	r = amdgpu_discovery_set_mm_ip_blocks(adev);
+	if (adev->asic_type == CHIP_SIENNA_CICHLID && amdgpu_sriov_vf(adev))
+		r = amdgpu_device_ip_block_add(adev, &vcn_v3_0_ip_block);
+	else
+		r = amdgpu_discovery_set_mm_ip_blocks(adev);
 	if (r)
 		return r;
 
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c
index 4f7c70845785..87f56b61be53 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c
@@ -86,6 +86,10 @@ int amdgpu_vcn_sw_init(struct amdgpu_device *adev)
 	for (i = 0; i < adev->vcn.num_vcn_inst; i++)
 		atomic_set(&adev->vcn.inst[i].dpg_enc_submission_cnt, 0);
 
+	if (adev->asic_type == CHIP_SIENNA_CICHLID && amdgpu_sriov_vf(adev)) {
+		fw_name = FIRMWARE_SIENNA_CICHLID;
+		goto next;
+	}
 	switch (adev->ip_versions[UVD_HWIP][0]) {
 	case IP_VERSION(1, 0, 0):
 	case IP_VERSION(1, 0, 1):
@@ -168,6 +172,8 @@ int amdgpu_vcn_sw_init(struct amdgpu_device *adev)
 		return -EINVAL;
 	}
 
+next:
+
 	r = request_firmware(&adev->vcn.fw, fw_name, adev->dev);
 	if (r) {
 		dev_err(adev->dev, "amdgpu_vcn: Can't load firmware \"%s\"\n",
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2021-11-29 16:53 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-23 11:34 [PATCH] drm/amdgpu/sriov/vcn: skip ip revision check case to ip init for SIENNA_CICHLID Jane Jian
2021-11-23 15:02 ` Deucher, Alexander
2021-11-24  2:53   ` Jian, Jane
2021-11-24  3:10     ` Chen, Guchun
  -- strict thread matches above, loose matches on Subject: below --
2021-11-25  3:14 Jane Jian
2021-11-25  3:18 ` Chen, Guchun
2021-11-24 14:20 Jane Jian
2021-11-24 14:22 ` Alex Deucher
2021-11-25  2:18   ` Chen, Guchun
2021-11-25  2:21     ` Chen, Guchun
2021-11-29 16:53       ` Deucher, Alexander
2021-11-24  9:54 Jane Jian
2021-11-24 14:12 ` Alex Deucher
2021-11-23 11:33 Jane Jian

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.