All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/amdgpu: fix incorrect VCN revision in SRIOV
@ 2021-12-08  8:46 Leslie Shi
  2021-12-08  8:46 ` [PATCH] drm/amdgpu: add modifiers in amdgpu_vkms_plane_init() Leslie Shi
  2021-12-08  9:13 ` [PATCH] drm/amdgpu: fix incorrect VCN revision in SRIOV Chen, Guchun
  0 siblings, 2 replies; 6+ messages in thread
From: Leslie Shi @ 2021-12-08  8:46 UTC (permalink / raw)
  To: amd-gfx

Guest 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 <Yuliang.Shi@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c
index 2658414c503d..2323815ac32d 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c
@@ -293,6 +293,9 @@ bool amdgpu_vcn_is_disabled_vcn(struct amdgpu_device *adev, enum vcn_ring_type t
 	if (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)) {
-- 
2.25.1


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

* [PATCH] drm/amdgpu: add modifiers in amdgpu_vkms_plane_init()
  2021-12-08  8:46 [PATCH] drm/amdgpu: fix incorrect VCN revision in SRIOV Leslie Shi
@ 2021-12-08  8:46 ` Leslie Shi
  2021-12-09  2:52   ` Chen, Guchun
  2021-12-08  9:13 ` [PATCH] drm/amdgpu: fix incorrect VCN revision in SRIOV Chen, Guchun
  1 sibling, 1 reply; 6+ messages in thread
From: Leslie Shi @ 2021-12-08  8:46 UTC (permalink / raw)
  To: amd-gfx

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]

Signed-off-by: Leslie Shi <Yuliang.Shi@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c
index af3a2f8c12b4..03a13771a9f7 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c
@@ -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


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

* RE: [PATCH] drm/amdgpu: fix incorrect VCN revision in SRIOV
  2021-12-08  8:46 [PATCH] drm/amdgpu: fix incorrect VCN revision in SRIOV Leslie Shi
  2021-12-08  8:46 ` [PATCH] drm/amdgpu: add modifiers in amdgpu_vkms_plane_init() Leslie Shi
@ 2021-12-08  9:13 ` Chen, Guchun
  2021-12-08 15:35   ` Lazar, Lijo
  1 sibling, 1 reply; 6+ messages in thread
From: Chen, Guchun @ 2021-12-08  9:13 UTC (permalink / raw)
  To: Shi, Leslie, amd-gfx

[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 <amd-gfx-bounces@lists.freedesktop.org> On Behalf Of Leslie Shi
Sent: Wednesday, December 8, 2021 4:46 PM
To: amd-gfx@lists.freedesktop.org
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.

Fixes: 36b7d5646476 ("drm/amdgpu: handle SRIOV VCN revision parsing")
Signed-off-by: Leslie Shi <Yuliang.Shi@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c
index 2658414c503d..2323815ac32d 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c
@@ -293,6 +293,9 @@ bool amdgpu_vcn_is_disabled_vcn(struct amdgpu_device *adev, enum vcn_ring_type t
 	if (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)) {
-- 
2.25.1

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

* Re: [PATCH] drm/amdgpu: fix incorrect VCN revision in SRIOV
  2021-12-08  9:13 ` [PATCH] drm/amdgpu: fix incorrect VCN revision in SRIOV Chen, Guchun
@ 2021-12-08 15:35   ` Lazar, Lijo
  2021-12-08 16:30     ` Alex Deucher
  0 siblings, 1 reply; 6+ messages in thread
From: Lazar, Lijo @ 2021-12-08 15:35 UTC (permalink / raw)
  To: Chen, Guchun, Shi, Leslie, amd-gfx



On 12/8/2021 2:43 PM, Chen, Guchun wrote:
> [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.
> 

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

> Regards,
> Guchun
> 
> -----Original Message-----
> From: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> On Behalf Of Leslie Shi
> Sent: Wednesday, December 8, 2021 4:46 PM
> To: amd-gfx@lists.freedesktop.org
> 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.
> 
> Fixes: 36b7d5646476 ("drm/amdgpu: handle SRIOV VCN revision parsing")
> Signed-off-by: Leslie Shi <Yuliang.Shi@amd.com>
> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c | 3 +++
>   1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c
> index 2658414c503d..2323815ac32d 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c
> @@ -293,6 +293,9 @@ bool amdgpu_vcn_is_disabled_vcn(struct amdgpu_device *adev, enum vcn_ring_type t
>   	if (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)) {
> 

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

* Re: [PATCH] drm/amdgpu: fix incorrect VCN revision in SRIOV
  2021-12-08 15:35   ` Lazar, Lijo
@ 2021-12-08 16:30     ` Alex Deucher
  0 siblings, 0 replies; 6+ messages in thread
From: Alex Deucher @ 2021-12-08 16:30 UTC (permalink / raw)
  To: Lazar, Lijo; +Cc: Shi, Leslie, amd-gfx, Chen, Guchun

On Wed, Dec 8, 2021 at 11:09 AM Lazar, Lijo <lijo.lazar@amd.com> wrote:
>
>
>
> On 12/8/2021 2:43 PM, Chen, Guchun wrote:
> > [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.
> >
>
> 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.
>

That seems cleaner.  We can also drop
amdgpu_discovery_get_vcn_version() and just use vcn_config.

Alex

> Thanks,
> Lijo
>
> > Regards,
> > Guchun
> >
> > -----Original Message-----
> > From: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> On Behalf Of Leslie Shi
> > Sent: Wednesday, December 8, 2021 4:46 PM
> > To: amd-gfx@lists.freedesktop.org
> > 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.
> >
> > Fixes: 36b7d5646476 ("drm/amdgpu: handle SRIOV VCN revision parsing")
> > Signed-off-by: Leslie Shi <Yuliang.Shi@amd.com>
> > ---
> >   drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c | 3 +++
> >   1 file changed, 3 insertions(+)
> >
> > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c
> > index 2658414c503d..2323815ac32d 100644
> > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c
> > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c
> > @@ -293,6 +293,9 @@ bool amdgpu_vcn_is_disabled_vcn(struct amdgpu_device *adev, enum vcn_ring_type t
> >       if (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)) {
> >

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

* RE: [PATCH] drm/amdgpu: add modifiers in amdgpu_vkms_plane_init()
  2021-12-08  8:46 ` [PATCH] drm/amdgpu: add modifiers in amdgpu_vkms_plane_init() Leslie Shi
@ 2021-12-09  2:52   ` Chen, Guchun
  0 siblings, 0 replies; 6+ messages in thread
From: Chen, Guchun @ 2021-12-09  2:52 UTC (permalink / raw)
  To: Shi, Leslie, amd-gfx

[Public]

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

Regards,
Guchun

-----Original Message-----
From: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> On Behalf Of Leslie Shi
Sent: Wednesday, December 8, 2021 4:46 PM
To: amd-gfx@lists.freedesktop.org
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]

Signed-off-by: Leslie Shi <Yuliang.Shi@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c
index af3a2f8c12b4..03a13771a9f7 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c
@@ -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

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

end of thread, other threads:[~2021-12-09 16:54 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-08  8:46 [PATCH] drm/amdgpu: fix incorrect VCN revision in SRIOV Leslie Shi
2021-12-08  8:46 ` [PATCH] drm/amdgpu: add modifiers in amdgpu_vkms_plane_init() Leslie Shi
2021-12-09  2:52   ` Chen, Guchun
2021-12-08  9:13 ` [PATCH] drm/amdgpu: fix incorrect VCN revision in SRIOV Chen, Guchun
2021-12-08 15:35   ` Lazar, Lijo
2021-12-08 16:30     ` Alex Deucher

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.