My apologies for bothering the mailing list once more-
I found the relevant commit for this in the linux git history, and found
the relevant changes. I added those changes locally on my machine, however
when I compile I get the following:
ld -T ld.script -X --warn-common -nopie -o bsd ${SYSTEM_HEAD} vers.o ${OBJS}
ld: error: undefined symbol: psp_v11_0_set_psp_funcs
>>> referenced by amdgpu_psp.c:62
(/usr/src/sys/dev/pci/drm/amd/amdgpu/amdgpu_psp.c:62)
>>>               amdgpu_psp.o:(psp_sw_init)

ld: error: undefined symbol: vega20_smu_funcs
>>> referenced by hwmgr.c:164
(/usr/src/sys/dev/pci/drm/amd/powerplay/hwmgr/hwmgr.c:164)
>>>               hwmgr.o:(hwmgr_early_init)

ld: error: undefined symbol: vega20_hwmgr_init
>>> referenced by hwmgr.c:165
(/usr/src/sys/dev/pci/drm/amd/powerplay/hwmgr/hwmgr.c:165)
>>>               hwmgr.o:(hwmgr_early_init)

ld: error: undefined symbol: nbio_v7_4_funcs
>>> referenced by soc15.c:501
(/usr/src/sys/dev/pci/drm/amd/amdgpu/soc15.c:501)
>>>               soc15.o:(soc15_set_ip_blocks)

ld: error: undefined symbol: nbio_v7_4_funcs
>>> referenced by soc15.c:501
(/usr/src/sys/dev/pci/drm/amd/amdgpu/soc15.c:501)
>>>               soc15.o:(soc15_set_ip_blocks)
*** Error 1 in /usr/src/sys/arch/amd64/compile/GENERIC.MP (Makefile:1426
'bsd': @echo ld -T ld.script -X --warn-common -nopie -o bsd '${SYST...)
>From what I can tell, these all mention functions added in new files added
from the linux drm... is there anything in particular I need to do to make
sure the compiler picks up the relevant files, or maybe something to the
Makefile? I can post a diff of what I've done so far if that would be
useful.

Thanks again for all the help.

On Wed, Sep 4, 2019 at 9:44 AM Jonathan Gray <[email protected]> wrote:

> Look for individual post 4.19 linux commits that are relevant.
> We have in the past taken small patches to enable more
> generations of hardware.
>
> On Wed, Sep 04, 2019 at 08:11:24AM -0500, Charlie Burnett wrote:
> > Hey,
> > I???ve been trying to write a patch to get vega 20 working, but due to a
> > screw up on my end I lost the progress I???d made. Before I start over
> again,
> > I was wondering if you had any advice on how to do it? Before, I was
> trying
> > to more or less just port the vega 20 hwmgr files in from FreeBSD drm
> next
> > which is at linux drm 5.0 as well as the other files which seemed to
> > mention Vega 20 or seemed to be needed to compile. I wasn???t having much
> > luck as you can imagine, and currently I???m still in university so my
> > experience with kernel patching isn???t fantastic, I was wondering if you
> > might have any advice where to begin if I???m having to start from
> scratch?
> > Best regards,
> > Charlie Burnett
> >
> > On Thu, Aug 1, 2019 at 11:06 PM Jonathan Gray <[email protected]> wrote:
> >
> > > On Fri, Aug 02, 2019 at 03:11:54AM -0500, Charlie Burnett wrote:
> > > > Hey-
> > > > I'd been messing around with the AMDGPU on current (which I'm aware
> is
> > > very
> > > > experimental) and had very few issues with it using a Vega 56 GPU. I
> > > > recently swapped to another Vega GPU (Radeon VII) and have issues
> with
> > > the
> > > > display not showing anything. Still boots fine, in that I can still
> enter
> > > > commands (i.e. reboot) so it has to be a display issue. I tried
> searching
> > > > for the diff where the firmware was added which I'm certain I saw
> (for
> > > Vega
> > > > 20) but can't seem to find it in the commit history. Anyone have a
> fix
> > > for
> > > > it, and if not, who should I talk to if I wanted to help get it
> working?
> > > I
> > > > saw most of the AMDGPU commits have been by @jonathangray if he
> would be
> > > > the best option.
> > > > Thanks!
> > >
> > > vega20 firmware was added when ports/sysutils/firmware/amdgpu was
> > > updated to 20190312.
> > >
> > > vega20 is marked as experimental in the version of drm we have, but we
> > > don't currently check the flag on probe like linux does.
> > >
> > > The following diff will prevent amdgpu from matching on devices
> > > in the amdgpu_pciidlist table with the AMD_EXP_HW_SUPPORT flag
> > > (currently these are all vega20 ids).
> > >
> > > Index: sys/dev/pci/drm/include/drm/drm_drv.h
> > > ===================================================================
> > > RCS file: /cvs/src/sys/dev/pci/drm/include/drm/drm_drv.h,v
> > > retrieving revision 1.2
> > > diff -u -p -r1.2 drm_drv.h
> > > --- sys/dev/pci/drm/include/drm/drm_drv.h       25 Jul 2019 05:48:16
> > > -0000      1.2
> > > +++ sys/dev/pci/drm/include/drm/drm_drv.h       2 Aug 2019 03:29:58
> -0000
> > > @@ -291,5 +291,7 @@ static inline bool drm_drv_uses_atomic_m
> > >  int    drm_dev_register(struct drm_device *, unsigned long);
> > >  void   drm_dev_unregister(struct drm_device *);
> > >  int    drm_getpciinfo(struct drm_device *, void *, struct drm_file *);
> > > +const struct drm_pcidev        *drm_find_description(int, int,
> > > +    const struct drm_pcidev *);
> > >
> > >  #endif
> > > Index: sys/dev/pci/drm/amd/amdgpu/amdgpu_kms.c
> > > ===================================================================
> > > RCS file: /cvs/src/sys/dev/pci/drm/amd/amdgpu/amdgpu_kms.c,v
> > > retrieving revision 1.3
> > > diff -u -p -r1.3 amdgpu_kms.c
> > > --- sys/dev/pci/drm/amd/amdgpu/amdgpu_kms.c     4 Jul 2019 03:39:07
> -0000
> > >      1.3
> > > +++ sys/dev/pci/drm/amd/amdgpu/amdgpu_kms.c     2 Aug 2019 03:35:35
> -0000
> > > @@ -1337,10 +1337,23 @@ int amdgpu_debugfs_firmware_init(struct
> > >  int
> > >  amdgpu_probe(struct device *parent, void *match, void *aux)
> > >  {
> > > +       struct pci_attach_args *pa = aux;
> > > +       const struct drm_pcidev *id_entry;
> > > +       unsigned long flags = 0;
> > > +
> > >         if (amdgpu_fatal_error)
> > >                 return 0;
> > > -       if (drm_pciprobe(aux, amdgpu_pciidlist))
> > > -               return 20;
> > > +
> > > +       id_entry = drm_find_description(PCI_VENDOR(pa->pa_id),
> > > +           PCI_PRODUCT(pa->pa_id), amdgpu_pciidlist);
> > > +       if (id_entry != NULL) {
> > > +               flags = id_entry->driver_data;
> > > +               if (flags & AMD_EXP_HW_SUPPORT)
> > > +                       return 0;
> > > +               else
> > > +                       return 20;
> > > +       }
> > > +
> > >         return 0;
> > >  }
> > >
> > >
> > >
>

Reply via email to