drm/amdgpu: fix incorrect VCN revision in SRIOV
Subsystems (2)
PATCH 1/1 drm/amdgpu: fix incorrect VCN revision in SRIOV
Guest OS will setup VCN instance 1 which is disabled as an enabled instance. This will cause VCN ib ring test failure during modprobe.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c +3 -0
@@ -293,6 +293,9 @@ bool amdgpu_vcn_is_disabled_vcn(struct amdgpu_device *adev, enum vcn_ring_type tif (amdgpu_discovery_get_vcn_version (adev, vcn_instance, &major, &minor, &revision) !=0 )return true; +if (amdgpu_sriov_vf (adev)) + revision |= adev->vcn.sriov_config[vcn_instance] <<6 ; +if ((type ==VCN_ENCODE_RING ) && (revision &VCN_BLOCK_ENCODE_DISABLE_MASK )) { ret = true; }else if ((type ==VCN_DECODE_RING ) && (revision &VCN_BLOCK_DECODE_DISABLE_MASK )) {
Signature · 1 line
2.25.1
[Public]
Hi Leslie,
Can we move revision handling in this patch into amdgpu_discovery_get_vcn_version? Then we will maintain all revision handlings only in amdgpu_discovery.c.
Regards,
Guchun
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Leslie Shi
Sent: Wednesday, December 8, 2021 4:46 PM
To: [email protected]
Subject: [PATCH] drm/amdgpu: fix incorrect VCN revision in SRIOV
Guest OS will setup VCN instance 1 which is disabled as an enabled instance. This will cause VCN ib ring test failure during modprobe.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c +3 -0
@@ -293,6 +293,9 @@ bool amdgpu_vcn_is_disabled_vcn(struct amdgpu_device *adev, enum vcn_ring_type tif (amdgpu_discovery_get_vcn_version (adev, vcn_instance, &major, &minor, &revision) !=0 )return true; +if (amdgpu_sriov_vf (adev)) + revision |= adev->vcn.sriov_config[vcn_instance] <<6 ; +if ((type ==VCN_ENCODE_RING ) && (revision &VCN_BLOCK_ENCODE_DISABLE_MASK )) { ret = true; }else if ((type ==VCN_DECODE_RING ) && (revision &VCN_BLOCK_DECODE_DISABLE_MASK )) {
Signature · 1 line
2.25.1
Quoted 6 lines · Guchun
[Public]
Hi Leslie,
Can we move revision handling in this patch into
amdgpu_discovery_get_vcn_version? Then we will maintain all revision handlings only inamdgpu_discovery.c.
This seems to be more about VCN config than revision. A better thing to do will be to rename sriov_config as vcn_config and use that here (regardless of SRIOV or not).
Change discovery code to -
adev->vcn.vcn_config[adev->vcn.num_vcn_inst] = (ip->revision & 0xc0);
And check here as:
vcn_config & VCN_BLOCK_ENCODE_DISABLE_MASK
Looks like baremetal enables all and VF enables only encode or decode on particular VCN instance.
Thanks,
Lijo
Quoted 33 lines
Regards,
Guchun-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Leslie Shi
Sent: Wednesday, December 8, 2021 4:46 PM
To: [email protected]
Subject: [PATCH] drm/amdgpu: fix incorrect VCN revision in SRIOVGuest OS will setup VCN instance 1 which is disabled as an enabled instance. This will cause VCN ib ring test failure during modprobe.
Fixes 36b7d5646476 ("drm/amdgpu: handle SRIOV VCN revision parsing")Signed-off-by Leslie Shi <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c | 3 +++ 1 file changed, 3 insertions(+)drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c +3
-0@@ -293,6 +293,9 @@ bool amdgpu_vcn_is_disabled_vcn(struct amdgpu_device *adev, enum vcn_ring_type tif (amdgpu_discovery_get_vcn_version (adev, vcn_instance, &major, &minor, &revision) !=0 )return true; +if (amdgpu_sriov_vf (adev)) + revision |= adev->vcn.sriov_config[vcn_instance] <<6 ; +if ((type ==VCN_ENCODE_RING ) && (revision &VCN_BLOCK_ENCODE_DISABLE_MASK )) { ret = true; }else if ((type ==VCN_DECODE_RING ) && (revision &VCN_BLOCK_DECODE_DISABLE_MASK )) {
Quoted 15 lines · Lijo
Quoted 6 lines · Guchun
[Public]
Hi Leslie,
Can we move revision handling in this patch into
amdgpu_discovery_get_vcn_version? Then we will maintain all revision handlings only inamdgpu_discovery.c.This seems to be more about VCN config than revision. A better thing to do will be to rename
sriov_configasvcn_configand use that here (regardless of SRIOV or not).
Quoted 9 lines
Change discovery code to -
adev->vcn.vcn_config[adev->vcn.num_vcn_inst] = (ip->revision & 0xc0);And check here as:
vcn_config&VCN_BLOCK_ENCODE_DISABLE_MASKLooks like baremetal enables all and VF enables only encode or decode on particular VCN instance.
That seems cleaner. We can also drop amdgpu_discovery_get_vcn_version() and just use vcn_config.
Alex
Quoted 36 lines
Thanks,
LijoQuoted 33 lines
Regards,
Guchun-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Leslie Shi
Sent: Wednesday, December 8, 2021 4:46 PM
To: [email protected]
Subject: [PATCH] drm/amdgpu: fix incorrect VCN revision in SRIOVGuest OS will setup VCN instance 1 which is disabled as an enabled instance. This will cause VCN ib ring test failure during modprobe.
Fixes 36b7d5646476 ("drm/amdgpu: handle SRIOV VCN revision parsing")Signed-off-by Leslie Shi <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c | 3 +++ 1 file changed, 3 insertions(+)drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c +3
-0@@ -293,6 +293,9 @@ bool amdgpu_vcn_is_disabled_vcn(struct amdgpu_device *adev, enum vcn_ring_type tif (amdgpu_discovery_get_vcn_version (adev, vcn_instance, &major, &minor, &revision) !=0 )return true; +if (amdgpu_sriov_vf (adev)) + revision |= adev->vcn.sriov_config[vcn_instance] <<6 ; +if ((type ==VCN_ENCODE_RING ) && (revision &VCN_BLOCK_ENCODE_DISABLE_MASK )) { ret = true; }else if ((type ==VCN_DECODE_RING ) && (revision &VCN_BLOCK_DECODE_DISABLE_MASK )) {
PATCH 1/1 drm/amdgpu: add modifiers in amdgpu_vkms_plane_init()
In reply to Leslie ShiFix following warning in SRIOV during modprobe:
amdgpu 0000:00:08.0: GFX9+ requires FB check based on format modifier
WARNING: CPU: 0 PID: 1023 at drivers/gpu/drm/amd/amdgpu/amdgpu_display.c:1150 amdgpu_display_framebuffer_init+0x8e7/0xb40 [amdgpu]
--- drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c +2 -1
@@ -390,6 +390,7 @@ static struct drm_plane *amdgpu_vkms_plane_init(struct drm_device *dev, int index) {struct drm_plane *plane; +uint64_t modifiers[] = {DRM_FORMAT_MOD_LINEAR ,DRM_FORMAT_MOD_INVALID };int ret; plane =kzalloc (sizeof (*plane),GFP_KERNEL );
@@ -400,7 +401,7 @@ static struct drm_plane *amdgpu_vkms_plane_init(struct drm_device *dev, &amdgpu_vkms_plane_funcs, amdgpu_vkms_formats,ARRAY_SIZE (amdgpu_vkms_formats), - NULL, type, NULL); + modifiers, type, NULL);if (ret) {kfree (plane);return ERR_PTR (ret);
Signature · 1 line
2.25.1
RE: [PATCH] drm/amdgpu: add modifiers in amdgpu_vkms_plane_init()
[Public]
Regards,
Guchun
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Leslie Shi
Sent: Wednesday, December 8, 2021 4:46 PM
To: [email protected]
Subject: [PATCH] drm/amdgpu: add modifiers in amdgpu_vkms_plane_init()
Fix following warning in SRIOV during modprobe:
amdgpu 0000:00:08.0: GFX9+ requires FB check based on format modifier
WARNING: CPU: 0 PID: 1023 at drivers/gpu/drm/amd/amdgpu/amdgpu_display.c:1150 amdgpu_display_framebuffer_init+0x8e7/0xb40 [amdgpu]
--- drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c +2 -0
@@ -390,6 +390,7 @@ static struct drm_plane *amdgpu_vkms_plane_init(struct drm_device *dev, int index) {struct drm_plane *plane; +uint64_t modifiers[] = {DRM_FORMAT_MOD_LINEAR , +DRM_FORMAT_MOD_INVALID };int ret;
plane = kzalloc(sizeof(*plane), GFP_KERNEL); @@ -400,7 +401,7 @@ static struct drm_plane *amdgpu_vkms_plane_init(struct drm_device *dev,
&amdgpu_vkms_plane_funcs,
amdgpu_vkms_formats,
ARRAY_SIZE(amdgpu_vkms_formats),
- NULL, type, NULL);
+ modifiers, type, NULL);
if (ret) {
kfree(plane);
return ERR_PTR(ret);
--
2.25.1