History log of /src/sys/arch/sparc64/include/pci_machdep.h |
Revision | | Date | Author | Comments |
1.31 |
| 23-Jun-2024 |
riastradh | pci: Pass cookie through pci_find_device, pci_enumerate_bus, take 2.
New functions pci_find_device1 and pci_enumerate_bus1 have the cookie argument. Existing symbols pci_find_device and pci_enumerate_bus are now wrappers for the cookieless version.
This will allow pci_find_device callers to pass a cookie through to the match function so they can keep state or pass in extra parameters like b/d/f numbers, which will allow us to nix some horrible kludges in the Linux PCI API emulation for drm (and, perhaps, Intel wifi).
This change drops the symbol pci_probe_device, in favour of a new pci_probe_device1 with the cookie argument. But I don't think that requires a revbump because it's only called by MD pci_enumerate_bus1 implementations, which don't live in modules anyway.
Take 2: Make sure to handle NULL match function.
|
1.30 |
| 20-May-2024 |
riastradh | Revert "pci: Pass cookie through pci_find_device, pci_enumerate_bus."
Evidently something is wrong with this, to be diagnosed and redone once the builds and tests are in better shape.
|
1.29 |
| 20-May-2024 |
riastradh | pci: Pass cookie through pci_find_device, pci_enumerate_bus.
New functions pci_find_device1 and pci_enumerate_bus1 have the cookie argument. Existing symbols pci_find_device and pci_enumerate_bus are now wrappers for the cookieless version.
This drops the symbol pci_probe_device, in favour of a new pci_probe_device1 with the cookie argument. But I don't think that requires a revbump because it's only called by MD pci_enumerate_bus1 implementations, which don't live in modules anyway.
|
1.28 |
| 07-Jul-2016 |
msaitoh | branches: 1.28.48; KNF. Remove extra spaces. No functional change.
|
1.27 |
| 29-Mar-2014 |
christos | branches: 1.27.6; make pci_intr_string and eisa_intr_string take a buffer and a length instead of relying in local static storage.
|
1.26 |
| 27-Oct-2012 |
chs | branches: 1.26.2; split device_t/softc for all remaining drivers. replace "struct device *" with "device_t". use device_xname(), device_unit(), etc.
|
1.25 |
| 04-Apr-2011 |
dyoung | branches: 1.25.4; 1.25.14; Neither pci_dma64_available(), pci_probe_device(), pci_mapreg_map(9), pci_find_rom(), pci_intr_map(9), pci_enumerate_bus(), nor the match predicate passed to pciide_compat_intr_establish() should ever modify their pci_attach_args argument, so make their pci_attach_args arguments const and deal with the fallout throughout the kernel.
For the most part, these changes add a 'const' where there was no 'const' before, however, some drivers and MD code used to modify pci_attach_args. Now those drivers either copy their pci_attach_args and modify the copy, or refrain from modifying pci_attach_args:
Xen: according to Manuel Bouyer, writing to pci_attach_args in pci_intr_map() was a leftover from Xen 2. Probably a bug. I stopped writing it. I have not tested this change.
siside(4): sis_hostbr_match() needlessly wrote to pci_attach_args. Probably a bug. I use a temporary variable. I have not tested this change.
slide(4): sl82c105_chip_map() overwrote the caller's pci_attach_args. Probably a bug. Use a local pci_attach_args. I have not tested this change.
viaide(4): via_sata_chip_map() and via_sata_chip_map_new() overwrote the caller's pci_attach_args. Probably a bug. Make a local copy of the caller's pci_attach_args and modify the copy. I have not tested this change.
While I'm here, make pci_mapreg_submap() static.
With these changes in place, I have tested the compilation of these kernels:
alpha GENERIC amd64 GENERIC XEN3_DOM0 arc GENERIC atari HADES MILAN-PCIIDE bebox GENERIC cats GENERIC cobalt GENERIC evbarm-eb NSLU2 evbarm-el ADI_BRH ARMADILLO9 CP3100 GEMINI GEMINI_MASTER GEMINI_SLAVE GUMSTIX HDL_G IMX31LITE INTEGRATOR IQ31244 IQ80310 IQ80321 IXDP425 IXM1200 KUROBOX_PRO LUBBOCK MARVELL_NAS NAPPI SHEEVAPLUG SMDK2800 TEAMASA_NPWR TEAMASA_NPWR_FC TS7200 TWINTAIL ZAO425 evbmips-el AP30 DBAU1500 DBAU1550 MALTA MERAKI MTX-1 OMSAL400 RB153 WGT624V3 evbmips64-el XLSATX evbppc EV64260 MPC8536DS MPC8548CDS OPENBLOCKS200 OPENBLOCKS266 OPENBLOCKS266_OPT P2020RDB PMPPC RB800 WALNUT hp700 GENERIC i386 ALL XEN3_DOM0 XEN3_DOMU ibmnws GENERIC macppc GENERIC mvmeppc GENERIC netwinder GENERIC ofppc GENERIC prep GENERIC sandpoint GENERIC sgimips GENERIC32_IP2x sparc GENERIC_SUN4U KRUPS sparc64 GENERIC
As of Sun Apr 3 15:26:26 CDT 2011, I could not compile these kernels with or without my patches in place:
### evbmips-el GDIUM
nbmake: nbmake: don't know how to make /home/dyoung/pristine-nbsd/src/sys/arch/mips/mips/softintr.c. Stop
### evbarm-el MPCSA_GENERIC src/sys/arch/evbarm/conf/MPCSA_GENERIC:318: ds1672rtc*: unknown device `ds1672rtc'
### ia64 GENERIC
/tmp/genassym.28085/assym.c: In function 'f111': /tmp/genassym.28085/assym.c:67: error: invalid application of 'sizeof' to incomplete type 'struct pcb' /tmp/genassym.28085/assym.c:76: error: dereferencing pointer to incomplete type
### sgimips GENERIC32_IP3x
crmfb.o: In function `crmfb_attach': crmfb.c:(.text+0x2304): undefined reference to `ddc_read_edid' crmfb.c:(.text+0x2304): relocation truncated to fit: R_MIPS_26 against `ddc_read_edid' crmfb.c:(.text+0x234c): undefined reference to `edid_parse' crmfb.c:(.text+0x234c): relocation truncated to fit: R_MIPS_26 against `edid_parse' crmfb.c:(.text+0x2354): undefined reference to `edid_print' crmfb.c:(.text+0x2354): relocation truncated to fit: R_MIPS_26 against `edid_print'
|
1.24 |
| 06-Jan-2010 |
mrg | branches: 1.24.4; 1.24.6; move the guts of pci_intr_map() into pci_machdep.c, and move the schizo ign addition into a hook. also, don't double shift the ign in set_intr.
tested on U60 and SB2500.
|
1.23 |
| 30-Nov-2009 |
mrg | convert pci_intr_map() into a chipset tag function pointer, and implement the schizo version slightly differently.
pull out the schizo's IGN from the upaid, not the apparently broken device ID register. from openbsd.
with this i appear to have valid working interrupts on the SB2500.
tested on U60 and SB2500.
XXX: we can probably kill (*spc_find_ino)() now that pci_intr_map() itself XXX: is no longer a first class function.
|
1.22 |
| 10-Dec-2008 |
mrg | ofpci_make_tag(): don't write PCI_COMMAND_STATUS_REG with PCI_COMMAND_(MEM|MASTER|IO)_ENABLE, or it in. sparc_pci_childspace(): move psycho.c:get_childspace() into pci_machdep.c but rename it psycho_alloc_bus_tag(): use M_ZERO
|
1.21 |
| 09-Dec-2008 |
nakayama | Fix CardBus, PCI-PCI bridge support borked in previous commit.
|
1.20 |
| 07-Dec-2008 |
mrg | a few clean up/rearrange changes, somewhat inspired from openbsd's schizo.c:
- rename pp_busnode{} -> spc_busnode{}, and move it to sparc_pci_chipset{}
- move public pci functions pci_conf_read(), pci_conf_write() and pci_intr_establish() into psycho.c, renaming them in the process, and add pointers through sparc_pci_chipset{} to access them. as part of this, add PDB_INTMAP and PDB_CONF debug options to psycho.c
- move and rename sparc64 private pci_find_ino() into sparc_pci_chipset{}, like the above
- update psycho_alloc_chipset() to set the new 4 function members
no functional change intended. XXX: not tested on cardbus.
|
1.19 |
| 29-May-2008 |
mrg | branches: 1.19.4; 1.19.6; remove clause #3 from my license where there are no other copyright holders involved.
|
1.18 |
| 11-Feb-2006 |
cdi | branches: 1.18.68; 1.18.70; 1.18.72; 1.18.74; ANSIfication: u_intN_t -> uintN_t, use ANSI function declarations/definitions instead of K&R ones.
|
1.17 |
| 11-Dec-2005 |
christos | branches: 1.17.2; 1.17.4; 1.17.6; merge ktrace-lwp.
|
1.16 |
| 17-Aug-2004 |
drochner | branches: 1.16.12; make PCI devices attachable/detachable (as far as the particular drivers allow), and allow to rescan a bus selectively (ie only the device/ function I'm looking at)
|
1.15 |
| 29-Jul-2004 |
drochner | give the special PCI bus enumerator a sparc64_ prefix and make the PCI_MACHDEP_ENUMERATE_BUS macro point to it
|
1.14 |
| 16-May-2002 |
eeh | branches: 1.14.8; Make the PCI code actually work.
|
1.13 |
| 16-May-2002 |
thorpej | branches: 1.13.2; * Add "pcitag_t *pba_bridgetag" to pci_attach_args. This is set to NULL for root PCI busses. For busses behind a bridge, it points to a persistent copy of the bridge's pcitag_t. This can be very useful for machine-dependent PCI bus enumeration code. * Implement a machine-dependent pci_enumerate_bus() for sparc64 which uses OFW device nodes to enumerate the bus. When a PCI bus that is behind a bridge is attached, pci_attach_hook() allocates a new PCI chipset tag for the new bus and sets it's "curnode" to the OFW node of the bridge. This is used as a starting point when enumerating that bus. Root busses get the OFW node of the host bridge (psycho). * Garbage-collect "ofpci" and "ofppb" from the sparc64 port.
|
1.12 |
| 15-May-2002 |
thorpej | Let machine-dependent code specify how to enumerate the bus. Currently, everyone uses pci_enumerate_bus_generic().
|
1.11 |
| 15-May-2002 |
thorpej | Garbage-collect __PCI_DEV_FUNCORDER.
|
1.10 |
| 15-May-2002 |
thorpej | Implement pci_decompose_tag().
|
1.9 |
| 26-Feb-2002 |
eeh | Fix PR# port-sparc64/13811: PCITAG_SETNODE() is defined using `x' insted of `t'. from URA Hiroshi
|
1.8 |
| 18-Oct-2001 |
eeh | branches: 1.8.4; Disable __PCI_DEV_FUNCORDER since it's now badly borken.
|
1.7 |
| 20-Jul-2001 |
eeh | PCI overhaul.
|
1.6 |
| 02-Mar-2001 |
mrg | branches: 1.6.4; use pci_bus_devorder() and pci_dev_funcorder()
|
1.5 |
| 28-Dec-2000 |
sommerfeld | Change pci_intr_map to get interrupt source information from a "struct pci_attach_args *" instead of from four separate parameters which in all cases were extracted from the same "struct pci_attach_args".
This both simplifies the driver api, and allows for alternate PCI interrupt mapping schemes, such as one using the tables described in the Intel Multiprocessor Spec which describe interrupt wirings for devices behind pci-pci bridges based on the device's location rather the bridge's location.
Tested on alpha and i386; welcome to 1.5Q
|
1.4 |
| 04-Jun-2000 |
cgd | Implement the more flexiable `evcnt' interface as discussed (briefly) on tech-kern and now documented in evcnt(9).
|
1.3 |
| 01-Jun-2000 |
cgd | kill __P in these files. (I had to look at them anyway with an eye for adding some protos... and adding them with __P seems wrong, but mixing __P and not __P in the same file seems wrong too, so...)
|
1.2 |
| 24-May-2000 |
eeh | branches: 1.2.2; Use the PCI function code to distinguish simba bus A from bus B instead of the current hack.
|
1.1 |
| 04-Jun-1999 |
mrg | branches: 1.1.2; 1.1.4; PCI driver for the UltraSPARC. this only works on the Ultra5/10 machines (`SUNW,sabre') for now, and it doesn't really quite work there yet anyway. the bus space/dma code is cloned from the sbus driver. the IOMMU code also is cloned from the sbus code, but separated out into iommu.c so that we can share it with the sbus driver. hopefully, much of the bus space/dma code can also be re-shared with the sbus driver and the ebus driver but for now these copies will do.
support for the real UltraSPARC PCI (`SUNW,psycho') is unwritten, though most of this code is shared with it.
we can probe PCI config space and try to configue devices, but interrupts don't work yet...
|
1.1.4.3 |
| 12-Mar-2001 |
bouyer | Sync with HEAD.
|
1.1.4.2 |
| 05-Jan-2001 |
bouyer | Sync with HEAD
|
1.1.4.1 |
| 20-Nov-2000 |
bouyer | Update thorpej_scsipi to -current as of a month ago A i386 GENERIC kernel compiles without the siop, ahc and bha drivers (will be updated later). i386 IDE/ATAPI and ncr work, as well as sparc/esp_sbus. alpha should work as well (untested yet). siop, ahc and bha will be updated once I've updated the branch to current -current, as well as machine-dependant code.
|
1.1.2.1 |
| 21-Jun-1999 |
thorpej | Sync w/ -current.
|
1.2.2.1 |
| 22-Jun-2000 |
minoura | Sync w/ netbsd-1-5-base.
|
1.6.4.4 |
| 23-Jun-2002 |
jdolecek | catch up with -current on kqueue branch
|
1.6.4.3 |
| 16-Mar-2002 |
jdolecek | Catch up with -current.
|
1.6.4.2 |
| 10-Jan-2002 |
thorpej | Sync kqueue branch with -current.
|
1.6.4.1 |
| 03-Aug-2001 |
lukem | update to -current
|
1.8.4.4 |
| 20-Jun-2002 |
nathanw | Catch up to -current.
|
1.8.4.3 |
| 28-Feb-2002 |
nathanw | Catch up to -current.
|
1.8.4.2 |
| 26-Feb-2002 |
eeh | Fix PR# port-sparc64/13811: PCITAG_SETNODE() is defined using `x' insted of `t'. from URA Hiroshi
|
1.8.4.1 |
| 18-Oct-2001 |
eeh | file pci_machdep.h was added on branch nathanw_sa on 2002-02-26 22:05:55 +0000
|
1.13.2.2 |
| 30-May-2002 |
gehenna | Catch up with -current.
|
1.13.2.1 |
| 16-May-2002 |
gehenna | file pci_machdep.h was added on branch gehenna-devsw on 2002-05-30 15:35:54 +0000
|
1.14.8.4 |
| 21-Sep-2004 |
skrll | Fix the sync with head I botched.
|
1.14.8.3 |
| 18-Sep-2004 |
skrll | Sync with HEAD.
|
1.14.8.2 |
| 25-Aug-2004 |
skrll | Sync with HEAD.
|
1.14.8.1 |
| 03-Aug-2004 |
skrll | Sync with HEAD
|
1.16.12.1 |
| 21-Jun-2006 |
yamt | sync with head.
|
1.17.6.1 |
| 22-Apr-2006 |
simonb | Sync with head.
|
1.17.4.1 |
| 09-Sep-2006 |
rpaulo | sync with head
|
1.17.2.1 |
| 18-Feb-2006 |
yamt | sync with head.
|
1.18.74.1 |
| 23-Jun-2008 |
wrstuden | Sync w/ -current. 34 merge conflicts to follow.
|
1.18.72.2 |
| 11-Mar-2010 |
yamt | sync with head
|
1.18.72.1 |
| 04-May-2009 |
yamt | sync with head.
|
1.18.70.1 |
| 04-Jun-2008 |
yamt | sync with head
|
1.18.68.2 |
| 17-Jan-2009 |
mjf | Sync with HEAD.
|
1.18.68.1 |
| 02-Jun-2008 |
mjf | Sync with HEAD.
|
1.19.6.1 |
| 19-Jan-2009 |
skrll | Sync with HEAD.
|
1.19.4.1 |
| 13-Dec-2008 |
haad | Update haad-dm branch to haad-dm-base2.
|
1.24.6.1 |
| 06-Jun-2011 |
jruoho | Sync with HEAD.
|
1.24.4.1 |
| 21-Apr-2011 |
rmind | sync with head
|
1.25.14.3 |
| 03-Dec-2017 |
jdolecek | update from HEAD
|
1.25.14.2 |
| 20-Aug-2014 |
tls | Rebase to HEAD as of a few days ago.
|
1.25.14.1 |
| 20-Nov-2012 |
tls | Resync to 2012-11-19 00:00:00 UTC
|
1.25.4.2 |
| 22-May-2014 |
yamt | sync with head.
for a reference, the tree before this commit was tagged as yamt-pagecache-tag8.
this commit was splitted into small chunks to avoid a limitation of cvs. ("Protocol error: too many arguments")
|
1.25.4.1 |
| 30-Oct-2012 |
yamt | sync with head
|
1.26.2.1 |
| 18-May-2014 |
rmind | sync with head
|
1.27.6.1 |
| 09-Jul-2016 |
skrll | Sync with HEAD
|
1.28.48.1 |
| 04-Oct-2024 |
martin | Pull up following revision(s) (requested by rin in ticket #928):
sys/external/bsd/drm2/dist/drm/drm_gem.c: revision 1.25 sys/external/bsd/drm2/dist/drm/radeon/radeon_ci_dpm.c: revision 1.7 sys/external/bsd/drm2/dist/drm/nouveau/nvkm/engine/device/priv.h: revision 1.4 sys/external/bsd/drm2/dist/drm/nouveau/nvkm/engine/device/nouveau_nvkm_engine_device_acpi.c: revision 1.4 sys/external/bsd/drm2/dist/drm/i915/display/intel_opregion.h: revision 1.6 sys/external/bsd/drm2/dist/drm/i915/i915_drv.h: revision 1.49 sys/external/bsd/drm2/include/linux/mxm-wmi.h: revision 1.1 sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/pci/nouveau_nvkm_subdev_pci_pcie.c: revision 1.4 sys/external/bsd/drm2/dist/drm/nouveau/nvkm/engine/device/nouveau_nvkm_engine_device_base.c: revision 1.13 sys/external/bsd/common/include/linux/bitops.h: revision 1.17 sys/external/bsd/drm2/nouveau/files.nouveau: revision 1.40 sys/external/bsd/drm2/linux/linux_pci.c: revision 1.30 sys/external/bsd/drm2/dist/drm/radeon/radeon_drv.h: revision 1.5 sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/pci/nouveau_nvkm_subdev_pci_pcie.c: revision 1.5 sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/mxm/nouveau_nvkm_subdev_mxm_base.c: revision 1.5 sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_gart.c: revision 1.12 sys/external/bsd/drm2/dist/drm/radeon/radeon_rv770.c: revision 1.3 sys/external/bsd/drm2/dist/drm/nouveau/nvkm/engine/disp/nouveau_nvkm_engine_disp_sorgm200.c: revision 1.3 sys/external/bsd/common/include/linux/printk.h: revision 1.14 sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/instmem/nouveau_nvkm_subdev_instmem_gk20a.c: revision 1.10 sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_vi.c: revision 1.4 sys/external/bsd/drm2/include/linux/acpi.h: revision 1.11 sys/external/bsd/drm2/drm/drm_cdevsw.c: revision 1.31 sys/external/bsd/drm2/dist/drm/radeon/radeon_si.c: revision 1.6 sys/external/bsd/drm2/dist/drm/nouveau/nouveau_acpi.c: revision 1.5 sys/external/bsd/drm2/dist/drm/i915/display/intel_acpi.h: revision 1.5 sys/external/bsd/drm2/include/acpi/video.h: revision 1.3 sys/external/bsd/drm2/dist/drm/radeon/radeon_evergreen.c: revision 1.6 sys/external/bsd/drm2/dist/drm/nouveau/nouveau_acpi.h: revision 1.4 sys/arch/sparc64/include/pci_machdep.h: revision 1.31 sys/arch/sparc64/dev/pci_machdep.c: revision 1.83 sys/external/bsd/drm2/include/linux/kref.h: revision 1.14 sys/external/bsd/drm2/dist/drm/nouveau/nvkm/engine/device/nouveau_nvkm_engine_device_pci.c: revision 1.12 sys/external/bsd/drm2/linux/linux_dma_buf.c: revision 1.17 sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/bios/nouveau_nvkm_subdev_bios_shadowacpi.c: revision 1.4 sys/external/bsd/drm2/drm/drm_module.c: revision 1.32 sys/external/bsd/drm2/dist/drm/i915/i915_gem.h: revision 1.8 sys/external/bsd/drm2/dist/drm/i915/gem/i915_gem_dmabuf.c: revision 1.7 sys/external/bsd/drm2/include/linux/smp.h: revision 1.5 sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_si.c: revision 1.5 sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_device.c: revision 1.20 sys/arch/x86/x86/bus_dma.c: revision 1.91 sys/external/bsd/drm2/radeon/files.radeon: revision 1.40 sys/external/bsd/drm2/include/acpi/acpi_bus.h: revision 1.1 sys/external/bsd/drm2/dist/drm/nouveau/nouveau_drv.h: revision 1.5 sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_device.c: revision 1.21 sys/external/bsd/common/include/asm/barrier.h: revision 1.20 sys/external/bsd/drm2/include/linux/nbsd-namespace-acpi.h: revision 1.2 sys/external/bsd/common/include/asm/barrier.h: revision 1.21 sys/modules/drmkms/drmkms_pci.h: revision 1.1 sys/external/bsd/drm2/dist/drm/drm_dp_helper.c: revision 1.17 sys/external/bsd/drm2/radeon/radeon_pci.c: revision 1.23 sys/external/bsd/drm2/linux/linux_xa.c: revision 1.4 sys/external/bsd/drm2/ttm/ttm_bo_vm.c: revision 1.23 sys/external/bsd/drm2/ttm/ttm_bo_vm.c: revision 1.24 sys/external/bsd/drm2/ttm/ttm_bo_vm.c: revision 1.25 sys/external/bsd/drm2/linux/linux_pci.c: revision 1.26 sys/dev/pci/pcivar.h: revision 1.120 sys/arch/xen/include/pci_machdep.h: revision 1.24 sys/external/bsd/drm2/ttm/ttm_bo_vm.c: revision 1.26 sys/external/bsd/drm2/linux/linux_pci.c: revision 1.27 sys/external/bsd/drm2/ttm/ttm_bo_vm.c: revision 1.27 sys/external/bsd/drm2/linux/linux_pci.c: revision 1.28 sys/external/bsd/drm2/dist/drm/radeon/radeon_cik.c: revision 1.8 sys/external/bsd/drm2/ttm/ttm_bo_vm.c: revision 1.28 sys/external/bsd/drm2/linux/linux_pci.c: revision 1.29 sys/external/bsd/drm2/include/linux/pci.h: revision 1.57 sys/external/bsd/drm2/include/linux/pci.h: revision 1.58 sys/external/bsd/drm2/dist/drm/radeon/radeon_acpi.c: revision 1.5 sys/external/bsd/drm2/dist/drm/nouveau/nouveau_display.c: revision 1.6 sys/external/bsd/drm2/dist/drm/amd/powerplay/hwmgr/amdgpu_hwmgr.c: revision 1.3 sys/external/bsd/drm2/dist/drm/amd/display/dc/core/amdgpu_dc_stream.c: revision 1.3 share/man/man9/bus_dma.9: revision 1.69 sys/external/bsd/drm2/drm/drm_gem_cma_helper.c: revision 1.15 sys/external/bsd/drm2/dist/drm/radeon/radeon_acpi.c: revision 1.6 sys/external/bsd/drm2/dist/drm/radeon/radeon.h: revision 1.12 sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_cik.c: revision 1.7 sys/dev/acpi/acpi_mcfg.c: revision 1.29 sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_acpi.c: revision 1.6 sys/external/bsd/drm2/dist/drm/radeon/radeon_r600.c: revision 1.7 sys/external/bsd/drm2/dist/drm/radeon/radeon_bios.c: revision 1.13 sys/modules/amdgpu/Makefile: revision 1.9 sys/external/bsd/drm2/dist/drm/radeon/radeon_bios.c: revision 1.14 sys/external/bsd/common/linux/linux_tasklet.c: revision 1.12 sys/external/bsd/drm2/dist/drm/nouveau/include/nvkm/core/device.h: revision 1.10 sys/external/bsd/drm2/dist/drm/i915/gem/i915_gem_mman.c: revision 1.23 sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu.h: revision 1.9 sys/external/bsd/drm2/include/linux/interval_tree.h: revision 1.14 sys/external/bsd/drm2/dist/drm/i915/gem/i915_gem_mman.c: revision 1.26 sys/external/bsd/drm2/dist/drm/amd/powerplay/hwmgr/amdgpu_smu7_hwmgr.c: revision 1.5 sys/dev/pci/pci.c: revision 1.168 sys/external/bsd/drm2/dist/drm/i915/gem/i915_gem_mman.c: revision 1.27 sys/external/bsd/drm2/dist/drm/radeon/radeon_si_dpm.c: revision 1.9 sys/external/bsd/drm2/pci/files.drmkms_pci: revision 1.18 sys/external/bsd/drm2/linux/linux_sync_file.c: revision 1.3 sys/external/bsd/drm2/amdgpu/files.amdgpu: revision 1.31 sys/external/bsd/drm2/dist/drm/nouveau/nvkm/engine/device/nouveau_nvkm_engine_device_tegra.c: revision 1.4 sys/external/bsd/drm2/dist/drm/drm_gem.c: revision 1.24 sys/arch/xen/xen/xpci_xenbus.c: revision 1.29
drm: Eliminate __HAVE_ATOMIC_AS_MEMBAR conditionals. Discussed on tech-kern: https://mail-index.netbsd.org/tech-kern/2023/02/23/msg028729.html
linux asm/barrier.h: Fix !MULTIPROCESSOR build.
remove "nouveau" from a comment. noted by jmcneill.
drm: KASSERT(A && B) -> KASSERT(A); KASSERT(B) comment a function that has a clear overbounds read but it isn't used. found by GCC 12.
nix the NetBSD specific GEM_BUG_ON(). avoids GCC 12 warnings, and matches upstream closer. avoid uninitialised variable usage in drm_gem_cma_create_internal(). in the case nothing has returned 'error', 'nsegs' and the dma info are (potentially) uninitialised, so consider this an error. found by GCC 12.
avoid a GCC 12 warning. there's a 1-element long array and a loop conditional that tries to see if indexes for it are not identical. as these indexes will always both be 0, the only valid index, the condition is always false. GCC 12 triggers a strange warning on this code that can never run (see below), so simply assert the array size is 1 and comment the rest. amdgpu_dc_stream.c:470:55: error: array subscript [0, 0] is outside array bounds of 'struct dc_writeback_info[1]' [-Werror=array-bounds] 470 | stream->writeback_info[j] = stream->writeback_info[i];
convert a KASSERT() into an if () panic() sequence to appease GCC 12. OK riastradh@.
drm: Fix conditionals around drmkms_pci and agp. Kernel should build now with all pci drm drivers stripped out but DRM_LEGACY still enabled. (Might not be very useful, but it'll build. Maybe we should also have DRM_LEGACY_PCI so those drivers can be modloaded later.)
drmkms: Fix module build. avoid an unlikely array bounds issue picked up by GCC 12. nvkm_pcie_speed() can return -1, which is then used as an array index, so make this default return PCIe 1.0 speeds.
drm: enable almost all PCIe functionality linux_pci.c revisions 1.24 and 1.25 implemented most of the remaining missing PCIe backends, but only enabled them for some amdgpu portions. this enables all code marked with "XXX amdgpu pcie", "XXX radeon pcie", and "XXX pcie speed". for most of it, simply removing #ifndefs __NetBSD__ to enable compliation was required, once the new "bus->max_bus_speed" member was added to struct pci_bus. add an "always fails" backend for pci_enable_atomic_ops_to_root() which seems to only be necessary for virtual GPU functionality (and could be implemented if needed.) tested on radeon 5450, 7750, R7 240 [radeon], and RX 550 [amdgpu], and nvidia 750 and 1030 [nouveau]. this still does not quite work on nvidia cards. there are two problems that remain: - the call to set the link speed is skipped because the speed is set to the default value of "-1". nvkm_pcie_set_link() will actually determine the right value for this and for some cards, calling this function if the current speed is -1 helps set the link speed. it may be that on linux other paths we don't have enabled properly would set this (there's one via debugfs, and a jetson specific one, though perhaps setting either AC or DC speed values as boot options (after hooking up these for netbsd) would currently work. - worse, cards newer than kepler - geforce 900, 1000, and newer, are all lacking the backing support to set pcie link speed. the GT 1030 card i have been testing with remains at pcie 1.0.
radeon: fix and enable ACPI methods for getting ROM BIOS The hacky way of getting the BIOS mapped only works on x86. ACPI should be preferred if available. Makes BIOS reading though VFCT work on aarch64 with EDK2. (But only if EDK2 has POSTed the GPU.) XXX amdgpu should get the same treatment.
drm: put_cpu() should enable preemption, not disable it again
drm(4): make pr_debug equivalent to aprint_debug significantly reduces the default spam from amdgpu(4).
drm: Set CONFIG_ACPI in linux/acpi.h and make it build.
Leave a little ACPI-related functionality disabled for now, like getting EDID out of ACPI -- needs a bit more work to make this work, and I don't have hardware to work on that. Should help with failures of the forms: - unable to locate a BIOS ROM - bios: unable to locate usable image on various machines.
radeon_acpi.c: ifdef out unused function on NetBSD. Should fix syzkaller build.
drm(4): Fix st_rdev in stat. dminor->index already has the 64*type adjustment, as allocated in drm_minor_alloc. PR kern/58180
linux_sync_file: Fix missing init/fini steps. Noted by rjs@. PR kern/58210
ttm: Sync ttm_bo_uvm_fault_idle better with Linux. PR xsrc/58133 ttm: Undo mistake in previous.
PR xsrc/58133 linux: Add a few more cases to pci_get_class. Should fix crash on boot with amdgpu now that the ACPI business is enabled.
i915: Fix dmabuf mmap object.
drm: Fix missing bounds checks in dma buf mmap.
drm_gem.c: Fix sense of assertion. This is the opposite of WARN_ON. Noted by rjs@.
drm_gem.c: Enable drm_gem_fence_array_add now that we emulate xa. linux_xa: Delete and replace collision in xa_store as intended. Don't free the colliding node that's still in the tree. Noted by rjs@.
i915_gem_mman.c: Apply mmap types via pmap flags. This way, userland gets buffers mapped write-combining or uncached as needed. PR xsrc/58307
x86: Teach bus_dmamem_map about BUS_DMA_PREFETCHABLE. PR port-amd64/58308
bus_dma(9): Document BUS_DMA_PREFETCHABLE. Like BUS_DMA_NOCACHE. Doesn't absolve you of the need for bus_dmamap_sync, but if you later pass the vaddr to bus_dmamap_load, the DMA map might notice the mapping is write-combining and use this to make bus_dmamap_sync cheaper. PR kern/58309
nouveau_nvkm_subdev_instmem_gk20a.c: Use BUS_DMA_PREFETCHABLE. Matches Linux's pgprot_writecombine. Unclear where the appropriate bus_dmamap_sync happens, or is supposed to happen -- not using it would be wrong, but asking for a prefetchable mapping may paper over symptoms, at least!
ttm: Sync more with Linux. Add the original copyright and attribution since this is now, intentionally, a modified copy of the original and not just roughly the same algorithm.
ttm: Respect PGO_ALLPAGES. Not sure this is useful but it reduces XXX's and makes this match udv_fault better so it's easier to understand.
ttm: Sync cacheability flag logic with Linux.
ttm: Add XXX about readahead fault failures.
pci: Pass cookie through pci_find_device, pci_enumerate_bus, take 2. New functions pci_find_device1 and pci_enumerate_bus1 have the cookie argument. Existing symbols pci_find_device and pci_enumerate_bus are now wrappers for the cookieless version. This will allow pci_find_device callers to pass a cookie through to the match function so they can keep state or pass in extra parameters like b/d/f numbers, which will allow us to nix some horrible kludges in the Linux PCI API emulation for drm (and, perhaps, Intel wifi). This change drops the symbol pci_probe_device, in favour of a new pci_probe_device1 with the cookie argument. But I don't think that requires a revbump because it's only called by MD pci_enumerate_bus1 implementations, which don't live in modules anyway. Take 2: Make sure to handle NULL match function. linux_pci: Nix pci enumeration kludges. Now that we can pass a cookie through, this stuff will be a little less fragile.
i915: Omit needless i915_gem_object_pin/unpin_pages cycle in fault. vm_fault_cpu and vm_fault_gtt, called by i915_gem_fault, already do the pinning and unpinning internally, so there is no need for i915_gem_fault to do it. No functional change intended, except that the transient pin count will be one lower than before during the fault routine (but it will still be positive).
i915: Match Linux fault routine return code actions. Omit needless EINTR interception -- this is now handled by i915_error_to_vmf_fault. Earlier revert was over a false alarm -- bisection shows the new warnings arose from linux_pci.c 1.29 here: https://mail-index.netbsd.org/source-changes/2024/06/23/msg151929.html
linux_pci: Fix shifto in pci_get_class. It looks like Linux's pci_get_class also matches the interface part of the PCI class register (but not the revision part), and I hadn't noticed that in the previous shim structured differently.
With GCC12 kernel ALL/amd64 triggers "'sor' may be used uninitialized". If "sublinks & 3" is zero GCC is right and sor[1] may be returned unitialized. Fix by initializing "sor" to zero to return -1 instead of uninitialized value. Ok: Taylor R Campbell <riastradh@>
amdgpu: Map BAR 2, not BAR 5, on pre-bonaire chips. PR kern/58384
amdgpu: Map consecutive pages, not the same one over and over again. PR kern/58385
linux/bitops: Fix overestimate for BITS_TO_LONGS(9) Fortunately, this seems harmless except for allocating excessive buffer memory. Pointed out by nonaka@, OK riastradh@.
|