History log of /netbsd-current/sys/external/bsd/drm2/linux/linux_pci.c
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 1.30 24-Jun-2024 riastradh

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.


# 1.29 23-Jun-2024 riastradh

linux_pci: Nix pci enumeration kludges.

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


# 1.28 19-May-2024 riastradh

linux: Add a few more cases to pci_get_class.

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


Revision tags: thorpej-ifq-base thorpej-altq-separation-base
# 1.27 30-Sep-2023 mrg

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.


# 1.26 04-Sep-2023 mrg

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

OK riastradh@.


Revision tags: netbsd-10-0-RELEASE netbsd-10-0-RC6 netbsd-10-0-RC5 netbsd-10-0-RC4 netbsd-10-0-RC3 netbsd-10-0-RC2 netbsd-10-0-RC1 netbsd-10-base
# 1.25 17-Oct-2022 mrg

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


Revision tags: bouyer-sunxi-drm-base
# 1.24 20-Sep-2022 mrg

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@


# 1.23 20-Jul-2022 riastradh

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


# 1.22 19-Jul-2022 riastradh

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.


# 1.21 27-Feb-2022 riastradh

drm: Deconditionalize pci_get_segment.


# 1.20 19-Dec-2021 riastradh

linux: pci_name


# 1.19 19-Dec-2021 riastradh

i915: another whack at it


# 1.18 19-Dec-2021 riastradh

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.


# 1.17 19-Dec-2021 riastradh

Include acpica.h for NACPICA.


# 1.16 19-Dec-2021 riastradh

Move acpi includes to linux_pci.c to avoid pollution.


# 1.15 19-Dec-2021 riastradh

Stub dev_is_pci


Author: Maya Rashish <maya@NetBSD.org>


# 1.14 19-Dec-2021 riastradh

Define pci_is_thunderbolt_attached (answer: no).


# 1.13 19-Dec-2021 riastradh

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


# 1.12 19-Dec-2021 riastradh

Define pci_get/set_drvdata properly.


# 1.11 19-Dec-2021 riastradh

pci_get_bus_and_slot -> pci_get_domain_bus_and_slot


Revision tags: thorpej-i2c-spi-conf2-base thorpej-futex2-base thorpej-cfargs2-base cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 cjep_staticlib_x-base thorpej-i2c-spi-conf-base thorpej-cfargs-base thorpej-futex-base bouyer-xenpvh-base2 phil-wifi-20200421 bouyer-xenpvh-base1 phil-wifi-20200411 bouyer-xenpvh-base is-mlppp-base phil-wifi-20200406 ad-namecache-base3
# 1.10 12-Feb-2020 jdolecek

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


# 1.9 07-Feb-2020 jmcneill

Turn MSI off again.


# 1.8 03-Feb-2020 jmcneill

Re-enable PCI MSI for DRM devices


Revision tags: ad-namecache-base2
# 1.7 18-Jan-2020 jmcneill

Use pci_get_segment if available


Revision tags: netbsd-9-4-RELEASE netbsd-9-3-RELEASE netbsd-9-2-RELEASE netbsd-9-1-RELEASE netbsd-9-0-RELEASE netbsd-9-0-RC2 ad-namecache-base1 ad-namecache-base netbsd-9-0-RC1 phil-wifi-20191119 netbsd-9-base phil-wifi-20190609 isaki-audio2-base pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906
# 1.6 28-Aug-2018 riastradh

branches: 1.6.2; 1.6.6; 1.6.10;
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.


# 1.5 27-Aug-2018 riastradh

Try agp_i810_borrow only if CONFIG_AGP is enabled.


# 1.4 27-Aug-2018 riastradh

Treat pre-enabled devices as 1 enablecnt.


# 1.3 27-Aug-2018 riastradh

Zero the whole thing for good measure.


# 1.2 27-Aug-2018 riastradh

Make sure the resources are marked unmapped initially.


# 1.1 27-Aug-2018 riastradh

Move the Linux PCI shim into its very own .c file.

The poor thing has deserved this for a very long time, even though it
is full of kludges. Also I'm tired of recompiling everything every
time I touch it.


# 1.29 23-Jun-2024 riastradh

linux_pci: Nix pci enumeration kludges.

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


# 1.28 19-May-2024 riastradh

linux: Add a few more cases to pci_get_class.

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


Revision tags: thorpej-ifq-base thorpej-altq-separation-base
# 1.27 30-Sep-2023 mrg

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.


# 1.26 04-Sep-2023 mrg

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

OK riastradh@.


Revision tags: netbsd-10-0-RELEASE netbsd-10-0-RC6 netbsd-10-0-RC5 netbsd-10-0-RC4 netbsd-10-0-RC3 netbsd-10-0-RC2 netbsd-10-0-RC1 netbsd-10-base
# 1.25 17-Oct-2022 mrg

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


Revision tags: bouyer-sunxi-drm-base
# 1.24 20-Sep-2022 mrg

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@


# 1.23 20-Jul-2022 riastradh

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


# 1.22 19-Jul-2022 riastradh

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.


# 1.21 27-Feb-2022 riastradh

drm: Deconditionalize pci_get_segment.


# 1.20 19-Dec-2021 riastradh

linux: pci_name


# 1.19 19-Dec-2021 riastradh

i915: another whack at it


# 1.18 19-Dec-2021 riastradh

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.


# 1.17 19-Dec-2021 riastradh

Include acpica.h for NACPICA.


# 1.16 19-Dec-2021 riastradh

Move acpi includes to linux_pci.c to avoid pollution.


# 1.15 19-Dec-2021 riastradh

Stub dev_is_pci


Author: Maya Rashish <maya@NetBSD.org>


# 1.14 19-Dec-2021 riastradh

Define pci_is_thunderbolt_attached (answer: no).


# 1.13 19-Dec-2021 riastradh

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


# 1.12 19-Dec-2021 riastradh

Define pci_get/set_drvdata properly.


# 1.11 19-Dec-2021 riastradh

pci_get_bus_and_slot -> pci_get_domain_bus_and_slot


Revision tags: thorpej-i2c-spi-conf2-base thorpej-futex2-base thorpej-cfargs2-base cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 cjep_staticlib_x-base thorpej-i2c-spi-conf-base thorpej-cfargs-base thorpej-futex-base bouyer-xenpvh-base2 phil-wifi-20200421 bouyer-xenpvh-base1 phil-wifi-20200411 bouyer-xenpvh-base is-mlppp-base phil-wifi-20200406 ad-namecache-base3
# 1.10 12-Feb-2020 jdolecek

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


# 1.9 07-Feb-2020 jmcneill

Turn MSI off again.


# 1.8 03-Feb-2020 jmcneill

Re-enable PCI MSI for DRM devices


Revision tags: ad-namecache-base2
# 1.7 18-Jan-2020 jmcneill

Use pci_get_segment if available


Revision tags: netbsd-9-4-RELEASE netbsd-9-3-RELEASE netbsd-9-2-RELEASE netbsd-9-1-RELEASE netbsd-9-0-RELEASE netbsd-9-0-RC2 ad-namecache-base1 ad-namecache-base netbsd-9-0-RC1 phil-wifi-20191119 netbsd-9-base phil-wifi-20190609 isaki-audio2-base pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906
# 1.6 28-Aug-2018 riastradh

branches: 1.6.2; 1.6.6; 1.6.10;
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.


# 1.5 27-Aug-2018 riastradh

Try agp_i810_borrow only if CONFIG_AGP is enabled.


# 1.4 27-Aug-2018 riastradh

Treat pre-enabled devices as 1 enablecnt.


# 1.3 27-Aug-2018 riastradh

Zero the whole thing for good measure.


# 1.2 27-Aug-2018 riastradh

Make sure the resources are marked unmapped initially.


# 1.1 27-Aug-2018 riastradh

Move the Linux PCI shim into its very own .c file.

The poor thing has deserved this for a very long time, even though it
is full of kludges. Also I'm tired of recompiling everything every
time I touch it.


# 1.28 19-May-2024 riastradh

linux: Add a few more cases to pci_get_class.

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


Revision tags: thorpej-ifq-base thorpej-altq-separation-base
# 1.27 30-Sep-2023 mrg

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.


# 1.26 04-Sep-2023 mrg

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

OK riastradh@.


Revision tags: netbsd-10-0-RELEASE netbsd-10-0-RC6 netbsd-10-0-RC5 netbsd-10-0-RC4 netbsd-10-0-RC3 netbsd-10-0-RC2 netbsd-10-0-RC1 netbsd-10-base
# 1.25 17-Oct-2022 mrg

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


Revision tags: bouyer-sunxi-drm-base
# 1.24 20-Sep-2022 mrg

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@


# 1.23 20-Jul-2022 riastradh

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


# 1.22 19-Jul-2022 riastradh

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.


# 1.21 27-Feb-2022 riastradh

drm: Deconditionalize pci_get_segment.


# 1.20 19-Dec-2021 riastradh

linux: pci_name


# 1.19 19-Dec-2021 riastradh

i915: another whack at it


# 1.18 19-Dec-2021 riastradh

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.


# 1.17 19-Dec-2021 riastradh

Include acpica.h for NACPICA.


# 1.16 19-Dec-2021 riastradh

Move acpi includes to linux_pci.c to avoid pollution.


# 1.15 19-Dec-2021 riastradh

Stub dev_is_pci


Author: Maya Rashish <maya@NetBSD.org>


# 1.14 19-Dec-2021 riastradh

Define pci_is_thunderbolt_attached (answer: no).


# 1.13 19-Dec-2021 riastradh

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


# 1.12 19-Dec-2021 riastradh

Define pci_get/set_drvdata properly.


# 1.11 19-Dec-2021 riastradh

pci_get_bus_and_slot -> pci_get_domain_bus_and_slot


Revision tags: thorpej-i2c-spi-conf2-base thorpej-futex2-base thorpej-cfargs2-base cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 cjep_staticlib_x-base thorpej-i2c-spi-conf-base thorpej-cfargs-base thorpej-futex-base bouyer-xenpvh-base2 phil-wifi-20200421 bouyer-xenpvh-base1 phil-wifi-20200411 bouyer-xenpvh-base is-mlppp-base phil-wifi-20200406 ad-namecache-base3
# 1.10 12-Feb-2020 jdolecek

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


# 1.9 07-Feb-2020 jmcneill

Turn MSI off again.


# 1.8 03-Feb-2020 jmcneill

Re-enable PCI MSI for DRM devices


Revision tags: ad-namecache-base2
# 1.7 18-Jan-2020 jmcneill

Use pci_get_segment if available


Revision tags: netbsd-9-4-RELEASE netbsd-9-3-RELEASE netbsd-9-2-RELEASE netbsd-9-1-RELEASE netbsd-9-0-RELEASE netbsd-9-0-RC2 ad-namecache-base1 ad-namecache-base netbsd-9-0-RC1 phil-wifi-20191119 netbsd-9-base phil-wifi-20190609 isaki-audio2-base pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906
# 1.6 28-Aug-2018 riastradh

branches: 1.6.2; 1.6.6; 1.6.10;
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.


# 1.5 27-Aug-2018 riastradh

Try agp_i810_borrow only if CONFIG_AGP is enabled.


# 1.4 27-Aug-2018 riastradh

Treat pre-enabled devices as 1 enablecnt.


# 1.3 27-Aug-2018 riastradh

Zero the whole thing for good measure.


# 1.2 27-Aug-2018 riastradh

Make sure the resources are marked unmapped initially.


# 1.1 27-Aug-2018 riastradh

Move the Linux PCI shim into its very own .c file.

The poor thing has deserved this for a very long time, even though it
is full of kludges. Also I'm tired of recompiling everything every
time I touch it.


# 1.27 30-Sep-2023 mrg

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.


# 1.26 04-Sep-2023 mrg

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

OK riastradh@.


Revision tags: netbsd-10-base
# 1.25 17-Oct-2022 mrg

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


Revision tags: bouyer-sunxi-drm-base
# 1.24 20-Sep-2022 mrg

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@


# 1.23 20-Jul-2022 riastradh

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


# 1.22 19-Jul-2022 riastradh

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.


# 1.21 27-Feb-2022 riastradh

drm: Deconditionalize pci_get_segment.


# 1.20 19-Dec-2021 riastradh

linux: pci_name


# 1.19 19-Dec-2021 riastradh

i915: another whack at it


# 1.18 19-Dec-2021 riastradh

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.


# 1.17 19-Dec-2021 riastradh

Include acpica.h for NACPICA.


# 1.16 19-Dec-2021 riastradh

Move acpi includes to linux_pci.c to avoid pollution.


# 1.15 19-Dec-2021 riastradh

Stub dev_is_pci


Author: Maya Rashish <maya@NetBSD.org>


# 1.14 19-Dec-2021 riastradh

Define pci_is_thunderbolt_attached (answer: no).


# 1.13 19-Dec-2021 riastradh

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


# 1.12 19-Dec-2021 riastradh

Define pci_get/set_drvdata properly.


# 1.11 19-Dec-2021 riastradh

pci_get_bus_and_slot -> pci_get_domain_bus_and_slot


Revision tags: thorpej-i2c-spi-conf2-base thorpej-futex2-base thorpej-cfargs2-base cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 cjep_staticlib_x-base thorpej-i2c-spi-conf-base thorpej-cfargs-base thorpej-futex-base bouyer-xenpvh-base2 phil-wifi-20200421 bouyer-xenpvh-base1 phil-wifi-20200411 bouyer-xenpvh-base is-mlppp-base phil-wifi-20200406 ad-namecache-base3
# 1.10 12-Feb-2020 jdolecek

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


# 1.9 07-Feb-2020 jmcneill

Turn MSI off again.


# 1.8 03-Feb-2020 jmcneill

Re-enable PCI MSI for DRM devices


Revision tags: ad-namecache-base2
# 1.7 18-Jan-2020 jmcneill

Use pci_get_segment if available


Revision tags: netbsd-9-3-RELEASE netbsd-9-2-RELEASE netbsd-9-1-RELEASE netbsd-9-0-RELEASE netbsd-9-0-RC2 ad-namecache-base1 ad-namecache-base netbsd-9-0-RC1 phil-wifi-20191119 netbsd-9-base phil-wifi-20190609 isaki-audio2-base pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906
# 1.6 28-Aug-2018 riastradh

branches: 1.6.2; 1.6.6; 1.6.10;
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.


# 1.5 27-Aug-2018 riastradh

Try agp_i810_borrow only if CONFIG_AGP is enabled.


# 1.4 27-Aug-2018 riastradh

Treat pre-enabled devices as 1 enablecnt.


# 1.3 27-Aug-2018 riastradh

Zero the whole thing for good measure.


# 1.2 27-Aug-2018 riastradh

Make sure the resources are marked unmapped initially.


# 1.1 27-Aug-2018 riastradh

Move the Linux PCI shim into its very own .c file.

The poor thing has deserved this for a very long time, even though it
is full of kludges. Also I'm tired of recompiling everything every
time I touch it.


# 1.26 04-Sep-2023 mrg

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

OK riastradh@.


Revision tags: netbsd-10-base
# 1.25 17-Oct-2022 mrg

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


Revision tags: bouyer-sunxi-drm-base
# 1.24 20-Sep-2022 mrg

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@


# 1.23 20-Jul-2022 riastradh

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


# 1.22 19-Jul-2022 riastradh

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.


# 1.21 27-Feb-2022 riastradh

drm: Deconditionalize pci_get_segment.


# 1.20 19-Dec-2021 riastradh

linux: pci_name


# 1.19 19-Dec-2021 riastradh

i915: another whack at it


# 1.18 19-Dec-2021 riastradh

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.


# 1.17 19-Dec-2021 riastradh

Include acpica.h for NACPICA.


# 1.16 19-Dec-2021 riastradh

Move acpi includes to linux_pci.c to avoid pollution.


# 1.15 19-Dec-2021 riastradh

Stub dev_is_pci


Author: Maya Rashish <maya@NetBSD.org>


# 1.14 19-Dec-2021 riastradh

Define pci_is_thunderbolt_attached (answer: no).


# 1.13 19-Dec-2021 riastradh

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


# 1.12 19-Dec-2021 riastradh

Define pci_get/set_drvdata properly.


# 1.11 19-Dec-2021 riastradh

pci_get_bus_and_slot -> pci_get_domain_bus_and_slot


Revision tags: thorpej-i2c-spi-conf2-base thorpej-futex2-base thorpej-cfargs2-base cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 cjep_staticlib_x-base thorpej-i2c-spi-conf-base thorpej-cfargs-base thorpej-futex-base bouyer-xenpvh-base2 phil-wifi-20200421 bouyer-xenpvh-base1 phil-wifi-20200411 bouyer-xenpvh-base is-mlppp-base phil-wifi-20200406 ad-namecache-base3
# 1.10 12-Feb-2020 jdolecek

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


# 1.9 07-Feb-2020 jmcneill

Turn MSI off again.


# 1.8 03-Feb-2020 jmcneill

Re-enable PCI MSI for DRM devices


Revision tags: ad-namecache-base2
# 1.7 18-Jan-2020 jmcneill

Use pci_get_segment if available


Revision tags: netbsd-9-3-RELEASE netbsd-9-2-RELEASE netbsd-9-1-RELEASE netbsd-9-0-RELEASE netbsd-9-0-RC2 ad-namecache-base1 ad-namecache-base netbsd-9-0-RC1 phil-wifi-20191119 netbsd-9-base phil-wifi-20190609 isaki-audio2-base pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906
# 1.6 28-Aug-2018 riastradh

branches: 1.6.2; 1.6.6; 1.6.10;
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.


# 1.5 27-Aug-2018 riastradh

Try agp_i810_borrow only if CONFIG_AGP is enabled.


# 1.4 27-Aug-2018 riastradh

Treat pre-enabled devices as 1 enablecnt.


# 1.3 27-Aug-2018 riastradh

Zero the whole thing for good measure.


# 1.2 27-Aug-2018 riastradh

Make sure the resources are marked unmapped initially.


# 1.1 27-Aug-2018 riastradh

Move the Linux PCI shim into its very own .c file.

The poor thing has deserved this for a very long time, even though it
is full of kludges. Also I'm tired of recompiling everything every
time I touch it.


# 1.25 17-Oct-2022 mrg

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


Revision tags: bouyer-sunxi-drm-base
# 1.24 20-Sep-2022 mrg

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@


# 1.23 20-Jul-2022 riastradh

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


# 1.22 19-Jul-2022 riastradh

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.


# 1.21 27-Feb-2022 riastradh

drm: Deconditionalize pci_get_segment.


# 1.20 19-Dec-2021 riastradh

linux: pci_name


# 1.19 19-Dec-2021 riastradh

i915: another whack at it


# 1.18 19-Dec-2021 riastradh

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.


# 1.17 19-Dec-2021 riastradh

Include acpica.h for NACPICA.


# 1.16 19-Dec-2021 riastradh

Move acpi includes to linux_pci.c to avoid pollution.


# 1.15 19-Dec-2021 riastradh

Stub dev_is_pci


Author: Maya Rashish <maya@NetBSD.org>


# 1.14 19-Dec-2021 riastradh

Define pci_is_thunderbolt_attached (answer: no).


# 1.13 19-Dec-2021 riastradh

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


# 1.12 19-Dec-2021 riastradh

Define pci_get/set_drvdata properly.


# 1.11 19-Dec-2021 riastradh

pci_get_bus_and_slot -> pci_get_domain_bus_and_slot


Revision tags: thorpej-i2c-spi-conf2-base thorpej-futex2-base thorpej-cfargs2-base cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 cjep_staticlib_x-base thorpej-i2c-spi-conf-base thorpej-cfargs-base thorpej-futex-base bouyer-xenpvh-base2 phil-wifi-20200421 bouyer-xenpvh-base1 phil-wifi-20200411 bouyer-xenpvh-base is-mlppp-base phil-wifi-20200406 ad-namecache-base3
# 1.10 12-Feb-2020 jdolecek

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


# 1.9 07-Feb-2020 jmcneill

Turn MSI off again.


# 1.8 03-Feb-2020 jmcneill

Re-enable PCI MSI for DRM devices


Revision tags: ad-namecache-base2
# 1.7 18-Jan-2020 jmcneill

Use pci_get_segment if available


Revision tags: netbsd-9-3-RELEASE netbsd-9-2-RELEASE netbsd-9-1-RELEASE netbsd-9-0-RELEASE netbsd-9-0-RC2 ad-namecache-base1 ad-namecache-base netbsd-9-0-RC1 phil-wifi-20191119 netbsd-9-base phil-wifi-20190609 isaki-audio2-base pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906
# 1.6 28-Aug-2018 riastradh

branches: 1.6.2; 1.6.6; 1.6.10;
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.


# 1.5 27-Aug-2018 riastradh

Try agp_i810_borrow only if CONFIG_AGP is enabled.


# 1.4 27-Aug-2018 riastradh

Treat pre-enabled devices as 1 enablecnt.


# 1.3 27-Aug-2018 riastradh

Zero the whole thing for good measure.


# 1.2 27-Aug-2018 riastradh

Make sure the resources are marked unmapped initially.


# 1.1 27-Aug-2018 riastradh

Move the Linux PCI shim into its very own .c file.

The poor thing has deserved this for a very long time, even though it
is full of kludges. Also I'm tired of recompiling everything every
time I touch it.


# 1.24 20-Sep-2022 mrg

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@


# 1.23 20-Jul-2022 riastradh

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


# 1.22 19-Jul-2022 riastradh

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.


# 1.21 27-Feb-2022 riastradh

drm: Deconditionalize pci_get_segment.


# 1.20 19-Dec-2021 riastradh

linux: pci_name


# 1.19 19-Dec-2021 riastradh

i915: another whack at it


# 1.18 19-Dec-2021 riastradh

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.


# 1.17 19-Dec-2021 riastradh

Include acpica.h for NACPICA.


# 1.16 19-Dec-2021 riastradh

Move acpi includes to linux_pci.c to avoid pollution.


# 1.15 19-Dec-2021 riastradh

Stub dev_is_pci


Author: Maya Rashish <maya@NetBSD.org>


# 1.14 19-Dec-2021 riastradh

Define pci_is_thunderbolt_attached (answer: no).


# 1.13 19-Dec-2021 riastradh

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


# 1.12 19-Dec-2021 riastradh

Define pci_get/set_drvdata properly.


# 1.11 19-Dec-2021 riastradh

pci_get_bus_and_slot -> pci_get_domain_bus_and_slot


Revision tags: thorpej-i2c-spi-conf2-base thorpej-futex2-base thorpej-cfargs2-base cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 cjep_staticlib_x-base thorpej-i2c-spi-conf-base thorpej-cfargs-base thorpej-futex-base bouyer-xenpvh-base2 phil-wifi-20200421 bouyer-xenpvh-base1 phil-wifi-20200411 bouyer-xenpvh-base is-mlppp-base phil-wifi-20200406 ad-namecache-base3
# 1.10 12-Feb-2020 jdolecek

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


# 1.9 07-Feb-2020 jmcneill

Turn MSI off again.


# 1.8 03-Feb-2020 jmcneill

Re-enable PCI MSI for DRM devices


Revision tags: ad-namecache-base2
# 1.7 18-Jan-2020 jmcneill

Use pci_get_segment if available


Revision tags: netbsd-9-3-RELEASE netbsd-9-2-RELEASE netbsd-9-1-RELEASE netbsd-9-0-RELEASE netbsd-9-0-RC2 ad-namecache-base1 ad-namecache-base netbsd-9-0-RC1 phil-wifi-20191119 netbsd-9-base phil-wifi-20190609 isaki-audio2-base pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906
# 1.6 28-Aug-2018 riastradh

branches: 1.6.2; 1.6.6; 1.6.10;
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.


# 1.5 27-Aug-2018 riastradh

Try agp_i810_borrow only if CONFIG_AGP is enabled.


# 1.4 27-Aug-2018 riastradh

Treat pre-enabled devices as 1 enablecnt.


# 1.3 27-Aug-2018 riastradh

Zero the whole thing for good measure.


# 1.2 27-Aug-2018 riastradh

Make sure the resources are marked unmapped initially.


# 1.1 27-Aug-2018 riastradh

Move the Linux PCI shim into its very own .c file.

The poor thing has deserved this for a very long time, even though it
is full of kludges. Also I'm tired of recompiling everything every
time I touch it.


# 1.23 20-Jul-2022 riastradh

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


# 1.22 19-Jul-2022 riastradh

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.


# 1.21 27-Feb-2022 riastradh

drm: Deconditionalize pci_get_segment.


# 1.20 19-Dec-2021 riastradh

linux: pci_name


# 1.19 19-Dec-2021 riastradh

i915: another whack at it


# 1.18 19-Dec-2021 riastradh

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.


# 1.17 19-Dec-2021 riastradh

Include acpica.h for NACPICA.


# 1.16 19-Dec-2021 riastradh

Move acpi includes to linux_pci.c to avoid pollution.


# 1.15 19-Dec-2021 riastradh

Stub dev_is_pci


Author: Maya Rashish <maya@NetBSD.org>


# 1.14 19-Dec-2021 riastradh

Define pci_is_thunderbolt_attached (answer: no).


# 1.13 19-Dec-2021 riastradh

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


# 1.12 19-Dec-2021 riastradh

Define pci_get/set_drvdata properly.


# 1.11 19-Dec-2021 riastradh

pci_get_bus_and_slot -> pci_get_domain_bus_and_slot


Revision tags: thorpej-i2c-spi-conf2-base thorpej-futex2-base thorpej-cfargs2-base cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 cjep_staticlib_x-base thorpej-i2c-spi-conf-base thorpej-cfargs-base thorpej-futex-base bouyer-xenpvh-base2 phil-wifi-20200421 bouyer-xenpvh-base1 phil-wifi-20200411 bouyer-xenpvh-base is-mlppp-base phil-wifi-20200406 ad-namecache-base3
# 1.10 12-Feb-2020 jdolecek

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


# 1.9 07-Feb-2020 jmcneill

Turn MSI off again.


# 1.8 03-Feb-2020 jmcneill

Re-enable PCI MSI for DRM devices


Revision tags: ad-namecache-base2
# 1.7 18-Jan-2020 jmcneill

Use pci_get_segment if available


Revision tags: netbsd-9-2-RELEASE netbsd-9-1-RELEASE netbsd-9-0-RELEASE netbsd-9-0-RC2 ad-namecache-base1 ad-namecache-base netbsd-9-0-RC1 phil-wifi-20191119 netbsd-9-base phil-wifi-20190609 isaki-audio2-base pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906
# 1.6 28-Aug-2018 riastradh

branches: 1.6.2; 1.6.6; 1.6.10;
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.


# 1.5 27-Aug-2018 riastradh

Try agp_i810_borrow only if CONFIG_AGP is enabled.


# 1.4 27-Aug-2018 riastradh

Treat pre-enabled devices as 1 enablecnt.


# 1.3 27-Aug-2018 riastradh

Zero the whole thing for good measure.


# 1.2 27-Aug-2018 riastradh

Make sure the resources are marked unmapped initially.


# 1.1 27-Aug-2018 riastradh

Move the Linux PCI shim into its very own .c file.

The poor thing has deserved this for a very long time, even though it
is full of kludges. Also I'm tired of recompiling everything every
time I touch it.


# 1.21 27-Feb-2022 riastradh

drm: Deconditionalize pci_get_segment.


# 1.20 19-Dec-2021 riastradh

linux: pci_name


# 1.19 19-Dec-2021 riastradh

i915: another whack at it


# 1.18 19-Dec-2021 riastradh

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.


# 1.17 19-Dec-2021 riastradh

Include acpica.h for NACPICA.


# 1.16 19-Dec-2021 riastradh

Move acpi includes to linux_pci.c to avoid pollution.


# 1.15 19-Dec-2021 riastradh

Stub dev_is_pci


Author: Maya Rashish <maya@NetBSD.org>


# 1.14 19-Dec-2021 riastradh

Define pci_is_thunderbolt_attached (answer: no).


# 1.13 19-Dec-2021 riastradh

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


# 1.12 19-Dec-2021 riastradh

Define pci_get/set_drvdata properly.


# 1.11 19-Dec-2021 riastradh

pci_get_bus_and_slot -> pci_get_domain_bus_and_slot


Revision tags: thorpej-i2c-spi-conf2-base thorpej-futex2-base thorpej-cfargs2-base cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 cjep_staticlib_x-base thorpej-i2c-spi-conf-base thorpej-cfargs-base thorpej-futex-base bouyer-xenpvh-base2 phil-wifi-20200421 bouyer-xenpvh-base1 phil-wifi-20200411 bouyer-xenpvh-base is-mlppp-base phil-wifi-20200406 ad-namecache-base3
# 1.10 12-Feb-2020 jdolecek

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


# 1.9 07-Feb-2020 jmcneill

Turn MSI off again.


# 1.8 03-Feb-2020 jmcneill

Re-enable PCI MSI for DRM devices


Revision tags: ad-namecache-base2
# 1.7 18-Jan-2020 jmcneill

Use pci_get_segment if available


Revision tags: netbsd-9-2-RELEASE netbsd-9-1-RELEASE netbsd-9-0-RELEASE netbsd-9-0-RC2 ad-namecache-base1 ad-namecache-base netbsd-9-0-RC1 phil-wifi-20191119 netbsd-9-base phil-wifi-20190609 isaki-audio2-base pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906
# 1.6 28-Aug-2018 riastradh

branches: 1.6.2; 1.6.6; 1.6.10;
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.


# 1.5 27-Aug-2018 riastradh

Try agp_i810_borrow only if CONFIG_AGP is enabled.


# 1.4 27-Aug-2018 riastradh

Treat pre-enabled devices as 1 enablecnt.


# 1.3 27-Aug-2018 riastradh

Zero the whole thing for good measure.


# 1.2 27-Aug-2018 riastradh

Make sure the resources are marked unmapped initially.


# 1.1 27-Aug-2018 riastradh

Move the Linux PCI shim into its very own .c file.

The poor thing has deserved this for a very long time, even though it
is full of kludges. Also I'm tired of recompiling everything every
time I touch it.


# 1.20 19-Dec-2021 riastradh

linux: pci_name


# 1.19 19-Dec-2021 riastradh

i915: another whack at it


# 1.18 19-Dec-2021 riastradh

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.


# 1.17 19-Dec-2021 riastradh

Include acpica.h for NACPICA.


# 1.16 19-Dec-2021 riastradh

Move acpi includes to linux_pci.c to avoid pollution.


# 1.15 19-Dec-2021 riastradh

Stub dev_is_pci


Author: Maya Rashish <maya@NetBSD.org>


# 1.14 19-Dec-2021 riastradh

Define pci_is_thunderbolt_attached (answer: no).


# 1.13 19-Dec-2021 riastradh

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


# 1.12 19-Dec-2021 riastradh

Define pci_get/set_drvdata properly.


# 1.11 19-Dec-2021 riastradh

pci_get_bus_and_slot -> pci_get_domain_bus_and_slot


Revision tags: thorpej-i2c-spi-conf2-base thorpej-futex2-base thorpej-cfargs2-base cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 cjep_staticlib_x-base thorpej-i2c-spi-conf-base thorpej-cfargs-base thorpej-futex-base bouyer-xenpvh-base2 phil-wifi-20200421 bouyer-xenpvh-base1 phil-wifi-20200411 bouyer-xenpvh-base is-mlppp-base phil-wifi-20200406 ad-namecache-base3
# 1.10 12-Feb-2020 jdolecek

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


# 1.9 07-Feb-2020 jmcneill

Turn MSI off again.


# 1.8 03-Feb-2020 jmcneill

Re-enable PCI MSI for DRM devices


Revision tags: ad-namecache-base2
# 1.7 18-Jan-2020 jmcneill

Use pci_get_segment if available


Revision tags: netbsd-9-2-RELEASE netbsd-9-1-RELEASE netbsd-9-0-RELEASE netbsd-9-0-RC2 ad-namecache-base1 ad-namecache-base netbsd-9-0-RC1 phil-wifi-20191119 netbsd-9-base phil-wifi-20190609 isaki-audio2-base pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906
# 1.6 28-Aug-2018 riastradh

branches: 1.6.2; 1.6.6; 1.6.10;
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.


# 1.5 27-Aug-2018 riastradh

Try agp_i810_borrow only if CONFIG_AGP is enabled.


# 1.4 27-Aug-2018 riastradh

Treat pre-enabled devices as 1 enablecnt.


# 1.3 27-Aug-2018 riastradh

Zero the whole thing for good measure.


# 1.2 27-Aug-2018 riastradh

Make sure the resources are marked unmapped initially.


# 1.1 27-Aug-2018 riastradh

Move the Linux PCI shim into its very own .c file.

The poor thing has deserved this for a very long time, even though it
is full of kludges. Also I'm tired of recompiling everything every
time I touch it.


# 1.10 12-Feb-2020 jdolecek

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


# 1.9 07-Feb-2020 jmcneill

Turn MSI off again.


# 1.8 03-Feb-2020 jmcneill

Re-enable PCI MSI for DRM devices


Revision tags: ad-namecache-base2
# 1.7 18-Jan-2020 jmcneill

Use pci_get_segment if available


Revision tags: netbsd-9-0-RC2 ad-namecache-base1 ad-namecache-base netbsd-9-0-RC1 phil-wifi-20191119 netbsd-9-base phil-wifi-20190609 isaki-audio2-base pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906
# 1.6 28-Aug-2018 riastradh

branches: 1.6.2; 1.6.6; 1.6.10;
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.


# 1.5 27-Aug-2018 riastradh

Try agp_i810_borrow only if CONFIG_AGP is enabled.


# 1.4 27-Aug-2018 riastradh

Treat pre-enabled devices as 1 enablecnt.


# 1.3 27-Aug-2018 riastradh

Zero the whole thing for good measure.


# 1.2 27-Aug-2018 riastradh

Make sure the resources are marked unmapped initially.


# 1.1 27-Aug-2018 riastradh

Move the Linux PCI shim into its very own .c file.

The poor thing has deserved this for a very long time, even though it
is full of kludges. Also I'm tired of recompiling everything every
time I touch it.


# 1.9 07-Feb-2020 jmcneill

Turn MSI off again.


# 1.8 03-Feb-2020 jmcneill

Re-enable PCI MSI for DRM devices


Revision tags: ad-namecache-base2
# 1.7 18-Jan-2020 jmcneill

Use pci_get_segment if available


Revision tags: netbsd-9-0-RC2 ad-namecache-base1 ad-namecache-base netbsd-9-0-RC1 phil-wifi-20191119 netbsd-9-base phil-wifi-20190609 isaki-audio2-base pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906
# 1.6 28-Aug-2018 riastradh

branches: 1.6.2; 1.6.6; 1.6.10;
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.


# 1.5 27-Aug-2018 riastradh

Try agp_i810_borrow only if CONFIG_AGP is enabled.


# 1.4 27-Aug-2018 riastradh

Treat pre-enabled devices as 1 enablecnt.


# 1.3 27-Aug-2018 riastradh

Zero the whole thing for good measure.


# 1.2 27-Aug-2018 riastradh

Make sure the resources are marked unmapped initially.


# 1.1 27-Aug-2018 riastradh

Move the Linux PCI shim into its very own .c file.

The poor thing has deserved this for a very long time, even though it
is full of kludges. Also I'm tired of recompiling everything every
time I touch it.


# 1.8 03-Feb-2020 jmcneill

Re-enable PCI MSI for DRM devices


Revision tags: ad-namecache-base2
# 1.7 18-Jan-2020 jmcneill

Use pci_get_segment if available


Revision tags: netbsd-9-0-RC2 ad-namecache-base1 ad-namecache-base netbsd-9-0-RC1 phil-wifi-20191119 netbsd-9-base phil-wifi-20190609 isaki-audio2-base pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906
# 1.6 28-Aug-2018 riastradh

branches: 1.6.2; 1.6.6; 1.6.10;
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.


# 1.5 27-Aug-2018 riastradh

Try agp_i810_borrow only if CONFIG_AGP is enabled.


# 1.4 27-Aug-2018 riastradh

Treat pre-enabled devices as 1 enablecnt.


# 1.3 27-Aug-2018 riastradh

Zero the whole thing for good measure.


# 1.2 27-Aug-2018 riastradh

Make sure the resources are marked unmapped initially.


# 1.1 27-Aug-2018 riastradh

Move the Linux PCI shim into its very own .c file.

The poor thing has deserved this for a very long time, even though it
is full of kludges. Also I'm tired of recompiling everything every
time I touch it.


# 1.7 18-Jan-2020 jmcneill

Use pci_get_segment if available


Revision tags: ad-namecache-base1 ad-namecache-base netbsd-9-0-RC1 phil-wifi-20191119 netbsd-9-base phil-wifi-20190609 isaki-audio2-base pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906
# 1.6 28-Aug-2018 riastradh

branches: 1.6.2; 1.6.6;
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.


# 1.5 27-Aug-2018 riastradh

Try agp_i810_borrow only if CONFIG_AGP is enabled.


# 1.4 27-Aug-2018 riastradh

Treat pre-enabled devices as 1 enablecnt.


# 1.3 27-Aug-2018 riastradh

Zero the whole thing for good measure.


# 1.2 27-Aug-2018 riastradh

Make sure the resources are marked unmapped initially.


# 1.1 27-Aug-2018 riastradh

Move the Linux PCI shim into its very own .c file.

The poor thing has deserved this for a very long time, even though it
is full of kludges. Also I'm tired of recompiling everything every
time I touch it.


Revision tags: isaki-audio2-base pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906
# 1.6 28-Aug-2018 riastradh

branches: 1.6.2;
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.


# 1.5 27-Aug-2018 riastradh

Try agp_i810_borrow only if CONFIG_AGP is enabled.


# 1.4 27-Aug-2018 riastradh

Treat pre-enabled devices as 1 enablecnt.


# 1.3 27-Aug-2018 riastradh

Zero the whole thing for good measure.


# 1.2 27-Aug-2018 riastradh

Make sure the resources are marked unmapped initially.


# 1.1 27-Aug-2018 riastradh

Move the Linux PCI shim into its very own .c file.

The poor thing has deserved this for a very long time, even though it
is full of kludges. Also I'm tired of recompiling everything every
time I touch it.