[PATCH] drm/amdgpu: fix incorrect VCN revision in SRIOV

Alex Deucher alexdeucher at gmail.com
Wed Dec 8 16:30:35 UTC 2021


On Wed, Dec 8, 2021 at 11:09 AM Lazar, Lijo <lijo.lazar at 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 at lists.freedesktop.org> On Behalf Of Leslie Shi
> > Sent: Wednesday, December 8, 2021 4:46 PM
> > To: amd-gfx at 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 at 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)) {
> >


More information about the amd-gfx mailing list