AMDGPU in current issue

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

AMDGPU in current issue

Charlie Burnett
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!
Reply | Threaded
Open this post in threaded view
|

Re: AMDGPU in current issue

Jonathan Gray-11
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 | Threaded
Open this post in threaded view
|

Re: AMDGPU in current issue

Oriol Demaria-2

Been using since yesterday a custom kernel with amdgpu, on a Ryzen 5 PRO
2500U, as I saw many commits. For me now the display is now usable and
stable, still minor issues, so I can use the laptop with external
monitor.

In exchange I tried to hibernate, which was working with the UEFI vesa
driver, and seems that doesn't work (tried only once) and suspend still
not working.

I will keep using the amdgpu driver from now unless I see major issues,
because being able to use two screens is important.

Regards.

Jonathan Gray <[hidden email]> writes:

> 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;
>  }
>  


--
Oriol Demaria
2FFED630C16E4FF8

Reply | Threaded
Open this post in threaded view
|

Re: AMDGPU in current issue

Charlie Burnett
In reply to this post by Jonathan Gray-11
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 <[hidden email]> 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 | Threaded
Open this post in threaded view
|

Re: AMDGPU in current issue

Jonathan Gray-11
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 <[hidden email]> 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 | Threaded
Open this post in threaded view
|

Re: AMDGPU in current issue

Charlie Burnett
Thanks for the advice!
Do you happen to have a link to the commit amdgpu is at currently?

On Wed, Sep 4, 2019 at 9:44 AM Jonathan Gray <[hidden email]> 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 <[hidden email]> 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 | Threaded
Open this post in threaded view
|

Re: AMDGPU in current issue

Charlie Burnett
In reply to this post by Jonathan Gray-11
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 <[hidden email]> 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 <[hidden email]> 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 | Threaded
Open this post in threaded view
|

Re: AMDGPU in current issue

Jonathan Gray-11
In reply to this post by Charlie Burnett
amdgpu tracks the linux-4.19.y (lts) branch of linux-stable
currently this is 4.19.69

On Wed, Sep 04, 2019 at 10:28:51AM -0500, Charlie Burnett wrote:

> Thanks for the advice!
> Do you happen to have a link to the commit amdgpu is at currently?
>
> On Wed, Sep 4, 2019 at 9:44 AM Jonathan Gray <[hidden email]> 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 <[hidden email]> 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 | Threaded
Open this post in threaded view
|

Re: AMDGPU in current issue

Charlie Burnett
Hey, apologies to continually bother you with this, but I've gotten a
driver that compiles and detects the card... however it seems to be having
powerplay table issues, I was wondering if this was ever an issue when
initially porting, and if so how'd you go about fixing it?
Leaving the powerplay untouched and only altering the amdgpu subdirectory
results in this error in the following error in dmesg:
initializing kernel modesetting (VEGA20 0x1002:0x66AF 0x1002:0x081E 0xC1).
amdgpu_device_resize_fb_bar: stub
amdgpu: [powerplay] smc start failed
amdgpu: [powerplay] powerplay hw init failed
[drm] *ERROR* hw_init of IP block <powerplay> failed -22
drm:pid0:amdgpu_device_init *ERROR* amdgpu_device_ip_init failed
drm:pid0:amdgpu_attachhook *ERROR* Fatal error during GPU init
efifb0 at mainbus0: 3440x1440, 32bpp
wsdisplay0 at efifb0 mux 1: console (std, vt100 emulation), using wskbd0
wskbd1: connecting to wsdisplay0
wskbd2: connecting to wsdisplay0
wskbd3: connecting to wsdisplay0
wskbd4: connecting to wsdisplay0
wsdisplay0: screen 1-5 added (std, vt100 emulation)

Compiling the kernel with the additional powerplay changes relevant to vega
20 results in a similar message, although instead of the "hw_init" having
issues, it complains about "Unmatch PPTable version, vbios update may be
needed". I'd post a diff, but trying to generate a diff through cvs isn't
picking up the files I've added even with the --new-file option, but I'm
rather unfamiliar with cvs/diff in general so it's probable I screwed the
pooch on that part somehow. Any help would be very much appreciated, and
thanks for the help you've given already!

On Wed, Sep 4, 2019 at 8:04 PM Jonathan Gray <[hidden email]> wrote:

> amdgpu tracks the linux-4.19.y (lts) branch of linux-stable
> currently this is 4.19.69
>
> On Wed, Sep 04, 2019 at 10:28:51AM -0500, Charlie Burnett wrote:
> > Thanks for the advice!
> > Do you happen to have a link to the commit amdgpu is at currently?
> >
> > On Wed, Sep 4, 2019 at 9:44 AM Jonathan Gray <[hidden email]> 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 <[hidden email]> 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;
> > > > >  }
> > > > >
> > > > >
> > > > >
> > >
>
>