On Fri, Aug 16, 2019 at 10:21:33PM +0200, Mark Kettenis wrote:
> The diff below provides a minimal implementation of some of the Linux
> ACPI iterfaces.  Enough to allow us to compile the ACPI code for
> radeon(4) and amdgpu(4).  With this diff the brightness keys on my HP
> laptop with:
>=20
> cpu0: AMD A4-4355M APU with Radeon(tm) HD Graphics, 1897.56 MHz, 15-10-01
> ...
> radeondrm0 at pci0 dev 1 function 0 "ATI Radeon HD 7400G" rev 0x00
>=20
> now work.  I'd like to see some more tests, especially on laptops with
> amdgpu(4).  Diff has some debug printing enabled.  Feel free to share
> the dmesg output with me.

In linux these files are only built with CONFIG_ACPI
so we should probably modify them to put that in the files themselves

=2E/amd/amdgpu/Makefile:amdgpu-$(CONFIG_ACPI) +=3D amdgpu_acpi.o
=2E/i915/Makefile:i915-$(CONFIG_ACPI)             +=3D intel_acpi.o intel_o=
pregion.o
=2E/radeon/Makefile:radeon-$(CONFIG_ACPI) +=3D radeon_acpi.o

This diff doesn't build on at least arm64 and sparc64

cc -g -Werror -Wall -Wimplicit-function-declaration  -Wno-uninitialized -Wn=
o-pointer-sign  -Wno-constant-conversion -Wno-address-of-packed-member  -Wf=
rame-larger-than=3D2047 -march=3Darmv8-a+nofp+nosimd  -fno-omit-frame-point=
er -mno-omit-leaf-frame-pointer  -ffixed-x18 -ffreestanding -fno-pie -O2 -p=
ipe -nostdinc -I/usr/src/sys -I/sys/arch/arm64/compile/GENERIC.MP/obj -I/us=
r/src/sys/arch  -I/usr/src/sys/dev/pci/drm/include  -I/usr/src/sys/dev/pci/=
drm/include/uapi -DDDB -DDIAGNOSTIC -DKTRACE -DACCOUNTING -DKMEMSTATS -DPTR=
ACE -DPOOL_DEBUG -DCRYPTO -DSYSVMSG -DSYSVSEM -DSYSVSHM -DUVM_SWAP_ENCRYPT =
-DFFS -DFFS2 -DFFS_SOFTUPDATES -DUFS_DIRHASH -DQUOTA -DEXT2FS -DMFS -DNFSCL=
IENT -DNFSSERVER -DCD9660 -DUDF -DMSDOSFS -DFIFO -DFUSE -DSOCKET_SPLICE -DT=
CP_ECN -DTCP_SIGNATURE -DINET6 -DIPSEC -DPPP_BSDCOMP -DPPP_DEFLATE -DPIPEX =
-DMROUTING -DMPLS -DBOOT_CONFIG -DTIMEZONE=3D"0" -DDST=3D"0" -DPCIVERBOSE -=
DUSER_PCICONF -DUSBVERBOSE -DWSDISPLAY_COMPAT_USL -DWSDISPLAY_COMPAT_RAWKBD=
 -DWSDISPLAY_DEFAULTSCREENS=3D"6" -DONEWIREVERBOSE -DMULTIPROCESSOR -DMAXUS=
ERS=3D80 -D_KERNEL -D__arm64__ -MD -MP  -c /usr/src/sys/dev/pci/drm/radeon/=
radeon_bios.c
/usr/src/sys/dev/pci/drm/radeon/radeon_bios.c:331:17: error: implicit decla=
ration of function
      'pci_get_class' is invalid in C99 [-Werror,-Wimplicit-function-declar=
ation]
        while ((pdev =3D pci_get_class(PCI_CLASS_DISPLAY_VGA << 8, pdev)) !=
=3D NULL) {
                       ^
/usr/src/sys/dev/pci/drm/radeon/radeon_bios.c:331:31: error: use of undecla=
red identifier
      'PCI_CLASS_DISPLAY_VGA'
        while ((pdev =3D pci_get_class(PCI_CLASS_DISPLAY_VGA << 8, pdev)) !=
=3D NULL) {
                                     ^
/usr/src/sys/dev/pci/drm/radeon/radeon_bios.c:344:32: error: use of undecla=
red identifier
      'PCI_CLASS_DISPLAY_OTHER'
                while ((pdev =3D pci_get_class(PCI_CLASS_DISPLAY_OTHER << 8=
, pdev)) !=3D NULL) {
                                             ^
3 errors generated.
*** Error 1 in /sys/arch/arm64/compile/GENERIC.MP (Makefile:863 'radeon_bio=
s.o')

cc -g -Werror -Wall -Wimplicit-function-declaration  -Wno-uninitialized -Wn=
o-pointer-sign  -Wframe-larger-than=3D2047 -Wa,-Av9b, -mno-fpu -ffreestandi=
ng -fno-pie -O2 -pipe -nostdinc -I/sys -I/sys/arch/sparc64/compile/GENERIC/=
obj -I/sys/arch  -I/sys/dev/pci/drm/include  -I/sys/dev/pci/drm/include/uap=
i -DDDB -DDIAGNOSTIC -DKTRACE -DACCOUNTING -DKMEMSTATS -DPTRACE -DPOOL_DEBU=
G -DCRYPTO -DSYSVMSG -DSYSVSEM -DSYSVSHM -DUVM_SWAP_ENCRYPT -DFFS -DFFS2 -D=
FFS_SOFTUPDATES -DUFS_DIRHASH -DQUOTA -DEXT2FS -DMFS -DNFSCLIENT -DNFSSERVE=
R -DCD9660 -DUDF -DMSDOSFS -DFIFO -DFUSE -DSOCKET_SPLICE -DTCP_ECN -DTCP_SI=
GNATURE -DINET6 -DIPSEC -DPPP_BSDCOMP -DPPP_DEFLATE -DPIPEX -DMROUTING -DMP=
LS -DBOOT_CONFIG -DSUN4US -DSUN4V -DPCIVERBOSE -DUSER_PCICONF -DAPERTURE -D=
USBVERBOSE -DWSEMUL_SUN -DWSEMUL_NO_VT100 -DWSEMUL_DUMB -DWSDISPLAY_COMPAT_=
RAWKBD -DONEWIREVERBOSE -DMAXUSERS=3D64 -D_KERNEL -MD -MP  -c /sys/dev/pci/=
drm/radeon/radeon_acpi.c
cc1: warnings being treated as errors
In file included from /sys/arch/sparc64/compile/GENERIC/obj/machine/bus.h:3=
38,
                 from /sys/dev/pci/pcivar.h:48,
                 from /sys/dev/pci/drm/include/linux/pci.h:23,
                 from /sys/dev/pci/drm/radeon/radeon_acpi.c:25:
/sys/arch/sparc64/sparc64/busop.h: In function 'bus_space_read_2':
/sys/arch/sparc64/sparc64/busop.h:72: warning: implicit declaration of func=
tion 'lduha'
/sys/arch/sparc64/sparc64/busop.h: In function 'bus_space_write_2':
/sys/arch/sparc64/sparc64/busop.h:93: warning: implicit declaration of func=
tion 'stha'
/sys/arch/sparc64/sparc64/busop.h: In function 'bus_space_read_4':
/sys/arch/sparc64/sparc64/busop.h:135: warning: implicit declaration of fun=
ction 'lduwa'
/sys/arch/sparc64/sparc64/busop.h: In function 'bus_space_write_4':
/sys/arch/sparc64/sparc64/busop.h:156: warning: implicit declaration of fun=
ction 'stwa'
/sys/arch/sparc64/sparc64/busop.h: In function 'bus_space_read_8':
/sys/arch/sparc64/sparc64/busop.h:198: warning: implicit declaration of fun=
ction 'ldxa'
/sys/arch/sparc64/sparc64/busop.h: In function 'bus_space_write_8':
/sys/arch/sparc64/sparc64/busop.h:219: warning: implicit declaration of fun=
ction 'stxa'
/sys/arch/sparc64/sparc64/busop.h: In function 'bus_space_read_1':
/sys/arch/sparc64/sparc64/busop.h:261: warning: implicit declaration of fun=
ction 'lduba'
/sys/arch/sparc64/sparc64/busop.h: In function 'bus_space_write_1':
/sys/arch/sparc64/sparc64/busop.h:282: warning: implicit declaration of fun=
ction 'stba'
/sys/dev/pci/drm/radeon/radeon_acpi.c: At top level:
/sys/dev/pci/drm/radeon/radeon_acpi.c:708: error: redefinition of 'radeon_a=
cpi_init'
/sys/dev/pci/drm/radeon/radeon.h:2992: error: previous definition of 'radeo=
n_acpi_init' was here
/sys/dev/pci/drm/radeon/radeon_acpi.c:798: error: redefinition of 'radeon_a=
cpi_fini'
/sys/dev/pci/drm/radeon/radeon.h:2993: error: previous definition of 'radeo=
n_acpi_fini' was here
*** Error 1 in /sys/arch/sparc64/compile/GENERIC (Makefile:932 'radeon_acpi=
=2Eo')

Reply via email to