History log of /netbsd-src/sys/external/bsd/drm2/linux/linux_pci.c (Results 1 – 25 of 30)
Revision Date Author Comments
# 5bb9ef19 24-Jun-2024 riastradh <riastradh@NetBSD.org>

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 pr

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.

show more ...


# d5a34bf3 23-Jun-2024 riastradh <riastradh@NetBSD.org>

linux_pci: Nix pci enumeration kludges.

Now that we can pass a cookie through, this stuff will be a little
less fragile.


# de0b2f54 19-May-2024 riastradh <riastradh@NetBSD.org>

linux: Add a few more cases to pci_get_class.

Should fix crash on boot with amdgpu now that the ACPI business is
enabled.


# 00c5a72c 30-Sep-2023 mrg <mrg@NetBSD.org>

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 a

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.

show more ...


# 7cb953c8 04-Sep-2023 mrg <mrg@NetBSD.org>

convert a KASSERT() into an if () panic() sequence to appease GCC 12.

OK riastradh@.


# cb8e3c86 17-Oct-2022 mrg <mrg@NetBSD.org>

add pcie capability and read request size linux compat, some pci root support

implement support for:
- pcie_capability_read_dword()
- pcie_capability_read_word()
- pcie_capability_write_dword()
- pc

add pcie capability and read request size linux compat, some pci root support

implement support for:
- pcie_capability_read_dword()
- pcie_capability_read_word()
- pcie_capability_write_dword()
- pcie_capability_write_word()
- pcie_get_readrq()
- pcie_set_readrq()

implement the "struct pci_dev" bus->self member by creating a minimal fake
"struct pci_dev" for the pci bus itself. this is kind of gross. it checks
that the current device's parent is a netbsd "pci" device, and that it has
a (grand) parent "ppb" device, and then fills in the fake device based upon
the pci and ppb devices.

add some PCIE_LCSR2_TGT_LSPEED encodings, and map them to linux names.
map several other PCIE_LCSR and PCIE_LCAP names.

uncomment several pcie code segments in radeon and amdgpu. (not sure that
we can test the amdgpu_si.c change, as we use the radeon version and the
amdgpu version hangs on the one machine i have.)

tested on amdgpu (RX550) and radeon (7750 & 3650).


ok @riastradh

show more ...


# 16e2f9f2 20-Sep-2022 mrg <mrg@NetBSD.org>

fill out more of the linux pci API compat

- implement pcie_get_speed_cap(), pcie_bandwidth_available(), and
pci_is_root_bus().
- expand "enum pci_bus_speed" to add PCIe 5.x and 6.x speeds.
- add "

fill out more of the linux pci API compat

- implement pcie_get_speed_cap(), pcie_bandwidth_available(), and
pci_is_root_bus().
- expand "enum pci_bus_speed" to add PCIe 5.x and 6.x speeds.
- add "enum pcie_link_width".
- add defines for PCIE_LCSR_LINKSPEED (PCIe generation) and PCIE_LCSR_NLW
(negotiated lane width) to pcireg.h
- enable amdgpu_device_get_pcie_info() code now it works.

ok riastradh@

show more ...


# 86a0f5fd 20-Jul-2022 riastradh <riastradh@NetBSD.org>

drm: Use real pci segment number, not pciN device unit.


# 5fc7130c 19-Jul-2022 riastradh <riastradh@NetBSD.org>

drm: Nix drm_agp_borrow.

This horrible kludge dates from before I understood the relation of
genfb_pci and pci drm drivers in the old and new worlds of drm.

The only user of it, in i915, was change

drm: Nix drm_agp_borrow.

This horrible kludge dates from before I understood the relation of
genfb_pci and pci drm drivers in the old and new worlds of drm.

The only user of it, in i915, was changed to use agp_i810_borrow
directly in the last drm update, so this hack can die.

show more ...


# 96633a0d 27-Feb-2022 riastradh <riastradh@NetBSD.org>

drm: Deconditionalize pci_get_segment.


# 8a88a9ef 19-Dec-2021 riastradh <riastradh@NetBSD.org>

linux: pci_name


# dfa0e026 19-Dec-2021 riastradh <riastradh@NetBSD.org>

i915: another whack at it


# a92437f5 19-Dec-2021 riastradh <riastradh@NetBSD.org>

drm: Remove local diffs for drm_pci_set_busid.

Instead, move it to its own file that can be safely used without
bringing in a link/run-time dependency on pci.


# 03ec3320 19-Dec-2021 riastradh <riastradh@NetBSD.org>

Include acpica.h for NACPICA.


# 33fe66da 19-Dec-2021 riastradh <riastradh@NetBSD.org>

Move acpi includes to linux_pci.c to avoid pollution.


# cc33933c 19-Dec-2021 riastradh <riastradh@NetBSD.org>

Stub dev_is_pci


Author: Maya Rashish <maya@NetBSD.org>


# edb5cae2 19-Dec-2021 riastradh <riastradh@NetBSD.org>

Define pci_is_thunderbolt_attached (answer: no).


# b0ecd478 19-Dec-2021 riastradh <riastradh@NetBSD.org>

Update change to Linux struct resource members: end, not size.


# 11bf911f 19-Dec-2021 riastradh <riastradh@NetBSD.org>

Define pci_get/set_drvdata properly.


# d09c8680 19-Dec-2021 riastradh <riastradh@NetBSD.org>

pci_get_bus_and_slot -> pci_get_domain_bus_and_slot


# 5fb21da8 12-Feb-2020 jdolecek <jdolecek@NetBSD.org>

re-enable MSI - this actually enables MSI only for intel/radeon/generic
which are reported to work fine, while nouveau (which breaks with
MSI) still uses INTx

see the thread
http://mail-index.netbsd

re-enable MSI - this actually enables MSI only for intel/radeon/generic
which are reported to work fine, while nouveau (which breaks with
MSI) still uses INTx

see the thread
http://mail-index.netbsd.org/current-users/2020/02/06/msg037661.html

show more ...


# 5cdcfc1b 07-Feb-2020 jmcneill <jmcneill@NetBSD.org>

Turn MSI off again.


# e88c2985 03-Feb-2020 jmcneill <jmcneill@NetBSD.org>

Re-enable PCI MSI for DRM devices


# d3e2e38e 18-Jan-2020 jmcneill <jmcneill@NetBSD.org>

Use pci_get_segment if available


# d46aeca2 28-Aug-2018 riastradh <riastradh@NetBSD.org>

Rework PCI and AGP conditionalization.

- Push drm_pci_set_unique into driver callback.
- Eliminate drm_pci_set_unique_hook.
- Gather all drm_agp_* functions into struct drm_agp_hooks.
- Replace the

Rework PCI and AGP conditionalization.

- Push drm_pci_set_unique into driver callback.
- Eliminate drm_pci_set_unique_hook.
- Gather all drm_agp_* functions into struct drm_agp_hooks.
- Replace the nonsensical old atomic garbage by serious locking.
- Make drm_agpsupport.c its own module.
- Eliminate NDRMKMS_PCI.
- Use NAGP from "agp.h" only in drm_module.c for horrible hack.
=> See comment in file for rationale.
- Always define CONFIG_PCI=1 and CONFIG_AGP=1.
- Always go through the drm_agp_* function hooks.
- Ifdef out nouveau agp stuff that doesn't go through drm_agp_*
for reasons that I'm too frustrated to figure out tonight.
- pci_iomap no longer automagically does agp_i810_borrow.
=> Use drm_agp_borrow instead.

show more ...


12