Home | History | Annotate | only in /src/sys/external/bsd/drm2/include/linux
History log of /src/sys/external/bsd/drm2/include/linux
RevisionDateAuthorComments
 1.11 16-Apr-2024  riastradh 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.
 1.10 28-May-2022  manu branches: 1.10.4;
Let radeon DRM driver build on ports that lack ACPI
 1.9 27-Feb-2022  riastradh linux: Define acpi_size as alias for ACPI_SIZE.
 1.8 27-Feb-2022  riastradh drm: Omit needless conditionals around #include "acpica.h".
 1.7 27-Feb-2022  riastradh drm: Move acpi_check_dsm &c. from intel_acpi.c to new linux_acpi.c.
 1.6 19-Dec-2021  riastradh i915: another whack at it
 1.5 18-Jan-2020  jmcneill Pull in acpica.h on aarch64
 1.4 17-Oct-2015  jmcneill branches: 1.4.18; 1.4.24;
only include acpivar.h when NACPICA > 0
 1.3 05-Nov-2014  nonaka branches: 1.3.2;
i915drmkms(4): Enable CONFIG_ACPI if NACPICA > 0.
Now brightness can be adjusted via hotkey on Mouse Computer LB-J300X (Clevo W330SU2).
 1.2 18-Mar-2014  riastradh branches: 1.2.4; 1.2.6; 1.2.8; 1.2.10;
Merge riastradh-drm2 to HEAD.
 1.1 24-Jul-2013  riastradh branches: 1.1.2;
file acpi.h was initially added on branch riastradh-drm2.
 1.1.2.1 24-Jul-2013  riastradh Add stubs for Linux header files for drm.
 1.2.10.3 03-Dec-2017  jdolecek update from HEAD
 1.2.10.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.2.10.1 18-Mar-2014  tls file acpi.h was added on branch tls-maxphys on 2014-08-20 00:04:21 +0000
 1.2.8.1 11-Nov-2014  martin Pull up following revision(s) (requested by nonaka in ticket #197):
sys/external/bsd/drm2/dist/drm/i915/i915_drv.h: revision 1.10
sys/external/bsd/drm2/include/linux/pci.h: revision 1.10
sys/external/bsd/drm2/dist/drm/i915/intel_acpi.c: revision 1.3
sys/external/bsd/drm2/dist/drm/i915/intel_acpi.c: revision 1.4
sys/external/bsd/drm2/dist/drm/i915/intel_acpi.c: revision 1.5
sys/external/bsd/drm2/dist/drm/i915/intel_opregion.c: revision 1.6
sys/external/bsd/drm2/dist/drm/i915/intel_opregion.c: revision 1.7
sys/external/bsd/drm2/include/linux/acpi.h: revision 1.3
sys/external/bsd/drm2/dist/drm/i915/i915_dma.c: revision 1.12
sys/external/bsd/drm2/i915drm/files.i915drmkms: revision 1.8
i915drmkms(4): Enable CONFIG_ACPI if NACPICA > 0.
Now brightness can be adjusted via hotkey on Mouse Computer LB-J300X
(Clevo W330SU2).
Fix compilation (debug)
pci_attach_args of pci_find_device and match function is not the same thing.
fix PR/49372.
 1.2.6.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.2.6.1 18-Mar-2014  yamt file acpi.h was added on branch yamt-pagecache on 2014-05-22 11:40:56 +0000
 1.2.4.2 18-May-2014  rmind sync with head
 1.2.4.1 18-Mar-2014  rmind file acpi.h was added on branch rmind-smpnet on 2014-05-18 17:46:01 +0000
 1.3.2.1 27-Dec-2015  skrll Sync with HEAD (as of 26th Dec)
 1.4.24.1 25-Jan-2020  ad Sync with head.
 1.4.18.1 08-Apr-2020  martin Merge changes from current as of 20200406
 1.10.4.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@.
 1.2 18-Mar-2014  riastradh branches: 1.2.4; 1.2.6; 1.2.10;
Merge riastradh-drm2 to HEAD.
 1.1 24-Jul-2013  riastradh branches: 1.1.2;
file acpi_io.h was initially added on branch riastradh-drm2.
 1.1.2.3 24-Jul-2013  riastradh Define acpi_os_iounmap as AcpiOsUnmapMemory in <linux/acpi_io.h>.
 1.1.2.2 24-Jul-2013  riastradh Fill in <linux/acpi_io.h> with acpi_os_ioremap (= AcpiOsMapMemory).

Define __acpi_iomem as an empty frotz to replace the Linux __iomem
attribute selectively and greppably. AcpiOsMapMemory returns usable
kernel virtual addresses, so we don't need to use bus_space_mumble or
anything to dereference them.
 1.1.2.1 24-Jul-2013  riastradh Add stubs for Linux header files for drm.
 1.2.10.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.2.10.1 18-Mar-2014  tls file acpi_io.h was added on branch tls-maxphys on 2014-08-20 00:04:21 +0000
 1.2.6.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.2.6.1 18-Mar-2014  yamt file acpi_io.h was added on branch yamt-pagecache on 2014-05-22 11:40:56 +0000
 1.2.4.2 18-May-2014  rmind sync with head
 1.2.4.1 18-Mar-2014  rmind file acpi_io.h was added on branch rmind-smpnet on 2014-05-18 17:46:01 +0000
 1.3 19-Dec-2021  riastradh Make <linux/agp_backend.h> yield the AGP APIish.
 1.2 18-Mar-2014  riastradh branches: 1.2.4; 1.2.6; 1.2.10;
Merge riastradh-drm2 to HEAD.
 1.1 24-Jul-2013  riastradh branches: 1.1.2;
file agp_backend.h was initially added on branch riastradh-drm2.
 1.1.2.1 24-Jul-2013  riastradh Add stubs for Linux header files for drm.
 1.2.10.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.2.10.1 18-Mar-2014  tls file agp_backend.h was added on branch tls-maxphys on 2014-08-20 00:04:21 +0000
 1.2.6.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.2.6.1 18-Mar-2014  yamt file agp_backend.h was added on branch yamt-pagecache on 2014-05-22 11:40:56 +0000
 1.2.4.2 18-May-2014  rmind sync with head
 1.2.4.1 18-Mar-2014  rmind file agp_backend.h was added on branch rmind-smpnet on 2014-05-18 17:46:01 +0000
 1.1 19-Dec-2021  riastradh More Linux header stubs.

Let's just use empty header files until we actually populate these.
Save a bit of disk space...
 1.5 19-Dec-2021  riastradh linux: stub async_synchronize_cookie
 1.4 27-Aug-2018  riastradh branches: 1.4.2; 1.4.6;
Implement <linux/async.h> synchronously.
 1.3 27-Aug-2018  riastradh provide pr_notice
avoid needing unregister_oom_notifier
use intel_register_dsm_handler(dev), as older drm does
provide dummy async_schedule
provide atomic_or
match side-loading


Author: coypu <coypu@sdf.org>
Committer: Taylor R Campbell <riastradh@NetBSD.org>
 1.2 27-Aug-2018  riastradh include guard for async.h


Author: coypu <coypu@sdf.org>
Committer: Taylor R Campbell <riastradh@NetBSD.org>
 1.1 27-Aug-2018  riastradh local versions of headers required


Author: coypu <coypu@sdf.org>
Committer: Taylor R Campbell <riastradh@NetBSD.org>
 1.4.6.2 10-Jun-2019  christos Sync with HEAD
 1.4.6.1 27-Aug-2018  christos file async.h was added on branch phil-wifi on 2019-06-10 22:08:31 +0000
 1.4.2.2 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.4.2.1 27-Aug-2018  pgoyette file async.h was added on branch pgoyette-compat on 2018-09-06 06:56:36 +0000
 1.42 19-Dec-2021  riastradh amdgpu: Another pass through.

amdgpu_object.c
amdgpu_pci.c
amdgpu_pm.c
amdgpu_polaris10_smumgr.c
amdgpu_pp_psm.c
amdgpu_ppatomctrl.c
amdgpu_ppatomfwctrl.c
amdgpu_process_pptables_v1_0.o
amdgpu_psp.o
amdgpu_psp_v10_0.c
amdgpu_psp_v11_0.c
amdgpu_psp_v12_0.c
amdgpu_psp_v3_1.c
amdgpu_ras.c
amdgpu_ras_eeprom.c
amdgpu_rc_calc.c
amdgpu_rc_calc_dpi.c
amdgpu_ring.c
amdgpu_rlc.c
amdgpu_rn_clk_mgr.c
amdgpu_sdma_v3_0.c
amdgpu_sdma_v4_0.c
amdgpu_sdma_v5_0.c
amdgpu_si.c
amdgpu_si_dma.c
amdgpu_si_dpm.c
amdgpu_smu.c
amdgpu_smu10_hwmgr.c
amdgpu_smu7_hwmgr.c
amdgpu_smu8_hwmgr.c
amdgpu_smu8_smumgr.c
amdgpu_smu_v11_0.c (and a sprinkling of consts)
amdgpu_smu_v11_0_i2c.c
amdgpu_soc15.c
amdgpu_tonga_smumgr.c
amdgpu_ttm.c
amdgpu_ucode.c
amdgpu_uvd.c
amdgpu_uvd_v5_0.c
amdgpu_uvd_v6_0.c
amdgpu_uvd_v7_0.c
amdgpu_vce.c
amdgpu_vce_v2_0.c
amdgpu_vce_v4_0.c
amdgpu_vcn_v1_0.c
amdgpu_vcn_v2_0.c
amdgpu_vcn_v2_5.c
amdgpu_vega10_hwmgr.c
amdgpu_vega10_powertune.c
amdgpu_vega10_processpptables.c
amdgpu_vega10_reg_init.c
amdgpu_vega12_hwmgr.c
amdgpu_vega20_hwmgr.c
amdgpu_vega20_ppt.c
amdgpu_vega20_reg_init.c
amdgpu_vi.c
amdgpu_virt.c
amdgpu_vram_mgr.c
amdgpu_xgmi.c -- disable (for now?)
amdgpufb.c
 1.41 19-Dec-2021  riastradh i915: more work
 1.40 19-Dec-2021  riastradh i915: More progress.
 1.39 19-Dec-2021  riastradh linux: Just use __sync_* for xchg and cmpxchg.

Easier than figuring out the dance with __builtin_choose_expr to make
these work with all types they need to work with.
 1.38 19-Dec-2021  riastradh linux: Make xchg and cmpxchg work on pointers too.
 1.37 19-Dec-2021  riastradh drm/linux: atomic_fetch_add/inc
 1.36 19-Dec-2021  riastradh drm/linux: Add memset32, SZ_64K, atomic_sub_return.
 1.35 19-Dec-2021  riastradh cmpxchg
 1.34 19-Dec-2021  riastradh Move Linux atomic bitops from linux/atomic.h to linux/bitops.h.
 1.33 19-Dec-2021  riastradh Move smp_mb_before/after_atomic from linux/atomic.h to asm/barrier.h.
 1.32 19-Dec-2021  riastradh Linux clear_bit_unlock
 1.31 19-Dec-2021  riastradh atomic_set_release
 1.30 19-Dec-2021  riastradh atomic_long_xchg
 1.29 19-Dec-2021  riastradh Omit __insn_barrier where implied or subsumed by volatile.
 1.28 19-Dec-2021  riastradh atomic_dec_if_positive
 1.27 19-Dec-2021  riastradh Allow atomic_read of const.
 1.26 19-Dec-2021  riastradh Guarantee no repeated loads.
 1.25 19-Dec-2021  riastradh atomic_fetch_xor
 1.24 19-Dec-2021  riastradh atomic_andnot
 1.23 19-Dec-2021  riastradh Kludgey xchg.
 1.22 14-Feb-2020  maya Reduce diffs by side-loading some header files like Linux.

From riastradh
 1.21 28-Sep-2019  christos branches: 1.21.2;
Fix signed/unsigned comparison
 1.20 27-Jan-2019  pgoyette Merge the [pgoyette-compat] branch
 1.19 27-Aug-2018  riastradh Implement atomic64_add_return and atomic64_inc_return.
 1.18 27-Aug-2018  riastradh Sort.
 1.17 27-Aug-2018  riastradh Fix argument types of atomic64_add/sub to be sensible.

Technically Linux does use long long rather than int64_t, but that's
silly.
 1.16 27-Aug-2018  riastradh Implement ATOMIC64_INIT.
 1.15 27-Aug-2018  riastradh Hash-locked atomic64 to give ports like powerpc32 a chance at radeon.
 1.14 27-Aug-2018  riastradh Add atomic_long.
 1.13 27-Aug-2018  riastradh Attempt to match Linux semantics for membars implied by atomics.

This is kind of moot at the moment because we're mostly x86-only for
drmkms, but this might help in the future if we ever went beyond x86.
 1.12 27-Aug-2018  riastradh Nix memory barriers that were nixed upstream. Add smp_mb__after_atomic.
 1.11 27-Aug-2018  riastradh Fix return types of test_and_{set,clear,change}_bit.
 1.10 27-Aug-2018  riastradh Add Linux smp_mb__before_atomic.
 1.9 27-Aug-2018  riastradh Implement atomic64_cmpxchg.
 1.8 27-Aug-2018  riastradh provide pr_notice
avoid needing unregister_oom_notifier
use intel_register_dsm_handler(dev), as older drm does
provide dummy async_schedule
provide atomic_or
match side-loading


Author: coypu <coypu@sdf.org>
Committer: Taylor R Campbell <riastradh@NetBSD.org>
 1.7 17-Jul-2014  riastradh branches: 1.7.4; 1.7.28; 1.7.30;
Correct return values of Linux test-and-set operations (PR 48999).

Linux's Documentation/atomic_ops.txt says in no uncertain terms these
must return 0 or 1, not zero or nonzero. I don't think this has
caused an issue for drm (yet), but better to have it right.
 1.6 16-Jul-2014  riastradh First whack at radeon driver.

No hardware to test yet, but it builds.
 1.5 16-Jul-2014  riastradh Make it build and boot on my test machines.

Screen blanks on boot on the Ivy Bridge system with

DRM error in cpt_serr_int_handler: PCH transcoder A FIFO underrun

But after that everything is OK. Appears to be an upstream problem.
To investigate...

I think there's a cache flushing issue somewhere -- there are little
display artefacts on my T60.
 1.4 03-Jun-2014  riastradh Fix atomic_dec_and_test in <linux/atomic.h>: test 0, not -1.
 1.3 01-Apr-2014  riastradh branches: 1.3.2; 1.3.4; 1.3.6;
Fix volatile qualifiers in drm2 <linux/atomic.h>.
 1.2 18-Mar-2014  riastradh Merge riastradh-drm2 to HEAD.
 1.1 24-Jul-2013  riastradh branches: 1.1.2;
file atomic.h was initially added on branch riastradh-drm2.
 1.1.2.11 08-Sep-2013  riastradh Add Linux ATOMIC_INIT, atomic_inc_return, and atomic_dec_return.
 1.1.2.10 08-Sep-2013  riastradh Fix Linux atomic set/clear/change_bit to work on arrays.
 1.1.2.9 24-Jul-2013  riastradh Add several operations to <linux/atomic.h>.

atomic_add_unless
atomic_clear_mask
atomic_inc_not_zero
atomic_set_mask
atomic_sub
 1.1.2.8 24-Jul-2013  riastradh Add Linux SMP atomic inc/dec memory barriers to <linux/atomic.h>.
 1.1.2.7 24-Jul-2013  riastradh Add atomic_add and atomic_add_return to <linux/atomic.h>.
 1.1.2.6 24-Jul-2013  riastradh Separate `struct atomic { ... }' from typedef for greppability.
 1.1.2.5 24-Jul-2013  riastradh Add some bit-toggling atomics to <linux/atomic.h>.
 1.1.2.4 24-Jul-2013  riastradh Use a union rather than casts in <linux/atomic.h>. Add atomic_dec.
 1.1.2.3 24-Jul-2013  riastradh Add some atomic operations to <linux/atomic.h>.
 1.1.2.2 24-Jul-2013  riastradh Implement atomic_t and atomic_read in drm2's <linux/atomic.h> shim.
 1.1.2.1 24-Jul-2013  riastradh Add stubs for Linux header files for drm.
 1.3.6.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.3.6.1 01-Apr-2014  yamt file atomic.h was added on branch yamt-pagecache on 2014-05-22 11:40:56 +0000
 1.3.4.2 18-May-2014  rmind sync with head
 1.3.4.1 01-Apr-2014  rmind file atomic.h was added on branch rmind-smpnet on 2014-05-18 17:46:01 +0000
 1.3.2.1 10-Aug-2014  tls Rebase.
 1.7.30.3 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.7.30.2 08-Apr-2020  martin Merge changes from current as of 20200406
 1.7.30.1 10-Jun-2019  christos Sync with HEAD
 1.7.28.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.7.4.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.7.4.1 17-Jul-2014  tls file atomic.h was added on branch tls-maxphys on 2014-08-20 00:04:21 +0000
 1.21.2.1 29-Feb-2020  ad Sync with head.
 1.2 19-Dec-2021  riastradh Implement ewma API, exponentially weighted moving average.
 1.1 19-Dec-2021  riastradh Create stub headers for files included by drm code.


Author: Maya Rashish <maya@NetBSD.org>
 1.3 19-Dec-2021  riastradh Backlight enable/disable stubs.
 1.2 18-Mar-2014  riastradh branches: 1.2.4; 1.2.6; 1.2.10;
Merge riastradh-drm2 to HEAD.
 1.1 24-Jul-2013  riastradh branches: 1.1.2;
file backlight.h was initially added on branch riastradh-drm2.
 1.1.2.1 24-Jul-2013  riastradh Add stubs for Linux header files for drm.
 1.2.10.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.2.10.1 18-Mar-2014  tls file backlight.h was added on branch tls-maxphys on 2014-08-20 00:04:21 +0000
 1.2.6.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.2.6.1 18-Mar-2014  yamt file backlight.h was added on branch yamt-pagecache on 2014-05-22 11:40:56 +0000
 1.2.4.2 18-May-2014  rmind sync with head
 1.2.4.1 18-Mar-2014  rmind file backlight.h was added on branch rmind-smpnet on 2014-05-18 17:46:01 +0000
 1.2 19-Dec-2021  riastradh i915: another whack at it
 1.1 19-Dec-2021  riastradh Create stub headers for files included by drm code.


Author: Maya Rashish <maya@NetBSD.org>
 1.13 19-Dec-2021  riastradh amdgpu: Another pass through.

amdgpu_object.c
amdgpu_pci.c
amdgpu_pm.c
amdgpu_polaris10_smumgr.c
amdgpu_pp_psm.c
amdgpu_ppatomctrl.c
amdgpu_ppatomfwctrl.c
amdgpu_process_pptables_v1_0.o
amdgpu_psp.o
amdgpu_psp_v10_0.c
amdgpu_psp_v11_0.c
amdgpu_psp_v12_0.c
amdgpu_psp_v3_1.c
amdgpu_ras.c
amdgpu_ras_eeprom.c
amdgpu_rc_calc.c
amdgpu_rc_calc_dpi.c
amdgpu_ring.c
amdgpu_rlc.c
amdgpu_rn_clk_mgr.c
amdgpu_sdma_v3_0.c
amdgpu_sdma_v4_0.c
amdgpu_sdma_v5_0.c
amdgpu_si.c
amdgpu_si_dma.c
amdgpu_si_dpm.c
amdgpu_smu.c
amdgpu_smu10_hwmgr.c
amdgpu_smu7_hwmgr.c
amdgpu_smu8_hwmgr.c
amdgpu_smu8_smumgr.c
amdgpu_smu_v11_0.c (and a sprinkling of consts)
amdgpu_smu_v11_0_i2c.c
amdgpu_soc15.c
amdgpu_tonga_smumgr.c
amdgpu_ttm.c
amdgpu_ucode.c
amdgpu_uvd.c
amdgpu_uvd_v5_0.c
amdgpu_uvd_v6_0.c
amdgpu_uvd_v7_0.c
amdgpu_vce.c
amdgpu_vce_v2_0.c
amdgpu_vce_v4_0.c
amdgpu_vcn_v1_0.c
amdgpu_vcn_v2_0.c
amdgpu_vcn_v2_5.c
amdgpu_vega10_hwmgr.c
amdgpu_vega10_powertune.c
amdgpu_vega10_processpptables.c
amdgpu_vega10_reg_init.c
amdgpu_vega12_hwmgr.c
amdgpu_vega20_hwmgr.c
amdgpu_vega20_ppt.c
amdgpu_vega20_reg_init.c
amdgpu_vi.c
amdgpu_virt.c
amdgpu_vram_mgr.c
amdgpu_xgmi.c -- disable (for now?)
amdgpufb.c
 1.12 19-Dec-2021  riastradh drm: Another pass over i915 and some supporting logic.

This makes a shim around sg_table, which essentially represents two
things:

1. an array of pages (roughly corresponding to bus_dma_segment_t[])
2. an array of DMA addresses stored in a bus_dmamap_t

Both parts are optional; different parts of i915 use sg_tables to
pass around one or both of the two parts. This helps to reduce the
ifdefs by quite a bit, although it's not always clear which part of
an sg_table any particular interface is actually using which is why I
was reluctant to do this before.
 1.11 19-Dec-2021  riastradh drm/linux: Fix bitmap_zalloc size.
 1.10 19-Dec-2021  riastradh Provide bitmap_alloc


Author: Maya Rashish <maya@NetBSD.org>
Committer: Taylor R Campbell <riastradh@NetBSD.org>
 1.9 19-Dec-2021  riastradh bitmap_complement
 1.8 27-Aug-2018  riastradh Split bitmap_set/clear into begin/middle/end sections.

For clarity and speed. Largely from uwe@ with tweaks from me.
 1.7 27-Aug-2018  riastradh Name the number of words in bitmap_zero too.
 1.6 27-Aug-2018  riastradh Be consistent about nbits >= bpl.
 1.5 27-Aug-2018  riastradh Name bpl in bitmap_and/or. Fix and clarify comments.
 1.4 27-Aug-2018  riastradh Try setting and clearing the bits we meant, not other bits.

Fix comments to match intent while we're fixing reality too.
 1.3 27-Aug-2018  riastradh Implement Linux bitmap utilities.
 1.2 18-Mar-2014  riastradh branches: 1.2.4; 1.2.6; 1.2.10; 1.2.34; 1.2.36;
Merge riastradh-drm2 to HEAD.
 1.1 24-Jul-2013  riastradh branches: 1.1.2;
file bitmap.h was initially added on branch riastradh-drm2.
 1.1.2.1 24-Jul-2013  riastradh Add stubs for Linux header files for drm.
 1.2.36.1 10-Jun-2019  christos Sync with HEAD
 1.2.34.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.2.10.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.2.10.1 18-Mar-2014  tls file bitmap.h was added on branch tls-maxphys on 2014-08-20 00:04:21 +0000
 1.2.6.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.2.6.1 18-Mar-2014  yamt file bitmap.h was added on branch yamt-pagecache on 2014-05-22 11:40:56 +0000
 1.2.4.2 18-May-2014  rmind sync with head
 1.2.4.1 18-Mar-2014  rmind file bitmap.h was added on branch rmind-smpnet on 2014-05-18 17:46:01 +0000
 1.14 27-Aug-2018  riastradh move bitops.h so we can include it from kernel.h

match linux side-loading of this header.


Author: coypu <coypu@sdf.org>
Committer: Taylor R Campbell <riastradh@NetBSD.org>
 1.13 06-Aug-2018  riastradh Fix find_first_zero_bit to find the high bits of 64-bit words...oops.

XXX pullup
 1.12 06-Aug-2018  riastradh hweight32 should take uint32_t, not uint16_t. OOPS.

XXX pullup
 1.11 13-Oct-2015  riastradh branches: 1.11.10; 1.11.16; 1.11.18;
Fix comment in previous.
 1.10 13-Oct-2015  riastradh Fix indexing convention of Linux __ffs/__ffs64 shims.

They reject zero input, and yield zero-based indexing, unlike our
ffs/ffs64, which return zero for zero and yield one-based indexing.

May let nouveau make a little more progress toward booting!

Found by mrg@.
 1.9 25-Feb-2015  riastradh Add hweight8 (hamming weight of 8-bit quantity).
 1.8 23-Aug-2014  riastradh branches: 1.8.2;
Another round of nouveau whack-a-mole.
 1.7 06-Aug-2014  riastradh branches: 1.7.2; 1.7.4;
Add Linux __ffs64.
 1.6 17-Jul-2014  riastradh Correct return values of Linux test-and-set operations (PR 48999).

Linux's Documentation/atomic_ops.txt says in no uncertain terms these
must return 0 or 1, not zero or nonzero. I don't think this has
caused an issue for drm (yet), but better to have it right.
 1.5 17-Jul-2014  riastradh Add non-atomic Linux test-and-set operations.
 1.4 16-Jul-2014  riastradh First whack at radeon driver.

No hardware to test yet, but it builds.
 1.3 16-Jul-2014  riastradh Make it build and boot on my test machines.

Screen blanks on boot on the Ivy Bridge system with

DRM error in cpt_serr_int_handler: PCH transcoder A FIFO underrun

But after that everything is OK. Appears to be an upstream problem.
To investigate...

I think there's a cache flushing issue somewhere -- there are little
display artefacts on my T60.
 1.2 18-Mar-2014  riastradh branches: 1.2.2; 1.2.4; 1.2.6;
Merge riastradh-drm2 to HEAD.
 1.1 24-Jul-2013  riastradh branches: 1.1.2;
file bitops.h was initially added on branch riastradh-drm2.
 1.1.2.3 08-Sep-2013  riastradh Add Linuxoid non-atomic __set/clear_bit to <linux/bitops.h>.
 1.1.2.2 24-Jul-2013  riastradh Implement hweight16 in <linux/bitops.h>.
 1.1.2.1 24-Jul-2013  riastradh Add stubs for Linux header files for drm.
 1.2.6.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.2.6.1 18-Mar-2014  yamt file bitops.h was added on branch yamt-pagecache on 2014-05-22 11:40:56 +0000
 1.2.4.2 18-May-2014  rmind sync with head
 1.2.4.1 18-Mar-2014  rmind file bitops.h was added on branch rmind-smpnet on 2014-05-18 17:46:01 +0000
 1.2.2.1 10-Aug-2014  tls Rebase.
 1.7.4.3 03-Dec-2017  jdolecek update from HEAD
 1.7.4.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.7.4.1 06-Aug-2014  tls file bitops.h was added on branch tls-maxphys on 2014-08-20 00:04:21 +0000
 1.7.2.3 06-Nov-2015  riz Pull up following revision(s) (requested by riastradh in ticket #1001):
sys/external/bsd/drm2/include/linux/bitops.h: revision 1.10
sys/external/bsd/drm2/include/linux/bitops.h: revision 1.11
Fix indexing convention of Linux __ffs/__ffs64 shims.
They reject zero input, and yield zero-based indexing, unlike our
ffs/ffs64, which return zero for zero and yield one-based indexing.
May let nouveau make a little more progress toward booting!
Found by mrg@.
Fix comment in previous.
 1.7.2.2 06-Mar-2015  snj Pull up following revision(s) (requested by mrg in ticket #573):
sys/external/bsd/common/include/linux/kernel.h: 1.5, 1.6
sys/external/bsd/drm2/dist/drm/drm_ioctl.c: 1.4
sys/external/bsd/drm2/dist/drm/drm_irq.c: 1.6-1.8
sys/external/bsd/drm2/dist/drm/i915/i915_dma.c: 1.13-1.15
sys/external/bsd/drm2/dist/drm/i915/i915_gem.c: 1.23-1.27
sys/external/bsd/drm2/dist/drm/i915/i915_gem_execbuffer.c: 1.5
sys/external/bsd/drm2/dist/drm/i915/intel_display.c: 1.14, 1.15
sys/external/bsd/drm2/dist/drm/i915/intel_dp.c: 1.10
sys/external/bsd/drm2/dist/drm/i915/intel_drv.h: 1.8
sys/external/bsd/drm2/dist/drm/i915/intel_i2c.c: 1.8-1.13
sys/external/bsd/drm2/dist/drm/i915/intel_pm.c: 1.6
sys/external/bsd/drm2/dist/drm/i915/intel_ringbuffer.c: 1.5, 1.6
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/device/nouveau_engine_device_base.c: 1.4
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/fifo/nouveau_engine_fifo_nvc0.c: 1.3, 1.4
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/fifo/nouveau_engine_fifo_nve0.c: 1.3, 1.4
sys/external/bsd/drm2/dist/drm/nouveau/core/include/core/device.h: 1.4
sys/external/bsd/drm2/dist/drm/nouveau/core/include/subdev/mc.h: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/include/subdev/pwr.h: 1.3, 1.4
sys/external/bsd/drm2/dist/drm/nouveau/core/os.h: 1.4, 1.5
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/bios/nouveau_subdev_bios_base.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/bios/nouveau_subdev_bios_pll.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/clock/nouveau_subdev_clock_base.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/clock/nouveau_subdev_clock_nv50.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/devinit/fbmem.h: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/devinit/nouveau_subdev_devinit_nv04.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/fb/nouveau_subdev_fb_nv50.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/fb/nouveau_subdev_fb_nvc0.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/fb/nv50.h: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/fb/nvc0.h: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/mc/nouveau_subdev_mc_base.c: 1.2, 1.3
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/mxm/nouveau_subdev_mxm_nv50.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/pwr/nouveau_subdev_pwr_base.c: 1.3, 1.4
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/therm/nouveau_subdev_therm_ic.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/timer/nouveau_subdev_timer_nv04.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/vm/nouveau_subdev_vm_base.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/vm/nouveau_subdev_vm_nv04.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/vm/nouveau_subdev_vm_nv44.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/vm/nv04.h: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_bo.h: 1.3
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_drm.c: 1.4, 1.5
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_fbcon.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_nv50_display.c: 1.3
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_nv84_fence.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_ttm.c: 1.3
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_ttm.h: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_vga.h: 1.2
sys/external/bsd/drm2/dist/drm/radeon/radeon_fence.c: 1.6-1.8
sys/external/bsd/drm2/dist/drm/radeon/radeon_pm.c: 1.3
sys/external/bsd/drm2/dist/drm/radeon/rs400.c: 1.3
sys/external/bsd/drm2/dist/drm/via/via_dmablit.c: 1.3, 1.4
sys/external/bsd/drm2/dist/drm/via/via_drv.h: 1.3
sys/external/bsd/drm2/dist/drm/via/via_irq.c: 1.3, 1.4
sys/external/bsd/drm2/dist/drm/via/via_video.c: 1.3, 1.4
sys/external/bsd/drm2/dist/include/drm/drmP.h: 1.10
sys/external/bsd/drm2/dist/include/drm/drm_crtc.h: 1.4
sys/external/bsd/drm2/dist/include/drm/drm_modes.h: 1.3
sys/external/bsd/drm2/dist/uapi/drm/i915_drm.h: 1.2
sys/external/bsd/drm2/drm/drm_cache.c: 1.4-1.6
sys/external/bsd/drm2/drm/drm_drv.c: 1.14
sys/external/bsd/drm2/drm/drm_module.c: 1.10
sys/external/bsd/drm2/drm/drm_sysctl.c: 1.5
sys/external/bsd/drm2/drm/drm_vma_manager.c: 1.2
sys/external/bsd/drm2/drm/drmfb.c: 1.1
sys/external/bsd/drm2/drm/files.drmkms: 1.10, 1.11
sys/external/bsd/drm2/i2c/drm_encoder_slave.c: 1.1
sys/external/bsd/drm2/i915drm/files.i915drmkms: 1.7, 1.10
sys/external/bsd/drm2/i915drm/intelfb.c: 1.11, 1.12
sys/external/bsd/drm2/include/asm/io.h: 1.4
sys/external/bsd/drm2/include/asm/unaligned.h: 1.2, 1.3
sys/external/bsd/drm2/include/drm/drm_encoder_slave.h: 1.1
sys/external/bsd/drm2/include/drm/drm_wait_netbsd.h: 1.7-1.11
sys/external/bsd/drm2/include/drm/drmfb.h: 1.1
sys/external/bsd/drm2/include/drm/drmfb_pci.h: 1.1, 1.2
sys/external/bsd/drm2/include/linux/bitops.h: 1.9
sys/external/bsd/drm2/include/linux/i2c.h: 1.7, 1.8
sys/external/bsd/drm2/include/linux/io-mapping.h: 1.5
sys/external/bsd/drm2/include/linux/moduleparam.h: 1.5
sys/external/bsd/drm2/include/linux/pci.h: 1.12-1.15
sys/external/bsd/drm2/include/linux/pm.h: 1.4
sys/external/bsd/drm2/include/linux/reboot.h: 1.2
sys/external/bsd/drm2/include/linux/slab.h: 1.5
sys/external/bsd/drm2/include/linux/string.h: 1.4
sys/external/bsd/drm2/include/linux/vgaarb.h: 1.3
sys/external/bsd/drm2/include/linux/ww_mutex.h: 1.10
sys/external/bsd/drm2/linux/files.drmkms_linux: 1.8
sys/external/bsd/drm2/linux/linux_i2c.c: 1.3
sys/external/bsd/drm2/linux/linux_ww_mutex.c: 1.1
sys/external/bsd/drm2/nouveau/files.nouveau: 1.5-1.8
sys/external/bsd/drm2/nouveau/nouveau_pci.c: 1.1-1.3
sys/external/bsd/drm2/nouveau/nouveau_pci.h: 1.1
sys/external/bsd/drm2/nouveau/nouveau_sysfs.c: 1.1
sys/external/bsd/drm2/nouveau/nouveau_vga.c: 1.1
sys/external/bsd/drm2/nouveau/nouveaufb.c: 1.1
sys/external/bsd/drm2/nouveau/nouveaufb.h: 1.1
sys/external/bsd/drm2/pci/drm_pci.c: 1.10-1.12
sys/external/bsd/drm2/pci/drm_pci_module.c: 1.4
sys/external/bsd/drm2/pci/drmfb_pci.c: 1.1-1.3
sys/external/bsd/drm2/pci/files.drmkms_pci: 1.5
sys/external/bsd/drm2/radeon/radeon_pci.c: 1.5-1.7
sys/modules/drmkms/Makefile: 1.8, 1.9
sys/modules/drmkms_linux/Makefile: 1.6
sys/modules/drmkms_pci/Makefile: 1.5
sync drm2 with HEAD.
 1.7.2.1 21-Sep-2014  snj Pull up following revision(s) (requested by riastradh in ticket #95):
sys/external/bsd/drm2/dist/drm/nouveau/core/include/subdev/fb.h: revision 1.2
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_nv10_fence.c: revision 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/bar/nouveau_subdev_bar_base.c: revision 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/include/engine/device.h: revision 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/include/subdev/pwr.h: revision 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/nouveau_engine_xtensa.c: revision 1.2
sys/external/bsd/drm2/include/linux/bitops.h: revision 1.8
sys/external/bsd/drm2/dist/drm/nouveau/dispnv04/nouveau_dispnv04_tvnv17.c: revision 1.3
sys/external/bsd/drm2/dist/drm/nouveau/dispnv04/nouveau_dispnv04_tvmodesnv17.c: revision 1.3
sys/external/bsd/drm2/dist/drm/nouveau/core/include/core/device.h: revision 1.3
sys/external/bsd/drm2/include/drm/drm_agp_netbsd.h: revision 1.4
sys/external/bsd/drm2/include/linux/spinlock.h: revision 1.4
sys/external/bsd/drm2/include/linux/pm_runtime.h: revision 1.3
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/crypt/nouveau_engine_crypt_nv98.c: revision 1.2
sys/external/bsd/drm2/nouveau/files.nouveau: revision 1.3
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/disp/nouveau_engine_disp_dacnv50.c: revision 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/fifo/nouveau_engine_fifo_nve0.c: revision 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/disp/nouveau_engine_disp_nv50.c: revision 1.2
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_gem.c: revision 1.3
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_bo.c: revision 1.5
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/perfmon/nouveau_engine_perfmon_base.c: revision 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/crypt/nouveau_engine_crypt_nv84.c: revision 1.2
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_fence.c: revision 1.3
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/graph/nouveau_engine_graph_nv50.c: revision 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/fifo/nouveau_engine_fifo_nvc0.c: revision 1.2
sys/external/bsd/drm2/include/linux/vmalloc.h: revision 1.4
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/fifo/nve0.h: revision 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/instmem/nv04.h: revision 1.2
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_drm.c: revision 1.3
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_drm.h: revision 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/fifo/nouveau_engine_fifo_base.c: revision 1.3
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/disp/nouveau_engine_disp_nvd0.c: revision 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/disp/nouveau_engine_disp_nv04.c: revision 1.2
sys/external/bsd/drm2/nouveau/nouveau_module.c: revision 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/instmem/nouveau_subdev_instmem_nv40.c: revision 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/graph/nouveau_engine_graph_gm107.c: revision 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/graph/nouveau_engine_graph_ctxnvd7.c: revision 1.2
sys/external/bsd/drm2/include/linux/mutex.h: revision 1.7
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/disp/nv50.h: revision 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/device/nouveau_engine_device_base.c: revision 1.3
sys/external/bsd/drm2/include/linux/i2c.h: revision 1.6
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/graph/nouveau_engine_graph_nvc0.c: revision 1.2
sys/external/bsd/drm2/include/linux/pagemap.h: revision 1.3
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/instmem/nouveau_subdev_instmem_nv04.c: revision 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/copy/nouveau_engine_copy_nva3.c: revision 1.2
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_nv50_display.c: revision 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/include/subdev/bar.h: revision 1.3
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/pwr/nouveau_subdev_pwr_base.c: revision 1.2
Another round of nouveau whack-a-mole.
 1.8.2.2 27-Dec-2015  skrll Sync with HEAD (as of 26th Dec)
 1.8.2.1 06-Apr-2015  skrll Sync with HEAD
 1.11.18.1 10-Jun-2019  christos Sync with HEAD
 1.11.16.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.11.10.1 31-Aug-2018  martin Pull up following revision(s) (requested by riastradh in ticket #997):

sys/external/bsd/drm2/i915drm/intel_gtt.c: revision 1.6
sys/external/bsd/drm2/include/linux/delay.h: revision 1.5
sys/external/bsd/common/include/linux/kernel.h: revision 1.9
sys/external/bsd/drm2/include/linux/vmalloc.h: revision 1.5
sys/external/bsd/drm2/include/linux/bitops.h: revision 1.12
sys/external/bsd/drm2/include/linux/bitops.h: revision 1.13

hweight32 should take uint32_t, not uint16_t. OOPS.
XXX pullup

Fix find_first_zero_bit to find the high bits of 64-bit words...oops.
XXX pullup

Use uvm_km_alloc(kernel_map) and pmap_kenter, not uvm_pagermapin.
XXX pullup

Flush chipset writes after GGTT update.

Echoes Linux commit:

commit 8516673a996870ea0ceb337ee4f83c33c5ec3111
Author: Chris Wilson <chris%chris-wilson.co.uk@localhost>
Date: Fri Dec 8 21:46:16 2017 +0000
agp/intel: Flush all chipset writes after updating the GGTT
Before accessing the GGTT we must flush the PTE writes and make them
visible to the chipset, or else the indirect access may end up in the
wrong page. In commit 3497971a71d8 ("agp/intel: Flush chipset writes
after updating a single PTE"), we noticed corruption of the uploads for
pwrite and for capturing GPU error states, but it was presumed that the
explicit calls to intel_gtt_chipset_flush() were sufficient for the
execbuffer path. However, we have not been flushing the chipset between
the PTE writes and access via the GTT itself.
For simplicity, do the flush after any PTE update rather than try and
batch the flushes on a just-in-time basis.
References: 3497971a71d8 ("agp/intel: Flush chipset writes after updating a single PTE")
Signed-off-by: Chris Wilson <chris%chris-wilson.co.uk@localhost>
Cc: Tvrtko Ursulin <tvrtko.ursulin%intel.com@localhost>
Cc: Mika Kuoppala <mika.kuoppala%intel.com@localhost>
Cc: drm-intel-fixes%lists.freedesktop.org@localhost
Reviewed-by: Joonas Lahtinen <joonas.lahtinen%linux.intel.com@localhost>
Link: https://patchwork.freedesktop.org/patch/msgid/20171208214616.30147-1-chris%chris-wilson.co.uk@localhost

XXX pullup


Round nsec up for usec delay.
XXX pullup


libkern min/max is 32-bit. Linux min/max is generic. @!*#@!$&
XXX pullup
 1.2 19-Dec-2021  riastradh Add a BIT_MASK in bits.h, move it to common so bitops.h can sideload

match linux.


Author: Maya Rashish <maya@NetBSD.org>
 1.1 19-Dec-2021  riastradh Create stub headers for files included by drm code.


Author: Maya Rashish <maya@NetBSD.org>
 1.4 19-Dec-2021  riastradh Move linux/bug.h and asm/bug.h to common.
 1.3 16-Jul-2014  riastradh branches: 1.3.4;
Make it build and boot on my test machines.

Screen blanks on boot on the Ivy Bridge system with

DRM error in cpt_serr_int_handler: PCH transcoder A FIFO underrun

But after that everything is OK. Appears to be an upstream problem.
To investigate...

I think there's a cache flushing issue somewhere -- there are little
display artefacts on my T60.
 1.2 18-Mar-2014  riastradh branches: 1.2.2; 1.2.4; 1.2.6;
Merge riastradh-drm2 to HEAD.
 1.1 24-Jul-2013  riastradh branches: 1.1.2;
file bug.h was initially added on branch riastradh-drm2.
 1.1.2.1 24-Jul-2013  riastradh Add stubs for Linux header files for drm.
 1.2.6.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.2.6.1 18-Mar-2014  yamt file bug.h was added on branch yamt-pagecache on 2014-05-22 11:40:56 +0000
 1.2.4.2 18-May-2014  rmind sync with head
 1.2.4.1 18-Mar-2014  rmind file bug.h was added on branch rmind-smpnet on 2014-05-18 17:46:01 +0000
 1.2.2.1 10-Aug-2014  tls Rebase.
 1.3.4.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.3.4.1 16-Jul-2014  tls file bug.h was added on branch tls-maxphys on 2014-08-20 00:04:21 +0000
 1.2 19-Dec-2021  riastradh linux: Move BUILD_BUG_* to common linux/build_bug.h.
 1.1 19-Dec-2021  riastradh Create stub headers for files included by drm code.


Author: Maya Rashish <maya@NetBSD.org>
 1.1 19-Dec-2021  riastradh More Linux header stubs.

Let's just use empty header files until we actually populate these.
Save a bit of disk space...
 1.3 19-Dec-2021  riastradh CAP_SYS_NICE
 1.2 14-Feb-2020  tnn branches: 1.2.2; 1.2.6;
fix a typo, caught by -Werror,-Wheader-guard
 1.1 14-Feb-2020  riastradh Reduce diffs by nixing DRM_SUSER macro, deleted upstream long ago.

Instead stub Linux capable(CAP_SYS_ADMIN).
 1.2.6.2 08-Apr-2020  martin Merge changes from current as of 20200406
 1.2.6.1 14-Feb-2020  martin file capability.h was added on branch phil-wifi on 2020-04-08 14:08:27 +0000
 1.2.2.2 29-Feb-2020  ad Sync with head.
 1.2.2.1 14-Feb-2020  ad file capability.h was added on branch ad-namecache on 2020-02-29 20:20:17 +0000
 1.2 18-Mar-2014  riastradh branches: 1.2.4; 1.2.6; 1.2.10;
Merge riastradh-drm2 to HEAD.
 1.1 24-Jul-2013  riastradh branches: 1.1.2;
file cdev.h was initially added on branch riastradh-drm2.
 1.1.2.1 24-Jul-2013  riastradh Add stubs for Linux header files for drm.
 1.2.10.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.2.10.1 18-Mar-2014  tls file cdev.h was added on branch tls-maxphys on 2014-08-20 00:04:21 +0000
 1.2.6.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.2.6.1 18-Mar-2014  yamt file cdev.h was added on branch yamt-pagecache on 2014-05-22 11:40:56 +0000
 1.2.4.2 18-May-2014  rmind sync with head
 1.2.4.1 18-Mar-2014  rmind file cdev.h was added on branch rmind-smpnet on 2014-05-18 17:46:01 +0000
 1.2 27-Aug-2018  riastradh branches: 1.2.2; 1.2.6;
Populate circ_buf.h with CIRC_SPACE.
 1.1 27-Aug-2018  riastradh local versions of headers required


Author: coypu <coypu@sdf.org>
Committer: Taylor R Campbell <riastradh@NetBSD.org>
 1.2.6.2 10-Jun-2019  christos Sync with HEAD
 1.2.6.1 27-Aug-2018  christos file circ_buf.h was added on branch phil-wifi on 2019-06-10 22:08:31 +0000
 1.2.2.2 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.2.2.1 27-Aug-2018  pgoyette file circ_buf.h was added on branch pgoyette-compat on 2018-09-06 06:56:36 +0000
 1.3 27-Aug-2018  riastradh branches: 1.3.2; 1.3.6;
Stub out clk API if no FBT.
 1.2 27-Aug-2018  riastradh Our clk API already echoes Linux's, it seems.
 1.1 27-Aug-2018  riastradh Stub <linux/clk.h>.
 1.3.6.2 10-Jun-2019  christos Sync with HEAD
 1.3.6.1 27-Aug-2018  christos file clk.h was added on branch phil-wifi on 2019-06-10 22:08:31 +0000
 1.3.2.2 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.3.2.1 27-Aug-2018  pgoyette file clk.h was added on branch pgoyette-compat on 2018-09-06 06:56:36 +0000
 1.2 18-Mar-2014  riastradh branches: 1.2.4; 1.2.6; 1.2.10;
Merge riastradh-drm2 to HEAD.
 1.1 24-Jul-2013  riastradh branches: 1.1.2;
file compat.h was initially added on branch riastradh-drm2.
 1.1.2.1 24-Jul-2013  riastradh Add stubs for Linux header files for drm.
 1.2.10.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.2.10.1 18-Mar-2014  tls file compat.h was added on branch tls-maxphys on 2014-08-20 00:04:21 +0000
 1.2.6.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.2.6.1 18-Mar-2014  yamt file compat.h was added on branch yamt-pagecache on 2014-05-22 11:40:56 +0000
 1.2.4.2 18-May-2014  rmind sync with head
 1.2.4.1 18-Mar-2014  rmind file compat.h was added on branch rmind-smpnet on 2014-05-18 17:46:01 +0000
 1.2 19-Dec-2021  riastradh Move <linux/compiler.h> to common.
 1.1 19-Dec-2021  riastradh Stub linux compiler.h, scatterlist.h, seqlock.h, sort.h.
 1.4 01-Apr-2014  riastradh Move <linux/completion.h> from drm2 to external/bsd/common.
 1.3 01-Apr-2014  riastradh Add some more Linux completion operations.

Adapted from a patch by nick@.
 1.2 18-Mar-2014  riastradh Merge riastradh-drm2 to HEAD.
 1.1 24-Jul-2013  riastradh branches: 1.1.2;
file completion.h was initially added on branch riastradh-drm2.
 1.1.2.6 07-Mar-2014  riastradh Fix return value of wait_for_completion_interruptible_timeout.
 1.1.2.5 08-Sep-2013  riastradh Destroy the mutex too in destroy_completion.
 1.1.2.4 08-Sep-2013  riastradh Implement destroy_completion in <linux/completion.h>.
 1.1.2.3 24-Jul-2013  riastradh Fix pointer nature of INIT_COMPLETION in <linux/completion.h>.
 1.1.2.2 24-Jul-2013  riastradh Rework <linux/completion.h> to match Linux semantics.
 1.1.2.1 24-Jul-2013  riastradh Add <linux/completion.h>.

A completion is a synchronized waitable `done' flag. Trivial
condvar/mutex/bool.
 1.1 27-Aug-2018  riastradh branches: 1.1.2; 1.1.6;
Add stub headers to be filled in as needed.
 1.1.6.2 10-Jun-2019  christos Sync with HEAD
 1.1.6.1 27-Aug-2018  christos file component.h was added on branch phil-wifi on 2019-06-10 22:08:31 +0000
 1.1.2.2 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.1.2.1 27-Aug-2018  pgoyette file component.h was added on branch pgoyette-compat on 2018-09-06 06:56:36 +0000
 1.3 14-Feb-2020  riastradh Stub out console_lock/unlock and drm_fb_helper_set_suspend.

Reduce some more diffs.
 1.2 18-Mar-2014  riastradh branches: 1.2.4; 1.2.6; 1.2.10; 1.2.36; 1.2.42;
Merge riastradh-drm2 to HEAD.
 1.1 24-Jul-2013  riastradh branches: 1.1.2;
file console.h was initially added on branch riastradh-drm2.
 1.1.2.1 24-Jul-2013  riastradh Add stubs for Linux header files for drm.
 1.2.42.1 29-Feb-2020  ad Sync with head.
 1.2.36.1 08-Apr-2020  martin Merge changes from current as of 20200406
 1.2.10.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.2.10.1 18-Mar-2014  tls file console.h was added on branch tls-maxphys on 2014-08-20 00:04:21 +0000
 1.2.6.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.2.6.1 18-Mar-2014  yamt file console.h was added on branch yamt-pagecache on 2014-05-22 11:40:56 +0000
 1.2.4.2 18-May-2014  rmind sync with head
 1.2.4.1 18-Mar-2014  rmind file console.h was added on branch rmind-smpnet on 2014-05-18 17:46:01 +0000
 1.4 19-Dec-2021  riastradh linux: Use sys/cpu.h, not machine/cpu.h.
 1.3 19-Dec-2021  riastradh Provide cpufreq.h


Author: Maya Rashish <maya@NetBSD.org>
Committer: Taylor R Campbell <riastradh@NetBSD.org>
 1.2 18-Mar-2014  riastradh branches: 1.2.4; 1.2.6; 1.2.10;
Merge riastradh-drm2 to HEAD.
 1.1 24-Jul-2013  riastradh branches: 1.1.2;
file cpufreq.h was initially added on branch riastradh-drm2.
 1.1.2.1 24-Jul-2013  riastradh Add stubs for Linux header files for drm.
 1.2.10.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.2.10.1 18-Mar-2014  tls file cpufreq.h was added on branch tls-maxphys on 2014-08-20 00:04:21 +0000
 1.2.6.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.2.6.1 18-Mar-2014  yamt file cpufreq.h was added on branch yamt-pagecache on 2014-05-22 11:40:56 +0000
 1.2.4.2 18-May-2014  rmind sync with head
 1.2.4.1 18-Mar-2014  rmind file cpufreq.h was added on branch rmind-smpnet on 2014-05-18 17:46:01 +0000
 1.2 20-Jul-2014  prlw1 branches: 1.2.2; 1.2.6;
The lua 5.1 to 5.3 update added isprint to libkern.h
 1.1 16-Jul-2014  riastradh Make it build and boot on my test machines.

Screen blanks on boot on the Ivy Bridge system with

DRM error in cpt_serr_int_handler: PCH transcoder A FIFO underrun

But after that everything is OK. Appears to be an upstream problem.
To investigate...

I think there's a cache flushing issue somewhere -- there are little
display artefacts on my T60.
 1.2.6.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.2.6.1 20-Jul-2014  tls file ctype.h was added on branch tls-maxphys on 2014-08-20 00:04:21 +0000
 1.2.2.2 10-Aug-2014  tls Rebase.
 1.2.2.1 20-Jul-2014  tls file ctype.h was added on branch tls-earlyentropy on 2014-08-10 06:55:39 +0000
 1.2 18-Mar-2014  riastradh branches: 1.2.4; 1.2.6; 1.2.10;
Merge riastradh-drm2 to HEAD.
 1.1 24-Jul-2013  riastradh branches: 1.1.2;
file debugfs.h was initially added on branch riastradh-drm2.
 1.1.2.1 24-Jul-2013  riastradh Add stubs for Linux header files for drm.
 1.2.10.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.2.10.1 18-Mar-2014  tls file debugfs.h was added on branch tls-maxphys on 2014-08-20 00:04:21 +0000
 1.2.6.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.2.6.1 18-Mar-2014  yamt file debugfs.h was added on branch yamt-pagecache on 2014-05-22 11:40:56 +0000
 1.2.4.2 18-May-2014  rmind sync with head
 1.2.4.1 18-Mar-2014  rmind file debugfs.h was added on branch rmind-smpnet on 2014-05-18 17:46:01 +0000
 1.1 19-Dec-2021  riastradh Create stub headers for files included by drm code.


Author: Maya Rashish <maya@NetBSD.org>
 1.8 19-Dec-2021  riastradh match linux side-loading


Author: Maya Rashish <maya@NetBSD.org>
 1.7 31-May-2021  riastradh drm: sys/param.h, not machine/param.h, for DELAY.
 1.6 14-Feb-2020  riastradh branches: 1.6.10; 1.6.12;
Placate -Wsign-compare.
 1.5 06-Aug-2018  riastradh branches: 1.5.6;
Round nsec up for usec delay.

XXX pullup
 1.4 19-Feb-2016  skrll branches: 1.4.10; 1.4.16; 1.4.18;
In msleep use mdelay if cold
 1.3 16-Jul-2014  riastradh branches: 1.3.2; 1.3.4; 1.3.6;
Make it build and boot on my test machines.

Screen blanks on boot on the Ivy Bridge system with

DRM error in cpt_serr_int_handler: PCH transcoder A FIFO underrun

But after that everything is OK. Appears to be an upstream problem.
To investigate...

I think there's a cache flushing issue somewhere -- there are little
display artefacts on my T60.
 1.2 18-Mar-2014  riastradh branches: 1.2.2; 1.2.4; 1.2.6;
Merge riastradh-drm2 to HEAD.
 1.1 24-Jul-2013  riastradh branches: 1.1.2;
file delay.h was initially added on branch riastradh-drm2.
 1.1.2.6 24-Jul-2013  riastradh Use mdelay for msleep of less than one tick.
 1.1.2.5 24-Jul-2013  riastradh Make udelay a static inline in <linux/delay.h>.
 1.1.2.4 24-Jul-2013  riastradh Add mdelay to <linux/delay.h>.
 1.1.2.3 24-Jul-2013  riastradh <linux/delay.h> needs <sys/kernel.h> for hz (in mstohz).
 1.1.2.2 24-Jul-2013  riastradh Implement udelay (DELAY) and msleep (kpause) in <linux/delay.h>.
 1.1.2.1 24-Jul-2013  riastradh Add stubs for Linux header files for drm.
 1.2.6.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.2.6.1 18-Mar-2014  yamt file delay.h was added on branch yamt-pagecache on 2014-05-22 11:40:56 +0000
 1.2.4.2 18-May-2014  rmind sync with head
 1.2.4.1 18-Mar-2014  rmind file delay.h was added on branch rmind-smpnet on 2014-05-18 17:46:01 +0000
 1.2.2.1 10-Aug-2014  tls Rebase.
 1.3.6.1 19-Mar-2016  skrll Sync with HEAD
 1.3.4.3 03-Dec-2017  jdolecek update from HEAD
 1.3.4.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.3.4.1 16-Jul-2014  tls file delay.h was added on branch tls-maxphys on 2014-08-20 00:04:21 +0000
 1.3.2.1 15-Apr-2016  snj Pull up following revision(s) (requested by riastradh in ticket #1157):
sys/external/bsd/drm2/dist/drm/nouveau/core/core/nouveau_core_subdev.c: revision 1.3
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/device/nouveau_engine_device_base.c: revisions 1.9, 1.10
sys/external/bsd/drm2/dist/drm/nouveau/core/include/core/namedb.h: revision 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/bar/nouveau_subdev_bar_base.c: revisions 1.4, 1.5
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/instmem/nouveau_subdev_instmem_nv40.c: revision 1.3
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_drm.c: revision 1.8
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_drm.h: revision 1.4
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_fence.c: revision 1.4
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_nv10_fence.c: revision 1.3
sys/external/bsd/drm2/include/linux/delay.h: revision 1.4
sys/external/bsd/drm2/include/linux/spinlock.h: revision 1.7
sys/external/bsd/drm2/nouveau/files.nouveau: revision 1.14
sys/external/bsd/drm2/nouveau/nouveau_pci.c: revision 1.7
Set nouveau to a more reasonable debug level.
Match the compile-time and default run-time settings in Linux.
--
Pass a sensible device state pointer to nouveau suspend/resume ops.
Gives nouveau half a chance of suspending and resuming -- not that it
works on my test laptop yet, but it's a start.
--
Fix bus_space_subregion error branch.
Return error code, not 0 (!), on bus_space_subregion failure.
In answer to `XXX error branch' comment: if nouveau_barobj_ctor
fails, then the caller will call nouveau_barobj_dtor too. So there's
no leak here.
Unlikely to fix any observed bugs with nouveau -- there's no error
branch in the Linux side here. But maybe it will catch some other
bug earlier.
--
Map the same mmio size as Linux does.
Unlikely to have practical consequences -- just reduces differences
in behaviour from upstream, to rule them out.
--
Print error code for failure to map PRAMIN BAR.
--
In msleep use mdelay if cold
--
Use only the low 32 bits of the bar object's vma offset as intended.
Should fix PR kern/50372, seen by everyone trying to use nouveau on
amd64 with hardware that uses nv50-style BARs and not nvc0-style
BARs.
--
Destroy the lock before caller frees memory.
--
Destroy spin locks appropriately.
--
Destroy the mutex before free.
--
Provide reader/writer semantics with recursive readers.
--
Exclude VRAM and FIFO regions from MMIO register mapping.
Nouveau maps those separately, and it is not trivial to convert those
mappings to bus_space_subregion.
 1.4.18.2 08-Apr-2020  martin Merge changes from current as of 20200406
 1.4.18.1 10-Jun-2019  christos Sync with HEAD
 1.4.16.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.4.10.1 31-Aug-2018  martin Pull up following revision(s) (requested by riastradh in ticket #997):

sys/external/bsd/drm2/i915drm/intel_gtt.c: revision 1.6
sys/external/bsd/drm2/include/linux/delay.h: revision 1.5
sys/external/bsd/common/include/linux/kernel.h: revision 1.9
sys/external/bsd/drm2/include/linux/vmalloc.h: revision 1.5
sys/external/bsd/drm2/include/linux/bitops.h: revision 1.12
sys/external/bsd/drm2/include/linux/bitops.h: revision 1.13

hweight32 should take uint32_t, not uint16_t. OOPS.
XXX pullup

Fix find_first_zero_bit to find the high bits of 64-bit words...oops.
XXX pullup

Use uvm_km_alloc(kernel_map) and pmap_kenter, not uvm_pagermapin.
XXX pullup

Flush chipset writes after GGTT update.

Echoes Linux commit:

commit 8516673a996870ea0ceb337ee4f83c33c5ec3111
Author: Chris Wilson <chris%chris-wilson.co.uk@localhost>
Date: Fri Dec 8 21:46:16 2017 +0000
agp/intel: Flush all chipset writes after updating the GGTT
Before accessing the GGTT we must flush the PTE writes and make them
visible to the chipset, or else the indirect access may end up in the
wrong page. In commit 3497971a71d8 ("agp/intel: Flush chipset writes
after updating a single PTE"), we noticed corruption of the uploads for
pwrite and for capturing GPU error states, but it was presumed that the
explicit calls to intel_gtt_chipset_flush() were sufficient for the
execbuffer path. However, we have not been flushing the chipset between
the PTE writes and access via the GTT itself.
For simplicity, do the flush after any PTE update rather than try and
batch the flushes on a just-in-time basis.
References: 3497971a71d8 ("agp/intel: Flush chipset writes after updating a single PTE")
Signed-off-by: Chris Wilson <chris%chris-wilson.co.uk@localhost>
Cc: Tvrtko Ursulin <tvrtko.ursulin%intel.com@localhost>
Cc: Mika Kuoppala <mika.kuoppala%intel.com@localhost>
Cc: drm-intel-fixes%lists.freedesktop.org@localhost
Reviewed-by: Joonas Lahtinen <joonas.lahtinen%linux.intel.com@localhost>
Link: https://patchwork.freedesktop.org/patch/msgid/20171208214616.30147-1-chris%chris-wilson.co.uk@localhost

XXX pullup


Round nsec up for usec delay.
XXX pullup


libkern min/max is 32-bit. Linux min/max is generic. @!*#@!$&
XXX pullup
 1.5.6.1 29-Feb-2020  ad Sync with head.
 1.6.12.1 31-May-2021  cjep sync with head
 1.6.10.1 17-Jun-2021  thorpej Sync w/ HEAD.
 1.17 29-Jul-2022  riastradh drm: Reduce verbosity of drm kernel messages.
 1.16 17-Jul-2022  riastradh drm: Ifdef out devm_* stuff rather than stub it out.

Stub is not helpful, and this pollutes the symbol namespace.
 1.15 19-Dec-2021  riastradh drm: Downgrade warnings from aprint_error to aprint_normal.
 1.14 19-Dec-2021  riastradh Make intel_psr.c build
netbsd-ify
Stub out intel_lpe_audio.c (for now?).
Hammer intel_opregion.c into shape.
Hack up intel_lrc.c
Adapt intel_reset.c
Stub out intel_region_lmem.c
Adapt intel_ring_submission.c
Adapt intel_rps.c
Adapt intel_sdvo.c
Adapt intel_runtime_pm.c
Adapt intel_sideband.c
Adapt intel_sprite.c
Adapt intel_tv.c
Adapt intel_tc.c
Adapt intel_sseu.c
Adapt intel_timeline.c
Adapt intel_uc_fw.c and fix typo
Fix up intel_uncore.c
intel_vga.c
intel_wakeref.c
intel_vdsc.c
intel_wopcm.c
intel_workarounds.c
i915_globals.c
Fix up intelfb.c
Stub out intel_guc_log.c
Stub out intel_dsi_dcs_backlight.c
i915_perf.c
intel_hdmi.c
intel_hdcp.c


Author: Maya Rashish <maya@NetBSD.org>
Committer: Taylor R Campbell <riastradh@NetBSD.org>
 1.13 19-Dec-2021  riastradh Alias dev_WARN=dev_warn.
 1.12 19-Dec-2021  riastradh Revert "Give up on finding how linux side-loads these"

Found it.
 1.11 19-Dec-2021  riastradh Add some sideloads.
 1.10 19-Dec-2021  riastradh Provide dev_warn_ratelimited


Author: Maya Rashish <maya@NetBSD.org>
 1.9 19-Dec-2021  riastradh stub devm_add_action


Author: Maya Rashish <maya@NetBSD.org>
 1.8 19-Dec-2021  riastradh provide get_device, XXX might want to revisit this later


Author: Maya Rashish <maya@NetBSD.org>
 1.7 19-Dec-2021  riastradh Empty dev_pm_set_driver_flags stub.
 1.6 27-Aug-2018  riastradh Paranoia: let dev be null, in match routines.
 1.5 27-Aug-2018  riastradh Add some more device print routines.
 1.4 16-Jul-2014  riastradh branches: 1.4.4; 1.4.28; 1.4.30;
First whack at radeon driver.

No hardware to test yet, but it builds.
 1.3 16-Jul-2014  riastradh Make it build and boot on my test machines.

Screen blanks on boot on the Ivy Bridge system with

DRM error in cpt_serr_int_handler: PCH transcoder A FIFO underrun

But after that everything is OK. Appears to be an upstream problem.
To investigate...

I think there's a cache flushing issue somewhere -- there are little
display artefacts on my T60.
 1.2 18-Mar-2014  riastradh branches: 1.2.2; 1.2.4; 1.2.6;
Merge riastradh-drm2 to HEAD.
 1.1 24-Jul-2013  riastradh branches: 1.1.2;
file device.h was initially added on branch riastradh-drm2.
 1.1.2.5 08-Sep-2013  riastradh Miscellaneous Linux header file crud.
 1.1.2.4 24-Jul-2013  riastradh Prefix `error: '/`warning: ' to Linux dev_err/dev_warn output.
 1.1.2.3 24-Jul-2013  riastradh Add dev_err to <linux/device.h> as another device_printf alias.
 1.1.2.2 24-Jul-2013  riastradh Add dev_warn (= device_printf, for now) to <linux/device.h>.
 1.1.2.1 24-Jul-2013  riastradh Add stubs for Linux header files for drm.
 1.2.6.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.2.6.1 18-Mar-2014  yamt file device.h was added on branch yamt-pagecache on 2014-05-22 11:40:56 +0000
 1.2.4.2 18-May-2014  rmind sync with head
 1.2.4.1 18-Mar-2014  rmind file device.h was added on branch rmind-smpnet on 2014-05-18 17:46:01 +0000
 1.2.2.1 10-Aug-2014  tls Rebase.
 1.4.30.1 10-Jun-2019  christos Sync with HEAD
 1.4.28.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.4.4.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.4.4.1 16-Jul-2014  tls file device.h was added on branch tls-maxphys on 2014-08-20 00:04:21 +0000
 1.12 19-Dec-2021  riastradh amdgpu: amdgpu_dma_buf.c
 1.11 19-Dec-2021  riastradh drm: Another pass over i915 and some supporting logic.

This makes a shim around sg_table, which essentially represents two
things:

1. an array of pages (roughly corresponding to bus_dma_segment_t[])
2. an array of DMA addresses stored in a bus_dmamap_t

Both parts are optional; different parts of i915 use sg_tables to
pass around one or both of the two parts. This helps to reduce the
ifdefs by quite a bit, although it's not always clear which part of
an sg_table any particular interface is actually using which is why I
was reluctant to do this before.
 1.10 19-Dec-2021  riastradh Fix up drm_prime.c.
 1.9 19-Dec-2021  riastradh dma_buf_ops::map and unmap are no more.
 1.8 19-Dec-2021  riastradh Rename reservation_object -> dma_resv.
 1.7 19-Dec-2021  riastradh match linux side-loading


Author: Maya Rashish <maya@NetBSD.org>
 1.6 19-Dec-2021  riastradh Update type signatures for begin/end_cpu_access.
 1.5 19-Dec-2021  riastradh Update dma-buf API enough to compile drm_prime.c.
 1.4 27-Aug-2018  riastradh Implement poll for reservations and dma bufs.
 1.3 27-Aug-2018  riastradh Draft support for drm prime.
 1.2 18-Mar-2014  riastradh branches: 1.2.4; 1.2.6; 1.2.10; 1.2.34; 1.2.36;
Merge riastradh-drm2 to HEAD.
 1.1 24-Jul-2013  riastradh branches: 1.1.2;
file dma-buf.h was initially added on branch riastradh-drm2.
 1.1.2.1 24-Jul-2013  riastradh Add stubs for Linux header files for drm.
 1.2.36.1 10-Jun-2019  christos Sync with HEAD
 1.2.34.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.2.10.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.2.10.1 18-Mar-2014  tls file dma-buf.h was added on branch tls-maxphys on 2014-08-20 00:04:21 +0000
 1.2.6.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.2.6.1 18-Mar-2014  yamt file dma-buf.h was added on branch yamt-pagecache on 2014-05-22 11:40:56 +0000
 1.2.4.2 18-May-2014  rmind sync with head
 1.2.4.1 18-Mar-2014  rmind file dma-buf.h was added on branch rmind-smpnet on 2014-05-18 17:46:01 +0000
 1.6 19-Dec-2021  riastradh drm: Draft dma-fence-array.
 1.5 19-Dec-2021  riastradh amdgpu: amdgpu_dma_buf.c
 1.4 19-Dec-2021  riastradh <sys/stdbool.h> for bool
 1.3 19-Dec-2021  riastradh dma-fence-array.h stub declarations.
 1.2 19-Dec-2021  riastradh Start dma_fence_array.
 1.1 19-Dec-2021  riastradh Bunch more Linux header file stubs.
 1.4 19-Dec-2021  riastradh drm: Implement dma fence chains.
 1.3 19-Dec-2021  riastradh dma fence chain stubs
 1.2 19-Dec-2021  riastradh dma fence chain stubs
 1.1 19-Dec-2021  riastradh Create stub headers for files included by drm code.


Author: Maya Rashish <maya@NetBSD.org>
 1.17 01-Sep-2022  riastradh drm: Fix dma fence stub so it works with locking operations.
 1.16 19-Dec-2021  riastradh drm: Support 64-bit fence context and sequence numbers.
 1.15 19-Dec-2021  riastradh drm: Sprinkle assertions about fence lifetime.
 1.14 19-Dec-2021  riastradh amdgpu_fb.c
amdgpu_fence.c
amdgpu_gart.c
amdgpu_fixpt31_32.c
amdgpu_fiji_smumgr.c
amdgpu_gem.c
amdgpu_gfx_v10_0.c
amdgpu_gfx_v6_0.c through amdgpu_gfx_v9_0.c
amdgpu_gmc.c
amdgpu_gmc_v6_0.c through amdgpu_gmc_v10_0.c
amdgpu_gtt_mgr.c
some amdgpu_h* files
some amdgpu_i* files
some amdgpu_j* files
amdgpu_kms.c
some amdgpu_m* and amdgpu_n* files
 1.13 19-Dec-2021  riastradh i915: Defer destroying request lock and fence until page destruction.
 1.12 19-Dec-2021  riastradh Move grody i915 dma-fence hacks into dma-fence proper.
 1.11 19-Dec-2021  riastradh Teach dma_fence_any_wait_timeout to return index of signalled fence.
 1.10 19-Dec-2021  riastradh dma_fence_get_status
 1.9 19-Dec-2021  riastradh More side loads.
 1.8 19-Dec-2021  riastradh First approximation of dma_fence_get_stub.
 1.7 19-Dec-2021  riastradh Allow const volatile fence pointer pointers in dma_fence_get_rcu_safe.
 1.6 19-Dec-2021  riastradh Namespace for dma_fence_get_rcu_safe.
 1.5 19-Dec-2021  riastradh dma_fence_set_error
 1.4 19-Dec-2021  riastradh Linux wants to violate abstractions, so fine, let them.
 1.3 19-Dec-2021  riastradh Add dma_fence_get_rcu_safe.
 1.2 19-Dec-2021  riastradh Rename fence -> dma_fence, step 3 of 3: code.
 1.1 19-Dec-2021  riastradh Rename fence -> dma_fence, step 1: files.
 1.10 19-Dec-2021  riastradh amdgpu: Another pass through.

amdgpu_object.c
amdgpu_pci.c
amdgpu_pm.c
amdgpu_polaris10_smumgr.c
amdgpu_pp_psm.c
amdgpu_ppatomctrl.c
amdgpu_ppatomfwctrl.c
amdgpu_process_pptables_v1_0.o
amdgpu_psp.o
amdgpu_psp_v10_0.c
amdgpu_psp_v11_0.c
amdgpu_psp_v12_0.c
amdgpu_psp_v3_1.c
amdgpu_ras.c
amdgpu_ras_eeprom.c
amdgpu_rc_calc.c
amdgpu_rc_calc_dpi.c
amdgpu_ring.c
amdgpu_rlc.c
amdgpu_rn_clk_mgr.c
amdgpu_sdma_v3_0.c
amdgpu_sdma_v4_0.c
amdgpu_sdma_v5_0.c
amdgpu_si.c
amdgpu_si_dma.c
amdgpu_si_dpm.c
amdgpu_smu.c
amdgpu_smu10_hwmgr.c
amdgpu_smu7_hwmgr.c
amdgpu_smu8_hwmgr.c
amdgpu_smu8_smumgr.c
amdgpu_smu_v11_0.c (and a sprinkling of consts)
amdgpu_smu_v11_0_i2c.c
amdgpu_soc15.c
amdgpu_tonga_smumgr.c
amdgpu_ttm.c
amdgpu_ucode.c
amdgpu_uvd.c
amdgpu_uvd_v5_0.c
amdgpu_uvd_v6_0.c
amdgpu_uvd_v7_0.c
amdgpu_vce.c
amdgpu_vce_v2_0.c
amdgpu_vce_v4_0.c
amdgpu_vcn_v1_0.c
amdgpu_vcn_v2_0.c
amdgpu_vcn_v2_5.c
amdgpu_vega10_hwmgr.c
amdgpu_vega10_powertune.c
amdgpu_vega10_processpptables.c
amdgpu_vega10_reg_init.c
amdgpu_vega12_hwmgr.c
amdgpu_vega20_hwmgr.c
amdgpu_vega20_ppt.c
amdgpu_vega20_reg_init.c
amdgpu_vi.c
amdgpu_virt.c
amdgpu_vram_mgr.c
amdgpu_xgmi.c -- disable (for now?)
amdgpufb.c
 1.9 19-Dec-2021  riastradh drm: Another pass over i915 and some supporting logic.

This makes a shim around sg_table, which essentially represents two
things:

1. an array of pages (roughly corresponding to bus_dma_segment_t[])
2. an array of DMA addresses stored in a bus_dmamap_t

Both parts are optional; different parts of i915 use sg_tables to
pass around one or both of the two parts. This helps to reduce the
ifdefs by quite a bit, although it's not always clear which part of
an sg_table any particular interface is actually using which is why I
was reluctant to do this before.
 1.8 19-Dec-2021  riastradh Stub dma_addressing_limited, fixup references for caller

This might turn out to be a mistake if we actually need to distinguish
if a device is only capable of 32-bit DMA.


Author: Maya Rashish <maya@NetBSD.org>
 1.7 19-Dec-2021  riastradh Move dma_addr_t to linux/types.h.
 1.6 19-Dec-2021  riastradh Allow maximum number of bits in DMA_BIT_MASK.
 1.5 27-Aug-2018  riastradh Forget about trying to replicate side-loading, will just include
directly


Author: coypu <coypu@sdf.org>
Committer: Taylor R Campbell <riastradh@NetBSD.org>
 1.4 27-Aug-2018  riastradh begin fixing -Werror build:

Provide missing declarations from older drm
provide more definitions used by code
no idea what might_lock is, but it might be some error-checking
lockdep thing.


Author: coypu <coypu@sdf.org>
Committer: Taylor R Campbell <riastradh@NetBSD.org>
 1.3 06-Aug-2014  riastradh branches: 1.3.4; 1.3.28; 1.3.30;
Add Linux DMA_BIT_MASK.
 1.2 18-Mar-2014  riastradh branches: 1.2.2; 1.2.4; 1.2.6;
Merge riastradh-drm2 to HEAD.
 1.1 24-Jul-2013  riastradh branches: 1.1.2;
file dma-mapping.h was initially added on branch riastradh-drm2.
 1.1.2.2 24-Jul-2013  riastradh Define dma_addr_t to be bus_addr_t in drm2's <linux/dma-mapping.h> shim.
 1.1.2.1 24-Jul-2013  riastradh Add stubs for Linux header files for drm.
 1.2.6.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.2.6.1 18-Mar-2014  yamt file dma-mapping.h was added on branch yamt-pagecache on 2014-05-22 11:40:56 +0000
 1.2.4.2 18-May-2014  rmind sync with head
 1.2.4.1 18-Mar-2014  rmind file dma-mapping.h was added on branch rmind-smpnet on 2014-05-18 17:46:01 +0000
 1.2.2.1 10-Aug-2014  tls Rebase.
 1.3.30.1 10-Jun-2019  christos Sync with HEAD
 1.3.28.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.3.4.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.3.4.1 06-Aug-2014  tls file dma-mapping.h was added on branch tls-maxphys on 2014-08-20 00:04:21 +0000
 1.10 19-Dec-2021  riastradh amdgpu: Another pass through.

amdgpu_object.c
amdgpu_pci.c
amdgpu_pm.c
amdgpu_polaris10_smumgr.c
amdgpu_pp_psm.c
amdgpu_ppatomctrl.c
amdgpu_ppatomfwctrl.c
amdgpu_process_pptables_v1_0.o
amdgpu_psp.o
amdgpu_psp_v10_0.c
amdgpu_psp_v11_0.c
amdgpu_psp_v12_0.c
amdgpu_psp_v3_1.c
amdgpu_ras.c
amdgpu_ras_eeprom.c
amdgpu_rc_calc.c
amdgpu_rc_calc_dpi.c
amdgpu_ring.c
amdgpu_rlc.c
amdgpu_rn_clk_mgr.c
amdgpu_sdma_v3_0.c
amdgpu_sdma_v4_0.c
amdgpu_sdma_v5_0.c
amdgpu_si.c
amdgpu_si_dma.c
amdgpu_si_dpm.c
amdgpu_smu.c
amdgpu_smu10_hwmgr.c
amdgpu_smu7_hwmgr.c
amdgpu_smu8_hwmgr.c
amdgpu_smu8_smumgr.c
amdgpu_smu_v11_0.c (and a sprinkling of consts)
amdgpu_smu_v11_0_i2c.c
amdgpu_soc15.c
amdgpu_tonga_smumgr.c
amdgpu_ttm.c
amdgpu_ucode.c
amdgpu_uvd.c
amdgpu_uvd_v5_0.c
amdgpu_uvd_v6_0.c
amdgpu_uvd_v7_0.c
amdgpu_vce.c
amdgpu_vce_v2_0.c
amdgpu_vce_v4_0.c
amdgpu_vcn_v1_0.c
amdgpu_vcn_v2_0.c
amdgpu_vcn_v2_5.c
amdgpu_vega10_hwmgr.c
amdgpu_vega10_powertune.c
amdgpu_vega10_processpptables.c
amdgpu_vega10_reg_init.c
amdgpu_vega12_hwmgr.c
amdgpu_vega20_hwmgr.c
amdgpu_vega20_ppt.c
amdgpu_vega20_reg_init.c
amdgpu_vi.c
amdgpu_virt.c
amdgpu_vram_mgr.c
amdgpu_xgmi.c -- disable (for now?)
amdgpufb.c
 1.9 19-Dec-2021  riastradh Implement dma_resv_locking_ctx more carefully.
 1.8 19-Dec-2021  riastradh Provide dma_resv_locking_ctx


Author: Maya Rashish <maya@NetBSD.org>
 1.7 19-Dec-2021  riastradh dma_resv_reserve_shared takes one more argument, num_fences

Fortunately it's ~always 1, and (XXX) I assume our implementation
assumes this, too. But assert it.


Author: Maya Rashish <maya@NetBSD.org>
 1.6 19-Dec-2021  riastradh Add slow path versions of to drm_resv_lock.
 1.5 19-Dec-2021  riastradh Rename reservation_object -> dma_resv.
 1.4 19-Dec-2021  riastradh handle us having a named union in struct ww_mutex


Author: Maya Rashish <maya@NetBSD.org>
 1.3 19-Dec-2021  riastradh Switch to upstream dma-resv.h, it's MIT


Author: Maya Rashish <maya@NetBSD.org>
 1.2 19-Dec-2021  riastradh stub xarray.h and dma-resv.h

Add some upstream side-loads and empty structs.


Author: Maya Rashish <maya@NetBSD.org>
 1.1 19-Dec-2021  riastradh Create stub headers for files included by drm code.


Author: Maya Rashish <maya@NetBSD.org>
 1.2 18-Mar-2014  riastradh branches: 1.2.4; 1.2.6; 1.2.10;
Merge riastradh-drm2 to HEAD.
 1.1 24-Jul-2013  riastradh branches: 1.1.2;
file dma_remapping.h was initially added on branch riastradh-drm2.
 1.1.2.1 24-Jul-2013  riastradh Add stubs for Linux header files for drm.
 1.2.10.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.2.10.1 18-Mar-2014  tls file dma_remapping.h was added on branch tls-maxphys on 2014-08-20 00:04:21 +0000
 1.2.6.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.2.6.1 18-Mar-2014  yamt file dma_remapping.h was added on branch yamt-pagecache on 2014-05-22 11:40:56 +0000
 1.2.4.2 18-May-2014  rmind sync with head
 1.2.4.1 18-Mar-2014  rmind file dma_remapping.h was added on branch rmind-smpnet on 2014-05-18 17:46:01 +0000
 1.2 25-Oct-2022  riastradh linux/dmapool.h: Start filling out stubs.
 1.1 17-Feb-2022  riastradh drm/vmwgfx: First draft. Passes make depend, doesn't build yet.
 1.6 27-Aug-2018  riastradh Need <sys/types.h> for bool.
 1.5 27-Aug-2018  riastradh Namespace Linux symbols.
 1.4 27-Aug-2018  riastradh provide some dummy structs

declaration without implementation of dmi_match (Won't link)
provide div64_u64_rem XXX the naming of the parameters is backwards
ci_send_msg_to_smc_return_parameter isn't unused, keep it


Author: coypu <coypu@sdf.org>
Committer: Taylor R Campbell <riastradh@NetBSD.org>
 1.3 25-Apr-2014  riastradh branches: 1.3.2; 1.3.4; 1.3.8; 1.3.32; 1.3.34;
Implement Linux dmi_check_system API.

Use it to get a Thinkpad quirk for i915 graphics.

Patch from nonoka@, PR 48708.
 1.2 18-Mar-2014  riastradh branches: 1.2.2;
Merge riastradh-drm2 to HEAD.
 1.1 24-Jul-2013  riastradh branches: 1.1.2;
file dmi.h was initially added on branch riastradh-drm2.
 1.1.2.1 24-Jul-2013  riastradh Add stubs for Linux header files for drm.
 1.2.2.1 10-Aug-2014  tls Rebase.
 1.3.34.1 10-Jun-2019  christos Sync with HEAD
 1.3.32.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.3.8.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.3.8.1 25-Apr-2014  tls file dmi.h was added on branch tls-maxphys on 2014-08-20 00:04:21 +0000
 1.3.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.3.4.1 25-Apr-2014  yamt file dmi.h was added on branch yamt-pagecache on 2014-05-22 11:40:56 +0000
 1.3.2.2 18-May-2014  rmind sync with head
 1.3.2.1 25-Apr-2014  rmind file dmi.h was added on branch rmind-smpnet on 2014-05-18 17:46:01 +0000
 1.2 18-Mar-2014  riastradh branches: 1.2.4; 1.2.6; 1.2.10;
Merge riastradh-drm2 to HEAD.
 1.1 24-Jul-2013  riastradh branches: 1.1.2;
file efi.h was initially added on branch riastradh-drm2.
 1.1.2.1 24-Jul-2013  riastradh Add stubs for Linux header files for drm.
 1.2.10.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.2.10.1 18-Mar-2014  tls file efi.h was added on branch tls-maxphys on 2014-08-20 00:04:21 +0000
 1.2.6.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.2.6.1 18-Mar-2014  yamt file efi.h was added on branch yamt-pagecache on 2014-05-22 11:40:56 +0000
 1.2.4.2 18-May-2014  rmind sync with head
 1.2.4.1 18-Mar-2014  rmind file efi.h was added on branch rmind-smpnet on 2014-05-18 17:46:01 +0000
 1.4 18-Aug-2015  skrll Move linux/err.h into common/include.

OK riastradh@
 1.3 16-Jul-2014  riastradh branches: 1.3.2; 1.3.4; 1.3.6; 1.3.10;
Make it build and boot on my test machines.

Screen blanks on boot on the Ivy Bridge system with

DRM error in cpt_serr_int_handler: PCH transcoder A FIFO underrun

But after that everything is OK. Appears to be an upstream problem.
To investigate...

I think there's a cache flushing issue somewhere -- there are little
display artefacts on my T60.
 1.2 18-Mar-2014  riastradh branches: 1.2.2; 1.2.4; 1.2.6;
Merge riastradh-drm2 to HEAD.
 1.1 24-Jul-2013  riastradh branches: 1.1.2;
file err.h was initially added on branch riastradh-drm2.
 1.1.2.4 24-Jul-2013  riastradh Add ENOTSUPP as an alias for ENOTSUP (XXX huh?) in <linux/err.h>.
 1.1.2.3 24-Jul-2013  riastradh Add EREMOTEIO as an alias for EIO to <linux/err.h>.
 1.1.2.2 24-Jul-2013  riastradh Avoid INT_MAX in PTR_ERR; check for truncation instead.
 1.1.2.1 24-Jul-2013  riastradh Implement Linux's kludgerous pointers-as-errors in <linux/err.h>.
 1.2.6.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.2.6.1 18-Mar-2014  yamt file err.h was added on branch yamt-pagecache on 2014-05-22 11:40:56 +0000
 1.2.4.2 18-May-2014  rmind sync with head
 1.2.4.1 18-Mar-2014  rmind file err.h was added on branch rmind-smpnet on 2014-05-18 17:46:01 +0000
 1.2.2.1 10-Aug-2014  tls Rebase.
 1.3.10.1 06-Sep-2016  skrll First pass at netbsd-7 updated with USB code from HEAD
 1.3.6.1 22-Sep-2015  skrll Sync with HEAD
 1.3.4.3 03-Dec-2017  jdolecek update from HEAD
 1.3.4.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.3.4.1 16-Jul-2014  tls file err.h was added on branch tls-maxphys on 2014-08-20 00:04:21 +0000
 1.3.2.1 05-Apr-2017  snj Pull up following revision(s) (requested by skrll in ticket #1395):
share/man/man4/axe.4: netbsd-7-nhusb
share/man/man4/axen.4: netbsd-7-nhusb
share/man/man4/cdce.4: netbsd-7-nhusb
share/man/man4/uaudio.4: netbsd-7-nhusb
share/man/man4/ucom.4: netbsd-7-nhusb
share/man/man4/uep.4: netbsd-7-nhusb
share/man/man4/urtw.4: netbsd-7-nhusb
share/man/man4/usb.4: netbsd-7-nhusb
share/man/man4/uyap.4: netbsd-7-nhusb
share/man/man4/xhci.4: netbsd-7-nhusb
share/man/man9/usbdi.9: netbsd-7-nhusb
sys/arch/amd64/conf/ALL: netbsd-7-nhusb
sys/arch/amd64/conf/GENERIC: netbsd-7-nhusb
sys/arch/amiga/dev/slhci_zbus.c: netbsd-7-nhusb
sys/arch/arm/allwinner/awin_otg.c: netbsd-7-nhusb
sys/arch/arm/allwinner/awin_usb.c: netbsd-7-nhusb
sys/arch/arm/amlogic/amlogic_dwctwo.c: netbsd-7-nhusb
sys/arch/arm/at91/at91ohci.c: netbsd-7-nhusb
sys/arch/arm/broadcom/bcm2835_dwctwo.c: netbsd-7-nhusb
sys/arch/arm/broadcom/bcm53xx_usb.c: netbsd-7-nhusb
sys/arch/arm/ep93xx/epohci.c: netbsd-7-nhusb
sys/arch/arm/gemini/obio_ehci.c: netbsd-7-nhusb
sys/arch/arm/imx/files.imx23: netbsd-7-nhusb
sys/arch/arm/imx/imxusb.c: netbsd-7-nhusb
sys/arch/arm/imx/imxusbreg.h: netbsd-7-nhusb
sys/arch/arm/omap/obio_ohci.c: netbsd-7-nhusb
sys/arch/arm/omap/omap3_ehci.c: netbsd-7-nhusb
sys/arch/arm/omap/omapl1x_ohci.c: netbsd-7-nhusb
sys/arch/arm/omap/tiotg.c: netbsd-7-nhusb
sys/arch/arm/s3c2xx0/ohci_s3c24x0.c: netbsd-7-nhusb
sys/arch/arm/samsung/exynos_usb.c: netbsd-7-nhusb
sys/arch/arm/xscale/pxa2x0_ohci.c: netbsd-7-nhusb
sys/arch/arm/zynq/zynq_usb.c: netbsd-7-nhusb
sys/arch/hpcarm/dev/nbp_slhci.c: netbsd-7-nhusb
sys/arch/hpcmips/dev/plumohci.c: netbsd-7-nhusb
sys/arch/i386/conf/ALL: netbsd-7-nhusb
sys/arch/i386/conf/GENERIC: netbsd-7-nhusb
sys/arch/i386/pci/gcscehci.c: netbsd-7-nhusb
sys/arch/luna68k/conf/GENERIC: netbsd-7-nhusb
sys/arch/mips/adm5120/dev/ahci.c: netbsd-7-nhusb
sys/arch/mips/adm5120/dev/ahcivar.h: netbsd-7-nhusb
sys/arch/mips/alchemy/dev/ohci_aubus.c: netbsd-7-nhusb
sys/arch/mips/atheros/dev/ehci_arbus.c: netbsd-7-nhusb
sys/arch/mips/atheros/dev/ohci_arbus.c: netbsd-7-nhusb
sys/arch/mips/conf/files.adm5120: netbsd-7-nhusb
sys/arch/mips/ralink/ralink_ehci.c: netbsd-7-nhusb
sys/arch/mips/ralink/ralink_ohci.c: netbsd-7-nhusb
sys/arch/mips/rmi/rmixl_ehci.c: netbsd-7-nhusb
sys/arch/mips/rmi/rmixl_ohci.c: netbsd-7-nhusb
sys/arch/playstation2/dev/ohci_sbus.c: netbsd-7-nhusb
sys/arch/powerpc/booke/dev/pq3ehci.c: netbsd-7-nhusb
sys/arch/powerpc/ibm4xx/dev/dwctwo_plb.c: netbsd-7-nhusb
sys/arch/x68k/dev/slhci_intio.c: netbsd-7-nhusb
sys/conf/files: netbsd-7-nhusb
sys/dev/cardbus/ehci_cardbus.c: netbsd-7-nhusb
sys/dev/cardbus/ohci_cardbus.c: netbsd-7-nhusb
sys/dev/cardbus/uhci_cardbus.c: netbsd-7-nhusb
sys/dev/ic/sl811hs.c: netbsd-7-nhusb
sys/dev/ic/sl811hsvar.h: netbsd-7-nhusb
sys/dev/isa/slhci_isa.c: netbsd-7-nhusb
sys/dev/marvell/ehci_mv.c: netbsd-7-nhusb
sys/dev/pci/ehci_pci.c: netbsd-7-nhusb
sys/dev/pci/ohci_pci.c: netbsd-7-nhusb
sys/dev/pci/uhci_pci.c: netbsd-7-nhusb
sys/dev/pci/xhci_pci.c: netbsd-7-nhusb
sys/dev/pcmcia/slhci_pcmcia.c: netbsd-7-nhusb
sys/dev/usb/Makefile.usbdevs: netbsd-7-nhusb
sys/dev/usb/TODO: netbsd-7-nhusb
sys/dev/usb/TODO.usbmp: netbsd-7-nhusb
sys/dev/usb/aubtfwl.c: netbsd-7-nhusb
sys/dev/usb/auvitek.c: netbsd-7-nhusb
sys/dev/usb/auvitek_audio.c: netbsd-7-nhusb
sys/dev/usb/auvitek_dtv.c: netbsd-7-nhusb
sys/dev/usb/auvitek_i2c.c: netbsd-7-nhusb
sys/dev/usb/auvitek_video.c: netbsd-7-nhusb
sys/dev/usb/auvitekvar.h: netbsd-7-nhusb
sys/dev/usb/ehci.c: netbsd-7-nhusb
sys/dev/usb/ehcireg.h: netbsd-7-nhusb
sys/dev/usb/ehcivar.h: netbsd-7-nhusb
sys/dev/usb/emdtv.c: netbsd-7-nhusb
sys/dev/usb/emdtv_dtv.c: netbsd-7-nhusb
sys/dev/usb/emdtv_ir.c: netbsd-7-nhusb
sys/dev/usb/emdtvvar.h: netbsd-7-nhusb
sys/dev/usb/ezload.c: netbsd-7-nhusb
sys/dev/usb/ezload.h: netbsd-7-nhusb
sys/dev/usb/files.usb: netbsd-7-nhusb
sys/dev/usb/hid.c: netbsd-7-nhusb
sys/dev/usb/hid.h: netbsd-7-nhusb
sys/dev/usb/if_athn_usb.c: netbsd-7-nhusb
sys/dev/usb/if_athn_usb.h: netbsd-7-nhusb
sys/dev/usb/if_atu.c: netbsd-7-nhusb
sys/dev/usb/if_atureg.h: netbsd-7-nhusb
sys/dev/usb/if_aue.c: netbsd-7-nhusb
sys/dev/usb/if_auereg.h: netbsd-7-nhusb
sys/dev/usb/if_axe.c: netbsd-7-nhusb
sys/dev/usb/if_axen.c: netbsd-7-nhusb
sys/dev/usb/if_axenreg.h: netbsd-7-nhusb
sys/dev/usb/if_axereg.h: netbsd-7-nhusb
sys/dev/usb/if_cdce.c: netbsd-7-nhusb
sys/dev/usb/if_cdcereg.h: netbsd-7-nhusb
sys/dev/usb/if_cue.c: netbsd-7-nhusb
sys/dev/usb/if_cuereg.h: netbsd-7-nhusb
sys/dev/usb/if_kue.c: netbsd-7-nhusb
sys/dev/usb/if_kuereg.h: netbsd-7-nhusb
sys/dev/usb/if_otus.c: netbsd-7-nhusb
sys/dev/usb/if_otusvar.h: netbsd-7-nhusb
sys/dev/usb/if_rum.c: netbsd-7-nhusb
sys/dev/usb/if_rumreg.h: netbsd-7-nhusb
sys/dev/usb/if_rumvar.h: netbsd-7-nhusb
sys/dev/usb/if_run.c: netbsd-7-nhusb
sys/dev/usb/if_runvar.h: netbsd-7-nhusb
sys/dev/usb/if_smsc.c: netbsd-7-nhusb
sys/dev/usb/if_smscreg.h: netbsd-7-nhusb
sys/dev/usb/if_smscvar.h: netbsd-7-nhusb
sys/dev/usb/if_udav.c: netbsd-7-nhusb
sys/dev/usb/if_udavreg.h: netbsd-7-nhusb
sys/dev/usb/if_upgt.c: netbsd-7-nhusb
sys/dev/usb/if_upgtvar.h: netbsd-7-nhusb
sys/dev/usb/if_upl.c: netbsd-7-nhusb
sys/dev/usb/if_ural.c: netbsd-7-nhusb
sys/dev/usb/if_uralreg.h: netbsd-7-nhusb
sys/dev/usb/if_uralvar.h: netbsd-7-nhusb
sys/dev/usb/if_url.c: netbsd-7-nhusb
sys/dev/usb/if_urlreg.h: netbsd-7-nhusb
sys/dev/usb/if_urndis.c: netbsd-7-nhusb
sys/dev/usb/if_urndisreg.h: netbsd-7-nhusb
sys/dev/usb/if_urtw.c: netbsd-7-nhusb
sys/dev/usb/if_urtwn.c: netbsd-7-nhusb
sys/dev/usb/if_urtwn_data.h: netbsd-7-nhusb
sys/dev/usb/if_urtwnreg.h: netbsd-7-nhusb
sys/dev/usb/if_urtwnvar.h: netbsd-7-nhusb
sys/dev/usb/if_urtwreg.h: netbsd-7-nhusb
sys/dev/usb/if_zyd.c: netbsd-7-nhusb
sys/dev/usb/if_zydreg.h: netbsd-7-nhusb
sys/dev/usb/irmce.c: netbsd-7-nhusb
sys/dev/usb/moscom.c: netbsd-7-nhusb
sys/dev/usb/motg.c: netbsd-7-nhusb
sys/dev/usb/motgvar.h: netbsd-7-nhusb
sys/dev/usb/ohci.c: netbsd-7-nhusb
sys/dev/usb/ohcireg.h: netbsd-7-nhusb
sys/dev/usb/ohcivar.h: netbsd-7-nhusb
sys/dev/usb/pseye.c: netbsd-7-nhusb
sys/dev/usb/slurm.c: netbsd-7-nhusb
sys/dev/usb/stuirda.c: netbsd-7-nhusb
sys/dev/usb/u3g.c: netbsd-7-nhusb
sys/dev/usb/uark.c: netbsd-7-nhusb
sys/dev/usb/uatp.c: netbsd-7-nhusb
sys/dev/usb/uaudio.c: netbsd-7-nhusb
sys/dev/usb/uberry.c: netbsd-7-nhusb
sys/dev/usb/ubsa.c: netbsd-7-nhusb
sys/dev/usb/ubsa_common.c: netbsd-7-nhusb
sys/dev/usb/ubsavar.h: netbsd-7-nhusb
sys/dev/usb/ubt.c: netbsd-7-nhusb
sys/dev/usb/uchcom.c: netbsd-7-nhusb
sys/dev/usb/ucom.c: netbsd-7-nhusb
sys/dev/usb/ucomvar.h: netbsd-7-nhusb
sys/dev/usb/ucycom.c: netbsd-7-nhusb
sys/dev/usb/udl.c: netbsd-7-nhusb
sys/dev/usb/udl.h: netbsd-7-nhusb
sys/dev/usb/udsbr.c: netbsd-7-nhusb
sys/dev/usb/udsir.c: netbsd-7-nhusb
sys/dev/usb/uep.c: netbsd-7-nhusb
sys/dev/usb/uftdi.c: netbsd-7-nhusb
sys/dev/usb/uftdireg.h: netbsd-7-nhusb
sys/dev/usb/ugen.c: netbsd-7-nhusb
sys/dev/usb/ugensa.c: netbsd-7-nhusb
sys/dev/usb/uhci.c: netbsd-7-nhusb
sys/dev/usb/uhcireg.h: netbsd-7-nhusb
sys/dev/usb/uhcivar.h: netbsd-7-nhusb
sys/dev/usb/uhid.c: netbsd-7-nhusb
sys/dev/usb/uhidev.c: netbsd-7-nhusb
sys/dev/usb/uhidev.h: netbsd-7-nhusb
sys/dev/usb/uhmodem.c: netbsd-7-nhusb
sys/dev/usb/uhso.c: netbsd-7-nhusb
sys/dev/usb/uhub.c: netbsd-7-nhusb
sys/dev/usb/uipad.c: netbsd-7-nhusb
sys/dev/usb/uipaq.c: netbsd-7-nhusb
sys/dev/usb/uirda.c: netbsd-7-nhusb
sys/dev/usb/uirdavar.h: netbsd-7-nhusb
sys/dev/usb/ukbd.c: netbsd-7-nhusb
sys/dev/usb/ukbdmap.c: netbsd-7-nhusb
sys/dev/usb/ukyopon.c: netbsd-7-nhusb
sys/dev/usb/ukyopon.h: netbsd-7-nhusb
sys/dev/usb/ulpt.c: netbsd-7-nhusb
sys/dev/usb/umass.c: netbsd-7-nhusb
sys/dev/usb/umass_isdata.c: netbsd-7-nhusb
sys/dev/usb/umass_isdata.h: netbsd-7-nhusb
sys/dev/usb/umass_quirks.c: netbsd-7-nhusb
sys/dev/usb/umass_quirks.h: netbsd-7-nhusb
sys/dev/usb/umass_scsipi.c: netbsd-7-nhusb
sys/dev/usb/umass_scsipi.h: netbsd-7-nhusb
sys/dev/usb/umassvar.h: netbsd-7-nhusb
sys/dev/usb/umcs.c: netbsd-7-nhusb
sys/dev/usb/umct.c: netbsd-7-nhusb
sys/dev/usb/umidi.c: netbsd-7-nhusb
sys/dev/usb/umidi_quirks.c: netbsd-7-nhusb
sys/dev/usb/umidi_quirks.h: netbsd-7-nhusb
sys/dev/usb/umodem.c: netbsd-7-nhusb
sys/dev/usb/umodem_common.c: netbsd-7-nhusb
sys/dev/usb/umodemvar.h: netbsd-7-nhusb
sys/dev/usb/ums.c: netbsd-7-nhusb
sys/dev/usb/uplcom.c: netbsd-7-nhusb
sys/dev/usb/urio.c: netbsd-7-nhusb
sys/dev/usb/urio.h: netbsd-7-nhusb
sys/dev/usb/usb.c: netbsd-7-nhusb
sys/dev/usb/usb.h: netbsd-7-nhusb
sys/dev/usb/usb_mem.c: netbsd-7-nhusb
sys/dev/usb/usb_mem.h: netbsd-7-nhusb
sys/dev/usb/usb_quirks.c: netbsd-7-nhusb
sys/dev/usb/usb_quirks.h: netbsd-7-nhusb
sys/dev/usb/usb_subr.c: netbsd-7-nhusb
sys/dev/usb/usbdevices.config: netbsd-7-nhusb
sys/dev/usb/usbdevs: netbsd-7-nhusb
sys/dev/usb/usbdevs.h: netbsd-7-nhusb
sys/dev/usb/usbdevs_data.h: netbsd-7-nhusb
sys/dev/usb/usbdi.c: netbsd-7-nhusb
sys/dev/usb/usbdi.h: netbsd-7-nhusb
sys/dev/usb/usbdi_util.c: netbsd-7-nhusb
sys/dev/usb/usbdi_util.h: netbsd-7-nhusb
sys/dev/usb/usbdivar.h: netbsd-7-nhusb
sys/dev/usb/usbhid.h: netbsd-7-nhusb
sys/dev/usb/usbhist.h: netbsd-7-nhusb
sys/dev/usb/usbroothub.c: netbsd-7-nhusb
sys/dev/usb/usbroothub.h: netbsd-7-nhusb
sys/dev/usb/usbroothub_subr.c: delete
sys/dev/usb/usbroothub_subr.h: delete
sys/dev/usb/uscanner.c: netbsd-7-nhusb
sys/dev/usb/uslsa.c: netbsd-7-nhusb
sys/dev/usb/usscanner.c: netbsd-7-nhusb
sys/dev/usb/ustir.c: netbsd-7-nhusb
sys/dev/usb/uthum.c: netbsd-7-nhusb
sys/dev/usb/utoppy.c: netbsd-7-nhusb
sys/dev/usb/uts.c: netbsd-7-nhusb
sys/dev/usb/uvideo.c: netbsd-7-nhusb
sys/dev/usb/uvisor.c: netbsd-7-nhusb
sys/dev/usb/uvscom.c: netbsd-7-nhusb
sys/dev/usb/uyap.c: netbsd-7-nhusb
sys/dev/usb/uyap_firmware.h: netbsd-7-nhusb
sys/dev/usb/uyurex.c: netbsd-7-nhusb
sys/dev/usb/x1input_rdesc.h: netbsd-7-nhusb
sys/dev/usb/xhci.c: netbsd-7-nhusb
sys/dev/usb/xhcireg.h: netbsd-7-nhusb
sys/dev/usb/xhcivar.h: netbsd-7-nhusb
sys/dev/usb/xinput_rdesc.h: netbsd-7-nhusb
sys/external/bsd/common/conf/files.linux: netbsd-7-nhusb
sys/external/bsd/common/include/linux/err.h: netbsd-7-nhusb
sys/external/bsd/common/include/linux/kernel.h: netbsd-7-nhusb
sys/external/bsd/common/include/linux/workqueue.h: netbsd-7-nhusb
sys/external/bsd/common/linux/linux_work.c: netbsd-7-nhusb
sys/external/bsd/drm2/dist/drm/radeon/atombios_encoders.c: netbsd-7-nhusb
sys/external/bsd/drm2/dist/drm/radeon/radeon_legacy_encoders.c: netbsd-7-nhusb
sys/external/bsd/drm2/drm/files.drmkms: netbsd-7-nhusb
sys/external/bsd/drm2/i915drm/files.i915drmkms: netbsd-7-nhusb
sys/external/bsd/drm2/include/linux/err.h: delete
sys/external/bsd/drm2/include/linux/workqueue.h: delete
sys/external/bsd/drm2/linux/files.drmkms_linux: netbsd-7-nhusb
sys/external/bsd/drm2/linux/linux_work.c: delete
sys/external/bsd/dwc2/dwc2.c: netbsd-7-nhusb
sys/external/bsd/dwc2/dwc2.h: netbsd-7-nhusb
sys/external/bsd/dwc2/dwc2var.h: netbsd-7-nhusb
sys/external/bsd/dwc2/dwctwo2netbsd: netbsd-7-nhusb
sys/external/bsd/dwc2/conf/files.dwc2: netbsd-7-nhusb
sys/external/bsd/dwc2/dist/dwc2_core.c: netbsd-7-nhusb
sys/external/bsd/dwc2/dist/dwc2_core.h: netbsd-7-nhusb
sys/external/bsd/dwc2/dist/dwc2_coreintr.c: netbsd-7-nhusb
sys/external/bsd/dwc2/dist/dwc2_hcd.c: netbsd-7-nhusb
sys/external/bsd/dwc2/dist/dwc2_hcd.h: netbsd-7-nhusb
sys/external/bsd/dwc2/dist/dwc2_hcdddma.c: netbsd-7-nhusb
sys/external/bsd/dwc2/dist/dwc2_hcdintr.c: netbsd-7-nhusb
sys/external/bsd/dwc2/dist/dwc2_hcdqueue.c: netbsd-7-nhusb
sys/external/bsd/dwc2/dist/dwc2_hw.h: netbsd-7-nhusb
sys/modules/drmkms_linux/Makefile: netbsd-7-nhusb
sys/modules/i915drmkms/Makefile: netbsd-7-nhusb
sys/rump/dev/lib/libugenhc/ugenhc.c: netbsd-7-nhusb
sys/rump/dev/lib/libusb/Makefile: netbsd-7-nhusb
sys/rump/dev/lib/libusb/USB.ioconf: netbsd-7-nhusb
sys/rump/dev/lib/libusb/usb_at_ugenhc.c: delete
sys/rump/dev/lib/libusb/opt/opt_usb.h: delete
sys/rump/dev/lib/libusb/opt/opt_usbverbose.h: delete
sys/sys/mbuf.h: netbsd-7-nhusb
usr.sbin/usbdevs/usbdevs.8: netbsd-7-nhusb
usr.sbin/usbdevs/usbdevs.c: netbsd-7-nhusb
Merge netbsd-7-nhusb:
- API / infrastructure changes to support memory management changes.
- Memory management improvements and bug fixes.
- HCDs should now be MP safe
- conversion to KERNHIST based debug
- FS/LS isoc support on ehci(4).
- conversion to kmem(9)
- Some USB 3 support - mostly from Takahiro HAYASHI (t-hash).
- interrupt transfers now get proper DMA operations
- general bug fixes
- kern/48308
- uhub status notification improvements
- umass(4) probe fix (applied to HEAD already)
- ohci(4) short transfer fix
- Change the SOFTINT level from NET to SERIAL for the USB softint handler.
This gives the callback a chance of running when another softint handler
at SOFTINT_NET has blocked holding a lock, e.g. softnet_lock and most of
the network stack.
- kern/49065 - ifconfig tun0 ... sequence locks up system / lockup:
softnet_lock held across usb xfr
- kern/50491 - unkillable wait in usbd_transfer while using usmsc0
on raspberry pi 2
- kern/51395 - USB Ethernet makes xhci hang
- Various improvements to slhci(4)
- Various improvements to dwc2(4)
 1.3 07-Apr-2014  riastradh Move <linux/errno.h> from drm2 to common.
 1.2 18-Mar-2014  riastradh branches: 1.2.2;
Merge riastradh-drm2 to HEAD.
 1.1 24-Jul-2013  riastradh branches: 1.1.2;
file errno.h was initially added on branch riastradh-drm2.
 1.1.2.3 08-Sep-2013  riastradh Add ERESTARTSYS as a Linuxoid alias for ERESTART.
 1.1.2.2 24-Jul-2013  riastradh Include <sys/errno.h> in <linux/errno.h>.
 1.1.2.1 24-Jul-2013  riastradh Add stubs for Linux header files for drm.
 1.2.2.1 10-Aug-2014  tls Rebase.
 1.5 19-Dec-2021  riastradh Include linux/export.h in linux/printk.h, move to common

linux does this through:
printk.h -> linkage.h -> export.h

this will require less patching of drm files.

Author: Maya Rashish <maya@NetBSD.org>
 1.4 19-Dec-2021  riastradh Move IS_REACHABLE to <linux/kernel.h> to avoid double definition.
 1.3 19-Dec-2021  riastradh Define IS_ENABLED and IS_REACHABLE.
 1.2 18-Mar-2014  riastradh branches: 1.2.4; 1.2.6; 1.2.10;
Merge riastradh-drm2 to HEAD.
 1.1 24-Jul-2013  riastradh branches: 1.1.2;
file export.h was initially added on branch riastradh-drm2.
 1.1.2.1 24-Jul-2013  riastradh Add stubs for Linux header files for drm.
 1.2.10.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.2.10.1 18-Mar-2014  tls file export.h was added on branch tls-maxphys on 2014-08-20 00:04:21 +0000
 1.2.6.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.2.6.1 18-Mar-2014  yamt file export.h was added on branch yamt-pagecache on 2014-05-22 11:40:56 +0000
 1.2.4.2 18-May-2014  rmind sync with head
 1.2.4.1 18-Mar-2014  rmind file export.h was added on branch rmind-smpnet on 2014-05-18 17:46:01 +0000
 1.1 19-Dec-2021  riastradh Bunch more Linux header file stubs.
 1.7 19-Dec-2021  riastradh drm: Just disable fb_get_options for now.
 1.6 19-Dec-2021  riastradh Match linux side-loading


Author: Maya Rashish <maya@NetBSD.org>
 1.5 19-Dec-2021  riastradh stub fb_get_options


Author: Maya Rashish <maya@NetBSD.org>
 1.4 14-Feb-2020  riastradh Stub out console_lock/unlock and drm_fb_helper_set_suspend.

Reduce some more diffs.
 1.3 27-Aug-2018  riastradh branches: 1.3.6;
match linux side loading of headers

more bring in OLD drm code to unbreak the build
matching netbsd types etc. to get the build going


Author: coypu <coypu@sdf.org>
Committer: Taylor R Campbell <riastradh@NetBSD.org>
 1.2 18-Mar-2014  riastradh branches: 1.2.4; 1.2.6; 1.2.10; 1.2.34; 1.2.36;
Merge riastradh-drm2 to HEAD.
 1.1 24-Jul-2013  riastradh branches: 1.1.2;
file fb.h was initially added on branch riastradh-drm2.
 1.1.2.2 24-Jul-2013  riastradh Define PICOS2KHZ and KHZ2PICOS in <linux/fb.h>.
 1.1.2.1 24-Jul-2013  riastradh Add stubs for Linux header files for drm.
 1.2.36.2 08-Apr-2020  martin Merge changes from current as of 20200406
 1.2.36.1 10-Jun-2019  christos Sync with HEAD
 1.2.34.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.2.10.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.2.10.1 18-Mar-2014  tls file fb.h was added on branch tls-maxphys on 2014-08-20 00:04:21 +0000
 1.2.6.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.2.6.1 18-Mar-2014  yamt file fb.h was added on branch yamt-pagecache on 2014-05-22 11:40:56 +0000
 1.2.4.2 18-May-2014  rmind sync with head
 1.2.4.1 18-Mar-2014  rmind file fb.h was added on branch rmind-smpnet on 2014-05-18 17:46:01 +0000
 1.3.6.1 29-Feb-2020  ad Sync with head.
 1.1 27-Aug-2018  riastradh branches: 1.1.2; 1.1.6;
Not sure what DRM is doing with the fdtable, but OK...
 1.1.6.2 10-Jun-2019  christos Sync with HEAD
 1.1.6.1 27-Aug-2018  christos file fdtable.h was added on branch phil-wifi on 2019-06-10 22:08:31 +0000
 1.1.2.2 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.1.2.1 27-Aug-2018  pgoyette file fdtable.h was added on branch pgoyette-compat on 2018-09-06 06:56:36 +0000
 1.18 19-Dec-2021  riastradh Create stub headers for files included by drm code.


Author: Maya Rashish <maya@NetBSD.org>
 1.17 19-Dec-2021  riastradh Rename fence -> dma_fence, step 1: files.
 1.16 14-Feb-2020  tnn FENCE_TRACE is __printflike
 1.15 27-Aug-2018  riastradh branches: 1.15.2; 1.15.6; 1.15.10;
Make extremely noisy fence trace output conditional.
 1.14 27-Aug-2018  riastradh Add fence_is_later and fence_wait_any_timeout.
 1.13 27-Aug-2018  riastradh Add missing namespacing.
 1.12 27-Aug-2018  riastradh Use atomics to manage fence->flags.

Outside users use this field too, and expect it to be managed with
atomics.
 1.11 27-Aug-2018  riastradh Draft implementation of the Linux reservation and fence APIs.
 1.10 27-Aug-2018  riastradh Add fence_enable_sw_signaling prototype.
 1.9 27-Aug-2018  riastradh Add fence_signal prototype.
 1.8 27-Aug-2018  riastradh Define FENCE_TRACE. Need some way to limit it...
 1.7 27-Aug-2018  riastradh Fill out <linux/fence.h>, pending implementing the symbols.
 1.6 27-Aug-2018  riastradh Namespace fence_get.
 1.5 27-Aug-2018  riastradh Add fence_get prototype.
 1.4 27-Aug-2018  riastradh Include <linux/rcupdate.h> in <linux/fence.h>.
 1.3 27-Aug-2018  riastradh Add some <linux/fence.h> prototypes.
 1.2 27-Aug-2018  riastradh provide some dummy structs

declaration without implementation of dmi_match (Won't link)
provide div64_u64_rem XXX the naming of the parameters is backwards
ci_send_msg_to_smc_return_parameter isn't unused, keep it


Author: coypu <coypu@sdf.org>
Committer: Taylor R Campbell <riastradh@NetBSD.org>
 1.1 27-Aug-2018  riastradh Add stub headers to be filled in as needed.
 1.15.10.1 29-Feb-2020  ad Sync with head.
 1.15.6.3 08-Apr-2020  martin Merge changes from current as of 20200406
 1.15.6.2 10-Jun-2019  christos Sync with HEAD
 1.15.6.1 27-Aug-2018  christos file fence.h was added on branch phil-wifi on 2019-06-10 22:08:31 +0000
 1.15.2.2 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.15.2.1 27-Aug-2018  pgoyette file fence.h was added on branch pgoyette-compat on 2018-09-06 06:56:36 +0000
 1.7 19-Dec-2021  riastradh New fdget/fdput wrappers help to reduce diffs.
 1.6 19-Dec-2021  riastradh missing includes


Author: Maya Rashish <maya@NetBSD.org>
 1.5 19-Dec-2021  riastradh <linux/file.h> oughta be enough to dereference struct file.
 1.4 19-Dec-2021  riastradh fget == fd_getfile
 1.3 19-Dec-2021  riastradh Work out sync file construction API.
 1.2 18-Mar-2014  riastradh branches: 1.2.4; 1.2.6; 1.2.10;
Merge riastradh-drm2 to HEAD.
 1.1 24-Jul-2013  riastradh branches: 1.1.2;
file file.h was initially added on branch riastradh-drm2.
 1.1.2.1 24-Jul-2013  riastradh Add stubs for Linux header files for drm.
 1.2.10.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.2.10.1 18-Mar-2014  tls file file.h was added on branch tls-maxphys on 2014-08-20 00:04:21 +0000
 1.2.6.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.2.6.1 18-Mar-2014  yamt file file.h was added on branch yamt-pagecache on 2014-05-22 11:40:56 +0000
 1.2.4.2 18-May-2014  rmind sync with head
 1.2.4.1 18-Mar-2014  rmind file file.h was added on branch rmind-smpnet on 2014-05-18 17:46:01 +0000
 1.12 19-Dec-2021  riastradh linux: request_firmware_direct
 1.11 19-Dec-2021  riastradh Move Linux firmware shims to their own .c file.
 1.10 19-Dec-2021  riastradh Add firmware_request_nowarn.
 1.9 27-Aug-2018  riastradh correct typo

shows up as null deref in finish_csr_load.


Author: coypoop <coypu@sdf.org>
Committer: Taylor R Campbell <riastradh@NetBSD.org>
 1.8 27-Aug-2018  riastradh Implement Linux asynchronous firmware load API.
 1.7 27-Aug-2018  riastradh just include linux/err.h instead of matching side loading

(it's included by fence.h, for example)

switch void* -> char* because of void pointer arithmetic.


Author: coypu <coypu@sdf.org>
Committer: Taylor R Campbell <riastradh@NetBSD.org>
 1.6 06-Aug-2014  riastradh branches: 1.6.4; 1.6.28; 1.6.30;
Omit needless firmware handle from Linux struct firmware.
 1.5 17-Jul-2014  riastradh Elide up to one excess driver-named component from firmware pathnames.
 1.4 17-Jul-2014  riastradh Tweak failure case for Linux firmware API.

request_firmware is guaranteed to yield null on failure;
release_firmware on null is guaranteed to be a no-op.
 1.3 16-Jul-2014  riastradh First whack at radeon driver.

No hardware to test yet, but it builds.
 1.2 18-Mar-2014  riastradh branches: 1.2.2; 1.2.4; 1.2.6;
Merge riastradh-drm2 to HEAD.
 1.1 24-Jul-2013  riastradh branches: 1.1.2;
file firmware.h was initially added on branch riastradh-drm2.
 1.1.2.1 24-Jul-2013  riastradh Add stubs for Linux header files for drm.
 1.2.6.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.2.6.1 18-Mar-2014  yamt file firmware.h was added on branch yamt-pagecache on 2014-05-22 11:40:56 +0000
 1.2.4.2 18-May-2014  rmind sync with head
 1.2.4.1 18-Mar-2014  rmind file firmware.h was added on branch rmind-smpnet on 2014-05-18 17:46:01 +0000
 1.2.2.1 10-Aug-2014  tls Rebase.
 1.6.30.1 10-Jun-2019  christos Sync with HEAD
 1.6.28.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.6.4.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.6.4.1 06-Aug-2014  tls file firmware.h was added on branch tls-maxphys on 2014-08-20 00:04:21 +0000
 1.2 25-Oct-2022  riastradh linux/frame.h: STACK_FRAME_NON_STANDARD
 1.1 17-Feb-2022  riastradh drm/vmwgfx: First draft. Passes make depend, doesn't build yet.
 1.7 19-Dec-2021  riastradh drm: Another pass over i915. Most of i915 gem builds now.
 1.6 19-Dec-2021  riastradh Linux defines struct file in linux/fs.h, match with includes


Author: Maya Rashish <maya@NetBSD.org>
 1.5 19-Dec-2021  riastradh Side-load <linux/wait_bit.h> in <linux/fs.h>.
 1.4 14-Feb-2020  maya Reduce diffs by side-loading some header files like Linux.

From riastradh
 1.3 14-Feb-2020  riastradh Reduce diffs by nixing DRM_SUSER macro, deleted upstream long ago.

Instead stub Linux capable(CAP_SYS_ADMIN).
 1.2 18-Mar-2014  riastradh branches: 1.2.4; 1.2.6; 1.2.10; 1.2.36; 1.2.42;
Merge riastradh-drm2 to HEAD.
 1.1 24-Jul-2013  riastradh branches: 1.1.2;
file fs.h was initially added on branch riastradh-drm2.
 1.1.2.1 24-Jul-2013  riastradh Add stubs for Linux header files for drm.
 1.2.42.1 29-Feb-2020  ad Sync with head.
 1.2.36.1 08-Apr-2020  martin Merge changes from current as of 20200406
 1.2.10.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.2.10.1 18-Mar-2014  tls file fs.h was added on branch tls-maxphys on 2014-08-20 00:04:21 +0000
 1.2.6.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.2.6.1 18-Mar-2014  yamt file fs.h was added on branch yamt-pagecache on 2014-05-22 11:40:56 +0000
 1.2.4.2 18-May-2014  rmind sync with head
 1.2.4.1 18-Mar-2014  rmind file fs.h was added on branch rmind-smpnet on 2014-05-18 17:46:01 +0000
 1.1 16-Jul-2014  riastradh branches: 1.1.2; 1.1.6;
First whack at radeon driver.

No hardware to test yet, but it builds.
 1.1.6.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.6.1 16-Jul-2014  tls file gcd.h was added on branch tls-maxphys on 2014-08-20 00:04:21 +0000
 1.1.2.2 10-Aug-2014  tls Rebase.
 1.1.2.1 16-Jul-2014  tls file gcd.h was added on branch tls-earlyentropy on 2014-08-10 06:55:39 +0000
 1.7 27-Aug-2018  riastradh gfp.h and slab.h are now used in kernel.h, so move to common.
 1.6 27-Aug-2018  riastradh Define __GFP_NOFAIL as zero since it's a noop here.
 1.5 17-Jul-2014  riastradh branches: 1.5.4; 1.5.28; 1.5.30;
Remove defunct declarations of alloc_page/free_page.
 1.4 16-Jul-2014  riastradh First whack at radeon driver.

No hardware to test yet, but it builds.
 1.3 16-Jul-2014  riastradh Make it build and boot on my test machines.

Screen blanks on boot on the Ivy Bridge system with

DRM error in cpt_serr_int_handler: PCH transcoder A FIFO underrun

But after that everything is OK. Appears to be an upstream problem.
To investigate...

I think there's a cache flushing issue somewhere -- there are little
display artefacts on my T60.
 1.2 18-Mar-2014  riastradh branches: 1.2.2; 1.2.4; 1.2.6;
Merge riastradh-drm2 to HEAD.
 1.1 24-Jul-2013  riastradh branches: 1.1.2;
file gfp.h was initially added on branch riastradh-drm2.
 1.1.2.2 24-Jul-2013  riastradh Implement Linux alloc_page/__free_page and kmap_atomic/kunmap_atomic.
 1.1.2.1 24-Jul-2013  riastradh Move GFP (`get free page') constants to <linux/gfp.h>.

Declare alloc_page and __free_page there too, to be implemented soon.
 1.2.6.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.2.6.1 18-Mar-2014  yamt file gfp.h was added on branch yamt-pagecache on 2014-05-22 11:40:56 +0000
 1.2.4.2 18-May-2014  rmind sync with head
 1.2.4.1 18-Mar-2014  rmind file gfp.h was added on branch rmind-smpnet on 2014-05-18 17:46:01 +0000
 1.2.2.1 10-Aug-2014  tls Rebase.
 1.5.30.1 10-Jun-2019  christos Sync with HEAD
 1.5.28.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.5.4.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.5.4.1 17-Jul-2014  tls file gfp.h was added on branch tls-maxphys on 2014-08-20 00:04:21 +0000
 1.3 19-Dec-2021  riastradh i915: hack hack hack
 1.2 27-Aug-2018  riastradh branches: 1.2.2; 1.2.6;
Can't and needn't xcall while cold.
 1.1 27-Aug-2018  riastradh Define synchronize_irq to broadcast xcall noop in <linux/hardirq.h>.
 1.2.6.2 10-Jun-2019  christos Sync with HEAD
 1.2.6.1 27-Aug-2018  christos file hardirq.h was added on branch phil-wifi on 2019-06-10 22:08:31 +0000
 1.2.2.2 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.2.2.1 27-Aug-2018  pgoyette file hardirq.h was added on branch pgoyette-compat on 2018-09-06 06:56:36 +0000
 1.5 19-Dec-2021  riastradh amdgpu_fb.c
amdgpu_fence.c
amdgpu_gart.c
amdgpu_fixpt31_32.c
amdgpu_fiji_smumgr.c
amdgpu_gem.c
amdgpu_gfx_v10_0.c
amdgpu_gfx_v6_0.c through amdgpu_gfx_v9_0.c
amdgpu_gmc.c
amdgpu_gmc_v6_0.c through amdgpu_gmc_v10_0.c
amdgpu_gtt_mgr.c
some amdgpu_h* files
some amdgpu_i* files
some amdgpu_j* files
amdgpu_kms.c
some amdgpu_m* and amdgpu_n* files
 1.4 19-Dec-2021  riastradh sys/param.h for uint32_t


Author: Maya Rashish <maya@NetBSD.org>
 1.3 19-Dec-2021  riastradh Dinky hash_32.
 1.2 18-Mar-2014  riastradh branches: 1.2.4; 1.2.6; 1.2.10;
Merge riastradh-drm2 to HEAD.
 1.1 24-Jul-2013  riastradh branches: 1.1.2;
file hash.h was initially added on branch riastradh-drm2.
 1.1.2.2 24-Jul-2013  riastradh Implement hash_long in <linux/hash.h>.

Uses the same hash function as in Linux, implemented differently.
 1.1.2.1 24-Jul-2013  riastradh Add stubs for Linux header files for drm.
 1.2.10.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.2.10.1 18-Mar-2014  tls file hash.h was added on branch tls-maxphys on 2014-08-20 00:04:21 +0000
 1.2.6.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.2.6.1 18-Mar-2014  yamt file hash.h was added on branch yamt-pagecache on 2014-05-22 11:40:56 +0000
 1.2.4.2 18-May-2014  rmind sync with head
 1.2.4.1 18-Mar-2014  rmind file hash.h was added on branch rmind-smpnet on 2014-05-18 17:46:01 +0000
 1.6 19-Dec-2021  riastradh amdgpu_fb.c
amdgpu_fence.c
amdgpu_gart.c
amdgpu_fixpt31_32.c
amdgpu_fiji_smumgr.c
amdgpu_gem.c
amdgpu_gfx_v10_0.c
amdgpu_gfx_v6_0.c through amdgpu_gfx_v9_0.c
amdgpu_gmc.c
amdgpu_gmc_v6_0.c through amdgpu_gmc_v10_0.c
amdgpu_gtt_mgr.c
some amdgpu_h* files
some amdgpu_i* files
some amdgpu_j* files
amdgpu_kms.c
some amdgpu_m* and amdgpu_n* files
 1.5 27-Aug-2018  riastradh branches: 1.5.2; 1.5.6;
Durr, declarations don't work like that.
 1.4 27-Aug-2018  riastradh Rewrite hashtable.h locally so it might work here.
 1.3 27-Aug-2018  riastradh some more definitions necessary

ifdef out all the i915 gtt virtual memory stuff that errors,
unless it looks exactly like the old code and then merge the
netbsd ifdefs for it.

we don't want to use their ALIGN(, which has more arguments,
use the old alt function.
merge in the old intel_acpi.c code.
don't duplicate DECLARE_BITMAP


Author: coypu <coypu@sdf.org>
Committer: Taylor R Campbell <riastradh@NetBSD.org>
 1.2 27-Aug-2018  riastradh something like hashtable.h from openbsd, WIP


Author: coypu <coypu@sdf.org>
Committer: Taylor R Campbell <riastradh@NetBSD.org>
 1.1 27-Aug-2018  riastradh local versions of headers required


Author: coypu <coypu@sdf.org>
Committer: Taylor R Campbell <riastradh@NetBSD.org>
 1.5.6.2 10-Jun-2019  christos Sync with HEAD
 1.5.6.1 27-Aug-2018  christos file hashtable.h was added on branch phil-wifi on 2019-06-10 22:08:31 +0000
 1.5.2.2 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.5.2.1 27-Aug-2018  pgoyette file hashtable.h was added on branch pgoyette-compat on 2018-09-06 06:56:36 +0000
 1.21 09-Jul-2022  riastradh linux/hdmi: Use ssize_t for all hdmi_*_infoframe_pack functions.
 1.20 09-Jul-2022  riastradh linux/hdmi: Handle unpacking audio frames too. Sort by number.
 1.19 09-Jul-2022  riastradh linux/hdmi: Make some private functions static.
 1.18 09-Jul-2022  riastradh linux/hdmi: Fix missing hdmi_avi_infoframe_init namespacing.
 1.17 09-Jul-2022  riastradh linux/hdmi.h: Split out logic into .c file.

Shoulda done this ages ago.
 1.16 09-Jul-2022  riastradh linux/hdmi.h: Implement hdmi_infoframe_log.
 1.15 09-Jul-2022  riastradh linux/hdmi.h: Fix spd infoframe header version.

Possibly relevant to PR kern/56740.
 1.14 19-Dec-2021  riastradh linux/hdmi: Update. Add unpack.
 1.13 19-Dec-2021  riastradh linux/hdmi: Fix buffer overrun with index typo.
 1.12 19-Dec-2021  riastradh linux/hdmi: Fix strlcpy abuse -- need strncpy to fill field.
 1.11 19-Dec-2021  riastradh i915: more passes
 1.10 19-Dec-2021  riastradh i915: another whack at it
 1.9 19-Dec-2021  riastradh Fill out some structs. Hopefully order doesn't matter...?

Also stub hdmi_drm_infoframe_init


Author: Maya Rashish <maya@NetBSD.org>
 1.8 19-Dec-2021  riastradh Stub hdmi structs


Author: Maya Rashish <maya@NetBSD.org>
 1.7 19-Dec-2021  riastradh Add some hdmi definitions.
 1.6 14-Nov-2015  jmcneill hdmi_audio_infoframe_pack: Initialize the entire output buffer.
hdmi_infoframe_checksum: Fix HDMI infoframe checksum calculations.
 1.5 24-Nov-2014  riastradh branches: 1.5.2;
Fix bounds checking in hdmi_infoframe_header_pack (PR kern/49411).
 1.4 23-Nov-2014  riastradh Back out previous, fix PR kern/49411 correctly.

frame->header.length is not initialized in the vendor packet case.
Instead, make hdmi_infoframe_header_pack take the packet length and
subtract the size of the header when packing the header.

(Could make it take the payload length instead, but for callers it is
more convenient to have a name for the whole packet length.)
 1.3 23-Nov-2014  riastradh Use correct length for hdmi_infoframe_header_pack in <linux/hdmi.h>.

Fixes PR kern/49411.
 1.2 16-Jul-2014  riastradh branches: 1.2.2; 1.2.4; 1.2.6;
First whack at radeon driver.

No hardware to test yet, but it builds.
 1.1 16-Jul-2014  riastradh Make it build and boot on my test machines.

Screen blanks on boot on the Ivy Bridge system with

DRM error in cpt_serr_int_handler: PCH transcoder A FIFO underrun

But after that everything is OK. Appears to be an upstream problem.
To investigate...

I think there's a cache flushing issue somewhere -- there are little
display artefacts on my T60.
 1.2.6.3 03-Dec-2017  jdolecek update from HEAD
 1.2.6.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.2.6.1 16-Jul-2014  tls file hdmi.h was added on branch tls-maxphys on 2014-08-20 00:04:21 +0000
 1.2.4.2 18-Nov-2015  msaitoh Pull up following revision(s) (requested by jmcneill in ticket #1039):
sys/external/bsd/drm2/include/linux/hdmi.h: revision 1.6
hdmi_audio_infoframe_pack: Initialize the entire output buffer.
hdmi_infoframe_checksum: Fix HDMI infoframe checksum calculations.
 1.2.4.1 11-Jan-2015  snj Pull up following revision(s) (requested by chs in ticket #401):
distrib/sets/lists/modules/md.amd64: revisions 1.46, 1.47 via patch
distrib/sets/lists/modules/md.i386: revisions 1.49, 1.50
sys/dev/ic/pcdisplayvar.h: revision 1.20
sys/dev/ic/vgavar.h: revision 1.32
sys/external/bsd/drm/dist/bsd-core/drm_drv.c: revision 1.26
sys/external/bsd/drm2/dist/drm/drm_agpsupport.c: revisions 1.5, 1.6
sys/external/bsd/drm2/dist/drm/drm_pci.c: revisions 1.4, 1.5
sys/external/bsd/drm2/dist/drm/drm_stub.c: revisions 1.6-1.8
sys/external/bsd/drm2/dist/drm/i915/i915_drv.h: revision 1.11
sys/external/bsd/drm2/dist/drm/radeon/cik.c: revision 1.3
sys/external/bsd/drm2/dist/drm/radeon/ni.c: revision 1.3
sys/external/bsd/drm2/dist/drm/radeon/si.c: revision 1.3
sys/external/bsd/drm2/dist/include/drm/drmP.h: revisions 1.8, 1.9
sys/external/bsd/drm2/dist/include/drm/drm_agpsupport.h: revisions 1.3, 1.4
sys/external/bsd/drm2/drm/drm_drv.c: revision 1.11
sys/external/bsd/drm2/drm/drm_module.c: revision 1.9
sys/external/bsd/drm2/drm/drm_sysctl.c: revisions 1.1-1.4
sys/external/bsd/drm2/drm/drm_vm.c: revision 1.7
sys/external/bsd/drm2/drm/files.drmkms: revisions 1.8, 1.9
sys/external/bsd/drm2/i915drm/files.i915drmkms: revision 1.9
sys/external/bsd/drm2/i915drm/i915_module.c: revisions 1.4, 1.5
sys/external/bsd/drm2/include/drm/drm_sysctl.h: revisions 1.1, 1.2
sys/external/bsd/drm2/include/linux/hdmi.h: revisions 1.3-1.5
sys/external/bsd/drm2/include/linux/module.h: revision 1.5
sys/external/bsd/drm2/include/linux/moduleparam.h: revisions 1.3, 1.4
sys/external/bsd/drm2/include/linux/pci.h: revision 1.11
sys/external/bsd/drm2/linux/linux_module.c: revision 1.5
sys/external/bsd/drm2/nouveau/files.nouveau: revision 1.4
sys/external/bsd/drm2/nouveau/nouveau_module.c: revision 1.3
sys/external/bsd/drm2/pci/drm_pci.c: revision 1.8
sys/external/bsd/drm2/pci/drm_pci_module.c: revision 1.3
sys/external/bsd/drm2/radeon/radeon_module.c: revision 1.3
sys/external/bsd/drm2/ttm/files.ttm: revision 1.1
sys/modules/drm2pci/Makefile: file removal
sys/modules/drmkms/Makefile: revisions 1.4-1.7
sys/modules/drmkms_linux/Makefile: revision 1.5
sys/modules/drmkms_pci/Makefile: revisions 1.3, 1.4
sys/modules/i915drmkms/Makefile: revisions 1.5-1.7
Split drm ttm config into a separate file.
--
Fix module build of drmkms_linux.
--
Remove vestigial drm2pci module, replaced by drmkms_pci.
--
fix the module class.
--
add the drmkms modules
--
make a drm_agp_destroy() function to resolve the circular dependency between
drmkms and drmkms_pci
--
finalize the idr code.
--
add drm_agp_destroy
--
fix drmkms module path for xen.
--
fix build failure.
/tmp/bracket/build/2014.11.10.22.43.46-i386/src/sys/external/bsd/drm2/include/linux/pci.h:36:20: fatal error: acpica.h: No such file or directory
--
make this work: add agpsupport and sysctl code
--
move agpsupport to drmkms to avoid circular dependencies.
--
turn on dynamic ldscript creation to handle link set symbol definitions
used in the automatic sysctl creation.
--
Add __link_set based code to automatically convert the linux module parameters
into sysctls.
--
this module needs MKLDSCRIPT too now
--
more _KERNEL_OPT
--
prettify and add to all the modules that have it.
--
fix description setting.
--
Adjust flags to allow building with clang.
--
Fix build with clang.
--
Drop casts in favour of expressions that actually give the right
pointer.
--
Move all PCI/AGP code back to drmkms_pci module where it belongs.
--
Use correct length for hdmi_infoframe_header_pack in <linux/hdmi.h>.
Fixes PR kern/49411.
--
Back out previous, fix PR kern/49411 correctly.
frame->header.length is not initialized in the vendor packet case.
Instead, make hdmi_infoframe_header_pack take the packet length and
subtract the size of the header when packing the header.
(Could make it take the payload length instead, but for callers it is
more convenient to have a name for the whole packet length.)
--
Fix bounds checking in hdmi_infoframe_header_pack (PR kern/49411).
--
Trivial build fix for no options SYSCTL_INCLUDE_DESCR case, to
avoid -Werror.
OK christos@ and riastradh@
--
fix debugging compilation (ALL kernel)
--
nouveau_nv50_fence.c needs -Wno-shadow.
--
fix a confusion between dev_t and devmajor_t, and include the primary
minor when calling makedev().
 1.2.2.2 10-Aug-2014  tls Rebase.
 1.2.2.1 16-Jul-2014  tls file hdmi.h was added on branch tls-earlyentropy on 2014-08-10 06:55:39 +0000
 1.5.2.1 27-Dec-2015  skrll Sync with HEAD (as of 26th Dec)
 1.6 19-Dec-2021  riastradh Side-load <linux/mm.h> in a few places.
 1.5 27-Aug-2018  riastradh Work around `kmap' namespace clash another way.
 1.4 27-Aug-2018  riastradh Sort.
 1.3 16-Jul-2014  riastradh branches: 1.3.4; 1.3.28; 1.3.30;
First whack at radeon driver.

No hardware to test yet, but it builds.
 1.2 18-Mar-2014  riastradh branches: 1.2.2; 1.2.4; 1.2.6;
Merge riastradh-drm2 to HEAD.
 1.1 24-Jul-2013  riastradh branches: 1.1.2;
file highmem.h was initially added on branch riastradh-drm2.
 1.1.2.5 08-Sep-2013  riastradh linux_ namespace for kmap and kunmap.
 1.1.2.4 08-Sep-2013  riastradh Fix kunmap: unlike kunmap_atomic, it takes a page, not a vaddr.

Unmapping the vaddr where the struct vm_page is stored makes for a
rather confusing state of affairs!
 1.1.2.3 24-Jul-2013  riastradh Implement non-`atomic' kmap/kunmap in drm2 Linux shims.

Uses uvm_km_alloc and pmap_kenter_pa. Does not use direct mappings
on architectures that support this (e.g., amd64).
 1.1.2.2 24-Jul-2013  riastradh Implement Linux alloc_page/__free_page and kmap_atomic/kunmap_atomic.
 1.1.2.1 24-Jul-2013  riastradh Add stubs for Linux header files for drm.
 1.2.6.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.2.6.1 18-Mar-2014  yamt file highmem.h was added on branch yamt-pagecache on 2014-05-22 11:40:56 +0000
 1.2.4.2 18-May-2014  rmind sync with head
 1.2.4.1 18-Mar-2014  rmind file highmem.h was added on branch rmind-smpnet on 2014-05-18 17:46:01 +0000
 1.2.2.1 10-Aug-2014  tls Rebase.
 1.3.30.1 10-Jun-2019  christos Sync with HEAD
 1.3.28.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.3.4.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.3.4.1 16-Jul-2014  tls file highmem.h was added on branch tls-maxphys on 2014-08-20 00:04:21 +0000
 1.1 19-Dec-2021  riastradh Add some Linux header stubs.
 1.7 19-Dec-2021  riastradh drm: Eliminate hrtimer_destroy and teardown_timer.

These are non-Linux shims added to the Linux API to pair with
hrtimer_setup and setup_timer, but they really only serve to call
callout_destroy, which is not strictly necessary in the NetBSD API.
So although we lose a little bit of diagnostic help this way, we also
reduce diffs a bit and save some trouble that bit us last week.
 1.6 19-Dec-2021  riastradh Add hrtimer_destroy


Author: Maya Rashish <maya@NetBSD.org>
Committer: Taylor R Campbell <riastradh@NetBSD.org>
 1.5 19-Dec-2021  riastradh i915: Adapt i915_perf.c.
 1.4 19-Dec-2021  riastradh linux compat: Draft hrtimer shims.

(not actually high-resolution, just a wrapper around callout(9))
 1.3 19-Dec-2021  riastradh Revert "Give up on finding how linux side-loads these"

Found it.
 1.2 19-Dec-2021  riastradh Stub struct hrtimer.
 1.1 06-Aug-2014  riastradh branches: 1.1.2; 1.1.6;
More Linux goo.
 1.1.6.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.6.1 06-Aug-2014  tls file hrtimer.h was added on branch tls-maxphys on 2014-08-20 00:04:21 +0000
 1.1.2.2 10-Aug-2014  tls Rebase.
 1.1.2.1 06-Aug-2014  tls file hrtimer.h was added on branch tls-earlyentropy on 2014-08-10 06:55:39 +0000
 1.1 16-Jul-2014  riastradh branches: 1.1.2; 1.1.6;
First whack at radeon driver.

No hardware to test yet, but it builds.
 1.1.6.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.6.1 16-Jul-2014  tls file hwmon-sysfs.h was added on branch tls-maxphys on 2014-08-20 00:04:21 +0000
 1.1.2.2 10-Aug-2014  tls Rebase.
 1.1.2.1 16-Jul-2014  tls file hwmon-sysfs.h was added on branch tls-earlyentropy on 2014-08-10 06:55:39 +0000
 1.1 16-Jul-2014  riastradh branches: 1.1.2; 1.1.6;
First whack at radeon driver.

No hardware to test yet, but it builds.
 1.1.6.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.6.1 16-Jul-2014  tls file hwmon.h was added on branch tls-maxphys on 2014-08-20 00:04:21 +0000
 1.1.2.2 10-Aug-2014  tls Rebase.
 1.1.2.1 16-Jul-2014  tls file hwmon.h was added on branch tls-earlyentropy on 2014-08-10 06:55:39 +0000
 1.4 26-Jul-2014  riastradh branches: 1.4.4;
Fill in i2c_bit_add_bus.
 1.3 16-Jul-2014  riastradh First whack at radeon driver.

No hardware to test yet, but it builds.
 1.2 18-Mar-2014  riastradh branches: 1.2.2; 1.2.4; 1.2.6;
Merge riastradh-drm2 to HEAD.
 1.1 24-Jul-2013  riastradh branches: 1.1.2;
file i2c-algo-bit.h was initially added on branch riastradh-drm2.
 1.1.2.2 24-Jul-2013  riastradh Add partial Linux i2c shim.

Just the parts we need for i915drm for now -- well, most of them;
more to come later.
 1.1.2.1 24-Jul-2013  riastradh Add stubs for Linux header files for drm.
 1.2.6.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.2.6.1 18-Mar-2014  yamt file i2c-algo-bit.h was added on branch yamt-pagecache on 2014-05-22 11:40:56 +0000
 1.2.4.2 18-May-2014  rmind sync with head
 1.2.4.1 18-Mar-2014  rmind file i2c-algo-bit.h was added on branch rmind-smpnet on 2014-05-18 17:46:01 +0000
 1.2.2.1 10-Aug-2014  tls Rebase.
 1.4.4.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.4.4.1 26-Jul-2014  tls file i2c-algo-bit.h was added on branch tls-maxphys on 2014-08-20 00:04:21 +0000
 1.14 19-Dec-2021  riastradh Make intel_psr.c build
netbsd-ify
Stub out intel_lpe_audio.c (for now?).
Hammer intel_opregion.c into shape.
Hack up intel_lrc.c
Adapt intel_reset.c
Stub out intel_region_lmem.c
Adapt intel_ring_submission.c
Adapt intel_rps.c
Adapt intel_sdvo.c
Adapt intel_runtime_pm.c
Adapt intel_sideband.c
Adapt intel_sprite.c
Adapt intel_tv.c
Adapt intel_tc.c
Adapt intel_sseu.c
Adapt intel_timeline.c
Adapt intel_uc_fw.c and fix typo
Fix up intel_uncore.c
intel_vga.c
intel_wakeref.c
intel_vdsc.c
intel_wopcm.c
intel_workarounds.c
i915_globals.c
Fix up intelfb.c
Stub out intel_guc_log.c
Stub out intel_dsi_dcs_backlight.c
i915_perf.c
intel_hdmi.c
intel_hdcp.c


Author: Maya Rashish <maya@NetBSD.org>
Committer: Taylor R Campbell <riastradh@NetBSD.org>
 1.13 19-Dec-2021  riastradh I2C_CLASS_SPD, IORESOURCE_IRQ
 1.12 19-Dec-2021  riastradh Add some sideloads.
 1.11 19-Dec-2021  riastradh match linux side-loading


Author: Maya Rashish <maya@NetBSD.org>
 1.10 19-Dec-2021  riastradh Provide a definition of I2C_M_STOP XXX


Author: Maya Rashish <maya@NetBSD.org>
 1.9 19-Dec-2021  riastradh Support i2c bus lock operations.
 1.8 05-Mar-2015  riastradh Reorganize Linux i2c header file and add a few more shims.
 1.7 05-Mar-2015  riastradh Remove outdated comment. The ->dev.parent stuff is part of the API.
 1.6 23-Aug-2014  riastradh branches: 1.6.2;
Another round of nouveau whack-a-mole.
 1.5 06-Aug-2014  riastradh branches: 1.5.2; 1.5.4;
Whack some nouveau moles.
 1.4 06-Aug-2014  riastradh Add Linux i2c stubs.
 1.3 16-Jul-2014  riastradh First whack at radeon driver.

No hardware to test yet, but it builds.
 1.2 18-Mar-2014  riastradh branches: 1.2.2; 1.2.4; 1.2.6;
Merge riastradh-drm2 to HEAD.
 1.1 24-Jul-2013  riastradh branches: 1.1.2;
file i2c.h was initially added on branch riastradh-drm2.
 1.1.2.5 24-Jul-2013  riastradh Add kludgey dev field to struct i2c_adapter for intel_dp.
 1.1.2.4 24-Jul-2013  riastradh Add partial Linux i2c shim.

Just the parts we need for i915drm for now -- well, most of them;
more to come later.
 1.1.2.3 24-Jul-2013  riastradh Include <sys/types.h> before <sys/device_if.h> in <linux/i2c.h>.
 1.1.2.2 24-Jul-2013  riastradh Define struct i2c_adapter as a device_t wrapper in <linux/i2c.h>.
 1.1.2.1 24-Jul-2013  riastradh Add stubs for Linux header files for drm.
 1.2.6.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.2.6.1 18-Mar-2014  yamt file i2c.h was added on branch yamt-pagecache on 2014-05-22 11:40:56 +0000
 1.2.4.2 18-May-2014  rmind sync with head
 1.2.4.1 18-Mar-2014  rmind file i2c.h was added on branch rmind-smpnet on 2014-05-18 17:46:01 +0000
 1.2.2.1 10-Aug-2014  tls Rebase.
 1.5.4.3 03-Dec-2017  jdolecek update from HEAD
 1.5.4.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.5.4.1 06-Aug-2014  tls file i2c.h was added on branch tls-maxphys on 2014-08-20 00:04:21 +0000
 1.5.2.2 06-Mar-2015  snj Pull up following revision(s) (requested by mrg in ticket #573):
sys/external/bsd/common/include/linux/kernel.h: 1.5, 1.6
sys/external/bsd/drm2/dist/drm/drm_ioctl.c: 1.4
sys/external/bsd/drm2/dist/drm/drm_irq.c: 1.6-1.8
sys/external/bsd/drm2/dist/drm/i915/i915_dma.c: 1.13-1.15
sys/external/bsd/drm2/dist/drm/i915/i915_gem.c: 1.23-1.27
sys/external/bsd/drm2/dist/drm/i915/i915_gem_execbuffer.c: 1.5
sys/external/bsd/drm2/dist/drm/i915/intel_display.c: 1.14, 1.15
sys/external/bsd/drm2/dist/drm/i915/intel_dp.c: 1.10
sys/external/bsd/drm2/dist/drm/i915/intel_drv.h: 1.8
sys/external/bsd/drm2/dist/drm/i915/intel_i2c.c: 1.8-1.13
sys/external/bsd/drm2/dist/drm/i915/intel_pm.c: 1.6
sys/external/bsd/drm2/dist/drm/i915/intel_ringbuffer.c: 1.5, 1.6
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/device/nouveau_engine_device_base.c: 1.4
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/fifo/nouveau_engine_fifo_nvc0.c: 1.3, 1.4
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/fifo/nouveau_engine_fifo_nve0.c: 1.3, 1.4
sys/external/bsd/drm2/dist/drm/nouveau/core/include/core/device.h: 1.4
sys/external/bsd/drm2/dist/drm/nouveau/core/include/subdev/mc.h: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/include/subdev/pwr.h: 1.3, 1.4
sys/external/bsd/drm2/dist/drm/nouveau/core/os.h: 1.4, 1.5
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/bios/nouveau_subdev_bios_base.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/bios/nouveau_subdev_bios_pll.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/clock/nouveau_subdev_clock_base.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/clock/nouveau_subdev_clock_nv50.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/devinit/fbmem.h: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/devinit/nouveau_subdev_devinit_nv04.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/fb/nouveau_subdev_fb_nv50.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/fb/nouveau_subdev_fb_nvc0.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/fb/nv50.h: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/fb/nvc0.h: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/mc/nouveau_subdev_mc_base.c: 1.2, 1.3
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/mxm/nouveau_subdev_mxm_nv50.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/pwr/nouveau_subdev_pwr_base.c: 1.3, 1.4
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/therm/nouveau_subdev_therm_ic.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/timer/nouveau_subdev_timer_nv04.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/vm/nouveau_subdev_vm_base.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/vm/nouveau_subdev_vm_nv04.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/vm/nouveau_subdev_vm_nv44.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/vm/nv04.h: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_bo.h: 1.3
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_drm.c: 1.4, 1.5
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_fbcon.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_nv50_display.c: 1.3
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_nv84_fence.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_ttm.c: 1.3
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_ttm.h: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_vga.h: 1.2
sys/external/bsd/drm2/dist/drm/radeon/radeon_fence.c: 1.6-1.8
sys/external/bsd/drm2/dist/drm/radeon/radeon_pm.c: 1.3
sys/external/bsd/drm2/dist/drm/radeon/rs400.c: 1.3
sys/external/bsd/drm2/dist/drm/via/via_dmablit.c: 1.3, 1.4
sys/external/bsd/drm2/dist/drm/via/via_drv.h: 1.3
sys/external/bsd/drm2/dist/drm/via/via_irq.c: 1.3, 1.4
sys/external/bsd/drm2/dist/drm/via/via_video.c: 1.3, 1.4
sys/external/bsd/drm2/dist/include/drm/drmP.h: 1.10
sys/external/bsd/drm2/dist/include/drm/drm_crtc.h: 1.4
sys/external/bsd/drm2/dist/include/drm/drm_modes.h: 1.3
sys/external/bsd/drm2/dist/uapi/drm/i915_drm.h: 1.2
sys/external/bsd/drm2/drm/drm_cache.c: 1.4-1.6
sys/external/bsd/drm2/drm/drm_drv.c: 1.14
sys/external/bsd/drm2/drm/drm_module.c: 1.10
sys/external/bsd/drm2/drm/drm_sysctl.c: 1.5
sys/external/bsd/drm2/drm/drm_vma_manager.c: 1.2
sys/external/bsd/drm2/drm/drmfb.c: 1.1
sys/external/bsd/drm2/drm/files.drmkms: 1.10, 1.11
sys/external/bsd/drm2/i2c/drm_encoder_slave.c: 1.1
sys/external/bsd/drm2/i915drm/files.i915drmkms: 1.7, 1.10
sys/external/bsd/drm2/i915drm/intelfb.c: 1.11, 1.12
sys/external/bsd/drm2/include/asm/io.h: 1.4
sys/external/bsd/drm2/include/asm/unaligned.h: 1.2, 1.3
sys/external/bsd/drm2/include/drm/drm_encoder_slave.h: 1.1
sys/external/bsd/drm2/include/drm/drm_wait_netbsd.h: 1.7-1.11
sys/external/bsd/drm2/include/drm/drmfb.h: 1.1
sys/external/bsd/drm2/include/drm/drmfb_pci.h: 1.1, 1.2
sys/external/bsd/drm2/include/linux/bitops.h: 1.9
sys/external/bsd/drm2/include/linux/i2c.h: 1.7, 1.8
sys/external/bsd/drm2/include/linux/io-mapping.h: 1.5
sys/external/bsd/drm2/include/linux/moduleparam.h: 1.5
sys/external/bsd/drm2/include/linux/pci.h: 1.12-1.15
sys/external/bsd/drm2/include/linux/pm.h: 1.4
sys/external/bsd/drm2/include/linux/reboot.h: 1.2
sys/external/bsd/drm2/include/linux/slab.h: 1.5
sys/external/bsd/drm2/include/linux/string.h: 1.4
sys/external/bsd/drm2/include/linux/vgaarb.h: 1.3
sys/external/bsd/drm2/include/linux/ww_mutex.h: 1.10
sys/external/bsd/drm2/linux/files.drmkms_linux: 1.8
sys/external/bsd/drm2/linux/linux_i2c.c: 1.3
sys/external/bsd/drm2/linux/linux_ww_mutex.c: 1.1
sys/external/bsd/drm2/nouveau/files.nouveau: 1.5-1.8
sys/external/bsd/drm2/nouveau/nouveau_pci.c: 1.1-1.3
sys/external/bsd/drm2/nouveau/nouveau_pci.h: 1.1
sys/external/bsd/drm2/nouveau/nouveau_sysfs.c: 1.1
sys/external/bsd/drm2/nouveau/nouveau_vga.c: 1.1
sys/external/bsd/drm2/nouveau/nouveaufb.c: 1.1
sys/external/bsd/drm2/nouveau/nouveaufb.h: 1.1
sys/external/bsd/drm2/pci/drm_pci.c: 1.10-1.12
sys/external/bsd/drm2/pci/drm_pci_module.c: 1.4
sys/external/bsd/drm2/pci/drmfb_pci.c: 1.1-1.3
sys/external/bsd/drm2/pci/files.drmkms_pci: 1.5
sys/external/bsd/drm2/radeon/radeon_pci.c: 1.5-1.7
sys/modules/drmkms/Makefile: 1.8, 1.9
sys/modules/drmkms_linux/Makefile: 1.6
sys/modules/drmkms_pci/Makefile: 1.5
sync drm2 with HEAD.
 1.5.2.1 21-Sep-2014  snj Pull up following revision(s) (requested by riastradh in ticket #95):
sys/external/bsd/drm2/dist/drm/nouveau/core/include/subdev/fb.h: revision 1.2
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_nv10_fence.c: revision 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/bar/nouveau_subdev_bar_base.c: revision 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/include/engine/device.h: revision 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/include/subdev/pwr.h: revision 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/nouveau_engine_xtensa.c: revision 1.2
sys/external/bsd/drm2/include/linux/bitops.h: revision 1.8
sys/external/bsd/drm2/dist/drm/nouveau/dispnv04/nouveau_dispnv04_tvnv17.c: revision 1.3
sys/external/bsd/drm2/dist/drm/nouveau/dispnv04/nouveau_dispnv04_tvmodesnv17.c: revision 1.3
sys/external/bsd/drm2/dist/drm/nouveau/core/include/core/device.h: revision 1.3
sys/external/bsd/drm2/include/drm/drm_agp_netbsd.h: revision 1.4
sys/external/bsd/drm2/include/linux/spinlock.h: revision 1.4
sys/external/bsd/drm2/include/linux/pm_runtime.h: revision 1.3
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/crypt/nouveau_engine_crypt_nv98.c: revision 1.2
sys/external/bsd/drm2/nouveau/files.nouveau: revision 1.3
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/disp/nouveau_engine_disp_dacnv50.c: revision 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/fifo/nouveau_engine_fifo_nve0.c: revision 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/disp/nouveau_engine_disp_nv50.c: revision 1.2
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_gem.c: revision 1.3
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_bo.c: revision 1.5
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/perfmon/nouveau_engine_perfmon_base.c: revision 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/crypt/nouveau_engine_crypt_nv84.c: revision 1.2
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_fence.c: revision 1.3
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/graph/nouveau_engine_graph_nv50.c: revision 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/fifo/nouveau_engine_fifo_nvc0.c: revision 1.2
sys/external/bsd/drm2/include/linux/vmalloc.h: revision 1.4
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/fifo/nve0.h: revision 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/instmem/nv04.h: revision 1.2
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_drm.c: revision 1.3
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_drm.h: revision 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/fifo/nouveau_engine_fifo_base.c: revision 1.3
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/disp/nouveau_engine_disp_nvd0.c: revision 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/disp/nouveau_engine_disp_nv04.c: revision 1.2
sys/external/bsd/drm2/nouveau/nouveau_module.c: revision 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/instmem/nouveau_subdev_instmem_nv40.c: revision 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/graph/nouveau_engine_graph_gm107.c: revision 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/graph/nouveau_engine_graph_ctxnvd7.c: revision 1.2
sys/external/bsd/drm2/include/linux/mutex.h: revision 1.7
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/disp/nv50.h: revision 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/device/nouveau_engine_device_base.c: revision 1.3
sys/external/bsd/drm2/include/linux/i2c.h: revision 1.6
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/graph/nouveau_engine_graph_nvc0.c: revision 1.2
sys/external/bsd/drm2/include/linux/pagemap.h: revision 1.3
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/instmem/nouveau_subdev_instmem_nv04.c: revision 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/copy/nouveau_engine_copy_nva3.c: revision 1.2
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_nv50_display.c: revision 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/include/subdev/bar.h: revision 1.3
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/pwr/nouveau_subdev_pwr_base.c: revision 1.2
Another round of nouveau whack-a-mole.
 1.6.2.1 06-Apr-2015  skrll Sync with HEAD
 1.11 11-Jul-2023  riastradh linux/idr.h: Need <sys/mutex.h> for kmutex_t.
 1.10 25-Oct-2022  riastradh branches: 1.10.2;
linux/idr.h: Update ida_* API.
 1.9 19-Dec-2021  riastradh Teach idr_remove to accept failure.

But teach it to return the data if it succeeds too.
 1.8 19-Dec-2021  riastradh Define idr_init_base.

Nothing actually uses this at the moment, because callers already
specify the base. Not really sure what the point is!
 1.7 27-Aug-2018  riastradh Draft rewrite of idr preload.

Previous idr code assumed every caller would definitely call
idr_preload, idr_alloc, idr_preload_end, but some callers skip
idr_alloc if an intermediate failure happens first, and would
therefore leak idr nodes.

Use a per-lwp single-node cache instead, and print warnings about
leakers.
 1.6 27-Aug-2018  riastradh Add ida_simple_remove.

Same as ida_remove for us. Linux requires caller to handle locking
for ida_remove (so it works with RCU) and ida_simple_remove just uses
a global lock where for users that aren't performance-critical. If
we ever pserialized idr, we'd have to do the same.
 1.5 27-Aug-2018  riastradh Add idr_get_next and idr_for_each_entry.
 1.4 27-Aug-2018  riastradh Sort.
 1.3 16-Jul-2014  riastradh branches: 1.3.4; 1.3.28; 1.3.30;
Make it build and boot on my test machines.

Screen blanks on boot on the Ivy Bridge system with

DRM error in cpt_serr_int_handler: PCH transcoder A FIFO underrun

But after that everything is OK. Appears to be an upstream problem.
To investigate...

I think there's a cache flushing issue somewhere -- there are little
display artefacts on my T60.
 1.2 18-Mar-2014  riastradh branches: 1.2.2; 1.2.4; 1.2.6;
Merge riastradh-drm2 to HEAD.
 1.1 24-Jul-2013  riastradh branches: 1.1.2;
file idr.h was initially added on branch riastradh-drm2.
 1.1.2.9 15-Jan-2014  riastradh Convert linux_idr(9) to use spin locks.

idr_for_each is unlocked; caller must exclude modifications.

Eventually this should be rewritten with pserialize and a fancy
bitmap algorithm, but this *actually* works for now.
 1.1.2.8 15-Jan-2014  riastradh Revert "Rewrite idr to use a dumber algorithm that admits pserialized use."

This reverts commit 3a389a1cb20777fb73575f0514b96265052ac1ea.

I don't know what I was smoking with this; just need to change the
rwlock to a spin lock and we'll be good!
 1.1.2.7 30-Dec-2013  riastradh Rewrite idr to use a dumber algorithm that admits pserialized use.

drm2 doesn't use them with RCU, but it does use them under spin locks,
so an rwlock is not kosher.

This algorithm is super-dumb, but the idr API has changed upstream,
and this is not performance-critical, so it's not worth investing
time in a better algorithm at the moment.
 1.1.2.6 24-Jul-2013  riastradh Use cpp to prefix linux_ to all the idr names.

Now all global symbols drm2.kmod defines begin with linux_ or drm_,
making it easier to check whether I've missed anything by running

nm --undefined-only drm2.kmod | awk '$3 ~ /^(drm|linux)_/'
 1.1.2.5 24-Jul-2013  riastradh Add idr_for_each to Linux idr abstraction.
 1.1.2.4 24-Jul-2013  riastradh Implement idr_replace.
 1.1.2.3 24-Jul-2013  riastradh Implement idr_remove_all.
 1.1.2.2 24-Jul-2013  riastradh Dumb implementation of a subset of Linux's idr abstraction.

An idr maintains a mapping from integers to data, like file descriptors
to struct file pointers.
 1.1.2.1 24-Jul-2013  riastradh Add stubs for Linux header files for drm.
 1.2.6.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.2.6.1 18-Mar-2014  yamt file idr.h was added on branch yamt-pagecache on 2014-05-22 11:40:56 +0000
 1.2.4.2 18-May-2014  rmind sync with head
 1.2.4.1 18-Mar-2014  rmind file idr.h was added on branch rmind-smpnet on 2014-05-18 17:46:01 +0000
 1.2.2.1 10-Aug-2014  tls Rebase.
 1.3.30.1 10-Jun-2019  christos Sync with HEAD
 1.3.28.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.3.4.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.3.4.1 16-Jul-2014  tls file idr.h was added on branch tls-maxphys on 2014-08-20 00:04:21 +0000
 1.10.2.1 09-Aug-2023  martin Pull up following revision(s) (requested by maya in ticket #316):

sys/arch/m68k/include/mutex.h: revision 1.13
sys/arch/arm/include/cpu.h: revision 1.125
sys/arch/sun68k/include/intr.h: revision 1.21
sys/arch/arm/include/mutex.h: revision 1.28
sys/sys/rwlock.h: revision 1.18
sys/arch/powerpc/include/mutex.h: revision 1.7
sys/arch/arm/include/mutex.h: revision 1.29
sys/arch/powerpc/include/mutex.h: revision 1.8
sys/uvm/uvm_param.h: revision 1.42
sys/sys/ksem.h: revision 1.16
sys/arch/x86/include/mutex.h: revision 1.10
sys/sys/proc.h: revision 1.372
sys/sys/ksem.h: revision 1.17
sys/arch/ia64/include/mutex.h: revision 1.8
sys/arch/evbarm/include/intr.h: revision 1.29
sys/sys/lua.h: revision 1.9
sys/arch/next68k/include/intr.h: revision 1.23
sys/arch/ia64/include/mutex.h: revision 1.9
sys/arch/hp300/include/intr.h: revision 1.35
sys/arch/hp300/include/intr.h: revision 1.36
sys/arch/sparc/include/cpu.h: revision 1.111
sys/arch/hppa/include/mutex.h: revision 1.16
sys/arch/vax/include/intr.h: revision 1.31
sys/arch/hppa/include/mutex.h: revision 1.17
sys/arch/news68k/include/intr.h: revision 1.28
sys/arch/hppa/include/mutex.h: revision 1.18
sys/arch/hppa/include/intr.h: revision 1.3
sys/arch/hppa/include/mutex.h: revision 1.19
sys/arch/hppa/include/intr.h: revision 1.4
sys/sys/sched.h: revision 1.92
sys/opencrypto/cryptodev.h: revision 1.51
sys/arch/vax/include/mutex.h: revision 1.20
sys/arch/sparc64/include/mutex.h: revision 1.10
sys/arch/ia64/include/sapicvar.h: revision 1.2
sys/arch/riscv/include/mutex.h: revision 1.5
sys/arch/amiga/dev/grfabs_cc.c: revision 1.39
sys/external/bsd/drm2/include/linux/idr.h: revision 1.11
sys/arch/riscv/include/mutex.h: revision 1.6
sys/ddb/files.ddb: revision 1.16
sys/arch/mac68k/include/intr.h: revision 1.32
share/man/man4/ddb.4: revision 1.203
sys/ddb/db_command.c: revision 1.183
sys/arch/mips/include/mutex.h: revision 1.10
sys/ddb/db_command.c: revision 1.184
sys/arch/x68k/include/intr.h: revision 1.22
sys/arch/sparc/include/psl.h: revision 1.51
sys/arch/or1k/include/mutex.h: revision 1.4
sys/arch/mips/include/mutex.h: revision 1.11
sys/arch/arm/xscale/pxa2x0_intr.h: revision 1.16
sys/arch/sparc64/include/cpu.h: revision 1.134
sys/arch/sparc/include/psl.h: revision 1.52
sys/arch/or1k/include/mutex.h: revision 1.5
sys/arch/mvme68k/include/intr.h: revision 1.22
sys/arch/luna68k/include/intr.h: revision 1.16
external/cddl/osnet/sys/sys/kcondvar.h: revision 1.6
sys/arch/sparc/include/mutex.h: revision 1.12
sys/arch/sparc/include/mutex.h: revision 1.13
sys/arch/usermode/include/mutex.h: revision 1.5
sys/arch/usermode/include/mutex.h: revision 1.6
sys/kern/kern_core.c: revision 1.38
usr.sbin/crash/Makefile: revision 1.49
sys/arch/amiga/include/intr.h: revision 1.23
sys/arch/alpha/include/mutex.h: revision 1.12
sys/arch/alpha/include/mutex.h: revision 1.13
sys/arch/evbarm/lubbock/sacc_obio.c: revision 1.16
sys/ddb/ddb.h: revision 1.6
sys/arch/sparc64/include/mutex.h: revision 1.8
sys/arch/sh3/include/mutex.h: revision 1.12
sys/arch/evbarm/lubbock/sacc_obio.c: revision 1.17
sys/ddb/db_syncobj.c: revision 1.1
sys/arch/vax/include/mutex.h: revision 1.18
sys/arch/sparc64/include/psl.h: revision 1.63
sys/arch/sparc64/include/mutex.h: revision 1.9
sys/arch/sh3/include/mutex.h: revision 1.13
sys/arch/evbarm/lubbock/obio.c: revision 1.13
sys/arch/atari/include/intr.h: revision 1.23
sys/ddb/db_syncobj.c: revision 1.2
sys/arch/vax/include/mutex.h: revision 1.19
sys/arch/evbarm/g42xxeb/obio.c: revision 1.14
sys/arch/evbarm/g42xxeb/obio.c: revision 1.15
sys/arch/cesfic/include/intr.h: revision 1.14
sys/ddb/db_syncobj.h: revision 1.1
sys/arch/x86/include/cpu.h: revision 1.134
sys/arch/evbarm/g42xxeb/obio.c: revision 1.16
sys/arch/cesfic/include/intr.h: revision 1.15
sys/arch/arm/xscale/pxa2x0_intr.c: revision 1.26
sys/sys/cpu_data.h: revision 1.54
sys/arch/m68k/include/mutex.h: revision 1.12
sys/arch/ia64/acpi/madt.c: revision 1.6

sys/rwlock.h: Make this more self-contained for bool.

machine/mutex.h: Sprinkle includes so this can be used by crash(8).

ddb: New `show all tstiles' command.
Shows who's waiting for which locks and what the owner is up to.

Include psl.h for ipl_cookie_t if __MUTEX_PRIVATE

sys: Rip <sys/resourcevar.h> out of <uvm/uvm_param.h>.

And thus out of <sys/param.h>, which is exceedingly overused and
fragile and delenda est.

Should fix (some) issues with the recent inclusion of machine/lock.h
in various machine/mutex.h files.

arm/mutex.h: Need machine/intr.h, machine/lock.h.

For ipl_cookie_t and __cpu_simple_lock_t.
evbarm/intr.h: Define ipl_cookie_t before including ARM_INTR_IMPL.

Otherwise arm/mutex.h doesn't work, due to a cyclic dependency which
should really be fixed.
opencrypto/cryptodev.h: Fix includes.
- Move sys/condvar.h under #ifdef _KERNEL.
- Add some other necessary includes and forward declarations.
- Sort.

hp300/intr.h: Fix missing includes.
linux/idr.h: Need <sys/mutex.h> for kmutex_t.
amiga/intr.h: Don't define spl*() functions if !_KERNEL.

This is used by crash(8) now, and what's important is ipl_cookie_t.
cesfic/intr.h: Expose ipl_cookie_t to userland for crash(8).
cesfic/intr.h: Expose ipl_cookie_t to userland only with _KMEMUSER.

Probably not necessary but let's be a little more cautious about
this.

atari/intr.h: Expose ipl_cookie_t with _KMEMUSER for crash(8).

arm/cpu.h: Need sys/param.h for COHERENCY_UNIT.

Nix machine/param.h -- not meant to be used directly, pulled in by
sys/param.h.

Move the definition of ipl_cookie_t out of the kernel-only sections,
some _KMEMUSER applications need it.

ddb: Cast pointer to uintptr_t first before db_expr_t.

hppa/intr.h: Expose ipl_cookie_t to _KMEMUSER for crash(8).

luna68k/intr.h: Expose ipl_cookie_t to _KMEMUSER for crash(8).

mvme68k/intr.h: Expose ipl_cookie_t to _KMEMUSER for crash(8).

news68k/intr.h: Fix includes. Put some definitions under _KERNEL.

next68k/intr.h: Expose ipl_cookie_t to _KMEMUSER for crash(8).

sys/ksem.h: Hack around fstat(8) abuse of _KERNEL.

sun68k/intr.h: Expose ipl_cookie_t to _KMEMUSER for crash(8).

vax/intr.h: Expose ipl_cookie_t to _KMEMUSER for crash(8).

x68k/intr.h: Put functions under _KERNEL so crash(8) can use this.

Make ipl_cookie_t visible for _KMEMUSER userland applications.

fix editor mishap in previous

Explicitly include <sys/mutex.h> for kmutex_t.

Replace kmutex_t * (which may be undefined here) with struct kmutex *,
suggested by Taylor.

hp300/intr.h: Put most of this under #ifdef _KERNEL.
Only ipl_cookie_t really needs to be exposed now, for crash(8).

mac68k/intr.h: Expose ipl_cookie_t to _KMEMUSER for crash(8).
Make inclusion of sys/intr.h explicit for spl*.

fix hppa and vax builds.

machine/lock.h isn't necessary for __cpu_simple_lock_t, it's in
sys/types.h. avoids cpu_data.h vs sched.h include order issues.

move the hppa ipl_t typedef with the moved usage of it.
machine/mutex.h: Sprinkle sys/types.h, omit machine/lock.h.

Turns out machine/lock.h is not needed for __cpu_simple_lock_t, which
always comes from sys/types.h. And, really, sys/types.h (or at least
sys/stdint.h) is needed for uintN_t and uintptr_t.

ddb: Cast pointer to uintptr_t, then to db_expr_t.
Avoids warnings about conversion between pointer and integer of
different size on some architectures.

re-fix hppa builds.

this file uses __cpu_simple_lock(), not just the underlying type,
so it does need machine/lock.h.

Break cycle by using `struct kmutex *' instead of `kmutex_t *'.
sys/sched.h included sys/mutex.h
which includes sys/intr.h
which includes machine/intr.h
which on cats includes arm/footbridge/footbridge_intr.h
which includes arm/cpu.h
which includes sys/cpu_data.h
which includes sys/sched.h

But there was never any real need for sys/mutex.h in sys/sched.h,
because it only uses pointers to the opaque struct kmutex. Cycle
broken by using `struct kmutex *' instead of pulling in sys/mutex.h
for the definition of kmutex_t.

Side effect: This revealed that sys/cpu_data.h needed sys/intr.h
(which was pulled in accidentally by sys/mutex.h via sys/sched.h) for
SOFTINT_COUNT. Also revealed some other machine/cpu.h header files
were missing includes of sys/mutex.h for kmutex_t.

ia64: Need sys/types.h for u_int, vaddr_t; sys/mutex.h for kmutex_t.

explicitly include no longer implicitly included sys/mutex.h.

arm/xscale: Use sys/bitops.h fls32 - 1 instead of 31 - __builtin_clz.
Sidesteps namespace collision with `#define bits ...' in net/zlib.c.

complete the previous - there were two calls to find_first_bit() to fix.

arm/xscale: Missed a spot with previous find_first_bit commit.

evbarm/g42xxeb: Fix off-by-one in previous.

The original find_first_bit(x) was 31 - __builtin_clz((uint32_t)x),
which is equivalent to fls32(x) - 1, not to fls32(x).

Note that fls32 is 1-based and returns 0 for x=0.
 1.2 18-Mar-2014  riastradh branches: 1.2.4; 1.2.6; 1.2.10;
Merge riastradh-drm2 to HEAD.
 1.1 24-Jul-2013  riastradh branches: 1.1.2;
file ihex.h was initially added on branch riastradh-drm2.
 1.1.2.1 24-Jul-2013  riastradh Add stubs for Linux header files for drm.
 1.2.10.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.2.10.1 18-Mar-2014  tls file ihex.h was added on branch tls-maxphys on 2014-08-20 00:04:21 +0000
 1.2.6.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.2.6.1 18-Mar-2014  yamt file ihex.h was added on branch yamt-pagecache on 2014-05-22 11:40:56 +0000
 1.2.4.2 18-May-2014  rmind sync with head
 1.2.4.1 18-Mar-2014  rmind file ihex.h was added on branch rmind-smpnet on 2014-05-18 17:46:01 +0000
 1.4 19-Dec-2021  riastradh Make intel_psr.c build
netbsd-ify
Stub out intel_lpe_audio.c (for now?).
Hammer intel_opregion.c into shape.
Hack up intel_lrc.c
Adapt intel_reset.c
Stub out intel_region_lmem.c
Adapt intel_ring_submission.c
Adapt intel_rps.c
Adapt intel_sdvo.c
Adapt intel_runtime_pm.c
Adapt intel_sideband.c
Adapt intel_sprite.c
Adapt intel_tv.c
Adapt intel_tc.c
Adapt intel_sseu.c
Adapt intel_timeline.c
Adapt intel_uc_fw.c and fix typo
Fix up intel_uncore.c
intel_vga.c
intel_wakeref.c
intel_vdsc.c
intel_wopcm.c
intel_workarounds.c
i915_globals.c
Fix up intelfb.c
Stub out intel_guc_log.c
Stub out intel_dsi_dcs_backlight.c
i915_perf.c
intel_hdmi.c
intel_hdcp.c


Author: Maya Rashish <maya@NetBSD.org>
Committer: Taylor R Campbell <riastradh@NetBSD.org>
 1.3 25-Apr-2014  riastradh branches: 1.3.2; 1.3.4; 1.3.8;
Implement Linux dmi_check_system API.

Use it to get a Thinkpad quirk for i915 graphics.

Patch from nonoka@, PR 48708.
 1.2 18-Mar-2014  riastradh branches: 1.2.2;
Merge riastradh-drm2 to HEAD.
 1.1 24-Jul-2013  riastradh branches: 1.1.2;
file init.h was initially added on branch riastradh-drm2.
 1.1.2.1 24-Jul-2013  riastradh Add stubs for Linux header files for drm.
 1.2.2.1 10-Aug-2014  tls Rebase.
 1.3.8.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.3.8.1 25-Apr-2014  tls file init.h was added on branch tls-maxphys on 2014-08-20 00:04:21 +0000
 1.3.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.3.4.1 25-Apr-2014  yamt file init.h was added on branch yamt-pagecache on 2014-05-22 11:40:56 +0000
 1.3.2.2 18-May-2014  rmind sync with head
 1.3.2.1 25-Apr-2014  rmind file init.h was added on branch rmind-smpnet on 2014-05-18 17:46:01 +0000
 1.2 18-Mar-2014  riastradh branches: 1.2.4; 1.2.6; 1.2.10;
Merge riastradh-drm2 to HEAD.
 1.1 24-Jul-2013  riastradh branches: 1.1.2;
file input.h was initially added on branch riastradh-drm2.
 1.1.2.1 24-Jul-2013  riastradh Add stubs for Linux header files for drm.
 1.2.10.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.2.10.1 18-Mar-2014  tls file input.h was added on branch tls-maxphys on 2014-08-20 00:04:21 +0000
 1.2.6.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.2.6.1 18-Mar-2014  yamt file input.h was added on branch yamt-pagecache on 2014-05-22 11:40:56 +0000
 1.2.4.2 18-May-2014  rmind sync with head
 1.2.4.1 18-Mar-2014  rmind file input.h was added on branch rmind-smpnet on 2014-05-18 17:46:01 +0000
 1.2 18-Mar-2014  riastradh branches: 1.2.4; 1.2.6; 1.2.10;
Merge riastradh-drm2 to HEAD.
 1.1 24-Jul-2013  riastradh branches: 1.1.2;
file intel-iommu.h was initially added on branch riastradh-drm2.
 1.1.2.1 24-Jul-2013  riastradh Add stubs for Linux header files for drm.
 1.2.10.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.2.10.1 18-Mar-2014  tls file intel-iommu.h was added on branch tls-maxphys on 2014-08-20 00:04:21 +0000
 1.2.6.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.2.6.1 18-Mar-2014  yamt file intel-iommu.h was added on branch yamt-pagecache on 2014-05-22 11:40:56 +0000
 1.2.4.2 18-May-2014  rmind sync with head
 1.2.4.1 18-Mar-2014  rmind file intel-iommu.h was added on branch rmind-smpnet on 2014-05-18 17:46:01 +0000
 1.10 19-Dec-2021  riastradh drm: Sprinkle miscellaneous includes.
 1.9 19-Dec-2021  riastradh drm: Another pass over i915. Most of i915 gem builds now.
 1.8 19-Dec-2021  riastradh Match linux side-loading


Author: Maya Rashish <maya@NetBSD.org>
 1.7 19-Dec-2021  riastradh Stub disable_irq, enable_irq.
 1.6 19-Dec-2021  riastradh <linux/interrupt.h> provides the tasklet API.
 1.5 19-Dec-2021  riastradh <linux/interrupt.h> side loads <linux/kernel.h>.
 1.4 14-Feb-2020  maya Reduce diffs by side-loading some header files like Linux.

From riastradh
 1.3 27-Aug-2018  riastradh branches: 1.3.6;
Define in_interrupt for debugging assertions.
 1.2 18-Mar-2014  riastradh branches: 1.2.4; 1.2.6; 1.2.10; 1.2.34; 1.2.36;
Merge riastradh-drm2 to HEAD.
 1.1 24-Jul-2013  riastradh branches: 1.1.2;
file interrupt.h was initially added on branch riastradh-drm2.
 1.1.2.1 24-Jul-2013  riastradh Add stubs for Linux header files for drm.
 1.2.36.2 08-Apr-2020  martin Merge changes from current as of 20200406
 1.2.36.1 10-Jun-2019  christos Sync with HEAD
 1.2.34.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.2.10.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.2.10.1 18-Mar-2014  tls file interrupt.h was added on branch tls-maxphys on 2014-08-20 00:04:21 +0000
 1.2.6.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.2.6.1 18-Mar-2014  yamt file interrupt.h was added on branch yamt-pagecache on 2014-05-22 11:40:56 +0000
 1.2.4.2 18-May-2014  rmind sync with head
 1.2.4.1 18-Mar-2014  rmind file interrupt.h was added on branch rmind-smpnet on 2014-05-18 17:46:01 +0000
 1.3.6.1 29-Feb-2020  ad Sync with head.
 1.14 01-May-2023  riastradh drm: KASSERT(A && B) -> KASSERT(A); KASSERT(B)
 1.13 27-Feb-2022  riastradh branches: 1.13.4;
linux: Actually do post-order tree traversal.

Requires breaking the rbtree(3) abstraction, but this is necessary
because the body of the loop often frees the element, so as is we had
a huge pile of use-after-free going on.

Requires changing struct interval_tree_node's rbnode member to match
the Linux name, since we now use container_of here, and radeon relies
on this.
 1.12 19-Dec-2021  riastradh Touch up the rbtree/intervaltree stubs.

Doesn't work at all yet, but maybe it will help.
 1.11 19-Dec-2021  riastradh Rename struct rb_root_cached field to match Linux as needed.
 1.10 19-Dec-2021  riastradh Move rbtree_postorder_for_each_entry_safe to linux/rbtree.h.
 1.9 19-Dec-2021  riastradh Move struct rb_root from linux interval_tree.h to rbtree.h.
 1.8 04-Jan-2019  tnn branches: 1.8.4;
interval_tree_iter_next: check the node we return, not the prev one.
Also assert that the interval is intersecting the requested boundary.
 1.7 28-Aug-2018  riastradh branches: 1.7.2;
Return the node we found. From tnn@.
 1.6 27-Aug-2018  riastradh Fill out interval tree a little bit including wacky linux rb stubs.
 1.5 27-Aug-2018  riastradh Fix ordering of interval trees, including using the right member names.
 1.4 27-Aug-2018  riastradh Dereference pointer to use what it points at!
 1.3 27-Aug-2018  riastradh Spell the field names right.
 1.2 27-Aug-2018  riastradh Give the interval trees a chance to compile.
 1.1 27-Aug-2018  riastradh Draft interval tree.
 1.7.2.3 18-Jan-2019  pgoyette Synch with HEAD
 1.7.2.2 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.7.2.1 28-Aug-2018  pgoyette file interval_tree.h was added on branch pgoyette-compat on 2018-09-06 06:56:36 +0000
 1.8.4.2 10-Jun-2019  christos Sync with HEAD
 1.8.4.1 04-Jan-2019  christos file interval_tree.h was added on branch phil-wifi on 2019-06-10 22:08:31 +0000
 1.13.4.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@.
 1.5 19-Dec-2021  riastradh drm: Fix an even number of sign errors in interval_tree_generic.h.
 1.4 19-Dec-2021  riastradh amdgpu: make most of amdgpu_vm.c build

Not quite done yet -- need to adapt the DMA address logic to use
bus_dmamap_t.
 1.3 19-Dec-2021  riastradh Touch up the rbtree/intervaltree stubs.

Doesn't work at all yet, but maybe it will help.
 1.2 19-Dec-2021  riastradh misc drm hacks
 1.1 19-Dec-2021  riastradh Stub linux interval_tree_generic.h, mem_encrypt.h, sync_file.h.
 1.1 19-Dec-2021  riastradh Create stub headers for files included by drm code.


Author: Maya Rashish <maya@NetBSD.org>
 1.13 19-Dec-2021  riastradh drm: Move io_mapping to very own .c file.
 1.12 19-Dec-2021  riastradh drm: Allow multiple concurrent io_mapping_map_wc on the same space.

(This should maybe check that there aren't overlapping maps of the
same parts of the space.)
 1.11 19-Dec-2021  riastradh drm: Fix io_mapping_map_wc to map all VAs, not just the first one.
 1.10 19-Dec-2021  riastradh drm: Allow >page-sized io_mapping_map_wc.
 1.9 19-Dec-2021  riastradh i915: Draft gem fault.
 1.8 19-Dec-2021  riastradh i915: ggtt
 1.7 19-Dec-2021  riastradh io_mapping_init/fini
 1.6 19-Dec-2021  riastradh io_mapping_map_wc takes a size argument now. Must be PAGE_SIZE.
 1.5 25-Feb-2015  riastradh <linux/io-mapping.h> needs <sys/mman.h> for PROT_READ/WRITE.

From chs@.
 1.4 18-Oct-2014  njoly branches: 1.4.2;
A void function should not return a value from another void function.
 1.3 28-Aug-2014  riastradh Make Linux io_mapping actually work.

Can't use bus_space_map/bus_space_unmap in interrupt context, where
Linux uses this io_mapping abstraction. Instead, do uvm_km_alloc up
front and then use bus_space_mmap/pmap_kenter_pa to map it.

XXX Should bus_space_reserve the region (but that's x86-only for now).
XXX Should use direct map if possible.
XXX Should set an MTRR WC too in case of direct map or no PAT.
 1.2 18-Mar-2014  riastradh branches: 1.2.4; 1.2.6; 1.2.8; 1.2.10;
Merge riastradh-drm2 to HEAD.
 1.1 24-Jul-2013  riastradh branches: 1.1.2;
file io-mapping.h was initially added on branch riastradh-drm2.
 1.1.2.3 08-Sep-2013  riastradh Just use bus_space_map for io-mapping, and limit to one at a time.

Reserving the whole region interferes with other parts of the driver
which want to map it in different ways. It also horrifically wastes
space when actually mapped, because there's no way to map a subregion
of a reservation. And the bus_space_reservation API is x86-only at
the moment.
 1.1.2.2 24-Jul-2013  riastradh Fill <linux/io-mapping.h> with an io_mapping abstraction.

Mapped to bus space reservations. This might not be appropriate --
non-x86 platforms don't have them yet, and I'm not 100% confident
that Linux uses io_mappings for regions exclusively like bus space
reservations will require, but if that requirement is violated then
at least it will fail noisily, whether because of a bug or because
Linux io_mappings work differently.
 1.1.2.1 24-Jul-2013  riastradh Add stubs for Linux header files for drm.
 1.2.10.3 03-Dec-2017  jdolecek update from HEAD
 1.2.10.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.2.10.1 18-Mar-2014  tls file io-mapping.h was added on branch tls-maxphys on 2014-08-20 00:04:21 +0000
 1.2.8.3 06-Mar-2015  snj Pull up following revision(s) (requested by mrg in ticket #573):
sys/external/bsd/common/include/linux/kernel.h: 1.5, 1.6
sys/external/bsd/drm2/dist/drm/drm_ioctl.c: 1.4
sys/external/bsd/drm2/dist/drm/drm_irq.c: 1.6-1.8
sys/external/bsd/drm2/dist/drm/i915/i915_dma.c: 1.13-1.15
sys/external/bsd/drm2/dist/drm/i915/i915_gem.c: 1.23-1.27
sys/external/bsd/drm2/dist/drm/i915/i915_gem_execbuffer.c: 1.5
sys/external/bsd/drm2/dist/drm/i915/intel_display.c: 1.14, 1.15
sys/external/bsd/drm2/dist/drm/i915/intel_dp.c: 1.10
sys/external/bsd/drm2/dist/drm/i915/intel_drv.h: 1.8
sys/external/bsd/drm2/dist/drm/i915/intel_i2c.c: 1.8-1.13
sys/external/bsd/drm2/dist/drm/i915/intel_pm.c: 1.6
sys/external/bsd/drm2/dist/drm/i915/intel_ringbuffer.c: 1.5, 1.6
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/device/nouveau_engine_device_base.c: 1.4
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/fifo/nouveau_engine_fifo_nvc0.c: 1.3, 1.4
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/fifo/nouveau_engine_fifo_nve0.c: 1.3, 1.4
sys/external/bsd/drm2/dist/drm/nouveau/core/include/core/device.h: 1.4
sys/external/bsd/drm2/dist/drm/nouveau/core/include/subdev/mc.h: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/include/subdev/pwr.h: 1.3, 1.4
sys/external/bsd/drm2/dist/drm/nouveau/core/os.h: 1.4, 1.5
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/bios/nouveau_subdev_bios_base.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/bios/nouveau_subdev_bios_pll.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/clock/nouveau_subdev_clock_base.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/clock/nouveau_subdev_clock_nv50.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/devinit/fbmem.h: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/devinit/nouveau_subdev_devinit_nv04.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/fb/nouveau_subdev_fb_nv50.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/fb/nouveau_subdev_fb_nvc0.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/fb/nv50.h: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/fb/nvc0.h: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/mc/nouveau_subdev_mc_base.c: 1.2, 1.3
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/mxm/nouveau_subdev_mxm_nv50.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/pwr/nouveau_subdev_pwr_base.c: 1.3, 1.4
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/therm/nouveau_subdev_therm_ic.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/timer/nouveau_subdev_timer_nv04.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/vm/nouveau_subdev_vm_base.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/vm/nouveau_subdev_vm_nv04.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/vm/nouveau_subdev_vm_nv44.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/vm/nv04.h: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_bo.h: 1.3
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_drm.c: 1.4, 1.5
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_fbcon.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_nv50_display.c: 1.3
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_nv84_fence.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_ttm.c: 1.3
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_ttm.h: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_vga.h: 1.2
sys/external/bsd/drm2/dist/drm/radeon/radeon_fence.c: 1.6-1.8
sys/external/bsd/drm2/dist/drm/radeon/radeon_pm.c: 1.3
sys/external/bsd/drm2/dist/drm/radeon/rs400.c: 1.3
sys/external/bsd/drm2/dist/drm/via/via_dmablit.c: 1.3, 1.4
sys/external/bsd/drm2/dist/drm/via/via_drv.h: 1.3
sys/external/bsd/drm2/dist/drm/via/via_irq.c: 1.3, 1.4
sys/external/bsd/drm2/dist/drm/via/via_video.c: 1.3, 1.4
sys/external/bsd/drm2/dist/include/drm/drmP.h: 1.10
sys/external/bsd/drm2/dist/include/drm/drm_crtc.h: 1.4
sys/external/bsd/drm2/dist/include/drm/drm_modes.h: 1.3
sys/external/bsd/drm2/dist/uapi/drm/i915_drm.h: 1.2
sys/external/bsd/drm2/drm/drm_cache.c: 1.4-1.6
sys/external/bsd/drm2/drm/drm_drv.c: 1.14
sys/external/bsd/drm2/drm/drm_module.c: 1.10
sys/external/bsd/drm2/drm/drm_sysctl.c: 1.5
sys/external/bsd/drm2/drm/drm_vma_manager.c: 1.2
sys/external/bsd/drm2/drm/drmfb.c: 1.1
sys/external/bsd/drm2/drm/files.drmkms: 1.10, 1.11
sys/external/bsd/drm2/i2c/drm_encoder_slave.c: 1.1
sys/external/bsd/drm2/i915drm/files.i915drmkms: 1.7, 1.10
sys/external/bsd/drm2/i915drm/intelfb.c: 1.11, 1.12
sys/external/bsd/drm2/include/asm/io.h: 1.4
sys/external/bsd/drm2/include/asm/unaligned.h: 1.2, 1.3
sys/external/bsd/drm2/include/drm/drm_encoder_slave.h: 1.1
sys/external/bsd/drm2/include/drm/drm_wait_netbsd.h: 1.7-1.11
sys/external/bsd/drm2/include/drm/drmfb.h: 1.1
sys/external/bsd/drm2/include/drm/drmfb_pci.h: 1.1, 1.2
sys/external/bsd/drm2/include/linux/bitops.h: 1.9
sys/external/bsd/drm2/include/linux/i2c.h: 1.7, 1.8
sys/external/bsd/drm2/include/linux/io-mapping.h: 1.5
sys/external/bsd/drm2/include/linux/moduleparam.h: 1.5
sys/external/bsd/drm2/include/linux/pci.h: 1.12-1.15
sys/external/bsd/drm2/include/linux/pm.h: 1.4
sys/external/bsd/drm2/include/linux/reboot.h: 1.2
sys/external/bsd/drm2/include/linux/slab.h: 1.5
sys/external/bsd/drm2/include/linux/string.h: 1.4
sys/external/bsd/drm2/include/linux/vgaarb.h: 1.3
sys/external/bsd/drm2/include/linux/ww_mutex.h: 1.10
sys/external/bsd/drm2/linux/files.drmkms_linux: 1.8
sys/external/bsd/drm2/linux/linux_i2c.c: 1.3
sys/external/bsd/drm2/linux/linux_ww_mutex.c: 1.1
sys/external/bsd/drm2/nouveau/files.nouveau: 1.5-1.8
sys/external/bsd/drm2/nouveau/nouveau_pci.c: 1.1-1.3
sys/external/bsd/drm2/nouveau/nouveau_pci.h: 1.1
sys/external/bsd/drm2/nouveau/nouveau_sysfs.c: 1.1
sys/external/bsd/drm2/nouveau/nouveau_vga.c: 1.1
sys/external/bsd/drm2/nouveau/nouveaufb.c: 1.1
sys/external/bsd/drm2/nouveau/nouveaufb.h: 1.1
sys/external/bsd/drm2/pci/drm_pci.c: 1.10-1.12
sys/external/bsd/drm2/pci/drm_pci_module.c: 1.4
sys/external/bsd/drm2/pci/drmfb_pci.c: 1.1-1.3
sys/external/bsd/drm2/pci/files.drmkms_pci: 1.5
sys/external/bsd/drm2/radeon/radeon_pci.c: 1.5-1.7
sys/modules/drmkms/Makefile: 1.8, 1.9
sys/modules/drmkms_linux/Makefile: 1.6
sys/modules/drmkms_pci/Makefile: 1.5
sync drm2 with HEAD.
 1.2.8.2 10-Nov-2014  martin Pull up following revision(s) (requested by snj in ticket #191):
sys/external/bsd/drm2/include/linux/io-mapping.h: revision 1.4
sys/external/bsd/drm2/dist/uapi/drm/drm.h: revision 1.5
sys/external/bsd/drm2/dist/drm/i915/intel_panel.c: revision 1.5
sys/external/bsd/drm2/dist/uapi/drm/drm.h: revision 1.6
sys/external/bsd/drm2/dist/drm/i915/intel_drv.h: revision 1.7
sys/external/bsd/drm2/include/linux/ww_mutex.h: revision 1.7
sys/external/bsd/drm2/dist/drm/i915/intel_dp.c: revision 1.8
sys/external/bsd/drm2/dist/drm/i915/i915_ums.c: revision 1.2
sys/external/bsd/drm2/dist/drm/i915/intel_pm.c: revision 1.5
sys/external/bsd/drm2/dist/drm/i915/i915_debugfs.c: revision 1.2
sys/external/bsd/drm2/dist/drm/i915/i915_drv.h: revision 1.9
sys/external/bsd/drm2/dist/drm/i915/i915_cmd_parser.c: revision 1.4
sys/external/bsd/drm2/dist/drm/i915/intel_dsi.c: revision 1.3
sys/external/bsd/drm2/dist/drm/i915/intel_display.c: revision 1.11
sys/external/bsd/drm2/dist/drm/i915/intel_hdmi.c: revision 1.5
sys/external/bsd/drm2/dist/drm/i915/intel_display.c: revision 1.12
sys/external/bsd/drm2/include/asm/processor.h: revision 1.3
sys/external/bsd/drm2/dist/drm/i915/intel_crt.c: revision 1.5
sys/external/bsd/drm2/dist/drm/i915/intel_sideband.c: revision 1.2
sys/external/bsd/drm2/dist/drm/i915/intel_ddi.c: revision 1.5
sys/external/bsd/drm2/dist/drm/i915/intel_tv.c: revision 1.5
sys/external/bsd/drm2/dist/drm/i915/i915_dma.c: revision 1.11
sys/external/bsd/drm2/dist/drm/i915/i915_irq.c: revision 1.10
sys/external/bsd/drm2/dist/drm/i915/i915_gem.c: revision 1.16
sys/external/bsd/drm2/dist/drm/i915/i915_gem.c: revision 1.17
sys/external/bsd/drm2/ttm/ttm_bo_vm.c: revision 1.6
sys/external/bsd/drm2/ttm/ttm_bo_vm.c: revision 1.7
sys/external/bsd/drm2/drm/drm_module.c: revision 1.8
sys/external/bsd/drm2/dist/drm/i915/intel_sprite.c: revision 1.2
sys/external/bsd/drm2/dist/drm/i915/intel_dsi_cmd.c: revision 1.2
sys/external/bsd/drm2/i915drm/intelfb.c: revision 1.10
sys/external/bsd/drm2/dist/drm/i915/intel_dvo.c: revision 1.2
sys/external/bsd/drm2/dist/drm/i915/intel_sdvo.c: revision 1.6
sys/external/bsd/drm2/dist/drm/i915/intel_lvds.c: revision 1.6
Code cleanup and minor bugfixes for drm2.
 1.2.8.1 21-Sep-2014  snj Pull up following revision(s) (requested by riastradh in ticket #98):
sys/external/bsd/drm2/include/linux/io-mapping.h: revision 1.3
Make Linux io_mapping actually work.
Can't use bus_space_map/bus_space_unmap in interrupt context, where
Linux uses this io_mapping abstraction. Instead, do uvm_km_alloc up
front and then use bus_space_mmap/pmap_kenter_pa to map it.
XXX Should bus_space_reserve the region (but that's x86-only for now).
XXX Should use direct map if possible.
XXX Should set an MTRR WC too in case of direct map or no PAT.
 1.2.6.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.2.6.1 18-Mar-2014  yamt file io-mapping.h was added on branch yamt-pagecache on 2014-05-22 11:40:56 +0000
 1.2.4.2 18-May-2014  rmind sync with head
 1.2.4.1 18-Mar-2014  rmind file io-mapping.h was added on branch rmind-smpnet on 2014-05-18 17:46:01 +0000
 1.4.2.1 06-Apr-2015  skrll Sync with HEAD
 1.8 19-Dec-2021  riastradh drm: Make some legacy UMS crap build.
 1.7 19-Dec-2021  riastradh arch_io_reserve_memtype_wc, arch_io_free_memtype_wc stubs.
 1.6 27-Aug-2018  riastradh Rename namespacing for phys_arch_wc_index.
 1.5 27-Aug-2018  riastradh phys_wc_to_mtrr_index got renamed to arch_phys_wc_index upstream.
 1.4 16-Jul-2014  riastradh branches: 1.4.4; 1.4.28; 1.4.30;
First whack at radeon driver.

No hardware to test yet, but it builds.
 1.3 16-Jul-2014  riastradh Make it build and boot on my test machines.

Screen blanks on boot on the Ivy Bridge system with

DRM error in cpt_serr_int_handler: PCH transcoder A FIFO underrun

But after that everything is OK. Appears to be an upstream problem.
To investigate...

I think there's a cache flushing issue somewhere -- there are little
display artefacts on my T60.
 1.2 18-Mar-2014  riastradh branches: 1.2.2; 1.2.4; 1.2.6;
Merge riastradh-drm2 to HEAD.
 1.1 24-Jul-2013  riastradh branches: 1.1.2;
file io.h was initially added on branch riastradh-drm2.
 1.1.2.1 24-Jul-2013  riastradh Add stubs for Linux header files for drm.
 1.2.6.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.2.6.1 18-Mar-2014  yamt file io.h was added on branch yamt-pagecache on 2014-05-22 11:40:56 +0000
 1.2.4.2 18-May-2014  rmind sync with head
 1.2.4.1 18-Mar-2014  rmind file io.h was added on branch rmind-smpnet on 2014-05-18 17:46:01 +0000
 1.2.2.1 10-Aug-2014  tls Rebase.
 1.4.30.1 10-Jun-2019  christos Sync with HEAD
 1.4.28.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.4.4.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.4.4.1 16-Jul-2014  tls file io.h was added on branch tls-maxphys on 2014-08-20 00:04:21 +0000
 1.1 27-Aug-2018  riastradh branches: 1.1.2; 1.1.6;
More Linux header file stubs.
 1.1.6.2 10-Jun-2019  christos Sync with HEAD
 1.1.6.1 27-Aug-2018  christos file iommu.h was added on branch phil-wifi on 2019-06-10 22:08:31 +0000
 1.1.2.2 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.1.2.1 27-Aug-2018  pgoyette file iommu.h was added on branch pgoyette-compat on 2018-09-06 06:56:36 +0000
 1.8 19-Dec-2021  riastradh drm: Make resource_size return resource_size_t like Linux.

Because Linux uses resource_size_t for absolute bus addresses, it is
actually bus_addr_t rather than bus_size_t. So using bus_size_t here
causes trouble with the i915 range_overflows macro, which verifies
that types match.
 1.7 19-Dec-2021  riastradh linux: Define IORESOURCE_* to be bits, not indices.
 1.6 19-Dec-2021  riastradh I2C_CLASS_SPD, IORESOURCE_IRQ
 1.5 19-Dec-2021  riastradh DEFINE_RES_MEM, resource_contains
 1.4 19-Dec-2021  riastradh Linux uses inclusive start/end, not start/size. Match.
 1.3 19-Dec-2021  riastradh resource_size
 1.2 18-Mar-2014  riastradh branches: 1.2.4; 1.2.6; 1.2.10;
Merge riastradh-drm2 to HEAD.
 1.1 24-Jul-2013  riastradh branches: 1.1.2;
file ioport.h was initially added on branch riastradh-drm2.
 1.1.2.1 24-Jul-2013  riastradh Add <linux/ioport.h> with struct resource: keeps bus_space_alloc books.
 1.2.10.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.2.10.1 18-Mar-2014  tls file ioport.h was added on branch tls-maxphys on 2014-08-20 00:04:21 +0000
 1.2.6.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.2.6.1 18-Mar-2014  yamt file ioport.h was added on branch yamt-pagecache on 2014-05-22 11:40:56 +0000
 1.2.4.2 18-May-2014  rmind sync with head
 1.2.4.1 18-Mar-2014  rmind file ioport.h was added on branch rmind-smpnet on 2014-05-18 17:46:01 +0000
 1.1 27-Aug-2018  riastradh branches: 1.1.2; 1.1.6;
Empty stub <linux/irq.h>.

Not sure why upstream uses it -- the file in Linux exhorts against
its usage in any MI code.
 1.1.6.2 10-Jun-2019  christos Sync with HEAD
 1.1.6.1 27-Aug-2018  christos file irq.h was added on branch phil-wifi on 2019-06-10 22:08:31 +0000
 1.1.2.2 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.1.2.1 27-Aug-2018  pgoyette file irq.h was added on branch pgoyette-compat on 2018-09-06 06:56:36 +0000
 1.6 19-Dec-2021  riastradh linux: Draft irq_work shims, in terms of a softint.

Doesn't actually run in hardirq context, but who's gonna notice...
 1.5 19-Dec-2021  riastradh linux: Odds and ends.
 1.4 19-Dec-2021  riastradh i915: machete
 1.3 19-Dec-2021  riastradh Match linux which is side-loading

linux/irq_work.h->
asm/irq_work.h->
asm/cpufeature.h

Avoids errors on static_cpu_has


Author: Maya Rashish <maya@NetBSD.org>
Committer: Taylor R Campbell <riastradh@NetBSD.org>
 1.2 19-Dec-2021  riastradh Fill in irq_work.h with stubs.
 1.1 19-Dec-2021  riastradh Create stub headers for files included by drm code.


Author: Maya Rashish <maya@NetBSD.org>
 1.1 19-Dec-2021  riastradh <linux/irqdomain.h>
 1.2 19-Dec-2021  riastradh irqs_disabled -- for assertions only.
 1.1 16-Jul-2014  riastradh branches: 1.1.2; 1.1.6;
Make it build and boot on my test machines.

Screen blanks on boot on the Ivy Bridge system with

DRM error in cpt_serr_int_handler: PCH transcoder A FIFO underrun

But after that everything is OK. Appears to be an upstream problem.
To investigate...

I think there's a cache flushing issue somewhere -- there are little
display artefacts on my T60.
 1.1.6.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.6.1 16-Jul-2014  tls file irqflags.h was added on branch tls-maxphys on 2014-08-20 00:04:21 +0000
 1.1.2.2 10-Aug-2014  tls Rebase.
 1.1.2.1 16-Jul-2014  tls file irqflags.h was added on branch tls-earlyentropy on 2014-08-10 06:55:39 +0000
 1.1 19-Dec-2021  riastradh Stub <linux/irqreturn.h> to just include drm_irq_netbsd.h.
 1.14 18-Mar-2022  riastradh drm: Use getticks(), not hardclock_ticks.
 1.13 14-Feb-2020  maya Reduce diffs by side-loading some header files like Linux.

From riastradh
 1.12 27-Aug-2018  riastradh branches: 1.12.6;
Define nsecs_to_jiffies.
 1.11 27-Aug-2018  riastradh Define jiffies_to_usecs, badly.
 1.10 27-Aug-2018  riastradh Define get_jiffies_64. Hope a 32-bit approximation is enough!
 1.9 27-Aug-2018  riastradh Call the parameter by its name, not its nickname!
 1.8 27-Aug-2018  riastradh Rework nsecs_to_jiffies64.
 1.7 27-Aug-2018  riastradh don't provide dev_to_i915 and ifdef out all users (unused)
provide nsecs_to_jiffies64, hopefully msec_to_jiffies * 10^6
provide BUILD_BUG as a no-op
include linux/err.h instead of matching side-loading, too hard to
figure out what gets it.


Author: coypu <coypu@sdf.org>
Committer: Taylor R Campbell <riastradh@NetBSD.org>
 1.6 26-Jul-2014  riastradh branches: 1.6.4; 1.6.28; 1.6.30;
Use tvtohz instead of ad-hacking it myself, suggested by apb@.
 1.5 26-Jul-2014  riastradh Make Linux usecs_to_jiffies work with hz up to 2000.
 1.4 16-Jul-2014  riastradh First whack at radeon driver.

No hardware to test yet, but it builds.
 1.3 16-Jul-2014  riastradh Make it build and boot on my test machines.

Screen blanks on boot on the Ivy Bridge system with

DRM error in cpt_serr_int_handler: PCH transcoder A FIFO underrun

But after that everything is OK. Appears to be an upstream problem.
To investigate...

I think there's a cache flushing issue somewhere -- there are little
display artefacts on my T60.
 1.2 18-Mar-2014  riastradh branches: 1.2.2; 1.2.4; 1.2.6;
Merge riastradh-drm2 to HEAD.
 1.1 24-Jul-2013  riastradh branches: 1.1.2;
file jiffies.h was initially added on branch riastradh-drm2.
 1.1.2.5 08-Sep-2013  riastradh Buncha new cruft for <linux/*.h>.
 1.1.2.4 08-Sep-2013  riastradh More miscellaneous Linux header cruft. See patch for details.
 1.1.2.3 24-Jul-2013  riastradh Add some conversion and comparison stuff to <linux/jiffies.h>.
 1.1.2.2 24-Jul-2013  riastradh Define jiffies to be hardclock_ticks in <linux/jiffies.h>.
 1.1.2.1 24-Jul-2013  riastradh Add stubs for Linux header files for drm.
 1.2.6.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.2.6.1 18-Mar-2014  yamt file jiffies.h was added on branch yamt-pagecache on 2014-05-22 11:40:56 +0000
 1.2.4.2 18-May-2014  rmind sync with head
 1.2.4.1 18-Mar-2014  rmind file jiffies.h was added on branch rmind-smpnet on 2014-05-18 17:46:01 +0000
 1.2.2.1 10-Aug-2014  tls Rebase.
 1.6.30.2 08-Apr-2020  martin Merge changes from current as of 20200406
 1.6.30.1 10-Jun-2019  christos Sync with HEAD
 1.6.28.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.6.4.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.6.4.1 26-Jul-2014  tls file jiffies.h was added on branch tls-maxphys on 2014-08-20 00:04:21 +0000
 1.12.6.1 29-Feb-2020  ad Sync with head.
 1.4 01-Apr-2014  riastradh kernel.h and list.h have already been moved to external/bsd/common.

With apologies to future revision control systems for not making it
clear this is effectively a rename.
 1.3 21-Mar-2014  riastradh Make uninitialized_var kludge expand to `x = 0'.

Forgot to commit this the other day.
 1.2 18-Mar-2014  riastradh Merge riastradh-drm2 to HEAD.
 1.1 24-Jul-2013  riastradh branches: 1.1.2;
file kernel.h was initially added on branch riastradh-drm2.
 1.1.2.22 08-Sep-2013  riastradh Miscellaneous Linux header file crud.
 1.1.2.21 08-Sep-2013  riastradh Buncha new cruft for <linux/*.h>.
 1.1.2.20 24-Jul-2013  riastradh Implement bogus max_t in <linux/kernel.h>.
 1.1.2.19 24-Jul-2013  riastradh Add min_t and DIV_ROUND_UP to <linux/kernel.h>.
 1.1.2.18 24-Jul-2013  riastradh Fix up some bit-hacking and pointer-futzing in <linux/kernel.h>.

- Avoid C arithmetic pitfalls and multiple evaluatoin in round_up.
- Add round_down.
- Explain why upper_32_bits and lower_32_bits exist.
- Explain what container_of does.
 1.1.2.17 24-Jul-2013  riastradh Add upper_32_bits and lower_32_bits to <linux/kernel.h>.
 1.1.2.16 24-Jul-2013  riastradh Add __always_unused and round_up to <linux/kernel.h>.
 1.1.2.15 24-Jul-2013  riastradh Define uninitialized_var in <linux/kernel.h>.
 1.1.2.14 24-Jul-2013  riastradh Include just <sys/types.h>, not <sys/systm.h>, in <linux/kernel.h>.
 1.1.2.13 24-Jul-2013  riastradh Define barrier() as __insn_barrier() in <linux/kernel.h>.
 1.1.2.12 24-Jul-2013  riastradh Add stub definition of __must_check to <linux/kernel.h>.
 1.1.2.11 24-Jul-2013  riastradh Make container_of type-safe with the help of a judicious sizeof.

Still avoids multiple evaluation of the pointer operand expression.
 1.1.2.10 24-Jul-2013  riastradh Implement abs64 in <linux/kernel.h>.
 1.1.2.9 24-Jul-2013  riastradh Implement unlikely as __predict_false in <linux/kernel.h>.
 1.1.2.8 24-Jul-2013  riastradh Move WARN and WARN_ON to <asm/bug.h> and add BUG_ON.
 1.1.2.7 24-Jul-2013  riastradh Define swap in <linux/kernel.h>.

Kinda hokey definition, but this avoids typeof.
 1.1.2.6 24-Jul-2013  riastradh Add WARN and WARN_ON to <linux/kernel.h>.
 1.1.2.5 24-Jul-2013  riastradh Include <sys/systm.h> in <linux/kernel.h> for offsetof.
 1.1.2.4 24-Jul-2013  riastradh Define __user to be empty in <linux/kernel.h>.

__user qualifies a pointer into userspace for static analyzers.
 1.1.2.3 24-Jul-2013  riastradh Add type-unsafe container_of to drm2's <linux/kernel.h>.
 1.1.2.2 24-Jul-2013  riastradh Define __printf in drm2's <linux/kernel.h> shim.
 1.1.2.1 24-Jul-2013  riastradh Add stubs for Linux header files for drm.
 1.6 19-Dec-2021  riastradh amdgpu: more destroy fixes.


Author: phone <mrg@NetBSD.org>
Committer: Taylor R Campbell <riastradh@NetBSD.org>
 1.5 19-Dec-2021  riastradh linux: INIT_KFIFO
 1.4 19-Dec-2021  riastradh statically allocated kfifo
 1.3 27-Aug-2018  riastradh kfifo is used under a spin lock, so its lock must be a spin lock.

From mrg@.
 1.2 27-Aug-2018  riastradh Rewrite <linux/kfifo.h>.

pcq isn't flexible enough for its needs now. Just use a spinlocked
circular buffer.
 1.1 16-Jul-2014  riastradh branches: 1.1.2; 1.1.6; 1.1.30; 1.1.32;
Make it build and boot on my test machines.

Screen blanks on boot on the Ivy Bridge system with

DRM error in cpt_serr_int_handler: PCH transcoder A FIFO underrun

But after that everything is OK. Appears to be an upstream problem.
To investigate...

I think there's a cache flushing issue somewhere -- there are little
display artefacts on my T60.
 1.1.32.1 10-Jun-2019  christos Sync with HEAD
 1.1.30.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.1.6.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.6.1 16-Jul-2014  tls file kfifo.h was added on branch tls-maxphys on 2014-08-20 00:04:21 +0000
 1.1.2.2 10-Aug-2014  tls Rebase.
 1.1.2.1 16-Jul-2014  tls file kfifo.h was added on branch tls-earlyentropy on 2014-08-10 06:55:39 +0000
 1.4 26-Oct-2022  riastradh ddb/db_active.h: New home for extern db_active.

This can be included unconditionally, and db_active can then be
queried unconditionally; if DDB is not in the kernel, then db_active
is a constant zero. Reduces need for #include opt_ddb.h, #ifdef DDB.
 1.3 19-Dec-2021  riastradh Need sys/types.h for bool.
 1.2 18-Mar-2014  riastradh branches: 1.2.4; 1.2.6; 1.2.10;
Merge riastradh-drm2 to HEAD.
 1.1 24-Jul-2013  riastradh branches: 1.1.2;
file kgdb.h was initially added on branch riastradh-drm2.
 1.1.2.3 29-Jan-2014  riastradh First draft of in-kernel drm2 attachment.

The drm2 `drm' device is now called `drmkms' (likewise `i915drmkms',
&c.) so that it can coexist with the old drm code to reduce diffs
from HEAD. (Can't call a device `drm2'.)
 1.1.2.2 08-Sep-2013  riastradh Buncha new cruft for <linux/*.h>.
 1.1.2.1 24-Jul-2013  riastradh Add stubs for Linux header files for drm.
 1.2.10.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.2.10.1 18-Mar-2014  tls file kgdb.h was added on branch tls-maxphys on 2014-08-20 00:04:21 +0000
 1.2.6.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.2.6.1 18-Mar-2014  yamt file kgdb.h was added on branch yamt-pagecache on 2014-05-22 11:40:56 +0000
 1.2.4.2 18-May-2014  rmind sync with head
 1.2.4.1 18-Mar-2014  rmind file kgdb.h was added on branch rmind-smpnet on 2014-05-18 17:46:01 +0000
 1.2 19-Dec-2021  riastradh linux: Stub linux/kmemleak.h.
 1.1 19-Dec-2021  riastradh Create stub headers for files included by drm code.


Author: Maya Rashish <maya@NetBSD.org>
 1.2 18-Mar-2014  riastradh branches: 1.2.4; 1.2.6; 1.2.10;
Merge riastradh-drm2 to HEAD.
 1.1 24-Jul-2013  riastradh branches: 1.1.2;
file kobject.h was initially added on branch riastradh-drm2.
 1.1.2.1 24-Jul-2013  riastradh Add stubs for Linux header files for drm.
 1.2.10.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.2.10.1 18-Mar-2014  tls file kobject.h was added on branch tls-maxphys on 2014-08-20 00:04:21 +0000
 1.2.6.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.2.6.1 18-Mar-2014  yamt file kobject.h was added on branch yamt-pagecache on 2014-05-22 11:40:56 +0000
 1.2.4.2 18-May-2014  rmind sync with head
 1.2.4.1 18-Mar-2014  rmind file kobject.h was added on branch rmind-smpnet on 2014-05-18 17:46:01 +0000
 1.14 24-Feb-2023  riastradh drm: Eliminate __HAVE_ATOMIC_AS_MEMBAR conditionals.

Discussed on tech-kern:
https://mail-index.netbsd.org/tech-kern/2023/02/23/msg028729.html
 1.13 09-Apr-2022  riastradh branches: 1.13.4;
linux/kref: Fix memory barriers and use membar_release/acquire.
 1.12 19-Dec-2021  riastradh i915: more work
 1.11 19-Dec-2021  riastradh Provide kref_put_lock


Author: Maya Rashish <maya@NetBSD.org>
Committer: Taylor R Campbell <riastradh@NetBSD.org>
 1.10 19-Dec-2021  riastradh Linux refcount API
 1.9 19-Dec-2021  riastradh Omit __insn_barrier where implied or subsumed by volatile.
 1.8 19-Dec-2021  riastradh Implement kref_read.
 1.7 27-Aug-2018  riastradh Insert membars needed for non-x86.

XXX We should really define membar_enter_postatomic and
membar_exit_preatomic to avoid relying on not typoing
__HAVE_ATOMIC_AS_MEMBAR.
 1.6 27-Aug-2018  riastradh Revert "Rename private member of kref, because Linux abuses the abstraction."

This reverts commit d45132a71ee3c2570db2f10eac27283d3ac5b392.

Linux's abuse will be fixed.
 1.5 27-Aug-2018  riastradh Rename private member of kref, because Linux abuses the abstraction.
 1.4 16-Jul-2014  riastradh branches: 1.4.4; 1.4.28; 1.4.30;
First whack at radeon driver.

No hardware to test yet, but it builds.
 1.3 16-Jul-2014  riastradh Make it build and boot on my test machines.

Screen blanks on boot on the Ivy Bridge system with

DRM error in cpt_serr_int_handler: PCH transcoder A FIFO underrun

But after that everything is OK. Appears to be an upstream problem.
To investigate...

I think there's a cache flushing issue somewhere -- there are little
display artefacts on my T60.
 1.2 18-Mar-2014  riastradh branches: 1.2.2; 1.2.4; 1.2.6;
Merge riastradh-drm2 to HEAD.
 1.1 24-Jul-2013  riastradh branches: 1.1.2;
file kref.h was initially added on branch riastradh-drm2.
 1.1.2.3 08-Sep-2013  riastradh Fix sense of atomic_cas loop condition and use kassertmsg for krefs.
 1.1.2.2 24-Jul-2013  riastradh Implement krefs in <linux/kref.h>.
 1.1.2.1 24-Jul-2013  riastradh Add stubs for Linux header files for drm.
 1.2.6.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.2.6.1 18-Mar-2014  yamt file kref.h was added on branch yamt-pagecache on 2014-05-22 11:40:56 +0000
 1.2.4.2 18-May-2014  rmind sync with head
 1.2.4.1 18-Mar-2014  rmind file kref.h was added on branch rmind-smpnet on 2014-05-18 17:46:01 +0000
 1.2.2.1 10-Aug-2014  tls Rebase.
 1.4.30.1 10-Jun-2019  christos Sync with HEAD
 1.4.28.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.4.4.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.4.4.1 16-Jul-2014  tls file kref.h was added on branch tls-maxphys on 2014-08-20 00:04:21 +0000
 1.13.4.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@.
 1.4 19-Dec-2021  riastradh drm: Rework Linux `kthread' abstraction to avoid race to sleep.

Requires passing in the caller's lock and condvar to kthread_run, but
for the one user that appears not to be an onerous requirement.
 1.3 19-Dec-2021  riastradh drm: linux kthread stubs
 1.2 18-Mar-2014  riastradh branches: 1.2.4; 1.2.6; 1.2.10;
Merge riastradh-drm2 to HEAD.
 1.1 24-Jul-2013  riastradh branches: 1.1.2;
file kthread.h was initially added on branch riastradh-drm2.
 1.1.2.1 24-Jul-2013  riastradh Add stubs for Linux header files for drm.
 1.2.10.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.2.10.1 18-Mar-2014  tls file kthread.h was added on branch tls-maxphys on 2014-08-20 00:04:21 +0000
 1.2.6.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.2.6.1 18-Mar-2014  yamt file kthread.h was added on branch yamt-pagecache on 2014-05-22 11:40:56 +0000
 1.2.4.2 18-May-2014  rmind sync with head
 1.2.4.1 18-Mar-2014  rmind file kthread.h was added on branch rmind-smpnet on 2014-05-18 17:46:01 +0000
 1.21 19-Dec-2021  riastradh drm: Make via build again.
 1.20 19-Dec-2021  riastradh linux: ktime_get_real_seconds
 1.19 19-Dec-2021  riastradh amdgpu: Another pass through.

amdgpu_object.c
amdgpu_pci.c
amdgpu_pm.c
amdgpu_polaris10_smumgr.c
amdgpu_pp_psm.c
amdgpu_ppatomctrl.c
amdgpu_ppatomfwctrl.c
amdgpu_process_pptables_v1_0.o
amdgpu_psp.o
amdgpu_psp_v10_0.c
amdgpu_psp_v11_0.c
amdgpu_psp_v12_0.c
amdgpu_psp_v3_1.c
amdgpu_ras.c
amdgpu_ras_eeprom.c
amdgpu_rc_calc.c
amdgpu_rc_calc_dpi.c
amdgpu_ring.c
amdgpu_rlc.c
amdgpu_rn_clk_mgr.c
amdgpu_sdma_v3_0.c
amdgpu_sdma_v4_0.c
amdgpu_sdma_v5_0.c
amdgpu_si.c
amdgpu_si_dma.c
amdgpu_si_dpm.c
amdgpu_smu.c
amdgpu_smu10_hwmgr.c
amdgpu_smu7_hwmgr.c
amdgpu_smu8_hwmgr.c
amdgpu_smu8_smumgr.c
amdgpu_smu_v11_0.c (and a sprinkling of consts)
amdgpu_smu_v11_0_i2c.c
amdgpu_soc15.c
amdgpu_tonga_smumgr.c
amdgpu_ttm.c
amdgpu_ucode.c
amdgpu_uvd.c
amdgpu_uvd_v5_0.c
amdgpu_uvd_v6_0.c
amdgpu_uvd_v7_0.c
amdgpu_vce.c
amdgpu_vce_v2_0.c
amdgpu_vce_v4_0.c
amdgpu_vcn_v1_0.c
amdgpu_vcn_v2_0.c
amdgpu_vcn_v2_5.c
amdgpu_vega10_hwmgr.c
amdgpu_vega10_powertune.c
amdgpu_vega10_processpptables.c
amdgpu_vega10_reg_init.c
amdgpu_vega12_hwmgr.c
amdgpu_vega20_hwmgr.c
amdgpu_vega20_ppt.c
amdgpu_vega20_reg_init.c
amdgpu_vi.c
amdgpu_virt.c
amdgpu_vram_mgr.c
amdgpu_xgmi.c -- disable (for now?)
amdgpufb.c
 1.18 19-Dec-2021  riastradh linux: ktime_get_ns
 1.17 19-Dec-2021  riastradh i915: another whack at it
 1.16 19-Dec-2021  riastradh drm: Another pass over i915. Most of i915 gem builds now.
 1.15 19-Dec-2021  riastradh provide ktime_ms_delta


Author: Maya Rashish <maya@NetBSD.org>
 1.14 19-Dec-2021  riastradh Stupid ktime_get_raw until I figure out what this should be.
 1.13 19-Dec-2021  riastradh ktime_add
 1.12 19-Dec-2021  riastradh struct timespec serves as a perfectly adequate struct timespec64.
 1.11 19-Dec-2021  riastradh ktime_after
 1.10 19-Dec-2021  riastradh ktime_t is now just int64_t, no longer a union.
 1.9 14-Feb-2020  maya Reduce diffs by side-loading some header files like Linux.

From riastradh
 1.8 02-Jan-2020  thorpej branches: 1.8.2;
- Eliminate the global "boottime" variable, which was being accessed
without any synchronization against changes by e.g. clock_settime().
- Replace with new getbinboottime() / getnanoboottime() / getmicroboottime()
functions (naming mirrors that of other time access functions in kern_tc.c).
It returns the (maybe-converted) value of timebasebin, which also tracks
our estimate of when the system was booted (i.e. the legacy "boottime" was
redundant).

XXX There needs to be a lockless synchronization mechanism for reading
timebasebin, but this is a problem in kern_tc.c that pre-existed these
"boottime" changes. At least now the problem is centralized in one location.
 1.7 27-Aug-2018  riastradh Need <sys/kernel.h> for boottime.
 1.6 27-Aug-2018  riastradh Rework Linux ktime.

- Remove union crap which has been removed upstream.
- Define everything in terms of ns_to_ktime and ktime_to_ns.
- Add ktime_to_us.
- Add ktime_us_delta.
 1.5 27-Aug-2018  riastradh Define ktime_get_raw_ns.
 1.4 27-Aug-2018  riastradh New ktime utilities. Fix monotonic offset business.
 1.3 16-Jul-2014  riastradh branches: 1.3.4; 1.3.28; 1.3.30;
Make it build and boot on my test machines.

Screen blanks on boot on the Ivy Bridge system with

DRM error in cpt_serr_int_handler: PCH transcoder A FIFO underrun

But after that everything is OK. Appears to be an upstream problem.
To investigate...

I think there's a cache flushing issue somewhere -- there are little
display artefacts on my T60.
 1.2 18-Mar-2014  riastradh branches: 1.2.2; 1.2.4; 1.2.6;
Merge riastradh-drm2 to HEAD.
 1.1 24-Jul-2013  riastradh branches: 1.1.2;
file ktime.h was initially added on branch riastradh-drm2.
 1.1.2.4 15-Jan-2014  riastradh Initialize the nsec correctly in ktime_get.
 1.1.2.3 15-Jan-2014  riastradh Use nanouptime, not nanotime, for ktime_get.

As far as I can tell, ktime_get is supposed to provide monotonic
time, not a clock synchronized to TAI.
 1.1.2.2 24-Jul-2013  riastradh Add timespec_to_ns and timeval_to_ns to <linux/ktime.h>.

Not quite the right place, but this'll do for now.
 1.1.2.1 24-Jul-2013  riastradh Add <linux/ktime.h> for drm2.
 1.2.6.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.2.6.1 18-Mar-2014  yamt file ktime.h was added on branch yamt-pagecache on 2014-05-22 11:40:56 +0000
 1.2.4.2 18-May-2014  rmind sync with head
 1.2.4.1 18-Mar-2014  rmind file ktime.h was added on branch rmind-smpnet on 2014-05-18 17:46:01 +0000
 1.2.2.1 10-Aug-2014  tls Rebase.
 1.3.30.2 08-Apr-2020  martin Merge changes from current as of 20200406
 1.3.30.1 10-Jun-2019  christos Sync with HEAD
 1.3.28.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.3.4.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.3.4.1 16-Jul-2014  tls file ktime.h was added on branch tls-maxphys on 2014-08-20 00:04:21 +0000
 1.8.2.1 29-Feb-2020  ad Sync with head.
 1.3 01-Apr-2014  riastradh kernel.h and list.h have already been moved to external/bsd/common.

With apologies to future revision control systems for not making it
clear this is effectively a rename.
 1.2 18-Mar-2014  riastradh Merge riastradh-drm2 to HEAD.
 1.1 24-Jul-2013  riastradh branches: 1.1.2;
file list.h was initially added on branch riastradh-drm2.
 1.1.2.12 24-Jul-2013  riastradh Add list_del_init to <linux/list.h>.
 1.1.2.11 24-Jul-2013  riastradh Rename fields of struct list_head to match Linux.

Linux code uses the fields by name, not by list_next and list_prev
accessors, so we'd better match.

hlist may need this too.
 1.1.2.10 24-Jul-2013  riastradh Add list_prev to <linux/list.h>.
 1.1.2.9 24-Jul-2013  riastradh Add list_move and list_replace to <linux/list.h>.
 1.1.2.8 24-Jul-2013  riastradh Add some hlist operations to <linux/list.h>.

Also add some bogus `rcu-safe' operations, to be filled in with the
right memory barriers later.
 1.1.2.7 24-Jul-2013  riastradh Define list_first_entry in <linux/list.h>.
 1.1.2.6 24-Jul-2013  riastradh Fix some typos and add some stuff to <linux/list.h>.
 1.1.2.5 24-Jul-2013  riastradh Implement list_empty and list_for_each_entry_safe in <linux/list.h>.

Also fix the list operations to be consistent about using the head,
rather than NULL, as the sentinel.
 1.1.2.4 24-Jul-2013  riastradh Add INIT_LIST_HEAD, list_add, list_add_tail, and list_del.
 1.1.2.3 24-Jul-2013  riastradh Reimplement (partial) Linux list abstraction directly.

TAILQ_* won't work easily because Linux doesn't distinguish heads from
noses.
 1.1.2.2 24-Jul-2013  riastradh Add initial draft of Linux list and hlist to <linux/list.h>.

Implemented in terms of TAILQ and LIST, respectively.
Not yet tested.
 1.1.2.1 24-Jul-2013  riastradh Add stubs for Linux header files for drm.
 1.2 18-Mar-2014  riastradh branches: 1.2.4; 1.2.6; 1.2.10;
Merge riastradh-drm2 to HEAD.
 1.1 24-Jul-2013  riastradh branches: 1.1.2;
file list_sort.h was initially added on branch riastradh-drm2.
 1.1.2.3 24-Jul-2013  riastradh `#define list_sort linux_list_sort' so `nm | grep linux' finds it.
 1.1.2.2 24-Jul-2013  riastradh Add linux_list_sort.c implementing list_sort.

Algorithm is merge sort using binary counting in a temporary array of
64 elements on the stack, big enough for any list that'll fit into
memory in a 64-bit address space, but small enough to fit comfortably
on the stack.
 1.1.2.1 24-Jul-2013  riastradh Add stubs for Linux header files for drm.
 1.2.10.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.2.10.1 18-Mar-2014  tls file list_sort.h was added on branch tls-maxphys on 2014-08-20 00:04:21 +0000
 1.2.6.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.2.6.1 18-Mar-2014  yamt file list_sort.h was added on branch yamt-pagecache on 2014-05-22 11:40:56 +0000
 1.2.4.2 18-May-2014  rmind sync with head
 1.2.4.1 18-Mar-2014  rmind file list_sort.h was added on branch rmind-smpnet on 2014-05-18 17:46:01 +0000
 1.7 09-Apr-2022  riastradh linux/llist: Use membar_release and membar_datadep_consumer.

No need for membar_acquire here! Loads are all data-dependent.
 1.6 19-Dec-2021  riastradh i915: intel_engine_pm.c and i915_active.c

...with a little less heinous abuse of C, and an attempt to
disentangle the tentacular abstraction violations rampant in these
components
 1.5 19-Dec-2021  riastradh i915: more work
 1.4 19-Dec-2021  riastradh linux/llist.h: Various fixups.
 1.3 19-Dec-2021  riastradh Linux wants llist_node::next.
 1.2 19-Dec-2021  riastradh Fix , -> ; typo in `for' header.
 1.1 19-Dec-2021  riastradh Reimplement GPL <linux/llist.h> using only the upstream comments.

Hope I gathered what this is trying to do...!
 1.9 19-Dec-2021  riastradh Make intel_psr.c build
netbsd-ify
Stub out intel_lpe_audio.c (for now?).
Hammer intel_opregion.c into shape.
Hack up intel_lrc.c
Adapt intel_reset.c
Stub out intel_region_lmem.c
Adapt intel_ring_submission.c
Adapt intel_rps.c
Adapt intel_sdvo.c
Adapt intel_runtime_pm.c
Adapt intel_sideband.c
Adapt intel_sprite.c
Adapt intel_tv.c
Adapt intel_tc.c
Adapt intel_sseu.c
Adapt intel_timeline.c
Adapt intel_uc_fw.c and fix typo
Fix up intel_uncore.c
intel_vga.c
intel_wakeref.c
intel_vdsc.c
intel_wopcm.c
intel_workarounds.c
i915_globals.c
Fix up intelfb.c
Stub out intel_guc_log.c
Stub out intel_dsi_dcs_backlight.c
i915_perf.c
intel_hdmi.c
intel_hdcp.c


Author: Maya Rashish <maya@NetBSD.org>
Committer: Taylor R Campbell <riastradh@NetBSD.org>
 1.8 19-Dec-2021  riastradh i915: hack hack hack
 1.7 19-Dec-2021  riastradh linux: fix __lockdep_used, add mutex_acquire/release
 1.6 19-Dec-2021  riastradh Stub might_lock_nested. Not in the LOCKDEP case...

Not sure we have anything for nested locks.


Author: Maya Rashish <maya@NetBSD.org>
Committer: Taylor R Campbell <riastradh@NetBSD.org>
 1.5 19-Dec-2021  riastradh Add some missing includes in linux/lockdep.h.
 1.4 19-Dec-2021  riastradh lockdep_pin/unpin_lock
 1.3 19-Dec-2021  riastradh looks like lock_release takes two args now


Author: Maya Rashish <maya@NetBSD.org>
 1.2 19-Dec-2021  riastradh Disable linux lockdep for now; matching ww_mutex too painful.
 1.1 19-Dec-2021  riastradh Move Linux lockdep stuff to its own header file.
 1.6 16-Feb-2020  riastradh Move another file from drm2 to common for <linux/kernel.h>.
 1.5 06-Aug-2014  riastradh branches: 1.5.4; 1.5.30; 1.5.36;
Add rounddown_pow_of_two.
 1.4 16-Jul-2014  riastradh First whack at radeon driver.

No hardware to test yet, but it builds.
 1.3 16-Jul-2014  riastradh Make it build and boot on my test machines.

Screen blanks on boot on the Ivy Bridge system with

DRM error in cpt_serr_int_handler: PCH transcoder A FIFO underrun

But after that everything is OK. Appears to be an upstream problem.
To investigate...

I think there's a cache flushing issue somewhere -- there are little
display artefacts on my T60.
 1.2 18-Mar-2014  riastradh branches: 1.2.2; 1.2.4; 1.2.6;
Merge riastradh-drm2 to HEAD.
 1.1 24-Jul-2013  riastradh branches: 1.1.2;
file log2.h was initially added on branch riastradh-drm2.
 1.1.2.3 08-Sep-2013  riastradh More miscellaneous Linux header cruft. See patch for details.
 1.1.2.2 24-Jul-2013  riastradh Include <sys/bitops.h> in <linux/log2.h> for ilog2.
 1.1.2.1 24-Jul-2013  riastradh Add stubs for Linux header files for drm.
 1.2.6.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.2.6.1 18-Mar-2014  yamt file log2.h was added on branch yamt-pagecache on 2014-05-22 11:40:56 +0000
 1.2.4.2 18-May-2014  rmind sync with head
 1.2.4.1 18-Mar-2014  rmind file log2.h was added on branch rmind-smpnet on 2014-05-18 17:46:01 +0000
 1.2.2.1 10-Aug-2014  tls Rebase.
 1.5.36.1 29-Feb-2020  ad Sync with head.
 1.5.30.1 08-Apr-2020  martin Merge changes from current as of 20200406
 1.5.4.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.5.4.1 06-Aug-2014  tls file log2.h was added on branch tls-maxphys on 2014-08-20 00:04:21 +0000
 1.12 19-Dec-2021  riastradh Provide not-quite-proper mul_u64_u32_div


Author: Maya Rashish <maya@NetBSD.org>
Committer: Taylor R Campbell <riastradh@NetBSD.org>
 1.11 19-Dec-2021  riastradh i915: Adapt i915_perf.c.
 1.10 19-Dec-2021  riastradh linux: div_u64_rem
 1.9 19-Dec-2021  riastradh mul_u64_u32_shr
 1.8 19-Dec-2021  riastradh Side load linux/types.h.
 1.7 19-Dec-2021  riastradh mul_u32_u32
 1.6 27-Aug-2018  riastradh Define DIV_ROUND_CLOSEST_ULL and div_s64.
 1.5 27-Aug-2018  riastradh Get dividend/divisor straight. No functional change.
 1.4 27-Aug-2018  riastradh provide some dummy structs

declaration without implementation of dmi_match (Won't link)
provide div64_u64_rem XXX the naming of the parameters is backwards
ci_send_msg_to_smc_return_parameter isn't unused, keep it


Author: coypu <coypu@sdf.org>
Committer: Taylor R Campbell <riastradh@NetBSD.org>
 1.3 16-Jul-2014  riastradh branches: 1.3.4; 1.3.28; 1.3.30;
First whack at radeon driver.

No hardware to test yet, but it builds.
 1.2 18-Mar-2014  riastradh branches: 1.2.2; 1.2.4; 1.2.6;
Merge riastradh-drm2 to HEAD.
 1.1 24-Jul-2013  riastradh branches: 1.1.2;
file math64.h was initially added on branch riastradh-drm2.
 1.1.2.2 24-Jul-2013  riastradh Add div_u64 to <linux/math64.h>.
 1.1.2.1 24-Jul-2013  riastradh Add <linux/math64.h> for drm2.
 1.2.6.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.2.6.1 18-Mar-2014  yamt file math64.h was added on branch yamt-pagecache on 2014-05-22 11:40:56 +0000
 1.2.4.2 18-May-2014  rmind sync with head
 1.2.4.1 18-Mar-2014  rmind file math64.h was added on branch rmind-smpnet on 2014-05-18 17:46:01 +0000
 1.2.2.1 10-Aug-2014  tls Rebase.
 1.3.30.1 10-Jun-2019  christos Sync with HEAD
 1.3.28.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.3.4.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.3.4.1 16-Jul-2014  tls file math64.h was added on branch tls-maxphys on 2014-08-20 00:04:21 +0000
 1.1 27-Aug-2018  riastradh branches: 1.1.2; 1.1.6;
dummy file to quiet include warnings


Author: coypu <coypu@sdf.org>
Committer: Taylor R Campbell <riastradh@NetBSD.org>
 1.1.6.2 10-Jun-2019  christos Sync with HEAD
 1.1.6.1 27-Aug-2018  christos file media-bus-format.h was added on branch phil-wifi on 2019-06-10 22:08:31 +0000
 1.1.2.2 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.1.2.1 27-Aug-2018  pgoyette file media-bus-format.h was added on branch pgoyette-compat on 2018-09-06 06:56:36 +0000
 1.2 25-Oct-2022  riastradh linux asm/uaccess.h: strncpy_from_user

(which does not actually have strncpy semantics, naturally, from what
I can gather)
 1.1 19-Dec-2021  riastradh Stub linux interval_tree_generic.h, mem_encrypt.h, sync_file.h.
 1.1 19-Dec-2021  riastradh Create stub headers for files included by drm code.


Author: Maya Rashish <maya@NetBSD.org>
 1.2 18-Mar-2014  riastradh branches: 1.2.4; 1.2.6; 1.2.10;
Merge riastradh-drm2 to HEAD.
 1.1 24-Jul-2013  riastradh branches: 1.1.2;
file miscdevice.h was initially added on branch riastradh-drm2.
 1.1.2.1 24-Jul-2013  riastradh Add stubs for Linux header files for drm.
 1.2.10.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.2.10.1 18-Mar-2014  tls file miscdevice.h was added on branch tls-maxphys on 2014-08-20 00:04:21 +0000
 1.2.6.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.2.6.1 18-Mar-2014  yamt file miscdevice.h was added on branch yamt-pagecache on 2014-05-22 11:40:56 +0000
 1.2.4.2 18-May-2014  rmind sync with head
 1.2.4.1 18-Mar-2014  rmind file miscdevice.h was added on branch rmind-smpnet on 2014-05-18 17:46:01 +0000
 1.24 19-Dec-2021  riastradh amdgpu: Another pass through.

amdgpu_object.c
amdgpu_pci.c
amdgpu_pm.c
amdgpu_polaris10_smumgr.c
amdgpu_pp_psm.c
amdgpu_ppatomctrl.c
amdgpu_ppatomfwctrl.c
amdgpu_process_pptables_v1_0.o
amdgpu_psp.o
amdgpu_psp_v10_0.c
amdgpu_psp_v11_0.c
amdgpu_psp_v12_0.c
amdgpu_psp_v3_1.c
amdgpu_ras.c
amdgpu_ras_eeprom.c
amdgpu_rc_calc.c
amdgpu_rc_calc_dpi.c
amdgpu_ring.c
amdgpu_rlc.c
amdgpu_rn_clk_mgr.c
amdgpu_sdma_v3_0.c
amdgpu_sdma_v4_0.c
amdgpu_sdma_v5_0.c
amdgpu_si.c
amdgpu_si_dma.c
amdgpu_si_dpm.c
amdgpu_smu.c
amdgpu_smu10_hwmgr.c
amdgpu_smu7_hwmgr.c
amdgpu_smu8_hwmgr.c
amdgpu_smu8_smumgr.c
amdgpu_smu_v11_0.c (and a sprinkling of consts)
amdgpu_smu_v11_0_i2c.c
amdgpu_soc15.c
amdgpu_tonga_smumgr.c
amdgpu_ttm.c
amdgpu_ucode.c
amdgpu_uvd.c
amdgpu_uvd_v5_0.c
amdgpu_uvd_v6_0.c
amdgpu_uvd_v7_0.c
amdgpu_vce.c
amdgpu_vce_v2_0.c
amdgpu_vce_v4_0.c
amdgpu_vcn_v1_0.c
amdgpu_vcn_v2_0.c
amdgpu_vcn_v2_5.c
amdgpu_vega10_hwmgr.c
amdgpu_vega10_powertune.c
amdgpu_vega10_processpptables.c
amdgpu_vega10_reg_init.c
amdgpu_vega12_hwmgr.c
amdgpu_vega20_hwmgr.c
amdgpu_vega20_ppt.c
amdgpu_vega20_reg_init.c
amdgpu_vi.c
amdgpu_virt.c
amdgpu_vram_mgr.c
amdgpu_xgmi.c -- disable (for now?)
amdgpufb.c
 1.23 19-Dec-2021  riastradh linux: Use kmem directly for Linux kmalloc.

Take advantage of this to do LOCKDEBUG_MEM_CHECK at the point of
kfree_rcu rather than in the RCU GC thread.
 1.22 19-Dec-2021  riastradh Cast, because we get passed void*


Author: Maya Rashish <maya@NetBSD.org>
Committer: Taylor R Campbell <riastradh@NetBSD.org>
 1.21 19-Dec-2021  riastradh drm: Another pass over i915. Most of i915 gem builds now.
 1.20 19-Dec-2021  riastradh kvcalloc
 1.19 19-Dec-2021  riastradh kvmalloc, kludgey platformdev hacks
 1.18 19-Dec-2021  riastradh Define untagged_addr


Author: Maya Rashish <maya@NetBSD.org>
 1.17 19-Dec-2021  riastradh Side-load linux/sizes.h like linux does.

One way to get SZ_1M to be defined for intel_guc.c


Author: Maya Rashish <maya@NetBSD.org>
 1.16 19-Dec-2021  riastradh Kookily define si_mem_available.
 1.15 19-Dec-2021  riastradh Define kvzalloc.
 1.14 19-Dec-2021  riastradh Define kvmalloc_array.
 1.13 23-Feb-2020  ad UVM locking changes, proposed on tech-kern:

- Change the lock on uvm_object, vm_amap and vm_anon to be a RW lock.
- Break v_interlock and vmobjlock apart. v_interlock remains a mutex.
- Do partial PV list locking in the x86 pmap. Others to follow later.
 1.12 19-Jan-2020  skrll Fix build on aarch64 by including uvm_object.h.

OK from Riastradh
 1.11 17-Jan-2020  ad set_page_dirty: take the vmobjlock if present
 1.10 15-Jan-2020  ad Merge from yamt-pagecache (after much testing):

- Reduce unnecessary page scan in putpages esp. when an object has a ton of
pages cached but only a few of them are dirty.

- Reduce the number of pmap operations by tracking page dirtiness more
precisely in uvm layer.
 1.9 27-Aug-2018  riastradh branches: 1.9.6;
Implement kvfree by free(9); assume kmalloc/vmalloc use malloc(9).
 1.8 27-Aug-2018  riastradh Implement set_page_dirty. Reduce diff a little.
 1.7 27-Aug-2018  riastradh match linux side loading of headers

more bring in OLD drm code to unbreak the build
matching netbsd types etc. to get the build going


Author: coypu <coypu@sdf.org>
Committer: Taylor R Campbell <riastradh@NetBSD.org>
 1.6 18-Oct-2015  jmcneill branches: 1.6.16; 1.6.18;
add get_num_physpages
 1.5 17-Apr-2015  riastradh Remove broken drm2 vm_mmap stub. Can't possibly have ever worked.
 1.4 14-Dec-2014  chs add a new "fo_mmap" fileops method to allow use of arbitrary uvm_objects for
mappings of file objects. move vnode-specific details of mmap()ing a vnode
from uvm_mmap() to the new vnode-specific vn_mmap(). add new uvm_mmap_dev()
and uvm_mmap_anon() convenience functions for mapping character devices
and anonymous memory, and replace all other calls to uvm_mmap() with those.
use the new fileop in drm2 so that libdrm can use mmap() to map things
like on other platforms (instead of the ioctl that we have used so far).
 1.3 16-Jul-2014  riastradh branches: 1.3.2; 1.3.4; 1.3.6;
First whack at radeon driver.

No hardware to test yet, but it builds.
 1.2 18-Mar-2014  riastradh branches: 1.2.2; 1.2.4; 1.2.6;
Merge riastradh-drm2 to HEAD.
 1.1 24-Jul-2013  riastradh branches: 1.1.2;
file mm.h was initially added on branch riastradh-drm2.
 1.1.2.5 08-Sep-2013  riastradh Fix definition of Linux PAGE_ALIGN in <linux/mm.h>.

Can't use uvm round_page because that depends on PAGE_MASK, whose
sense we have to invert for Linux! Plurgh.
 1.1.2.4 24-Jul-2013  riastradh Mega-kludge: reverse sense of PAGE_MASK in <linux/mm.h>.
 1.1.2.3 24-Jul-2013  riastradh Use e_vm_default_addr to choose a default address in Linux vm_mmap.
 1.1.2.2 24-Jul-2013  riastradh First stab at vm_mmap in <linux/mm.h>. Also PAGE_SIZE & round_page.
 1.1.2.1 24-Jul-2013  riastradh Add stubs for Linux header files for drm.
 1.2.6.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.2.6.1 18-Mar-2014  yamt file mm.h was added on branch yamt-pagecache on 2014-05-22 11:40:56 +0000
 1.2.4.2 18-May-2014  rmind sync with head
 1.2.4.1 18-Mar-2014  rmind file mm.h was added on branch rmind-smpnet on 2014-05-18 17:46:01 +0000
 1.2.2.1 10-Aug-2014  tls Rebase.
 1.3.6.3 27-Dec-2015  skrll Sync with HEAD (as of 26th Dec)
 1.3.6.2 06-Jun-2015  skrll Sync with HEAD
 1.3.6.1 06-Apr-2015  skrll Sync with HEAD
 1.3.4.3 03-Dec-2017  jdolecek update from HEAD
 1.3.4.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.3.4.1 16-Jul-2014  tls file mm.h was added on branch tls-maxphys on 2014-08-20 00:04:21 +0000
 1.3.2.2 23-Apr-2015  snj Pull up following revision(s) (requested by mrg in ticket #718):
sys/arch/x86/include/pmap.h: revision 1.56
sys/arch/x86/x86/pmap.c: revision 1.188
sys/dev/pci/agp_amd64.c: revision 1.8
sys/dev/pci/agp_i810.c: revision 1.118
sys/external/bsd/drm2/dist/drm/i915/i915_dma.c: revision 1.16
sys/external/bsd/drm2/dist/drm/i915/i915_gem.c: revision 1.29
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_agp.c: revision 1.3
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_ttm.c: revision 1.4
sys/external/bsd/drm2/dist/drm/radeon/atombios_crtc.c: revision 1.3
sys/external/bsd/drm2/dist/drm/radeon/radeon_agp.c: revision 1.3
sys/external/bsd/drm2/dist/drm/radeon/radeon_display.c: revision 1.3
sys/external/bsd/drm2/dist/drm/radeon/radeon_legacy_crtc.c: revision 1.2
sys/external/bsd/drm2/dist/drm/radeon/radeon_object.c: revision 1.3
sys/external/bsd/drm2/dist/drm/radeon/radeon_ttm.c: revision 1.7
sys/external/bsd/drm2/dist/drm/ttm/ttm_bo.c: revisions 1.7-1.10
sys/external/bsd/drm2/dist/drm/ttm/ttm_bo_util.c: revision 1.5
sys/external/bsd/drm2/i915drm/intelfb.c: revision 1.13
sys/external/bsd/drm2/include/drm/drm_wait_netbsd.h: revisions 1.12, 1.13
sys/external/bsd/drm2/include/linux/mm.h: revision 1.5
sys/external/bsd/drm2/include/linux/pci.h: revisions 1.16, 1.17
sys/external/bsd/drm2/nouveau/nouveaufb.c: revision 1.2
sys/external/bsd/drm2/radeon/radeon_pci.c: revisions 1.8, 1.9
sys/uvm/uvm_init.c: revision 1.46
Hack against the blank console problem:
Leave the CLUT alone on ancient cards. At least this leaves us with a
semi working console (red and blue are flipped). Leave an example of what
seems to be happening but disable it because colors are better than 444 bit
greyscale.
--
Initialize P->V tracking for unmanaged device pages in uvm_init.

Conditional on __HAVE_PMAP_PV_TRACK until we add it to all pmaps.

MI part of pmap_pv(9) change proposed on tech-kern:

https://mail-index.netbsd.org/tech-kern/2015/03/26/msg018561.html
--
Implement pmap_pv(9) for x86 for P->V tracking of unmanaged pages.

Proposed on tech-kern with no objections:

https://mail-index.netbsd.org/tech-kern/2015/03/26/msg018561.html
--
Use pmap_pv(9) to remove mappings of Intel graphics aperture pages.

Proposed on tech-kern with no objections:

https://mail-index.netbsd.org/tech-kern/2015/03/26/msg018561.html

Further background at:

https://mail-index.netbsd.org/tech-kern/2014/07/23/msg017392.html
--
Use pmap_pv(9) to remove mappings of device pages in TTM.

Adapt nouveau and radeon to do pmap_pv_track for their device pages.

Proposed on tech-kern with no objections:

https://mail-index.netbsd.org/tech-kern/2015/03/26/msg018561.html

Further background at:

https://mail-index.netbsd.org/tech-kern/2014/07/23/msg017392.html
--
Fix error branches in agp_amd64.c.

- agp_generic_detach always.
- Free asc if it was allocated. (Found by Brainy, noted by maxv@.)
- Free the GATT if it was allocated.
--
pmf_device_register returns false on failure, not true
--
In DRM_SPIN_WAIT_ON, don't stop after waiting only one tick.

Continue the loop to recheck the condition and count the whole
duration.
--
Don't use the video BIOS memory as an i915 flush page!
--
Don't let anyone else allocate the video BIOS either.
--
Missed a zero: it's 0x100000, not 0x10000.
--
Don't reserve if atomic -- caller must have pre-pinned the buffer.
--
Don't reserve if atomic -- caller must have pre-pinned the buffer.
--
almost add radeondrmkms suspend/resume support. it unfortunately doesn't work.
--
Need the page's uvm object lock to do pmap_page_protect.
--
Use KASSERTMSG to show bad base/offset.
--
KASSERT about page-alignment on initialization too.
--
Don't break when hardclock_ticks wraps around.

Since we now only count time spent in wait, rather than determining
the end time and checking whether we've passed it, timeouts might be
marginally longer in effect. Unlikely to be an issue.
--
Remove broken drm2 vm_mmap stub. Can't possibly have ever worked.
--
apply some of the additional changes from Arto Huusko in PR#49645:
- call pmf_device_deregister on detach.

i've kept the "resume = true" for radeon_resume_kms() call as it
seems to work for me (indeed, code inspection shows it is unused
on netbsd :-)

my old nforce4 box that can resume old drm (or could, last i tried
several years ago) while X and GL apps were running, can at least
survive a resume if X hasn't started. my one attempt so far with
X exited, but having run, did not work.
--
First attempt to make ttm_buffer_object_transfer less bogus.
--
Make sure mem.bus.is_iomem is initialized. PR 49833
 1.3.2.1 31-Dec-2014  snj Pull up following revision(s) (requested by chs in ticket #363):
common/lib/libprop/prop_kern.c: revision 1.18
sys/arch/mac68k/dev/grf_compat.c: revision 1.27
sys/arch/x68k/dev/grf.c: revision 1.45
sys/external/bsd/drm/dist/bsd-core/drm_bufs.c: revision 1.12
sys/external/bsd/drm2/drm/drm_drv.c: revision 1.12
sys/external/bsd/drm2/drm/drm_vm.c: revision 1.6
sys/external/bsd/drm2/include/linux/mm.h: revision 1.4
sys/kern/vfs_vnops.c: revision 1.192 via patch
sys/rump/librump/rumpkern/vm.c: revision 1.160
sys/sys/file.h: revision 1.78 via patch
sys/uvm/uvm_device.c: revision 1.64
sys/uvm/uvm_device.h: revision 1.13
sys/uvm/uvm_extern.h: revision 1.192
sys/uvm/uvm_mmap.c: revision 1.150 via patch
add a new "fo_mmap" fileops method to allow use of arbitrary uvm_objects for
mappings of file objects. move vnode-specific details of mmap()ing a vnode
from uvm_mmap() to the new vnode-specific vn_mmap(). add new uvm_mmap_dev()
and uvm_mmap_anon() convenience functions for mapping character devices
and anonymous memory, and replace all other calls to uvm_mmap() with those.
use the new fileop in drm2 so that libdrm can use mmap() to map things
like on other platforms (instead of the ioctl that we have used so far).
 1.6.18.2 08-Apr-2020  martin Merge changes from current as of 20200406
 1.6.18.1 10-Jun-2019  christos Sync with HEAD
 1.6.16.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.9.6.3 29-Feb-2020  ad Sync with head.
 1.9.6.2 25-Jan-2020  ad Sync with head.
 1.9.6.1 17-Jan-2020  ad Sync with head.
 1.8 19-Dec-2021  riastradh Sort includes; whitespace.
 1.7 19-Dec-2021  riastradh sys/types.h before including a netbsd uvm header


Author: Maya Rashish <maya@NetBSD.org>
Committer: Taylor R Campbell <riastradh@NetBSD.org>
 1.6 19-Dec-2021  riastradh Side-load <linux/completion.h> in <linux/mm_types.h>.
 1.5 14-Feb-2020  maya Reduce diffs by side-loading some header files like Linux.

From riastradh
 1.4 16-Jul-2014  riastradh branches: 1.4.4; 1.4.30; 1.4.36;
First whack at radeon driver.

No hardware to test yet, but it builds.
 1.3 16-Jul-2014  riastradh Make it build and boot on my test machines.

Screen blanks on boot on the Ivy Bridge system with

DRM error in cpt_serr_int_handler: PCH transcoder A FIFO underrun

But after that everything is OK. Appears to be an upstream problem.
To investigate...

I think there's a cache flushing issue somewhere -- there are little
display artefacts on my T60.
 1.2 18-Mar-2014  riastradh branches: 1.2.2; 1.2.4; 1.2.6;
Merge riastradh-drm2 to HEAD.
 1.1 24-Jul-2013  riastradh branches: 1.1.2;
file mm_types.h was initially added on branch riastradh-drm2.
 1.1.2.2 24-Jul-2013  riastradh Add struct page to <linux/mm_types.h> as a struct vm_page wrapper.
 1.1.2.1 24-Jul-2013  riastradh Add stubs for Linux header files for drm.
 1.2.6.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.2.6.1 18-Mar-2014  yamt file mm_types.h was added on branch yamt-pagecache on 2014-05-22 11:40:56 +0000
 1.2.4.2 18-May-2014  rmind sync with head
 1.2.4.1 18-Mar-2014  rmind file mm_types.h was added on branch rmind-smpnet on 2014-05-18 17:46:01 +0000
 1.2.2.1 10-Aug-2014  tls Rebase.
 1.4.36.1 29-Feb-2020  ad Sync with head.
 1.4.30.1 08-Apr-2020  martin Merge changes from current as of 20200406
 1.4.4.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.4.4.1 16-Jul-2014  tls file mm_types.h was added on branch tls-maxphys on 2014-08-20 00:04:21 +0000
 1.2 18-Mar-2014  riastradh branches: 1.2.4; 1.2.6; 1.2.10;
Merge riastradh-drm2 to HEAD.
 1.1 24-Jul-2013  riastradh branches: 1.1.2;
file mman.h was initially added on branch riastradh-drm2.
 1.1.2.1 24-Jul-2013  riastradh Add stubs for Linux header files for drm.
 1.2.10.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.2.10.1 18-Mar-2014  tls file mman.h was added on branch tls-maxphys on 2014-08-20 00:04:21 +0000
 1.2.6.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.2.6.1 18-Mar-2014  yamt file mman.h was added on branch yamt-pagecache on 2014-05-22 11:40:56 +0000
 1.2.4.2 18-May-2014  rmind sync with head
 1.2.4.1 18-Mar-2014  rmind file mman.h was added on branch rmind-smpnet on 2014-05-18 17:46:01 +0000
 1.1 19-Dec-2021  riastradh Create stub headers for files included by drm code.


Author: Maya Rashish <maya@NetBSD.org>
 1.1 19-Dec-2021  riastradh Create stub headers for files included by drm code.


Author: Maya Rashish <maya@NetBSD.org>
 1.13 25-Oct-2022  riastradh linux/module.h: MODULE_VERSION
 1.12 19-Dec-2021  riastradh Side load <linux/rbtree.h> for nouveau.
 1.11 19-Dec-2021  riastradh move MODULE_PARM_DESC to moduleparam.h


Author: Maya Rashish <maya@NetBSD.org>
 1.10 19-Dec-2021  riastradh <linux/stringify.h> for __stringify.
 1.9 19-Dec-2021  riastradh Define another __stringify for fun, can't ever have too many.
 1.8 19-Dec-2021  riastradh Define __MODULE_STRING.
 1.7 27-Aug-2018  riastradh Draft support for drm prime.
 1.6 27-Aug-2018  riastradh Include <sys/module.h> first in <linux/module.h>.

If not, later includes of <sys/module.h> will fail because
<linux/module.h> defines a Linux macro module_init that causes the
prototype for our function module_init to evaporate.
 1.5 12-Nov-2014  christos branches: 1.5.18; 1.5.20;
Add __link_set based code to automatically convert the linux module parameters
into sysctls.
 1.4 06-Aug-2014  riastradh branches: 1.4.2; 1.4.4;
Include moduleparam and export in <linux/module.h> as users expect.
 1.3 16-Jul-2014  riastradh First whack at radeon driver.

No hardware to test yet, but it builds.
 1.2 18-Mar-2014  riastradh branches: 1.2.2; 1.2.4; 1.2.6;
Merge riastradh-drm2 to HEAD.
 1.1 24-Jul-2013  riastradh branches: 1.1.2;
file module.h was initially added on branch riastradh-drm2.
 1.1.2.4 24-Jul-2013  riastradh Add THIS_MODULE (expanding to 0) to <linux/module.h>.
 1.1.2.3 24-Jul-2013  riastradh Add some Linuxy MODULE_* stubs to <linux/module.h>.
 1.1.2.2 24-Jul-2013  riastradh Define empty module_init and module_exit stubs in <linux/module.h>.
 1.1.2.1 24-Jul-2013  riastradh Add stubs for Linux header files for drm.
 1.2.6.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.2.6.1 18-Mar-2014  yamt file module.h was added on branch yamt-pagecache on 2014-05-22 11:40:56 +0000
 1.2.4.2 18-May-2014  rmind sync with head
 1.2.4.1 18-Mar-2014  rmind file module.h was added on branch rmind-smpnet on 2014-05-18 17:46:01 +0000
 1.2.2.1 10-Aug-2014  tls Rebase.
 1.4.4.3 03-Dec-2017  jdolecek update from HEAD
 1.4.4.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.4.4.1 06-Aug-2014  tls file module.h was added on branch tls-maxphys on 2014-08-20 00:04:21 +0000
 1.4.2.1 11-Jan-2015  snj Pull up following revision(s) (requested by chs in ticket #401):
distrib/sets/lists/modules/md.amd64: revisions 1.46, 1.47 via patch
distrib/sets/lists/modules/md.i386: revisions 1.49, 1.50
sys/dev/ic/pcdisplayvar.h: revision 1.20
sys/dev/ic/vgavar.h: revision 1.32
sys/external/bsd/drm/dist/bsd-core/drm_drv.c: revision 1.26
sys/external/bsd/drm2/dist/drm/drm_agpsupport.c: revisions 1.5, 1.6
sys/external/bsd/drm2/dist/drm/drm_pci.c: revisions 1.4, 1.5
sys/external/bsd/drm2/dist/drm/drm_stub.c: revisions 1.6-1.8
sys/external/bsd/drm2/dist/drm/i915/i915_drv.h: revision 1.11
sys/external/bsd/drm2/dist/drm/radeon/cik.c: revision 1.3
sys/external/bsd/drm2/dist/drm/radeon/ni.c: revision 1.3
sys/external/bsd/drm2/dist/drm/radeon/si.c: revision 1.3
sys/external/bsd/drm2/dist/include/drm/drmP.h: revisions 1.8, 1.9
sys/external/bsd/drm2/dist/include/drm/drm_agpsupport.h: revisions 1.3, 1.4
sys/external/bsd/drm2/drm/drm_drv.c: revision 1.11
sys/external/bsd/drm2/drm/drm_module.c: revision 1.9
sys/external/bsd/drm2/drm/drm_sysctl.c: revisions 1.1-1.4
sys/external/bsd/drm2/drm/drm_vm.c: revision 1.7
sys/external/bsd/drm2/drm/files.drmkms: revisions 1.8, 1.9
sys/external/bsd/drm2/i915drm/files.i915drmkms: revision 1.9
sys/external/bsd/drm2/i915drm/i915_module.c: revisions 1.4, 1.5
sys/external/bsd/drm2/include/drm/drm_sysctl.h: revisions 1.1, 1.2
sys/external/bsd/drm2/include/linux/hdmi.h: revisions 1.3-1.5
sys/external/bsd/drm2/include/linux/module.h: revision 1.5
sys/external/bsd/drm2/include/linux/moduleparam.h: revisions 1.3, 1.4
sys/external/bsd/drm2/include/linux/pci.h: revision 1.11
sys/external/bsd/drm2/linux/linux_module.c: revision 1.5
sys/external/bsd/drm2/nouveau/files.nouveau: revision 1.4
sys/external/bsd/drm2/nouveau/nouveau_module.c: revision 1.3
sys/external/bsd/drm2/pci/drm_pci.c: revision 1.8
sys/external/bsd/drm2/pci/drm_pci_module.c: revision 1.3
sys/external/bsd/drm2/radeon/radeon_module.c: revision 1.3
sys/external/bsd/drm2/ttm/files.ttm: revision 1.1
sys/modules/drm2pci/Makefile: file removal
sys/modules/drmkms/Makefile: revisions 1.4-1.7
sys/modules/drmkms_linux/Makefile: revision 1.5
sys/modules/drmkms_pci/Makefile: revisions 1.3, 1.4
sys/modules/i915drmkms/Makefile: revisions 1.5-1.7
Split drm ttm config into a separate file.
--
Fix module build of drmkms_linux.
--
Remove vestigial drm2pci module, replaced by drmkms_pci.
--
fix the module class.
--
add the drmkms modules
--
make a drm_agp_destroy() function to resolve the circular dependency between
drmkms and drmkms_pci
--
finalize the idr code.
--
add drm_agp_destroy
--
fix drmkms module path for xen.
--
fix build failure.
/tmp/bracket/build/2014.11.10.22.43.46-i386/src/sys/external/bsd/drm2/include/linux/pci.h:36:20: fatal error: acpica.h: No such file or directory
--
make this work: add agpsupport and sysctl code
--
move agpsupport to drmkms to avoid circular dependencies.
--
turn on dynamic ldscript creation to handle link set symbol definitions
used in the automatic sysctl creation.
--
Add __link_set based code to automatically convert the linux module parameters
into sysctls.
--
this module needs MKLDSCRIPT too now
--
more _KERNEL_OPT
--
prettify and add to all the modules that have it.
--
fix description setting.
--
Adjust flags to allow building with clang.
--
Fix build with clang.
--
Drop casts in favour of expressions that actually give the right
pointer.
--
Move all PCI/AGP code back to drmkms_pci module where it belongs.
--
Use correct length for hdmi_infoframe_header_pack in <linux/hdmi.h>.
Fixes PR kern/49411.
--
Back out previous, fix PR kern/49411 correctly.
frame->header.length is not initialized in the vendor packet case.
Instead, make hdmi_infoframe_header_pack take the packet length and
subtract the size of the header when packing the header.
(Could make it take the payload length instead, but for callers it is
more convenient to have a name for the whole packet length.)
--
Fix bounds checking in hdmi_infoframe_header_pack (PR kern/49411).
--
Trivial build fix for no options SYSCTL_INCLUDE_DESCR case, to
avoid -Werror.
OK christos@ and riastradh@
--
fix debugging compilation (ALL kernel)
--
nouveau_nv50_fence.c needs -Wno-shadow.
--
fix a confusion between dev_t and devmajor_t, and include the primary
minor when calling makedev().
 1.5.20.1 10-Jun-2019  christos Sync with HEAD
 1.5.18.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.11 19-Dec-2021  riastradh amdgpu: amdgpu_drv.c
 1.10 19-Dec-2021  riastradh move MODULE_PARM_DESC to moduleparam.h


Author: Maya Rashish <maya@NetBSD.org>
 1.9 19-Dec-2021  riastradh Alias MTYPE__Bool for MTYPE_bool because of cpp expansion.
 1.8 27-Aug-2018  riastradh Teach drm_sysctl about uint, kludgily.
 1.7 27-Aug-2018  riastradh module_param_named_unsafe stub.
 1.6 27-Aug-2018  riastradh Define module_param and module_param_unsafe.
 1.5 25-Feb-2015  riastradh branches: 1.5.16; 1.5.18;
Add string Linux module parameters.

Needed by nouveau.

From chs@.
 1.4 12-Nov-2014  christos branches: 1.4.2;
fix description setting.
 1.3 12-Nov-2014  christos Add __link_set based code to automatically convert the linux module parameters
into sysctls.
 1.2 18-Mar-2014  riastradh branches: 1.2.4; 1.2.6; 1.2.8; 1.2.10;
Merge riastradh-drm2 to HEAD.
 1.1 24-Jul-2013  riastradh branches: 1.1.2;
file moduleparam.h was initially added on branch riastradh-drm2.
 1.1.2.2 24-Jul-2013  riastradh Define empty module_param_named stub in <linux/moduleparam.h>.
 1.1.2.1 24-Jul-2013  riastradh Add stubs for Linux header files for drm.
 1.2.10.3 03-Dec-2017  jdolecek update from HEAD
 1.2.10.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.2.10.1 18-Mar-2014  tls file moduleparam.h was added on branch tls-maxphys on 2014-08-20 00:04:21 +0000
 1.2.8.2 06-Mar-2015  snj Pull up following revision(s) (requested by mrg in ticket #573):
sys/external/bsd/common/include/linux/kernel.h: 1.5, 1.6
sys/external/bsd/drm2/dist/drm/drm_ioctl.c: 1.4
sys/external/bsd/drm2/dist/drm/drm_irq.c: 1.6-1.8
sys/external/bsd/drm2/dist/drm/i915/i915_dma.c: 1.13-1.15
sys/external/bsd/drm2/dist/drm/i915/i915_gem.c: 1.23-1.27
sys/external/bsd/drm2/dist/drm/i915/i915_gem_execbuffer.c: 1.5
sys/external/bsd/drm2/dist/drm/i915/intel_display.c: 1.14, 1.15
sys/external/bsd/drm2/dist/drm/i915/intel_dp.c: 1.10
sys/external/bsd/drm2/dist/drm/i915/intel_drv.h: 1.8
sys/external/bsd/drm2/dist/drm/i915/intel_i2c.c: 1.8-1.13
sys/external/bsd/drm2/dist/drm/i915/intel_pm.c: 1.6
sys/external/bsd/drm2/dist/drm/i915/intel_ringbuffer.c: 1.5, 1.6
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/device/nouveau_engine_device_base.c: 1.4
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/fifo/nouveau_engine_fifo_nvc0.c: 1.3, 1.4
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/fifo/nouveau_engine_fifo_nve0.c: 1.3, 1.4
sys/external/bsd/drm2/dist/drm/nouveau/core/include/core/device.h: 1.4
sys/external/bsd/drm2/dist/drm/nouveau/core/include/subdev/mc.h: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/include/subdev/pwr.h: 1.3, 1.4
sys/external/bsd/drm2/dist/drm/nouveau/core/os.h: 1.4, 1.5
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/bios/nouveau_subdev_bios_base.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/bios/nouveau_subdev_bios_pll.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/clock/nouveau_subdev_clock_base.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/clock/nouveau_subdev_clock_nv50.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/devinit/fbmem.h: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/devinit/nouveau_subdev_devinit_nv04.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/fb/nouveau_subdev_fb_nv50.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/fb/nouveau_subdev_fb_nvc0.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/fb/nv50.h: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/fb/nvc0.h: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/mc/nouveau_subdev_mc_base.c: 1.2, 1.3
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/mxm/nouveau_subdev_mxm_nv50.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/pwr/nouveau_subdev_pwr_base.c: 1.3, 1.4
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/therm/nouveau_subdev_therm_ic.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/timer/nouveau_subdev_timer_nv04.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/vm/nouveau_subdev_vm_base.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/vm/nouveau_subdev_vm_nv04.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/vm/nouveau_subdev_vm_nv44.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/vm/nv04.h: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_bo.h: 1.3
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_drm.c: 1.4, 1.5
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_fbcon.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_nv50_display.c: 1.3
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_nv84_fence.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_ttm.c: 1.3
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_ttm.h: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_vga.h: 1.2
sys/external/bsd/drm2/dist/drm/radeon/radeon_fence.c: 1.6-1.8
sys/external/bsd/drm2/dist/drm/radeon/radeon_pm.c: 1.3
sys/external/bsd/drm2/dist/drm/radeon/rs400.c: 1.3
sys/external/bsd/drm2/dist/drm/via/via_dmablit.c: 1.3, 1.4
sys/external/bsd/drm2/dist/drm/via/via_drv.h: 1.3
sys/external/bsd/drm2/dist/drm/via/via_irq.c: 1.3, 1.4
sys/external/bsd/drm2/dist/drm/via/via_video.c: 1.3, 1.4
sys/external/bsd/drm2/dist/include/drm/drmP.h: 1.10
sys/external/bsd/drm2/dist/include/drm/drm_crtc.h: 1.4
sys/external/bsd/drm2/dist/include/drm/drm_modes.h: 1.3
sys/external/bsd/drm2/dist/uapi/drm/i915_drm.h: 1.2
sys/external/bsd/drm2/drm/drm_cache.c: 1.4-1.6
sys/external/bsd/drm2/drm/drm_drv.c: 1.14
sys/external/bsd/drm2/drm/drm_module.c: 1.10
sys/external/bsd/drm2/drm/drm_sysctl.c: 1.5
sys/external/bsd/drm2/drm/drm_vma_manager.c: 1.2
sys/external/bsd/drm2/drm/drmfb.c: 1.1
sys/external/bsd/drm2/drm/files.drmkms: 1.10, 1.11
sys/external/bsd/drm2/i2c/drm_encoder_slave.c: 1.1
sys/external/bsd/drm2/i915drm/files.i915drmkms: 1.7, 1.10
sys/external/bsd/drm2/i915drm/intelfb.c: 1.11, 1.12
sys/external/bsd/drm2/include/asm/io.h: 1.4
sys/external/bsd/drm2/include/asm/unaligned.h: 1.2, 1.3
sys/external/bsd/drm2/include/drm/drm_encoder_slave.h: 1.1
sys/external/bsd/drm2/include/drm/drm_wait_netbsd.h: 1.7-1.11
sys/external/bsd/drm2/include/drm/drmfb.h: 1.1
sys/external/bsd/drm2/include/drm/drmfb_pci.h: 1.1, 1.2
sys/external/bsd/drm2/include/linux/bitops.h: 1.9
sys/external/bsd/drm2/include/linux/i2c.h: 1.7, 1.8
sys/external/bsd/drm2/include/linux/io-mapping.h: 1.5
sys/external/bsd/drm2/include/linux/moduleparam.h: 1.5
sys/external/bsd/drm2/include/linux/pci.h: 1.12-1.15
sys/external/bsd/drm2/include/linux/pm.h: 1.4
sys/external/bsd/drm2/include/linux/reboot.h: 1.2
sys/external/bsd/drm2/include/linux/slab.h: 1.5
sys/external/bsd/drm2/include/linux/string.h: 1.4
sys/external/bsd/drm2/include/linux/vgaarb.h: 1.3
sys/external/bsd/drm2/include/linux/ww_mutex.h: 1.10
sys/external/bsd/drm2/linux/files.drmkms_linux: 1.8
sys/external/bsd/drm2/linux/linux_i2c.c: 1.3
sys/external/bsd/drm2/linux/linux_ww_mutex.c: 1.1
sys/external/bsd/drm2/nouveau/files.nouveau: 1.5-1.8
sys/external/bsd/drm2/nouveau/nouveau_pci.c: 1.1-1.3
sys/external/bsd/drm2/nouveau/nouveau_pci.h: 1.1
sys/external/bsd/drm2/nouveau/nouveau_sysfs.c: 1.1
sys/external/bsd/drm2/nouveau/nouveau_vga.c: 1.1
sys/external/bsd/drm2/nouveau/nouveaufb.c: 1.1
sys/external/bsd/drm2/nouveau/nouveaufb.h: 1.1
sys/external/bsd/drm2/pci/drm_pci.c: 1.10-1.12
sys/external/bsd/drm2/pci/drm_pci_module.c: 1.4
sys/external/bsd/drm2/pci/drmfb_pci.c: 1.1-1.3
sys/external/bsd/drm2/pci/files.drmkms_pci: 1.5
sys/external/bsd/drm2/radeon/radeon_pci.c: 1.5-1.7
sys/modules/drmkms/Makefile: 1.8, 1.9
sys/modules/drmkms_linux/Makefile: 1.6
sys/modules/drmkms_pci/Makefile: 1.5
sync drm2 with HEAD.
 1.2.8.1 11-Jan-2015  snj Pull up following revision(s) (requested by chs in ticket #401):
distrib/sets/lists/modules/md.amd64: revisions 1.46, 1.47 via patch
distrib/sets/lists/modules/md.i386: revisions 1.49, 1.50
sys/dev/ic/pcdisplayvar.h: revision 1.20
sys/dev/ic/vgavar.h: revision 1.32
sys/external/bsd/drm/dist/bsd-core/drm_drv.c: revision 1.26
sys/external/bsd/drm2/dist/drm/drm_agpsupport.c: revisions 1.5, 1.6
sys/external/bsd/drm2/dist/drm/drm_pci.c: revisions 1.4, 1.5
sys/external/bsd/drm2/dist/drm/drm_stub.c: revisions 1.6-1.8
sys/external/bsd/drm2/dist/drm/i915/i915_drv.h: revision 1.11
sys/external/bsd/drm2/dist/drm/radeon/cik.c: revision 1.3
sys/external/bsd/drm2/dist/drm/radeon/ni.c: revision 1.3
sys/external/bsd/drm2/dist/drm/radeon/si.c: revision 1.3
sys/external/bsd/drm2/dist/include/drm/drmP.h: revisions 1.8, 1.9
sys/external/bsd/drm2/dist/include/drm/drm_agpsupport.h: revisions 1.3, 1.4
sys/external/bsd/drm2/drm/drm_drv.c: revision 1.11
sys/external/bsd/drm2/drm/drm_module.c: revision 1.9
sys/external/bsd/drm2/drm/drm_sysctl.c: revisions 1.1-1.4
sys/external/bsd/drm2/drm/drm_vm.c: revision 1.7
sys/external/bsd/drm2/drm/files.drmkms: revisions 1.8, 1.9
sys/external/bsd/drm2/i915drm/files.i915drmkms: revision 1.9
sys/external/bsd/drm2/i915drm/i915_module.c: revisions 1.4, 1.5
sys/external/bsd/drm2/include/drm/drm_sysctl.h: revisions 1.1, 1.2
sys/external/bsd/drm2/include/linux/hdmi.h: revisions 1.3-1.5
sys/external/bsd/drm2/include/linux/module.h: revision 1.5
sys/external/bsd/drm2/include/linux/moduleparam.h: revisions 1.3, 1.4
sys/external/bsd/drm2/include/linux/pci.h: revision 1.11
sys/external/bsd/drm2/linux/linux_module.c: revision 1.5
sys/external/bsd/drm2/nouveau/files.nouveau: revision 1.4
sys/external/bsd/drm2/nouveau/nouveau_module.c: revision 1.3
sys/external/bsd/drm2/pci/drm_pci.c: revision 1.8
sys/external/bsd/drm2/pci/drm_pci_module.c: revision 1.3
sys/external/bsd/drm2/radeon/radeon_module.c: revision 1.3
sys/external/bsd/drm2/ttm/files.ttm: revision 1.1
sys/modules/drm2pci/Makefile: file removal
sys/modules/drmkms/Makefile: revisions 1.4-1.7
sys/modules/drmkms_linux/Makefile: revision 1.5
sys/modules/drmkms_pci/Makefile: revisions 1.3, 1.4
sys/modules/i915drmkms/Makefile: revisions 1.5-1.7
Split drm ttm config into a separate file.
--
Fix module build of drmkms_linux.
--
Remove vestigial drm2pci module, replaced by drmkms_pci.
--
fix the module class.
--
add the drmkms modules
--
make a drm_agp_destroy() function to resolve the circular dependency between
drmkms and drmkms_pci
--
finalize the idr code.
--
add drm_agp_destroy
--
fix drmkms module path for xen.
--
fix build failure.
/tmp/bracket/build/2014.11.10.22.43.46-i386/src/sys/external/bsd/drm2/include/linux/pci.h:36:20: fatal error: acpica.h: No such file or directory
--
make this work: add agpsupport and sysctl code
--
move agpsupport to drmkms to avoid circular dependencies.
--
turn on dynamic ldscript creation to handle link set symbol definitions
used in the automatic sysctl creation.
--
Add __link_set based code to automatically convert the linux module parameters
into sysctls.
--
this module needs MKLDSCRIPT too now
--
more _KERNEL_OPT
--
prettify and add to all the modules that have it.
--
fix description setting.
--
Adjust flags to allow building with clang.
--
Fix build with clang.
--
Drop casts in favour of expressions that actually give the right
pointer.
--
Move all PCI/AGP code back to drmkms_pci module where it belongs.
--
Use correct length for hdmi_infoframe_header_pack in <linux/hdmi.h>.
Fixes PR kern/49411.
--
Back out previous, fix PR kern/49411 correctly.
frame->header.length is not initialized in the vendor packet case.
Instead, make hdmi_infoframe_header_pack take the packet length and
subtract the size of the header when packing the header.
(Could make it take the payload length instead, but for callers it is
more convenient to have a name for the whole packet length.)
--
Fix bounds checking in hdmi_infoframe_header_pack (PR kern/49411).
--
Trivial build fix for no options SYSCTL_INCLUDE_DESCR case, to
avoid -Werror.
OK christos@ and riastradh@
--
fix debugging compilation (ALL kernel)
--
nouveau_nv50_fence.c needs -Wno-shadow.
--
fix a confusion between dev_t and devmajor_t, and include the primary
minor when calling makedev().
 1.2.6.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.2.6.1 18-Mar-2014  yamt file moduleparam.h was added on branch yamt-pagecache on 2014-05-22 11:40:56 +0000
 1.2.4.2 18-May-2014  rmind sync with head
 1.2.4.1 18-Mar-2014  rmind file moduleparam.h was added on branch rmind-smpnet on 2014-05-18 17:46:01 +0000
 1.4.2.1 06-Apr-2015  skrll Sync with HEAD
 1.5.18.1 10-Jun-2019  christos Sync with HEAD
 1.5.16.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.1 16-Jul-2014  riastradh branches: 1.1.2; 1.1.6;
Make it build and boot on my test machines.

Screen blanks on boot on the Ivy Bridge system with

DRM error in cpt_serr_int_handler: PCH transcoder A FIFO underrun

But after that everything is OK. Appears to be an upstream problem.
To investigate...

I think there's a cache flushing issue somewhere -- there are little
display artefacts on my T60.
 1.1.6.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.6.1 16-Jul-2014  tls file mount.h was added on branch tls-maxphys on 2014-08-20 00:04:21 +0000
 1.1.2.2 10-Aug-2014  tls Rebase.
 1.1.2.1 16-Jul-2014  tls file mount.h was added on branch tls-earlyentropy on 2014-08-10 06:55:39 +0000
 1.17 19-Dec-2021  riastradh drm: Another pass over i915 and some supporting logic.

This makes a shim around sg_table, which essentially represents two
things:

1. an array of pages (roughly corresponding to bus_dma_segment_t[])
2. an array of DMA addresses stored in a bus_dmamap_t

Both parts are optional; different parts of i915 use sg_tables to
pass around one or both of the two parts. This helps to reduce the
ifdefs by quite a bit, although it's not always clear which part of
an sg_table any particular interface is actually using which is why I
was reluctant to do this before.
 1.16 19-Dec-2021  riastradh recursive locking is bad, do not use this ever.
 1.15 19-Dec-2021  riastradh Move Linux lockdep stuff to its own header file.
 1.14 19-Dec-2021  riastradh Implement lockdep assertions. Add lockdep_assert_held_once.
 1.13 19-Dec-2021  riastradh Make <linux/mutex.h> side-load <linux/spinlock.h>.

Upstream actually side-loads <linux/spinlock_types.h> so you just get
spinlock_t without all the other spinlock operations, but whatever.

Reduce some diffs that this renders unnecessary.
 1.12 14-Feb-2020  maya Reduce diffs by side-loading some header files like Linux.

From riastradh
 1.11 27-Aug-2018  riastradh branches: 1.11.6;
Add lockdep_is_held stub.
 1.10 27-Aug-2018  riastradh Define __lockdep_used for variables used only in lockdep assertions.
 1.9 27-Aug-2018  riastradh begin fixing -Werror build:

Provide missing declarations from older drm
provide more definitions used by code
no idea what might_lock is, but it might be some error-checking
lockdep thing.


Author: coypu <coypu@sdf.org>
Committer: Taylor R Campbell <riastradh@NetBSD.org>
 1.8 27-Aug-2018  riastradh match linux side loading of headers

more bring in OLD drm code to unbreak the build
matching netbsd types etc. to get the build going


Author: coypu <coypu@sdf.org>
Committer: Taylor R Campbell <riastradh@NetBSD.org>
 1.7 23-Aug-2014  riastradh branches: 1.7.18; 1.7.20;
Another round of nouveau whack-a-mole.
 1.6 06-Aug-2014  riastradh branches: 1.6.2; 1.6.4;
Whack some nouveau moles.
 1.5 06-Aug-2014  riastradh Add Linux lockdep cruft.
 1.4 16-Jul-2014  riastradh First whack at radeon driver.

No hardware to test yet, but it builds.
 1.3 16-Jul-2014  riastradh Make it build and boot on my test machines.

Screen blanks on boot on the Ivy Bridge system with

DRM error in cpt_serr_int_handler: PCH transcoder A FIFO underrun

But after that everything is OK. Appears to be an upstream problem.
To investigate...

I think there's a cache flushing issue somewhere -- there are little
display artefacts on my T60.
 1.2 18-Mar-2014  riastradh branches: 1.2.2; 1.2.4; 1.2.6;
Merge riastradh-drm2 to HEAD.
 1.1 24-Jul-2013  riastradh branches: 1.1.2;
file mutex.h was initially added on branch riastradh-drm2.
 1.1.2.6 24-Jul-2013  riastradh Fix Linux mutex_lock_interruptible to return an error.
 1.1.2.5 24-Jul-2013  riastradh Add linux_mutex_destroy to <linux/mutex.h>.
 1.1.2.4 24-Jul-2013  riastradh Define linux_mutex_init in <linux/mutex.h> to make its uses greppable.
 1.1.2.3 24-Jul-2013  riastradh Implement Linux's struct mutex less sleazily.

Can't recall why I did it sleazily in the first place.
 1.1.2.2 24-Jul-2013  riastradh Fill <linux/mutex.h> with aliases for our mutex abstraction.

mutex_lock_interruptible isn't; this may require revisiting.
 1.1.2.1 24-Jul-2013  riastradh Add stubs for Linux header files for drm.
 1.2.6.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.2.6.1 18-Mar-2014  yamt file mutex.h was added on branch yamt-pagecache on 2014-05-22 11:40:56 +0000
 1.2.4.2 18-May-2014  rmind sync with head
 1.2.4.1 18-Mar-2014  rmind file mutex.h was added on branch rmind-smpnet on 2014-05-18 17:46:01 +0000
 1.2.2.1 10-Aug-2014  tls Rebase.
 1.6.4.3 03-Dec-2017  jdolecek update from HEAD
 1.6.4.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.6.4.1 06-Aug-2014  tls file mutex.h was added on branch tls-maxphys on 2014-08-20 00:04:21 +0000
 1.6.2.1 21-Sep-2014  snj Pull up following revision(s) (requested by riastradh in ticket #95):
sys/external/bsd/drm2/dist/drm/nouveau/core/include/subdev/fb.h: revision 1.2
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_nv10_fence.c: revision 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/bar/nouveau_subdev_bar_base.c: revision 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/include/engine/device.h: revision 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/include/subdev/pwr.h: revision 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/nouveau_engine_xtensa.c: revision 1.2
sys/external/bsd/drm2/include/linux/bitops.h: revision 1.8
sys/external/bsd/drm2/dist/drm/nouveau/dispnv04/nouveau_dispnv04_tvnv17.c: revision 1.3
sys/external/bsd/drm2/dist/drm/nouveau/dispnv04/nouveau_dispnv04_tvmodesnv17.c: revision 1.3
sys/external/bsd/drm2/dist/drm/nouveau/core/include/core/device.h: revision 1.3
sys/external/bsd/drm2/include/drm/drm_agp_netbsd.h: revision 1.4
sys/external/bsd/drm2/include/linux/spinlock.h: revision 1.4
sys/external/bsd/drm2/include/linux/pm_runtime.h: revision 1.3
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/crypt/nouveau_engine_crypt_nv98.c: revision 1.2
sys/external/bsd/drm2/nouveau/files.nouveau: revision 1.3
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/disp/nouveau_engine_disp_dacnv50.c: revision 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/fifo/nouveau_engine_fifo_nve0.c: revision 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/disp/nouveau_engine_disp_nv50.c: revision 1.2
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_gem.c: revision 1.3
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_bo.c: revision 1.5
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/perfmon/nouveau_engine_perfmon_base.c: revision 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/crypt/nouveau_engine_crypt_nv84.c: revision 1.2
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_fence.c: revision 1.3
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/graph/nouveau_engine_graph_nv50.c: revision 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/fifo/nouveau_engine_fifo_nvc0.c: revision 1.2
sys/external/bsd/drm2/include/linux/vmalloc.h: revision 1.4
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/fifo/nve0.h: revision 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/instmem/nv04.h: revision 1.2
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_drm.c: revision 1.3
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_drm.h: revision 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/fifo/nouveau_engine_fifo_base.c: revision 1.3
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/disp/nouveau_engine_disp_nvd0.c: revision 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/disp/nouveau_engine_disp_nv04.c: revision 1.2
sys/external/bsd/drm2/nouveau/nouveau_module.c: revision 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/instmem/nouveau_subdev_instmem_nv40.c: revision 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/graph/nouveau_engine_graph_gm107.c: revision 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/graph/nouveau_engine_graph_ctxnvd7.c: revision 1.2
sys/external/bsd/drm2/include/linux/mutex.h: revision 1.7
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/disp/nv50.h: revision 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/device/nouveau_engine_device_base.c: revision 1.3
sys/external/bsd/drm2/include/linux/i2c.h: revision 1.6
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/graph/nouveau_engine_graph_nvc0.c: revision 1.2
sys/external/bsd/drm2/include/linux/pagemap.h: revision 1.3
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/instmem/nouveau_subdev_instmem_nv04.c: revision 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/copy/nouveau_engine_copy_nva3.c: revision 1.2
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_nv50_display.c: revision 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/include/subdev/bar.h: revision 1.3
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/pwr/nouveau_subdev_pwr_base.c: revision 1.2
Another round of nouveau whack-a-mole.
 1.7.20.2 08-Apr-2020  martin Merge changes from current as of 20200406
 1.7.20.1 10-Jun-2019  christos Sync with HEAD
 1.7.18.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.11.6.1 29-Feb-2020  ad Sync with head.
 1.1 16-Apr-2024  riastradh branches: 1.1.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.
 1.1.4.2 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@.
 1.1.4.1 16-Apr-2024  martin file mxm-wmi.h was added on branch netbsd-10 on 2024-10-04 11:40:49 +0000
 1.2 16-Apr-2024  riastradh 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.
 1.1 27-Feb-2022  riastradh branches: 1.1.4;
drm: Move Linux ACPI case aliases to new nbsd-namespace-acpi.h.
 1.1.4.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@.
 1.4 19-Dec-2021  riastradh drm: Knuckle under and define sprintf in nbsd-namespace.h.
 1.3 19-Dec-2021  riastradh Work around our #define free.
 1.2 14-Feb-2020  riastradh branches: 1.2.2; 1.2.6;
Add LIST_HEAD to <linux/nbsd-namespace.h> too.
 1.1 14-Feb-2020  riastradh Use a header file hack to cope with Linux/NetBSD namespace clashes.

Currently serves for:

ALIGN
mutex_init
mutex_destroy
 1.2.6.2 08-Apr-2020  martin Merge changes from current as of 20200406
 1.2.6.1 14-Feb-2020  martin file nbsd-namespace.h was added on branch phil-wifi on 2020-04-08 14:08:27 +0000
 1.2.2.2 29-Feb-2020  ad Sync with head.
 1.2.2.1 14-Feb-2020  ad file nbsd-namespace.h was added on branch ad-namecache on 2020-02-29 20:20:17 +0000
 1.3 19-Dec-2021  riastradh Fix mistake in array_index_nospec.

j must be constrained to be in the same register on input or output;
otherwise the compiler may put them in different places, expect the
asm code to write to the output register, and read garbage from the
output register when we fail to put anything there.
 1.2 19-Dec-2021  riastradh array_index_nospec
 1.1 19-Dec-2021  riastradh Bunch more Linux header file stubs.
 1.5 19-Dec-2021  riastradh Match function name to code


Author: Maya Rashish <maya@NetBSD.org>
Committer: Taylor R Campbell <riastradh@NetBSD.org>
 1.4 19-Dec-2021  riastradh i915: more work
 1.3 27-Aug-2018  riastradh Add some shrinker and oom notifier stubs.
 1.2 18-Mar-2014  riastradh branches: 1.2.4; 1.2.6; 1.2.10; 1.2.34; 1.2.36;
Merge riastradh-drm2 to HEAD.
 1.1 24-Jul-2013  riastradh branches: 1.1.2;
file notifier.h was initially added on branch riastradh-drm2.
 1.1.2.2 08-Sep-2013  riastradh Miscellaneous Linux header file crud.
 1.1.2.1 24-Jul-2013  riastradh Add forgotten <linux/notifier.h>.
 1.2.36.1 10-Jun-2019  christos Sync with HEAD
 1.2.34.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.2.10.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.2.10.1 18-Mar-2014  tls file notifier.h was added on branch tls-maxphys on 2014-08-20 00:04:21 +0000
 1.2.6.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.2.6.1 18-Mar-2014  yamt file notifier.h was added on branch yamt-pagecache on 2014-05-22 11:40:56 +0000
 1.2.4.2 18-May-2014  rmind sync with head
 1.2.4.1 18-Mar-2014  rmind file notifier.h was added on branch rmind-smpnet on 2014-05-18 17:46:01 +0000
 1.1 27-Aug-2018  riastradh branches: 1.1.2; 1.1.6;
More Linux header file stubs.
 1.1.6.2 10-Jun-2019  christos Sync with HEAD
 1.1.6.1 27-Aug-2018  christos file of_device.h was added on branch phil-wifi on 2019-06-10 22:08:31 +0000
 1.1.2.2 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.1.2.1 27-Aug-2018  pgoyette file of_device.h was added on branch pgoyette-compat on 2018-09-06 06:56:36 +0000
 1.2 27-Aug-2018  riastradh branches: 1.2.2; 1.2.6;
Add some shrinker and oom notifier stubs.
 1.1 27-Aug-2018  riastradh local versions of headers required


Author: coypu <coypu@sdf.org>
Committer: Taylor R Campbell <riastradh@NetBSD.org>
 1.2.6.2 10-Jun-2019  christos Sync with HEAD
 1.2.6.1 27-Aug-2018  christos file oom.h was added on branch phil-wifi on 2019-06-10 22:08:32 +0000
 1.2.2.2 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.2.2.1 27-Aug-2018  pgoyette file oom.h was added on branch pgoyette-compat on 2018-09-06 06:56:36 +0000
 1.5 19-Dec-2021  riastradh linux: Move linux/overflow.h from drm2 to common.

Needed so linux/slab.h can side-load it.
 1.4 19-Dec-2021  riastradh Fix array_size. Helps to multiply, not add.
 1.3 19-Dec-2021  riastradh Fix up saturated arithmetic macros.
 1.2 19-Dec-2021  riastradh implement check_{add,mul}_overflow, using builtins


Author: Maya Rashish <maya@NetBSD.org>
 1.1 19-Dec-2021  riastradh Define Linux array_size function and expose via vmalloc.h.
 1.6 19-Dec-2021  riastradh drm: Another pass over i915. Most of i915 gem builds now.
 1.5 19-Dec-2021  riastradh drm/linux: pagemap.h->highmem.h side load
 1.4 19-Dec-2021  riastradh side-load linux/uaccess.h for copy_to/from_user
 1.3 23-Aug-2014  riastradh Another round of nouveau whack-a-mole.
 1.2 18-Mar-2014  riastradh branches: 1.2.4; 1.2.6; 1.2.8; 1.2.10;
Merge riastradh-drm2 to HEAD.
 1.1 24-Jul-2013  riastradh branches: 1.1.2;
file pagemap.h was initially added on branch riastradh-drm2.
 1.1.2.2 08-Sep-2013  riastradh More miscellaneous Linux header cruft. See patch for details.
 1.1.2.1 24-Jul-2013  riastradh Add stubs for Linux header files for drm.
 1.2.10.3 03-Dec-2017  jdolecek update from HEAD
 1.2.10.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.2.10.1 18-Mar-2014  tls file pagemap.h was added on branch tls-maxphys on 2014-08-20 00:04:21 +0000
 1.2.8.1 21-Sep-2014  snj Pull up following revision(s) (requested by riastradh in ticket #95):
sys/external/bsd/drm2/dist/drm/nouveau/core/include/subdev/fb.h: revision 1.2
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_nv10_fence.c: revision 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/bar/nouveau_subdev_bar_base.c: revision 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/include/engine/device.h: revision 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/include/subdev/pwr.h: revision 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/nouveau_engine_xtensa.c: revision 1.2
sys/external/bsd/drm2/include/linux/bitops.h: revision 1.8
sys/external/bsd/drm2/dist/drm/nouveau/dispnv04/nouveau_dispnv04_tvnv17.c: revision 1.3
sys/external/bsd/drm2/dist/drm/nouveau/dispnv04/nouveau_dispnv04_tvmodesnv17.c: revision 1.3
sys/external/bsd/drm2/dist/drm/nouveau/core/include/core/device.h: revision 1.3
sys/external/bsd/drm2/include/drm/drm_agp_netbsd.h: revision 1.4
sys/external/bsd/drm2/include/linux/spinlock.h: revision 1.4
sys/external/bsd/drm2/include/linux/pm_runtime.h: revision 1.3
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/crypt/nouveau_engine_crypt_nv98.c: revision 1.2
sys/external/bsd/drm2/nouveau/files.nouveau: revision 1.3
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/disp/nouveau_engine_disp_dacnv50.c: revision 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/fifo/nouveau_engine_fifo_nve0.c: revision 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/disp/nouveau_engine_disp_nv50.c: revision 1.2
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_gem.c: revision 1.3
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_bo.c: revision 1.5
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/perfmon/nouveau_engine_perfmon_base.c: revision 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/crypt/nouveau_engine_crypt_nv84.c: revision 1.2
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_fence.c: revision 1.3
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/graph/nouveau_engine_graph_nv50.c: revision 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/fifo/nouveau_engine_fifo_nvc0.c: revision 1.2
sys/external/bsd/drm2/include/linux/vmalloc.h: revision 1.4
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/fifo/nve0.h: revision 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/instmem/nv04.h: revision 1.2
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_drm.c: revision 1.3
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_drm.h: revision 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/fifo/nouveau_engine_fifo_base.c: revision 1.3
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/disp/nouveau_engine_disp_nvd0.c: revision 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/disp/nouveau_engine_disp_nv04.c: revision 1.2
sys/external/bsd/drm2/nouveau/nouveau_module.c: revision 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/instmem/nouveau_subdev_instmem_nv40.c: revision 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/graph/nouveau_engine_graph_gm107.c: revision 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/graph/nouveau_engine_graph_ctxnvd7.c: revision 1.2
sys/external/bsd/drm2/include/linux/mutex.h: revision 1.7
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/disp/nv50.h: revision 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/device/nouveau_engine_device_base.c: revision 1.3
sys/external/bsd/drm2/include/linux/i2c.h: revision 1.6
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/graph/nouveau_engine_graph_nvc0.c: revision 1.2
sys/external/bsd/drm2/include/linux/pagemap.h: revision 1.3
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/instmem/nouveau_subdev_instmem_nv04.c: revision 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/copy/nouveau_engine_copy_nva3.c: revision 1.2
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_nv50_display.c: revision 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/include/subdev/bar.h: revision 1.3
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/pwr/nouveau_subdev_pwr_base.c: revision 1.2
Another round of nouveau whack-a-mole.
 1.2.6.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.2.6.1 18-Mar-2014  yamt file pagemap.h was added on branch yamt-pagecache on 2014-05-22 11:40:56 +0000
 1.2.4.2 18-May-2014  rmind sync with head
 1.2.4.1 18-Mar-2014  rmind file pagemap.h was added on branch rmind-smpnet on 2014-05-18 17:46:01 +0000
 1.2 19-Dec-2021  riastradh Start xarray stubs.
 1.1 19-Dec-2021  riastradh More Linux header stubs.

Let's just use empty header files until we actually populate these.
Save a bit of disk space...
 1.58 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.
 1.57 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.56 25-Oct-2022  riastradh branches: 1.56.2;
linux/pci.h: Stubs for pci_request/release_region(s).
 1.55 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
 1.54 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.53 27-Feb-2022  riastradh linux: Define PCI_CLASS_DISPLAY_OTHER, wanted by radeon/amdgpu.
 1.52 27-Feb-2022  riastradh drm: Omit needless conditionals around #include "acpica.h".
 1.51 19-Dec-2021  riastradh linux: PCI_BUS_NUM; tweak types for PCI_SLOT/PCI_FUNC.
 1.50 19-Dec-2021  riastradh linux: pci_name
 1.49 19-Dec-2021  riastradh i915: another whack at it
 1.48 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.47 19-Dec-2021  riastradh Move acpi includes to linux_pci.c to avoid pollution.
 1.46 19-Dec-2021  riastradh Provide enum pci_bus_speed

We don't really make use of it but why not.


Author: Maya Rashish <maya@NetBSD.org>
 1.45 19-Dec-2021  riastradh Stub dev_is_pci


Author: Maya Rashish <maya@NetBSD.org>
 1.44 19-Dec-2021  riastradh Define pci_is_thunderbolt_attached (answer: no).
 1.43 19-Dec-2021  riastradh Side-load <linux/interrupt.h> in <linux/pci.h>.
 1.42 19-Dec-2021  riastradh Define pci_get/set_drvdata properly.
 1.41 19-Dec-2021  riastradh pci_get_bus_and_slot -> pci_get_domain_bus_and_slot
 1.40 19-Dec-2021  riastradh Define some obscure PCI ids.
 1.39 14-Feb-2020  maya Reduce diffs by side-loading some header files like Linux.

From riastradh
 1.38 18-Jan-2020  jmcneill Pull in acpica.h on aarch64
 1.37 27-Aug-2018  riastradh branches: 1.37.6;
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.36 27-Aug-2018  riastradh Fix sense of test to make linux_pci_dev_destroy work.
 1.35 27-Aug-2018  riastradh Initialize more of struct pci_device.
 1.34 27-Aug-2018  riastradh Implement linux_pci_dev_destroy.
 1.33 27-Aug-2018  riastradh Pass the parent explicitly to linux_pci_dev_init.

This will allow us to use it in match routines.
 1.32 27-Aug-2018  riastradh Free the bus crap.
 1.31 27-Aug-2018  riastradh For the kludges we don't have or need a device (parent) pointer.
 1.30 27-Aug-2018  riastradh Add no_64bit_msi field. (What to do wiht it?)
 1.29 27-Aug-2018  riastradh Add pci_enable/disable_device, pci_domain_nr, and some vendor ids.
 1.28 27-Aug-2018  riastradh Add pci_bus_read/write_config_{byte,word,dword}.
 1.27 27-Aug-2018  riastradh Namespace our private fields in Linux struct pci_device.
 1.26 27-Aug-2018  riastradh Stub pci_is_root_bus.
 1.25 27-Aug-2018  riastradh Forward-declare struct pci_driver, which is unused but appears in prototypes.
 1.24 31-Aug-2017  maya branches: 1.24.2; 1.24.4;
Disable MSI on DRMKMS (again).

It is causing problems on some older nvidia graphics cards:
http://mail-index.netbsd.org/netbsd-users/2017/08/02/msg020026.html
http://mail-index.netbsd.org/pkgsrc-users/2017/08/26/msg025492.html
PR kern/52440
 1.23 02-Mar-2017  nonaka branches: 1.23.6;
drmkms_pci: Use MSI if available (Take 2)

tested by martin@ and yhardy@
 1.22 17-Jan-2016  riastradh branches: 1.22.2; 1.22.4;
Use PCI ROM MD fallback if PCI ROM BAR points to invalid ROM.

We previously applied the PCI ROM MD fallback only if the PCI ROM BAR
was altogether unpopulated. Some Radeon devices seem to have a
populated PCI ROM BAR pointing at a bogus ROM, while 0xc0000 works
fine.

Fixes at least one manifestation of PR kern/49964.
 1.21 27-Oct-2015  riastradh Eliminate Linux struct pci_dev::dev, struct platform_device::dev.
 1.20 17-Oct-2015  jmcneill Don't include ACPI headers unless NACPICA > 0
 1.19 24-Jun-2015  riastradh Fix type of pd_rom_found_size: it's a size, not a handle.
 1.18 24-Jun-2015  riastradh Save the location of the found ROM so caller can bus_space_read it.
 1.17 06-Apr-2015  riastradh Missed a zero: it's 0x100000, not 0x10000.
 1.16 06-Apr-2015  riastradh Don't let anyone else allocate the video BIOS either.
 1.15 06-Mar-2015  riastradh One last round for nouveau. It links!
 1.14 25-Feb-2015  riastradh Add sizep argument to pci_platform_rom stub.
 1.13 25-Feb-2015  riastradh Add pci_platform_rom stub to <linux/pci.h>.
 1.12 25-Feb-2015  riastradh Add pci_enable_rom/pci_disable_rom to <linux/pci.h>.
 1.11 11-Nov-2014  nonaka branches: 1.11.2;
fix build failure.

> /tmp/bracket/build/2014.11.10.22.43.46-i386/src/sys/external/bsd/drm2/include/linux/pci.h:36:20: fatal error: acpica.h: No such file or directory
 1.10 05-Nov-2014  nonaka i915drmkms(4): Enable CONFIG_ACPI if NACPICA > 0.
Now brightness can be adjusted via hotkey on Mouse Computer LB-J300X (Clevo W330SU2).
 1.9 16-Oct-2014  riastradh Generalize pci_find_rom and use it to locate x86 video ROM in drm2.

- Make pci_find_rom take the ROM `BAR' size as a parameter, instead
of using pci_find_mem with the ROM `BAR' to detect the size.

- Use it to find the x86 video ROM in [0xc0000, 0xe0000) in drm2,
when nothing else reports that location.

- Adapt the one other caller in radeonfb, which already has the
maximum ROM size handy (romsz).

XXX pullup to netbsd-7
 1.8 13-Aug-2014  riastradh branches: 1.8.2;
Fix shifts & masks in Linux pci_read_config_{word,byte}.
 1.7 06-Aug-2014  riastradh branches: 1.7.2;
Add Linux PCI DMA stuff and NVIDIA vendor.
 1.6 16-Jul-2014  riastradh Remove needless pci_map_rom error messages.
 1.5 16-Jul-2014  riastradh First whack at radeon driver.

No hardware to test yet, but it builds.
 1.4 16-Jul-2014  riastradh Make it build and boot on my test machines.

Screen blanks on boot on the Ivy Bridge system with

DRM error in cpt_serr_int_handler: PCH transcoder A FIFO underrun

But after that everything is OK. Appears to be an upstream problem.
To investigate...

I think there's a cache flushing issue somewhere -- there are little
display artefacts on my T60.
 1.3 03-Apr-2014  riastradh branches: 1.3.2; 1.3.4; 1.3.6;
Miscellaneous fixes for drm2 on i386.
 1.2 18-Mar-2014  riastradh Merge riastradh-drm2 to HEAD.
 1.1 24-Jul-2013  riastradh branches: 1.1.2;
file pci.h was initially added on branch riastradh-drm2.
 1.1.2.15 24-Jul-2013  riastradh Add bogus struct device dev member to <linux/pci.h> struct pci_dev.
 1.1.2.14 24-Jul-2013  riastradh Add kludgey implementation of pci_map_rom.
 1.1.2.13 24-Jul-2013  riastradh Kludge up Linux PCI device shims.

. New drm_pci_attach/drm_pci_detach simplify initialization of
autoconf-derived struct pci_dev.

. New linux_pci_dev_init initializes struct pci_dev so that there's
one place where all its fields are listed. The kludge parameter is,
well, kludgey. Sorry.

. Replace pci_kludgey_find_dev by pci_get_bus_and_slot with the same
interface as Linux's, but some kasserts requiring it to look for the
one bus/device/function tuple that i915drm is interested in.

. Add pci_get_class which does similarly, for intel_detect_pch.

Later pci_get_bus_and_slot and pci_get_class should be fixed once we
can pass a cookie through PCI bus enumeration and pci_find_device.
 1.1.2.12 24-Jul-2013  riastradh Add pci_{read,write}_config_byte to <linux/pci.h>.
 1.1.2.11 24-Jul-2013  riastradh Fix struct pci_dev::dev in <linux/pci.h>.

Linux code expects it to be a struct device and takes its address,
but we can't arrange for the actual struct device to go there.
 1.1.2.10 24-Jul-2013  riastradh Fill in <linux/pci.h> a bit.
 1.1.2.9 24-Jul-2013  riastradh Add 16-bit (RMW) pci_{read,write}_config_word to <linux/pci.h>.
 1.1.2.8 24-Jul-2013  riastradh Add pci_set_master to <linux/pci.h>.
 1.1.2.7 24-Jul-2013  riastradh Add stubs for pci_enable_msi and pci_disable_msi to <linux/pci.h>.
 1.1.2.6 24-Jul-2013  riastradh Add field to struct pci_dev for the PCI device number.
 1.1.2.5 24-Jul-2013  riastradh Add pci_kludgey_find_dev to <linux/pci.h>.

This is not a Linux KPI, but the Linux KPI (pci_get_bus_and_slot)
doesn't pass along the original pci device or bus, so this is what
we'll use to replace uses of it (or, the one use of it) without
changing much code.
 1.1.2.4 24-Jul-2013  riastradh Add pci_bus_alloc_resource to <linux/pci.h>.
 1.1.2.3 24-Jul-2013  riastradh Add pci_config_{read,write}_dword to <linux/pci.h>.
 1.1.2.2 24-Jul-2013  riastradh Kill some #ifs in drmP.h by adding Linuxoid PCI goo to <linux/pci.h>.
 1.1.2.1 24-Jul-2013  riastradh Add stubs for Linux header files for drm.
 1.3.6.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.3.6.1 03-Apr-2014  yamt file pci.h was added on branch yamt-pagecache on 2014-05-22 11:40:56 +0000
 1.3.4.2 18-May-2014  rmind sync with head
 1.3.4.1 03-Apr-2014  rmind file pci.h was added on branch rmind-smpnet on 2014-05-18 17:46:01 +0000
 1.3.2.1 10-Aug-2014  tls Rebase.
 1.7.2.9 11-Feb-2016  snj Pull up following revision(s) (requested by riastradh in ticket #1080):
sys/external/bsd/drm2/dist/drm/i915/intel_i2c.c: revision 1.14
sys/external/bsd/drm2/dist/drm/i915/intel_pm.c: revision 1.8
sys/external/bsd/drm2/dist/drm/i915/intel_sdvo.c: revision 1.7
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_drm.c: revision 1.7
sys/external/bsd/drm2/dist/drm/nouveau/core/include/core/device.h: revision 1.5
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/bios/nouveau_subdev_bios_base.c: revision 1.3
sys/external/bsd/drm2/dist/drm/radeon/radeon_display.c: revision 1.5
sys/external/bsd/drm2/dist/drm/radeon/radeon_gem.c: revision 1.3
sys/external/bsd/drm2/dist/drm/radeon/radeon_i2c.c: revision 1.3
sys/external/bsd/drm2/dist/drm/radeon/radeon_kms.c: revision 1.3
sys/external/bsd/drm2/include/linux/pci.h: revision 1.21
sys/external/bsd/drm2/include/linux/platform_device.h: revision 1.7
sys/external/bsd/drm2/nouveau/nouveau_pci.c: revision 1.5
Use nv_device_base(dev) like other callers, not dev->pdev->dev.
First step in fixing the struct device nonsense. This won't actually
fix anything yet until we also fix nv_device_base.
--
dev->dev, not &dev->pdev->dev.
Latter is a charlatan, soon to meet judgment for its sins.
--
dev->dev, not &dev->pdev->dev.
Latter is a mistake that is all my fault. Oops.
--
Eliminate Linux struct pci_dev::dev, struct platform_device::dev.
 1.7.2.8 27-Jan-2016  snj Pull up following revision(s) (requested by riastradh in ticket #1077):
sys/external/bsd/drm2/include/linux/pci.h: revision 1.22
Use PCI ROM MD fallback if PCI ROM BAR points to invalid ROM.
We previously applied the PCI ROM MD fallback only if the PCI ROM BAR
was altogether unpopulated. Some Radeon devices seem to have a
populated PCI ROM BAR pointing at a bogus ROM, while 0xc0000 works
fine.
Fixes at least one manifestation of PR kern/49964.
 1.7.2.7 30-Jul-2015  snj Pull up following revision(s) (requested by riastradh in ticket #906):
sys/external/bsd/drm2/include/linux/pci.h: revisions 1.18, 1.19
sys/external/bsd/drm2/dist/drm/radeon/radeon_bios.c: revision 1.4
Save the location of the found ROM so caller can bus_space_read it.
--
Use bus_space_read rather than kmemdup to read ROM.
jakllsch@ reports that on some 64-bit systems, kmemdup does 8-byte
reads, which yield garbage in the high word. bus_space_read_region_1
does 1-byte reads instead, which seem to work.
Derived from a patch from jakllsch@.
--
Fix type of pd_rom_found_size: it's a size, not a handle.
 1.7.2.6 23-Apr-2015  snj Pull up following revision(s) (requested by mrg in ticket #718):
sys/arch/x86/include/pmap.h: revision 1.56
sys/arch/x86/x86/pmap.c: revision 1.188
sys/dev/pci/agp_amd64.c: revision 1.8
sys/dev/pci/agp_i810.c: revision 1.118
sys/external/bsd/drm2/dist/drm/i915/i915_dma.c: revision 1.16
sys/external/bsd/drm2/dist/drm/i915/i915_gem.c: revision 1.29
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_agp.c: revision 1.3
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_ttm.c: revision 1.4
sys/external/bsd/drm2/dist/drm/radeon/atombios_crtc.c: revision 1.3
sys/external/bsd/drm2/dist/drm/radeon/radeon_agp.c: revision 1.3
sys/external/bsd/drm2/dist/drm/radeon/radeon_display.c: revision 1.3
sys/external/bsd/drm2/dist/drm/radeon/radeon_legacy_crtc.c: revision 1.2
sys/external/bsd/drm2/dist/drm/radeon/radeon_object.c: revision 1.3
sys/external/bsd/drm2/dist/drm/radeon/radeon_ttm.c: revision 1.7
sys/external/bsd/drm2/dist/drm/ttm/ttm_bo.c: revisions 1.7-1.10
sys/external/bsd/drm2/dist/drm/ttm/ttm_bo_util.c: revision 1.5
sys/external/bsd/drm2/i915drm/intelfb.c: revision 1.13
sys/external/bsd/drm2/include/drm/drm_wait_netbsd.h: revisions 1.12, 1.13
sys/external/bsd/drm2/include/linux/mm.h: revision 1.5
sys/external/bsd/drm2/include/linux/pci.h: revisions 1.16, 1.17
sys/external/bsd/drm2/nouveau/nouveaufb.c: revision 1.2
sys/external/bsd/drm2/radeon/radeon_pci.c: revisions 1.8, 1.9
sys/uvm/uvm_init.c: revision 1.46
Hack against the blank console problem:
Leave the CLUT alone on ancient cards. At least this leaves us with a
semi working console (red and blue are flipped). Leave an example of what
seems to be happening but disable it because colors are better than 444 bit
greyscale.
--
Initialize P->V tracking for unmanaged device pages in uvm_init.

Conditional on __HAVE_PMAP_PV_TRACK until we add it to all pmaps.

MI part of pmap_pv(9) change proposed on tech-kern:

https://mail-index.netbsd.org/tech-kern/2015/03/26/msg018561.html
--
Implement pmap_pv(9) for x86 for P->V tracking of unmanaged pages.

Proposed on tech-kern with no objections:

https://mail-index.netbsd.org/tech-kern/2015/03/26/msg018561.html
--
Use pmap_pv(9) to remove mappings of Intel graphics aperture pages.

Proposed on tech-kern with no objections:

https://mail-index.netbsd.org/tech-kern/2015/03/26/msg018561.html

Further background at:

https://mail-index.netbsd.org/tech-kern/2014/07/23/msg017392.html
--
Use pmap_pv(9) to remove mappings of device pages in TTM.

Adapt nouveau and radeon to do pmap_pv_track for their device pages.

Proposed on tech-kern with no objections:

https://mail-index.netbsd.org/tech-kern/2015/03/26/msg018561.html

Further background at:

https://mail-index.netbsd.org/tech-kern/2014/07/23/msg017392.html
--
Fix error branches in agp_amd64.c.

- agp_generic_detach always.
- Free asc if it was allocated. (Found by Brainy, noted by maxv@.)
- Free the GATT if it was allocated.
--
pmf_device_register returns false on failure, not true
--
In DRM_SPIN_WAIT_ON, don't stop after waiting only one tick.

Continue the loop to recheck the condition and count the whole
duration.
--
Don't use the video BIOS memory as an i915 flush page!
--
Don't let anyone else allocate the video BIOS either.
--
Missed a zero: it's 0x100000, not 0x10000.
--
Don't reserve if atomic -- caller must have pre-pinned the buffer.
--
Don't reserve if atomic -- caller must have pre-pinned the buffer.
--
almost add radeondrmkms suspend/resume support. it unfortunately doesn't work.
--
Need the page's uvm object lock to do pmap_page_protect.
--
Use KASSERTMSG to show bad base/offset.
--
KASSERT about page-alignment on initialization too.
--
Don't break when hardclock_ticks wraps around.

Since we now only count time spent in wait, rather than determining
the end time and checking whether we've passed it, timeouts might be
marginally longer in effect. Unlikely to be an issue.
--
Remove broken drm2 vm_mmap stub. Can't possibly have ever worked.
--
apply some of the additional changes from Arto Huusko in PR#49645:
- call pmf_device_deregister on detach.

i've kept the "resume = true" for radeon_resume_kms() call as it
seems to work for me (indeed, code inspection shows it is unused
on netbsd :-)

my old nforce4 box that can resume old drm (or could, last i tried
several years ago) while X and GL apps were running, can at least
survive a resume if X hasn't started. my one attempt so far with
X exited, but having run, did not work.
--
First attempt to make ttm_buffer_object_transfer less bogus.
--
Make sure mem.bus.is_iomem is initialized. PR 49833
 1.7.2.5 06-Mar-2015  snj Pull up following revision(s) (requested by mrg in ticket #573):
sys/external/bsd/common/include/linux/kernel.h: 1.5, 1.6
sys/external/bsd/drm2/dist/drm/drm_ioctl.c: 1.4
sys/external/bsd/drm2/dist/drm/drm_irq.c: 1.6-1.8
sys/external/bsd/drm2/dist/drm/i915/i915_dma.c: 1.13-1.15
sys/external/bsd/drm2/dist/drm/i915/i915_gem.c: 1.23-1.27
sys/external/bsd/drm2/dist/drm/i915/i915_gem_execbuffer.c: 1.5
sys/external/bsd/drm2/dist/drm/i915/intel_display.c: 1.14, 1.15
sys/external/bsd/drm2/dist/drm/i915/intel_dp.c: 1.10
sys/external/bsd/drm2/dist/drm/i915/intel_drv.h: 1.8
sys/external/bsd/drm2/dist/drm/i915/intel_i2c.c: 1.8-1.13
sys/external/bsd/drm2/dist/drm/i915/intel_pm.c: 1.6
sys/external/bsd/drm2/dist/drm/i915/intel_ringbuffer.c: 1.5, 1.6
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/device/nouveau_engine_device_base.c: 1.4
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/fifo/nouveau_engine_fifo_nvc0.c: 1.3, 1.4
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/fifo/nouveau_engine_fifo_nve0.c: 1.3, 1.4
sys/external/bsd/drm2/dist/drm/nouveau/core/include/core/device.h: 1.4
sys/external/bsd/drm2/dist/drm/nouveau/core/include/subdev/mc.h: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/include/subdev/pwr.h: 1.3, 1.4
sys/external/bsd/drm2/dist/drm/nouveau/core/os.h: 1.4, 1.5
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/bios/nouveau_subdev_bios_base.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/bios/nouveau_subdev_bios_pll.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/clock/nouveau_subdev_clock_base.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/clock/nouveau_subdev_clock_nv50.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/devinit/fbmem.h: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/devinit/nouveau_subdev_devinit_nv04.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/fb/nouveau_subdev_fb_nv50.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/fb/nouveau_subdev_fb_nvc0.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/fb/nv50.h: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/fb/nvc0.h: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/mc/nouveau_subdev_mc_base.c: 1.2, 1.3
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/mxm/nouveau_subdev_mxm_nv50.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/pwr/nouveau_subdev_pwr_base.c: 1.3, 1.4
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/therm/nouveau_subdev_therm_ic.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/timer/nouveau_subdev_timer_nv04.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/vm/nouveau_subdev_vm_base.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/vm/nouveau_subdev_vm_nv04.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/vm/nouveau_subdev_vm_nv44.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/vm/nv04.h: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_bo.h: 1.3
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_drm.c: 1.4, 1.5
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_fbcon.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_nv50_display.c: 1.3
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_nv84_fence.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_ttm.c: 1.3
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_ttm.h: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_vga.h: 1.2
sys/external/bsd/drm2/dist/drm/radeon/radeon_fence.c: 1.6-1.8
sys/external/bsd/drm2/dist/drm/radeon/radeon_pm.c: 1.3
sys/external/bsd/drm2/dist/drm/radeon/rs400.c: 1.3
sys/external/bsd/drm2/dist/drm/via/via_dmablit.c: 1.3, 1.4
sys/external/bsd/drm2/dist/drm/via/via_drv.h: 1.3
sys/external/bsd/drm2/dist/drm/via/via_irq.c: 1.3, 1.4
sys/external/bsd/drm2/dist/drm/via/via_video.c: 1.3, 1.4
sys/external/bsd/drm2/dist/include/drm/drmP.h: 1.10
sys/external/bsd/drm2/dist/include/drm/drm_crtc.h: 1.4
sys/external/bsd/drm2/dist/include/drm/drm_modes.h: 1.3
sys/external/bsd/drm2/dist/uapi/drm/i915_drm.h: 1.2
sys/external/bsd/drm2/drm/drm_cache.c: 1.4-1.6
sys/external/bsd/drm2/drm/drm_drv.c: 1.14
sys/external/bsd/drm2/drm/drm_module.c: 1.10
sys/external/bsd/drm2/drm/drm_sysctl.c: 1.5
sys/external/bsd/drm2/drm/drm_vma_manager.c: 1.2
sys/external/bsd/drm2/drm/drmfb.c: 1.1
sys/external/bsd/drm2/drm/files.drmkms: 1.10, 1.11
sys/external/bsd/drm2/i2c/drm_encoder_slave.c: 1.1
sys/external/bsd/drm2/i915drm/files.i915drmkms: 1.7, 1.10
sys/external/bsd/drm2/i915drm/intelfb.c: 1.11, 1.12
sys/external/bsd/drm2/include/asm/io.h: 1.4
sys/external/bsd/drm2/include/asm/unaligned.h: 1.2, 1.3
sys/external/bsd/drm2/include/drm/drm_encoder_slave.h: 1.1
sys/external/bsd/drm2/include/drm/drm_wait_netbsd.h: 1.7-1.11
sys/external/bsd/drm2/include/drm/drmfb.h: 1.1
sys/external/bsd/drm2/include/drm/drmfb_pci.h: 1.1, 1.2
sys/external/bsd/drm2/include/linux/bitops.h: 1.9
sys/external/bsd/drm2/include/linux/i2c.h: 1.7, 1.8
sys/external/bsd/drm2/include/linux/io-mapping.h: 1.5
sys/external/bsd/drm2/include/linux/moduleparam.h: 1.5
sys/external/bsd/drm2/include/linux/pci.h: 1.12-1.15
sys/external/bsd/drm2/include/linux/pm.h: 1.4
sys/external/bsd/drm2/include/linux/reboot.h: 1.2
sys/external/bsd/drm2/include/linux/slab.h: 1.5
sys/external/bsd/drm2/include/linux/string.h: 1.4
sys/external/bsd/drm2/include/linux/vgaarb.h: 1.3
sys/external/bsd/drm2/include/linux/ww_mutex.h: 1.10
sys/external/bsd/drm2/linux/files.drmkms_linux: 1.8
sys/external/bsd/drm2/linux/linux_i2c.c: 1.3
sys/external/bsd/drm2/linux/linux_ww_mutex.c: 1.1
sys/external/bsd/drm2/nouveau/files.nouveau: 1.5-1.8
sys/external/bsd/drm2/nouveau/nouveau_pci.c: 1.1-1.3
sys/external/bsd/drm2/nouveau/nouveau_pci.h: 1.1
sys/external/bsd/drm2/nouveau/nouveau_sysfs.c: 1.1
sys/external/bsd/drm2/nouveau/nouveau_vga.c: 1.1
sys/external/bsd/drm2/nouveau/nouveaufb.c: 1.1
sys/external/bsd/drm2/nouveau/nouveaufb.h: 1.1
sys/external/bsd/drm2/pci/drm_pci.c: 1.10-1.12
sys/external/bsd/drm2/pci/drm_pci_module.c: 1.4
sys/external/bsd/drm2/pci/drmfb_pci.c: 1.1-1.3
sys/external/bsd/drm2/pci/files.drmkms_pci: 1.5
sys/external/bsd/drm2/radeon/radeon_pci.c: 1.5-1.7
sys/modules/drmkms/Makefile: 1.8, 1.9
sys/modules/drmkms_linux/Makefile: 1.6
sys/modules/drmkms_pci/Makefile: 1.5
sync drm2 with HEAD.
 1.7.2.4 11-Jan-2015  snj Pull up following revision(s) (requested by chs in ticket #401):
distrib/sets/lists/modules/md.amd64: revisions 1.46, 1.47 via patch
distrib/sets/lists/modules/md.i386: revisions 1.49, 1.50
sys/dev/ic/pcdisplayvar.h: revision 1.20
sys/dev/ic/vgavar.h: revision 1.32
sys/external/bsd/drm/dist/bsd-core/drm_drv.c: revision 1.26
sys/external/bsd/drm2/dist/drm/drm_agpsupport.c: revisions 1.5, 1.6
sys/external/bsd/drm2/dist/drm/drm_pci.c: revisions 1.4, 1.5
sys/external/bsd/drm2/dist/drm/drm_stub.c: revisions 1.6-1.8
sys/external/bsd/drm2/dist/drm/i915/i915_drv.h: revision 1.11
sys/external/bsd/drm2/dist/drm/radeon/cik.c: revision 1.3
sys/external/bsd/drm2/dist/drm/radeon/ni.c: revision 1.3
sys/external/bsd/drm2/dist/drm/radeon/si.c: revision 1.3
sys/external/bsd/drm2/dist/include/drm/drmP.h: revisions 1.8, 1.9
sys/external/bsd/drm2/dist/include/drm/drm_agpsupport.h: revisions 1.3, 1.4
sys/external/bsd/drm2/drm/drm_drv.c: revision 1.11
sys/external/bsd/drm2/drm/drm_module.c: revision 1.9
sys/external/bsd/drm2/drm/drm_sysctl.c: revisions 1.1-1.4
sys/external/bsd/drm2/drm/drm_vm.c: revision 1.7
sys/external/bsd/drm2/drm/files.drmkms: revisions 1.8, 1.9
sys/external/bsd/drm2/i915drm/files.i915drmkms: revision 1.9
sys/external/bsd/drm2/i915drm/i915_module.c: revisions 1.4, 1.5
sys/external/bsd/drm2/include/drm/drm_sysctl.h: revisions 1.1, 1.2
sys/external/bsd/drm2/include/linux/hdmi.h: revisions 1.3-1.5
sys/external/bsd/drm2/include/linux/module.h: revision 1.5
sys/external/bsd/drm2/include/linux/moduleparam.h: revisions 1.3, 1.4
sys/external/bsd/drm2/include/linux/pci.h: revision 1.11
sys/external/bsd/drm2/linux/linux_module.c: revision 1.5
sys/external/bsd/drm2/nouveau/files.nouveau: revision 1.4
sys/external/bsd/drm2/nouveau/nouveau_module.c: revision 1.3
sys/external/bsd/drm2/pci/drm_pci.c: revision 1.8
sys/external/bsd/drm2/pci/drm_pci_module.c: revision 1.3
sys/external/bsd/drm2/radeon/radeon_module.c: revision 1.3
sys/external/bsd/drm2/ttm/files.ttm: revision 1.1
sys/modules/drm2pci/Makefile: file removal
sys/modules/drmkms/Makefile: revisions 1.4-1.7
sys/modules/drmkms_linux/Makefile: revision 1.5
sys/modules/drmkms_pci/Makefile: revisions 1.3, 1.4
sys/modules/i915drmkms/Makefile: revisions 1.5-1.7
Split drm ttm config into a separate file.
--
Fix module build of drmkms_linux.
--
Remove vestigial drm2pci module, replaced by drmkms_pci.
--
fix the module class.
--
add the drmkms modules
--
make a drm_agp_destroy() function to resolve the circular dependency between
drmkms and drmkms_pci
--
finalize the idr code.
--
add drm_agp_destroy
--
fix drmkms module path for xen.
--
fix build failure.
/tmp/bracket/build/2014.11.10.22.43.46-i386/src/sys/external/bsd/drm2/include/linux/pci.h:36:20: fatal error: acpica.h: No such file or directory
--
make this work: add agpsupport and sysctl code
--
move agpsupport to drmkms to avoid circular dependencies.
--
turn on dynamic ldscript creation to handle link set symbol definitions
used in the automatic sysctl creation.
--
Add __link_set based code to automatically convert the linux module parameters
into sysctls.
--
this module needs MKLDSCRIPT too now
--
more _KERNEL_OPT
--
prettify and add to all the modules that have it.
--
fix description setting.
--
Adjust flags to allow building with clang.
--
Fix build with clang.
--
Drop casts in favour of expressions that actually give the right
pointer.
--
Move all PCI/AGP code back to drmkms_pci module where it belongs.
--
Use correct length for hdmi_infoframe_header_pack in <linux/hdmi.h>.
Fixes PR kern/49411.
--
Back out previous, fix PR kern/49411 correctly.
frame->header.length is not initialized in the vendor packet case.
Instead, make hdmi_infoframe_header_pack take the packet length and
subtract the size of the header when packing the header.
(Could make it take the payload length instead, but for callers it is
more convenient to have a name for the whole packet length.)
--
Fix bounds checking in hdmi_infoframe_header_pack (PR kern/49411).
--
Trivial build fix for no options SYSCTL_INCLUDE_DESCR case, to
avoid -Werror.
OK christos@ and riastradh@
--
fix debugging compilation (ALL kernel)
--
nouveau_nv50_fence.c needs -Wno-shadow.
--
fix a confusion between dev_t and devmajor_t, and include the primary
minor when calling makedev().
 1.7.2.3 11-Nov-2014  martin Pull up following revision(s) (requested by nonaka in ticket #197):
sys/external/bsd/drm2/dist/drm/i915/i915_drv.h: revision 1.10
sys/external/bsd/drm2/include/linux/pci.h: revision 1.10
sys/external/bsd/drm2/dist/drm/i915/intel_acpi.c: revision 1.3
sys/external/bsd/drm2/dist/drm/i915/intel_acpi.c: revision 1.4
sys/external/bsd/drm2/dist/drm/i915/intel_acpi.c: revision 1.5
sys/external/bsd/drm2/dist/drm/i915/intel_opregion.c: revision 1.6
sys/external/bsd/drm2/dist/drm/i915/intel_opregion.c: revision 1.7
sys/external/bsd/drm2/include/linux/acpi.h: revision 1.3
sys/external/bsd/drm2/dist/drm/i915/i915_dma.c: revision 1.12
sys/external/bsd/drm2/i915drm/files.i915drmkms: revision 1.8
i915drmkms(4): Enable CONFIG_ACPI if NACPICA > 0.
Now brightness can be adjusted via hotkey on Mouse Computer LB-J300X
(Clevo W330SU2).
Fix compilation (debug)
pci_attach_args of pci_find_device and match function is not the same thing.
fix PR/49372.
 1.7.2.2 17-Oct-2014  martin Pull up following revision(s) (requested by riastradh in ticket #144):
sys/dev/pci/radeonfb.c: revision 1.85
sys/dev/pci/pcivar.h: revision 1.100
sys/dev/pci/pci_map.c: revision 1.31
sys/external/bsd/drm2/include/linux/pci.h: revision 1.9
Generalize pci_find_rom and use it to locate x86 video ROM in drm2.
- Make pci_find_rom take the ROM `BAR' size as a parameter, instead
of using pci_find_mem with the ROM `BAR' to detect the size.
- Use it to find the x86 video ROM in [0xc0000, 0xe0000) in drm2,
when nothing else reports that location.
- Adapt the one other caller in radeonfb, which already has the
maximum ROM size handy (romsz).
XXX pullup to netbsd-7
 1.7.2.1 15-Aug-2014  martin Pull up following revision(s) (requested by riastradh in ticket #18):
sys/external/bsd/drm2/ttm/ttm_agp_backend.c: revision 1.2
sys/external/bsd/drm2/ttm/ttm_agp_backend.c: revision 1.3
sys/external/bsd/drm2/include/linux/pci.h: revision 1.8
Fix shifts & masks in Linux pci_read_config_{word,byte}.
Use ttm_dma_tt_init in ttm_agp_tt_create so we can use ttm_bus_dma.
Zero ttm_agp objects on creation.
 1.8.2.3 03-Dec-2017  jdolecek update from HEAD
 1.8.2.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.8.2.1 13-Aug-2014  tls file pci.h was added on branch tls-maxphys on 2014-08-20 00:04:21 +0000
 1.11.2.5 28-Aug-2017  skrll Sync with HEAD
 1.11.2.4 19-Mar-2016  skrll Sync with HEAD
 1.11.2.3 27-Dec-2015  skrll Sync with HEAD (as of 26th Dec)
 1.11.2.2 22-Sep-2015  skrll Sync with HEAD
 1.11.2.1 06-Apr-2015  skrll Sync with HEAD
 1.22.4.1 21-Apr-2017  bouyer Sync with HEAD
 1.22.2.1 20-Mar-2017  pgoyette Sync with HEAD
 1.23.6.1 01-Sep-2017  martin Pull up following revision(s) (requested by maya in ticket #259):
sys/external/bsd/drm2/include/linux/pci.h: revision 1.24
Disable MSI on DRMKMS (again).
It is causing problems on some older nvidia graphics cards:
http://mail-index.netbsd.org/netbsd-users/2017/08/02/msg020026.html
http://mail-index.netbsd.org/pkgsrc-users/2017/08/26/msg025492.html
PR kern/52440
 1.24.4.2 08-Apr-2020  martin Merge changes from current as of 20200406
 1.24.4.1 10-Jun-2019  christos Sync with HEAD
 1.24.2.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.37.6.2 29-Feb-2020  ad Sync with head.
 1.37.6.1 25-Jan-2020  ad Sync with head.
 1.56.2.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@.
 1.1 17-Feb-2022  riastradh drm/vmwgfx: First draft. Passes make depend, doesn't build yet.
 1.3 19-Dec-2021  riastradh Make intel_psr.c build
netbsd-ify
Stub out intel_lpe_audio.c (for now?).
Hammer intel_opregion.c into shape.
Hack up intel_lrc.c
Adapt intel_reset.c
Stub out intel_region_lmem.c
Adapt intel_ring_submission.c
Adapt intel_rps.c
Adapt intel_sdvo.c
Adapt intel_runtime_pm.c
Adapt intel_sideband.c
Adapt intel_sprite.c
Adapt intel_tv.c
Adapt intel_tc.c
Adapt intel_sseu.c
Adapt intel_timeline.c
Adapt intel_uc_fw.c and fix typo
Fix up intel_uncore.c
intel_vga.c
intel_wakeref.c
intel_vdsc.c
intel_wopcm.c
intel_workarounds.c
i915_globals.c
Fix up intelfb.c
Stub out intel_guc_log.c
Stub out intel_dsi_dcs_backlight.c
i915_perf.c
intel_hdmi.c
intel_hdcp.c


Author: Maya Rashish <maya@NetBSD.org>
Committer: Taylor R Campbell <riastradh@NetBSD.org>
 1.2 19-Dec-2021  riastradh Stub struct pmu.
 1.1 19-Dec-2021  riastradh More Linux header stubs.

Let's just use empty header files until we actually populate these.
Save a bit of disk space...
 1.2 19-Dec-2021  riastradh amdgpu: Another pass through.

amdgpu_object.c
amdgpu_pci.c
amdgpu_pm.c
amdgpu_polaris10_smumgr.c
amdgpu_pp_psm.c
amdgpu_ppatomctrl.c
amdgpu_ppatomfwctrl.c
amdgpu_process_pptables_v1_0.o
amdgpu_psp.o
amdgpu_psp_v10_0.c
amdgpu_psp_v11_0.c
amdgpu_psp_v12_0.c
amdgpu_psp_v3_1.c
amdgpu_ras.c
amdgpu_ras_eeprom.c
amdgpu_rc_calc.c
amdgpu_rc_calc_dpi.c
amdgpu_ring.c
amdgpu_rlc.c
amdgpu_rn_clk_mgr.c
amdgpu_sdma_v3_0.c
amdgpu_sdma_v4_0.c
amdgpu_sdma_v5_0.c
amdgpu_si.c
amdgpu_si_dma.c
amdgpu_si_dpm.c
amdgpu_smu.c
amdgpu_smu10_hwmgr.c
amdgpu_smu7_hwmgr.c
amdgpu_smu8_hwmgr.c
amdgpu_smu8_smumgr.c
amdgpu_smu_v11_0.c (and a sprinkling of consts)
amdgpu_smu_v11_0_i2c.c
amdgpu_soc15.c
amdgpu_tonga_smumgr.c
amdgpu_ttm.c
amdgpu_ucode.c
amdgpu_uvd.c
amdgpu_uvd_v5_0.c
amdgpu_uvd_v6_0.c
amdgpu_uvd_v7_0.c
amdgpu_vce.c
amdgpu_vce_v2_0.c
amdgpu_vce_v4_0.c
amdgpu_vcn_v1_0.c
amdgpu_vcn_v2_0.c
amdgpu_vcn_v2_5.c
amdgpu_vega10_hwmgr.c
amdgpu_vega10_powertune.c
amdgpu_vega10_processpptables.c
amdgpu_vega10_reg_init.c
amdgpu_vega12_hwmgr.c
amdgpu_vega20_hwmgr.c
amdgpu_vega20_ppt.c
amdgpu_vega20_reg_init.c
amdgpu_vi.c
amdgpu_virt.c
amdgpu_vram_mgr.c
amdgpu_xgmi.c -- disable (for now?)
amdgpufb.c
 1.1 19-Dec-2021  riastradh Create stub headers for files included by drm code.


Author: Maya Rashish <maya@NetBSD.org>
 1.1 19-Dec-2021  riastradh Create stub headers for files included by drm code.


Author: Maya Rashish <maya@NetBSD.org>
 1.1 19-Dec-2021  riastradh Add some Linux header stubs.
 1.8 19-Dec-2021  riastradh kvmalloc, kludgey platformdev hacks
 1.7 27-Oct-2015  riastradh Eliminate Linux struct pci_dev::dev, struct platform_device::dev.
 1.6 18-Oct-2015  jmcneill add dma tag to struct platform_device
 1.5 17-Oct-2015  jmcneill support for non-PCI devices
 1.4 06-Aug-2014  riastradh branches: 1.4.2; 1.4.4; 1.4.6;
Whack some nouveau moles.
 1.3 06-Aug-2014  riastradh Add bogus Linux platform_device stub.
 1.2 18-Mar-2014  riastradh branches: 1.2.2; 1.2.4; 1.2.6;
Merge riastradh-drm2 to HEAD.
 1.1 24-Jul-2013  riastradh branches: 1.1.2;
file platform_device.h was initially added on branch riastradh-drm2.
 1.1.2.1 24-Jul-2013  riastradh Add stubs for Linux header files for drm.
 1.2.6.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.2.6.1 18-Mar-2014  yamt file platform_device.h was added on branch yamt-pagecache on 2014-05-22 11:40:56 +0000
 1.2.4.2 18-May-2014  rmind sync with head
 1.2.4.1 18-Mar-2014  rmind file platform_device.h was added on branch rmind-smpnet on 2014-05-18 17:46:01 +0000
 1.2.2.1 10-Aug-2014  tls Rebase.
 1.4.6.1 27-Dec-2015  skrll Sync with HEAD (as of 26th Dec)
 1.4.4.3 03-Dec-2017  jdolecek update from HEAD
 1.4.4.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.4.4.1 06-Aug-2014  tls file platform_device.h was added on branch tls-maxphys on 2014-08-20 00:04:21 +0000
 1.4.2.1 11-Feb-2016  snj Pull up following revision(s) (requested by riastradh in ticket #1080):
sys/external/bsd/drm2/dist/drm/i915/intel_i2c.c: revision 1.14
sys/external/bsd/drm2/dist/drm/i915/intel_pm.c: revision 1.8
sys/external/bsd/drm2/dist/drm/i915/intel_sdvo.c: revision 1.7
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_drm.c: revision 1.7
sys/external/bsd/drm2/dist/drm/nouveau/core/include/core/device.h: revision 1.5
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/bios/nouveau_subdev_bios_base.c: revision 1.3
sys/external/bsd/drm2/dist/drm/radeon/radeon_display.c: revision 1.5
sys/external/bsd/drm2/dist/drm/radeon/radeon_gem.c: revision 1.3
sys/external/bsd/drm2/dist/drm/radeon/radeon_i2c.c: revision 1.3
sys/external/bsd/drm2/dist/drm/radeon/radeon_kms.c: revision 1.3
sys/external/bsd/drm2/include/linux/pci.h: revision 1.21
sys/external/bsd/drm2/include/linux/platform_device.h: revision 1.7
sys/external/bsd/drm2/nouveau/nouveau_pci.c: revision 1.5
Use nv_device_base(dev) like other callers, not dev->pdev->dev.
First step in fixing the struct device nonsense. This won't actually
fix anything yet until we also fix nv_device_base.
--
dev->dev, not &dev->pdev->dev.
Latter is a charlatan, soon to meet judgment for its sins.
--
dev->dev, not &dev->pdev->dev.
Latter is a mistake that is all my fault. Oops.
--
Eliminate Linux struct pci_dev::dev, struct platform_device::dev.
 1.5 27-Aug-2018  riastradh more declarations of things we need.

more power management ops.


Author: coypu <coypu@sdf.org>
Committer: Taylor R Campbell <riastradh@NetBSD.org>
 1.4 05-Mar-2015  riastradh branches: 1.4.16; 1.4.18;
Add an unused struct dev_pm_ops to <linux/pm.h>.
 1.3 16-Jul-2014  riastradh branches: 1.3.2; 1.3.4; 1.3.6;
First whack at radeon driver.

No hardware to test yet, but it builds.
 1.2 18-Mar-2014  riastradh branches: 1.2.2; 1.2.4; 1.2.6;
Merge riastradh-drm2 to HEAD.
 1.1 24-Jul-2013  riastradh branches: 1.1.2;
file pm.h was initially added on branch riastradh-drm2.
 1.1.2.1 24-Jul-2013  riastradh Add shim pm_message_t in crude imitation of Linux.
 1.2.6.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.2.6.1 18-Mar-2014  yamt file pm.h was added on branch yamt-pagecache on 2014-05-22 11:40:56 +0000
 1.2.4.2 18-May-2014  rmind sync with head
 1.2.4.1 18-Mar-2014  rmind file pm.h was added on branch rmind-smpnet on 2014-05-18 17:46:01 +0000
 1.2.2.1 10-Aug-2014  tls Rebase.
 1.3.6.1 06-Apr-2015  skrll Sync with HEAD
 1.3.4.3 03-Dec-2017  jdolecek update from HEAD
 1.3.4.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.3.4.1 16-Jul-2014  tls file pm.h was added on branch tls-maxphys on 2014-08-20 00:04:21 +0000
 1.3.2.1 06-Mar-2015  snj Pull up following revision(s) (requested by mrg in ticket #573):
sys/external/bsd/common/include/linux/kernel.h: 1.5, 1.6
sys/external/bsd/drm2/dist/drm/drm_ioctl.c: 1.4
sys/external/bsd/drm2/dist/drm/drm_irq.c: 1.6-1.8
sys/external/bsd/drm2/dist/drm/i915/i915_dma.c: 1.13-1.15
sys/external/bsd/drm2/dist/drm/i915/i915_gem.c: 1.23-1.27
sys/external/bsd/drm2/dist/drm/i915/i915_gem_execbuffer.c: 1.5
sys/external/bsd/drm2/dist/drm/i915/intel_display.c: 1.14, 1.15
sys/external/bsd/drm2/dist/drm/i915/intel_dp.c: 1.10
sys/external/bsd/drm2/dist/drm/i915/intel_drv.h: 1.8
sys/external/bsd/drm2/dist/drm/i915/intel_i2c.c: 1.8-1.13
sys/external/bsd/drm2/dist/drm/i915/intel_pm.c: 1.6
sys/external/bsd/drm2/dist/drm/i915/intel_ringbuffer.c: 1.5, 1.6
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/device/nouveau_engine_device_base.c: 1.4
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/fifo/nouveau_engine_fifo_nvc0.c: 1.3, 1.4
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/fifo/nouveau_engine_fifo_nve0.c: 1.3, 1.4
sys/external/bsd/drm2/dist/drm/nouveau/core/include/core/device.h: 1.4
sys/external/bsd/drm2/dist/drm/nouveau/core/include/subdev/mc.h: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/include/subdev/pwr.h: 1.3, 1.4
sys/external/bsd/drm2/dist/drm/nouveau/core/os.h: 1.4, 1.5
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/bios/nouveau_subdev_bios_base.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/bios/nouveau_subdev_bios_pll.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/clock/nouveau_subdev_clock_base.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/clock/nouveau_subdev_clock_nv50.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/devinit/fbmem.h: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/devinit/nouveau_subdev_devinit_nv04.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/fb/nouveau_subdev_fb_nv50.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/fb/nouveau_subdev_fb_nvc0.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/fb/nv50.h: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/fb/nvc0.h: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/mc/nouveau_subdev_mc_base.c: 1.2, 1.3
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/mxm/nouveau_subdev_mxm_nv50.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/pwr/nouveau_subdev_pwr_base.c: 1.3, 1.4
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/therm/nouveau_subdev_therm_ic.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/timer/nouveau_subdev_timer_nv04.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/vm/nouveau_subdev_vm_base.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/vm/nouveau_subdev_vm_nv04.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/vm/nouveau_subdev_vm_nv44.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/vm/nv04.h: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_bo.h: 1.3
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_drm.c: 1.4, 1.5
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_fbcon.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_nv50_display.c: 1.3
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_nv84_fence.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_ttm.c: 1.3
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_ttm.h: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_vga.h: 1.2
sys/external/bsd/drm2/dist/drm/radeon/radeon_fence.c: 1.6-1.8
sys/external/bsd/drm2/dist/drm/radeon/radeon_pm.c: 1.3
sys/external/bsd/drm2/dist/drm/radeon/rs400.c: 1.3
sys/external/bsd/drm2/dist/drm/via/via_dmablit.c: 1.3, 1.4
sys/external/bsd/drm2/dist/drm/via/via_drv.h: 1.3
sys/external/bsd/drm2/dist/drm/via/via_irq.c: 1.3, 1.4
sys/external/bsd/drm2/dist/drm/via/via_video.c: 1.3, 1.4
sys/external/bsd/drm2/dist/include/drm/drmP.h: 1.10
sys/external/bsd/drm2/dist/include/drm/drm_crtc.h: 1.4
sys/external/bsd/drm2/dist/include/drm/drm_modes.h: 1.3
sys/external/bsd/drm2/dist/uapi/drm/i915_drm.h: 1.2
sys/external/bsd/drm2/drm/drm_cache.c: 1.4-1.6
sys/external/bsd/drm2/drm/drm_drv.c: 1.14
sys/external/bsd/drm2/drm/drm_module.c: 1.10
sys/external/bsd/drm2/drm/drm_sysctl.c: 1.5
sys/external/bsd/drm2/drm/drm_vma_manager.c: 1.2
sys/external/bsd/drm2/drm/drmfb.c: 1.1
sys/external/bsd/drm2/drm/files.drmkms: 1.10, 1.11
sys/external/bsd/drm2/i2c/drm_encoder_slave.c: 1.1
sys/external/bsd/drm2/i915drm/files.i915drmkms: 1.7, 1.10
sys/external/bsd/drm2/i915drm/intelfb.c: 1.11, 1.12
sys/external/bsd/drm2/include/asm/io.h: 1.4
sys/external/bsd/drm2/include/asm/unaligned.h: 1.2, 1.3
sys/external/bsd/drm2/include/drm/drm_encoder_slave.h: 1.1
sys/external/bsd/drm2/include/drm/drm_wait_netbsd.h: 1.7-1.11
sys/external/bsd/drm2/include/drm/drmfb.h: 1.1
sys/external/bsd/drm2/include/drm/drmfb_pci.h: 1.1, 1.2
sys/external/bsd/drm2/include/linux/bitops.h: 1.9
sys/external/bsd/drm2/include/linux/i2c.h: 1.7, 1.8
sys/external/bsd/drm2/include/linux/io-mapping.h: 1.5
sys/external/bsd/drm2/include/linux/moduleparam.h: 1.5
sys/external/bsd/drm2/include/linux/pci.h: 1.12-1.15
sys/external/bsd/drm2/include/linux/pm.h: 1.4
sys/external/bsd/drm2/include/linux/reboot.h: 1.2
sys/external/bsd/drm2/include/linux/slab.h: 1.5
sys/external/bsd/drm2/include/linux/string.h: 1.4
sys/external/bsd/drm2/include/linux/vgaarb.h: 1.3
sys/external/bsd/drm2/include/linux/ww_mutex.h: 1.10
sys/external/bsd/drm2/linux/files.drmkms_linux: 1.8
sys/external/bsd/drm2/linux/linux_i2c.c: 1.3
sys/external/bsd/drm2/linux/linux_ww_mutex.c: 1.1
sys/external/bsd/drm2/nouveau/files.nouveau: 1.5-1.8
sys/external/bsd/drm2/nouveau/nouveau_pci.c: 1.1-1.3
sys/external/bsd/drm2/nouveau/nouveau_pci.h: 1.1
sys/external/bsd/drm2/nouveau/nouveau_sysfs.c: 1.1
sys/external/bsd/drm2/nouveau/nouveau_vga.c: 1.1
sys/external/bsd/drm2/nouveau/nouveaufb.c: 1.1
sys/external/bsd/drm2/nouveau/nouveaufb.h: 1.1
sys/external/bsd/drm2/pci/drm_pci.c: 1.10-1.12
sys/external/bsd/drm2/pci/drm_pci_module.c: 1.4
sys/external/bsd/drm2/pci/drmfb_pci.c: 1.1-1.3
sys/external/bsd/drm2/pci/files.drmkms_pci: 1.5
sys/external/bsd/drm2/radeon/radeon_pci.c: 1.5-1.7
sys/modules/drmkms/Makefile: 1.8, 1.9
sys/modules/drmkms_linux/Makefile: 1.6
sys/modules/drmkms_pci/Makefile: 1.5
sync drm2 with HEAD.
 1.4.18.1 10-Jun-2019  christos Sync with HEAD
 1.4.16.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.1 19-Dec-2021  riastradh Add some Linux header stubs.
 1.2 14-Feb-2020  maya Reduce diffs by side-loading some header files like Linux.

From riastradh
 1.1 16-Jul-2014  riastradh branches: 1.1.2; 1.1.6; 1.1.32; 1.1.38;
Make it build and boot on my test machines.

Screen blanks on boot on the Ivy Bridge system with

DRM error in cpt_serr_int_handler: PCH transcoder A FIFO underrun

But after that everything is OK. Appears to be an upstream problem.
To investigate...

I think there's a cache flushing issue somewhere -- there are little
display artefacts on my T60.
 1.1.38.1 29-Feb-2020  ad Sync with head.
 1.1.32.1 08-Apr-2020  martin Merge changes from current as of 20200406
 1.1.6.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.6.1 16-Jul-2014  tls file pm_qos.h was added on branch tls-maxphys on 2014-08-20 00:04:21 +0000
 1.1.2.2 10-Aug-2014  tls Rebase.
 1.1.2.1 16-Jul-2014  tls file pm_qos.h was added on branch tls-earlyentropy on 2014-08-10 06:55:39 +0000
 1.9 19-Dec-2021  riastradh linux: Make pm_runtime_get_if_in_use succeed.
 1.8 19-Dec-2021  riastradh Make intel_psr.c build
netbsd-ify
Stub out intel_lpe_audio.c (for now?).
Hammer intel_opregion.c into shape.
Hack up intel_lrc.c
Adapt intel_reset.c
Stub out intel_region_lmem.c
Adapt intel_ring_submission.c
Adapt intel_rps.c
Adapt intel_sdvo.c
Adapt intel_runtime_pm.c
Adapt intel_sideband.c
Adapt intel_sprite.c
Adapt intel_tv.c
Adapt intel_tc.c
Adapt intel_sseu.c
Adapt intel_timeline.c
Adapt intel_uc_fw.c and fix typo
Fix up intel_uncore.c
intel_vga.c
intel_wakeref.c
intel_vdsc.c
intel_wopcm.c
intel_workarounds.c
i915_globals.c
Fix up intelfb.c
Stub out intel_guc_log.c
Stub out intel_dsi_dcs_backlight.c
i915_perf.c
intel_hdmi.c
intel_hdcp.c


Author: Maya Rashish <maya@NetBSD.org>
Committer: Taylor R Campbell <riastradh@NetBSD.org>
 1.7 19-Dec-2021  riastradh pm_runtime_get, pm_runtime_put_sync stubs
 1.6 19-Dec-2021  riastradh More pm_runtime_* stubs.
 1.5 14-Feb-2020  maya Reduce diffs by side-loading some header files like Linux.

From riastradh
 1.4 27-Aug-2018  riastradh branches: 1.4.6;
Add pm_runtime_get_noresume stub.
 1.3 23-Aug-2014  riastradh branches: 1.3.18; 1.3.20;
Another round of nouveau whack-a-mole.
 1.2 16-Jul-2014  riastradh branches: 1.2.2; 1.2.4; 1.2.6;
First whack at radeon driver.

No hardware to test yet, but it builds.
 1.1 16-Jul-2014  riastradh Make it build and boot on my test machines.

Screen blanks on boot on the Ivy Bridge system with

DRM error in cpt_serr_int_handler: PCH transcoder A FIFO underrun

But after that everything is OK. Appears to be an upstream problem.
To investigate...

I think there's a cache flushing issue somewhere -- there are little
display artefacts on my T60.
 1.2.6.3 03-Dec-2017  jdolecek update from HEAD
 1.2.6.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.2.6.1 16-Jul-2014  tls file pm_runtime.h was added on branch tls-maxphys on 2014-08-20 00:04:21 +0000
 1.2.4.1 21-Sep-2014  snj Pull up following revision(s) (requested by riastradh in ticket #95):
sys/external/bsd/drm2/dist/drm/nouveau/core/include/subdev/fb.h: revision 1.2
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_nv10_fence.c: revision 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/bar/nouveau_subdev_bar_base.c: revision 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/include/engine/device.h: revision 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/include/subdev/pwr.h: revision 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/nouveau_engine_xtensa.c: revision 1.2
sys/external/bsd/drm2/include/linux/bitops.h: revision 1.8
sys/external/bsd/drm2/dist/drm/nouveau/dispnv04/nouveau_dispnv04_tvnv17.c: revision 1.3
sys/external/bsd/drm2/dist/drm/nouveau/dispnv04/nouveau_dispnv04_tvmodesnv17.c: revision 1.3
sys/external/bsd/drm2/dist/drm/nouveau/core/include/core/device.h: revision 1.3
sys/external/bsd/drm2/include/drm/drm_agp_netbsd.h: revision 1.4
sys/external/bsd/drm2/include/linux/spinlock.h: revision 1.4
sys/external/bsd/drm2/include/linux/pm_runtime.h: revision 1.3
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/crypt/nouveau_engine_crypt_nv98.c: revision 1.2
sys/external/bsd/drm2/nouveau/files.nouveau: revision 1.3
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/disp/nouveau_engine_disp_dacnv50.c: revision 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/fifo/nouveau_engine_fifo_nve0.c: revision 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/disp/nouveau_engine_disp_nv50.c: revision 1.2
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_gem.c: revision 1.3
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_bo.c: revision 1.5
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/perfmon/nouveau_engine_perfmon_base.c: revision 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/crypt/nouveau_engine_crypt_nv84.c: revision 1.2
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_fence.c: revision 1.3
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/graph/nouveau_engine_graph_nv50.c: revision 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/fifo/nouveau_engine_fifo_nvc0.c: revision 1.2
sys/external/bsd/drm2/include/linux/vmalloc.h: revision 1.4
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/fifo/nve0.h: revision 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/instmem/nv04.h: revision 1.2
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_drm.c: revision 1.3
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_drm.h: revision 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/fifo/nouveau_engine_fifo_base.c: revision 1.3
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/disp/nouveau_engine_disp_nvd0.c: revision 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/disp/nouveau_engine_disp_nv04.c: revision 1.2
sys/external/bsd/drm2/nouveau/nouveau_module.c: revision 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/instmem/nouveau_subdev_instmem_nv40.c: revision 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/graph/nouveau_engine_graph_gm107.c: revision 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/graph/nouveau_engine_graph_ctxnvd7.c: revision 1.2
sys/external/bsd/drm2/include/linux/mutex.h: revision 1.7
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/disp/nv50.h: revision 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/device/nouveau_engine_device_base.c: revision 1.3
sys/external/bsd/drm2/include/linux/i2c.h: revision 1.6
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/graph/nouveau_engine_graph_nvc0.c: revision 1.2
sys/external/bsd/drm2/include/linux/pagemap.h: revision 1.3
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/instmem/nouveau_subdev_instmem_nv04.c: revision 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/copy/nouveau_engine_copy_nva3.c: revision 1.2
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_nv50_display.c: revision 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/include/subdev/bar.h: revision 1.3
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/pwr/nouveau_subdev_pwr_base.c: revision 1.2
Another round of nouveau whack-a-mole.
 1.2.2.2 10-Aug-2014  tls Rebase.
 1.2.2.1 16-Jul-2014  tls file pm_runtime.h was added on branch tls-earlyentropy on 2014-08-10 06:55:39 +0000
 1.3.20.2 08-Apr-2020  martin Merge changes from current as of 20200406
 1.3.20.1 10-Jun-2019  christos Sync with HEAD
 1.3.18.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.4.6.1 29-Feb-2020  ad Sync with head.
 1.2 18-Mar-2014  riastradh branches: 1.2.4; 1.2.6; 1.2.10;
Merge riastradh-drm2 to HEAD.
 1.1 24-Jul-2013  riastradh branches: 1.1.2;
file pnp.h was initially added on branch riastradh-drm2.
 1.1.2.1 24-Jul-2013  riastradh Add stubs for Linux header files for drm.
 1.2.10.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.2.10.1 18-Mar-2014  tls file pnp.h was added on branch tls-maxphys on 2014-08-20 00:04:21 +0000
 1.2.6.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.2.6.1 18-Mar-2014  yamt file pnp.h was added on branch yamt-pagecache on 2014-05-22 11:40:56 +0000
 1.2.4.2 18-May-2014  rmind sync with head
 1.2.4.1 18-Mar-2014  rmind file pnp.h was added on branch rmind-smpnet on 2014-05-18 17:46:01 +0000
 1.5 19-Dec-2021  riastradh Sort includes; whitespace.
 1.4 19-Dec-2021  riastradh Match linux side-loading, fixes i915_getparam.c put_user undefined


Author: Maya Rashish <maya@NetBSD.org>
Committer: Taylor R Campbell <riastradh@NetBSD.org>
 1.3 19-Dec-2021  riastradh More side loads.
 1.2 18-Mar-2014  riastradh branches: 1.2.4; 1.2.6; 1.2.10;
Merge riastradh-drm2 to HEAD.
 1.1 24-Jul-2013  riastradh branches: 1.1.2;
file poll.h was initially added on branch riastradh-drm2.
 1.1.2.1 24-Jul-2013  riastradh Add stubs for Linux header files for drm.
 1.2.10.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.2.10.1 18-Mar-2014  tls file poll.h was added on branch tls-maxphys on 2014-08-20 00:04:21 +0000
 1.2.6.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.2.6.1 18-Mar-2014  yamt file poll.h was added on branch yamt-pagecache on 2014-05-22 11:40:56 +0000
 1.2.4.2 18-May-2014  rmind sync with head
 1.2.4.1 18-Mar-2014  rmind file poll.h was added on branch rmind-smpnet on 2014-05-18 17:46:01 +0000
 1.1 16-Jul-2014  riastradh branches: 1.1.2; 1.1.6;
First whack at radeon driver.

No hardware to test yet, but it builds.
 1.1.6.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.6.1 16-Jul-2014  tls file power_supply.h was added on branch tls-maxphys on 2014-08-20 00:04:21 +0000
 1.1.2.2 10-Aug-2014  tls Rebase.
 1.1.2.1 16-Jul-2014  tls file power_supply.h was added on branch tls-earlyentropy on 2014-08-10 06:55:39 +0000
 1.5 19-Dec-2021  riastradh i915: more work
 1.4 19-Dec-2021  riastradh in_task
 1.3 19-Dec-2021  riastradh Provide in_atomic


Author: Maya Rashish <maya@NetBSD.org>
 1.2 18-Mar-2014  riastradh branches: 1.2.4; 1.2.6; 1.2.10;
Merge riastradh-drm2 to HEAD.
 1.1 24-Jul-2013  riastradh branches: 1.1.2;
file preempt.h was initially added on branch riastradh-drm2.
 1.1.2.1 24-Jul-2013  riastradh Add <linux/preempt.h> for drm2.
 1.2.10.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.2.10.1 18-Mar-2014  tls file preempt.h was added on branch tls-maxphys on 2014-08-20 00:04:21 +0000
 1.2.6.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.2.6.1 18-Mar-2014  yamt file preempt.h was added on branch yamt-pagecache on 2014-05-22 11:40:56 +0000
 1.2.4.2 18-May-2014  rmind sync with head
 1.2.4.1 18-Mar-2014  rmind file preempt.h was added on branch rmind-smpnet on 2014-05-18 17:46:01 +0000
 1.2 19-Dec-2021  riastradh prefetchw stub
 1.1 19-Dec-2021  riastradh Bunch more Linux header file stubs.
 1.5 27-Aug-2018  riastradh move printk to common so we can reasonably include it from kernel.h
(linux side-loads the same)


Author: coypu <coypu@sdf.org>
Committer: Taylor R Campbell <riastradh@NetBSD.org>
 1.4 06-Aug-2014  riastradh branches: 1.4.4; 1.4.28; 1.4.30;
Add Linux printk cruft.
 1.3 16-Jul-2014  riastradh Make it build and boot on my test machines.

Screen blanks on boot on the Ivy Bridge system with

DRM error in cpt_serr_int_handler: PCH transcoder A FIFO underrun

But after that everything is OK. Appears to be an upstream problem.
To investigate...

I think there's a cache flushing issue somewhere -- there are little
display artefacts on my T60.
 1.2 18-Mar-2014  riastradh branches: 1.2.2; 1.2.4; 1.2.6;
Merge riastradh-drm2 to HEAD.
 1.1 24-Jul-2013  riastradh branches: 1.1.2;
file printk.h was initially added on branch riastradh-drm2.
 1.1.2.6 08-Sep-2013  riastradh Miscellaneous Linux header file crud.
 1.1.2.5 24-Jul-2013  riastradh Add pr_err as an alias for printf to drm2 <linux/printk.h>.
 1.1.2.4 24-Jul-2013  riastradh Add pr_warn_once as a bogus alias for printf in <linux/printk.h>.
 1.1.2.3 24-Jul-2013  riastradh Fix #endif include-protection comment in <linux/printk.h>.
 1.1.2.2 24-Jul-2013  riastradh Add hex dumping utilities to <linux/printk.h>.
 1.1.2.1 24-Jul-2013  riastradh Add <linux/printk.h>.
 1.2.6.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.2.6.1 18-Mar-2014  yamt file printk.h was added on branch yamt-pagecache on 2014-05-22 11:40:56 +0000
 1.2.4.2 18-May-2014  rmind sync with head
 1.2.4.1 18-Mar-2014  rmind file printk.h was added on branch rmind-smpnet on 2014-05-18 17:46:01 +0000
 1.2.2.1 10-Aug-2014  tls Rebase.
 1.4.30.1 10-Jun-2019  christos Sync with HEAD
 1.4.28.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.4.4.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.4.4.1 06-Aug-2014  tls file printk.h was added on branch tls-maxphys on 2014-08-20 00:04:21 +0000
 1.2 18-Mar-2014  riastradh branches: 1.2.4; 1.2.6; 1.2.10;
Merge riastradh-drm2 to HEAD.
 1.1 24-Jul-2013  riastradh branches: 1.1.2;
file proc_fs.h was initially added on branch riastradh-drm2.
 1.1.2.1 24-Jul-2013  riastradh Add stubs for Linux header files for drm.
 1.2.10.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.2.10.1 18-Mar-2014  tls file proc_fs.h was added on branch tls-maxphys on 2014-08-20 00:04:21 +0000
 1.2.6.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.2.6.1 18-Mar-2014  yamt file proc_fs.h was added on branch yamt-pagecache on 2014-05-22 11:40:56 +0000
 1.2.4.2 18-May-2014  rmind sync with head
 1.2.4.1 18-Mar-2014  rmind file proc_fs.h was added on branch rmind-smpnet on 2014-05-18 17:46:01 +0000
 1.1 19-Dec-2021  riastradh Create stub headers for files included by drm code.


Author: Maya Rashish <maya@NetBSD.org>
 1.1 27-Aug-2018  riastradh branches: 1.1.2; 1.1.6;
local versions of headers required


Author: coypu <coypu@sdf.org>
Committer: Taylor R Campbell <riastradh@NetBSD.org>
 1.1.6.2 10-Jun-2019  christos Sync with HEAD
 1.1.6.1 27-Aug-2018  christos file pwm.h was added on branch phil-wifi on 2019-06-10 22:08:32 +0000
 1.1.2.2 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.1.2.1 27-Aug-2018  pgoyette file pwm.h was added on branch pgoyette-compat on 2018-09-06 06:56:36 +0000
 1.8 19-Dec-2021  riastradh linux: Kludgily make radix tree safe for RCU

Using a lock is completely stupid (gotta be cpu_simple_lock because
there's no radix_tree_destroy or anything), and the nonsense to do
unvolatile/unconst is garbage, but it will serve to make this safe
for RCU until someone makes our radix tree code RCU-safe (which
Someone^TM should totally do).
 1.7 19-Dec-2021  riastradh linux: Kludgey radix tree shims
 1.6 19-Dec-2021  riastradh i915: Odds & ends.
 1.5 19-Dec-2021  riastradh drm: Another pass over i915 and some supporting logic.

This makes a shim around sg_table, which essentially represents two
things:

1. an array of pages (roughly corresponding to bus_dma_segment_t[])
2. an array of DMA addresses stored in a bus_dmamap_t

Both parts are optional; different parts of i915 use sg_tables to
pass around one or both of the two parts. This helps to reduce the
ifdefs by quite a bit, although it's not always clear which part of
an sg_table any particular interface is actually using which is why I
was reluctant to do this before.
 1.4 19-Dec-2021  riastradh Fix radix_tree_insert declaration.
 1.3 19-Dec-2021  riastradh Declare radix_tree_delete.
 1.2 19-Dec-2021  riastradh Stub linux radix tree API.
 1.1 19-Dec-2021  riastradh More Linux header stubs.

Let's just use empty header files until we actually populate these.
Save a bit of disk space...
 1.4 19-Dec-2021  riastradh Make intel_psr.c build
netbsd-ify
Stub out intel_lpe_audio.c (for now?).
Hammer intel_opregion.c into shape.
Hack up intel_lrc.c
Adapt intel_reset.c
Stub out intel_region_lmem.c
Adapt intel_ring_submission.c
Adapt intel_rps.c
Adapt intel_sdvo.c
Adapt intel_runtime_pm.c
Adapt intel_sideband.c
Adapt intel_sprite.c
Adapt intel_tv.c
Adapt intel_tc.c
Adapt intel_sseu.c
Adapt intel_timeline.c
Adapt intel_uc_fw.c and fix typo
Fix up intel_uncore.c
intel_vga.c
intel_wakeref.c
intel_vdsc.c
intel_wopcm.c
intel_workarounds.c
i915_globals.c
Fix up intelfb.c
Stub out intel_guc_log.c
Stub out intel_dsi_dcs_backlight.c
i915_perf.c
intel_hdmi.c
intel_hdcp.c


Author: Maya Rashish <maya@NetBSD.org>
Committer: Taylor R Campbell <riastradh@NetBSD.org>
 1.3 19-Dec-2021  riastradh i915: more work
 1.2 19-Dec-2021  riastradh get_random_int, get_random_long
 1.1 19-Dec-2021  riastradh Bunch more Linux header file stubs.
 1.6 09-Apr-2022  riastradh linux/ratelimit: Convert to membar_acquire and atomic_store_release.

Simplify while here: atomic_swap is enough, no need for atomic_cas.
(Maybe drm'll run faster on sparcv8 this way...!)
 1.5 19-Dec-2021  riastradh i915: Adapt i915_perf.c.
 1.4 19-Dec-2021  riastradh Fix Linux ratelimit state struct tag.
 1.3 19-Dec-2021  riastradh Kludge up <linux/ratelimit.h> with ppsratecheck.
 1.2 18-Mar-2014  riastradh branches: 1.2.4; 1.2.6; 1.2.10;
Merge riastradh-drm2 to HEAD.
 1.1 24-Jul-2013  riastradh branches: 1.1.2;
file ratelimit.h was initially added on branch riastradh-drm2.
 1.1.2.1 24-Jul-2013  riastradh Add stubs for Linux header files for drm.
 1.2.10.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.2.10.1 18-Mar-2014  tls file ratelimit.h was added on branch tls-maxphys on 2014-08-20 00:04:21 +0000
 1.2.6.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.2.6.1 18-Mar-2014  yamt file ratelimit.h was added on branch yamt-pagecache on 2014-05-22 11:40:56 +0000
 1.2.4.2 18-May-2014  rmind sync with head
 1.2.4.1 18-Mar-2014  rmind file ratelimit.h was added on branch rmind-smpnet on 2014-05-18 17:46:01 +0000
 1.18 27-Feb-2022  riastradh linux: New rb_move(&to, &from) to replace `to = from'.

NetBSD rbtree(3) is not relocatable, so this extra step is needed.
Unfortunately, there's no easy way to automate detection of where we
need to apply this in ported code...
 1.17 27-Feb-2022  riastradh linux: Actually do post-order tree traversal.

Requires breaking the rbtree(3) abstraction, but this is necessary
because the body of the loop often frees the element, so as is we had
a huge pile of use-after-free going on.

Requires changing struct interval_tree_node's rbnode member to match
the Linux name, since we now use container_of here, and radeon relies
on this.
 1.16 14-Feb-2022  riastradh linux: Don't skip the last node in rbtree iteration.
 1.15 19-Dec-2021  riastradh linux: Fix rb tree iteration.
 1.14 19-Dec-2021  riastradh linux/rbtree: Hack up constiness.
 1.13 19-Dec-2021  riastradh linux: Fix rbtree node/element confusion.
 1.12 19-Dec-2021  riastradh drm/linux: KNF
 1.11 19-Dec-2021  riastradh Provide and use an rb_next2 which takes a pointer to the tree as well

Easier for us to implement.


Author: Maya Rashish <maya@NetBSD.org>
Committer: Taylor R Campbell <riastradh@NetBSD.org>
 1.10 19-Dec-2021  riastradh drm/linux: rb_first/last
 1.9 19-Dec-2021  riastradh Touch up the rbtree/intervaltree stubs.

Doesn't work at all yet, but maybe it will help.
 1.8 19-Dec-2021  riastradh Rename struct rb_root_cached field to match Linux as needed.
 1.7 19-Dec-2021  riastradh Move rbtree_postorder_for_each_entry_safe to linux/rbtree.h.
 1.6 19-Dec-2021  riastradh Fix parameter order to match Linux.
 1.5 19-Dec-2021  riastradh Define rb_erase and rb_erase_cached -- easy wrappers.
 1.4 19-Dec-2021  riastradh Define stub struct rb_root_cached.
 1.3 19-Dec-2021  riastradh Move struct rb_root from linux interval_tree.h to rbtree.h.
 1.2 18-Mar-2014  riastradh branches: 1.2.4; 1.2.6; 1.2.10;
Merge riastradh-drm2 to HEAD.
 1.1 24-Jul-2013  riastradh branches: 1.1.2;
file rbtree.h was initially added on branch riastradh-drm2.
 1.1.2.1 24-Jul-2013  riastradh Add stubs for Linux header files for drm.
 1.2.10.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.2.10.1 18-Mar-2014  tls file rbtree.h was added on branch tls-maxphys on 2014-08-20 00:04:21 +0000
 1.2.6.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.2.6.1 18-Mar-2014  yamt file rbtree.h was added on branch yamt-pagecache on 2014-05-22 11:40:56 +0000
 1.2.4.2 18-May-2014  rmind sync with head
 1.2.4.1 18-Mar-2014  rmind file rbtree.h was added on branch rmind-smpnet on 2014-05-18 17:46:01 +0000
 1.2 19-Dec-2021  riastradh Make intel_psr.c build
netbsd-ify
Stub out intel_lpe_audio.c (for now?).
Hammer intel_opregion.c into shape.
Hack up intel_lrc.c
Adapt intel_reset.c
Stub out intel_region_lmem.c
Adapt intel_ring_submission.c
Adapt intel_rps.c
Adapt intel_sdvo.c
Adapt intel_runtime_pm.c
Adapt intel_sideband.c
Adapt intel_sprite.c
Adapt intel_tv.c
Adapt intel_tc.c
Adapt intel_sseu.c
Adapt intel_timeline.c
Adapt intel_uc_fw.c and fix typo
Fix up intel_uncore.c
intel_vga.c
intel_wakeref.c
intel_vdsc.c
intel_wopcm.c
intel_workarounds.c
i915_globals.c
Fix up intelfb.c
Stub out intel_guc_log.c
Stub out intel_dsi_dcs_backlight.c
i915_perf.c
intel_hdmi.c
intel_hdcp.c


Author: Maya Rashish <maya@NetBSD.org>
Committer: Taylor R Campbell <riastradh@NetBSD.org>
 1.1 19-Dec-2021  riastradh Create stub headers for files included by drm code.


Author: Maya Rashish <maya@NetBSD.org>
 1.14 19-Dec-2021  riastradh Move Linux RCU to common.
 1.13 19-Dec-2021  riastradh Define rcu_dereference_raw as alias for rcu_dereference.
 1.12 19-Dec-2021  riastradh Implement kfree_rcu.
 1.11 19-Dec-2021  riastradh Implement rcu_barrier to wait for call_rcu callbacks.

gc.cv has multiple purposes now, so use cv_broadcast instead of
cv_signal.
 1.10 19-Dec-2021  riastradh Add rcu_access_pointer and rcu_pointer_handoff.
 1.9 19-Dec-2021  riastradh RCU pointer fixes.

- Use __typeof__, not typeof.
- Use membar_exit, not membar_producer.
=> We want a store-release, not store/store barrier.
=> Consider:
foo->x = 42;
assert(foo->x == 42);
rcu_assign_pointer(globalfoo, foo);
The foo->x load can be reordered past the store/store barrier
(membar_producer), and happen after another thread has clobbered
foo->x.
- Put the evaluation of the right-hand side before the barrier.
 1.8 19-Dec-2021  riastradh Define RCU_INIT_POINTER.
 1.7 27-Aug-2018  riastradh Reverse backwards namespacing.
 1.6 27-Aug-2018  riastradh Nix extraneous whitespace.
 1.5 27-Aug-2018  riastradh Implement some of the Linux RCU API.
 1.4 27-Aug-2018  riastradh Fill out <linux/rcupdate.h>. The patent is expired, right?
 1.3 27-Aug-2018  riastradh Define __rcu.
 1.2 18-Mar-2014  riastradh branches: 1.2.4; 1.2.6; 1.2.10; 1.2.34; 1.2.36;
Merge riastradh-drm2 to HEAD.
 1.1 24-Jul-2013  riastradh branches: 1.1.2;
file rcupdate.h was initially added on branch riastradh-drm2.
 1.1.2.1 24-Jul-2013  riastradh Add stubs for Linux header files for drm.
 1.2.36.1 10-Jun-2019  christos Sync with HEAD
 1.2.34.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.2.10.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.2.10.1 18-Mar-2014  tls file rcupdate.h was added on branch tls-maxphys on 2014-08-20 00:04:21 +0000
 1.2.6.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.2.6.1 18-Mar-2014  yamt file rcupdate.h was added on branch yamt-pagecache on 2014-05-22 11:40:56 +0000
 1.2.4.2 18-May-2014  rmind sync with head
 1.2.4.1 18-Mar-2014  rmind file rcupdate.h was added on branch rmind-smpnet on 2014-05-18 17:46:01 +0000
 1.7 19-Dec-2021  riastradh linux: Misc empty stubs for amdgpu.
 1.6 01-Jan-2020  thorpej - Introduce a new global kernel variable "shutting_down" to indicate that
the system is shutting down or rebooting.
- Set this global in a new function called kern_reboot(), which is currently
just a basic wrapper around cpu_reboot().
- Call kern_reboot() instead of cpu_reboot() almost everywhere; a few
places remain where it's still called directly, but those are in early
pre-main() machdep locations.

Eventually, all of the various cpu_reboot() functions should be re-factored
and common functionality moved to kern_reboot(), but that's for another day.
 1.5 27-Aug-2018  riastradh Stub SYS_RESTART for reboot notifications so we can remove panic("XXX").
 1.4 27-Aug-2018  riastradh Add missing forward struct declaration.
 1.3 27-Aug-2018  riastradh Reboot notifier stubs.
 1.2 06-Mar-2015  riastradh branches: 1.2.16; 1.2.18;
One last round for nouveau. It links!
 1.1 06-Aug-2014  riastradh branches: 1.1.2; 1.1.4; 1.1.6; 1.1.8;
More Linux goo.
 1.1.8.1 06-Apr-2015  skrll Sync with HEAD
 1.1.6.3 03-Dec-2017  jdolecek update from HEAD
 1.1.6.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.6.1 06-Aug-2014  tls file reboot.h was added on branch tls-maxphys on 2014-08-20 00:04:21 +0000
 1.1.4.1 06-Mar-2015  snj Pull up following revision(s) (requested by mrg in ticket #573):
sys/external/bsd/common/include/linux/kernel.h: 1.5, 1.6
sys/external/bsd/drm2/dist/drm/drm_ioctl.c: 1.4
sys/external/bsd/drm2/dist/drm/drm_irq.c: 1.6-1.8
sys/external/bsd/drm2/dist/drm/i915/i915_dma.c: 1.13-1.15
sys/external/bsd/drm2/dist/drm/i915/i915_gem.c: 1.23-1.27
sys/external/bsd/drm2/dist/drm/i915/i915_gem_execbuffer.c: 1.5
sys/external/bsd/drm2/dist/drm/i915/intel_display.c: 1.14, 1.15
sys/external/bsd/drm2/dist/drm/i915/intel_dp.c: 1.10
sys/external/bsd/drm2/dist/drm/i915/intel_drv.h: 1.8
sys/external/bsd/drm2/dist/drm/i915/intel_i2c.c: 1.8-1.13
sys/external/bsd/drm2/dist/drm/i915/intel_pm.c: 1.6
sys/external/bsd/drm2/dist/drm/i915/intel_ringbuffer.c: 1.5, 1.6
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/device/nouveau_engine_device_base.c: 1.4
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/fifo/nouveau_engine_fifo_nvc0.c: 1.3, 1.4
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/fifo/nouveau_engine_fifo_nve0.c: 1.3, 1.4
sys/external/bsd/drm2/dist/drm/nouveau/core/include/core/device.h: 1.4
sys/external/bsd/drm2/dist/drm/nouveau/core/include/subdev/mc.h: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/include/subdev/pwr.h: 1.3, 1.4
sys/external/bsd/drm2/dist/drm/nouveau/core/os.h: 1.4, 1.5
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/bios/nouveau_subdev_bios_base.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/bios/nouveau_subdev_bios_pll.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/clock/nouveau_subdev_clock_base.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/clock/nouveau_subdev_clock_nv50.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/devinit/fbmem.h: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/devinit/nouveau_subdev_devinit_nv04.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/fb/nouveau_subdev_fb_nv50.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/fb/nouveau_subdev_fb_nvc0.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/fb/nv50.h: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/fb/nvc0.h: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/mc/nouveau_subdev_mc_base.c: 1.2, 1.3
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/mxm/nouveau_subdev_mxm_nv50.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/pwr/nouveau_subdev_pwr_base.c: 1.3, 1.4
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/therm/nouveau_subdev_therm_ic.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/timer/nouveau_subdev_timer_nv04.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/vm/nouveau_subdev_vm_base.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/vm/nouveau_subdev_vm_nv04.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/vm/nouveau_subdev_vm_nv44.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/vm/nv04.h: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_bo.h: 1.3
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_drm.c: 1.4, 1.5
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_fbcon.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_nv50_display.c: 1.3
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_nv84_fence.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_ttm.c: 1.3
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_ttm.h: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_vga.h: 1.2
sys/external/bsd/drm2/dist/drm/radeon/radeon_fence.c: 1.6-1.8
sys/external/bsd/drm2/dist/drm/radeon/radeon_pm.c: 1.3
sys/external/bsd/drm2/dist/drm/radeon/rs400.c: 1.3
sys/external/bsd/drm2/dist/drm/via/via_dmablit.c: 1.3, 1.4
sys/external/bsd/drm2/dist/drm/via/via_drv.h: 1.3
sys/external/bsd/drm2/dist/drm/via/via_irq.c: 1.3, 1.4
sys/external/bsd/drm2/dist/drm/via/via_video.c: 1.3, 1.4
sys/external/bsd/drm2/dist/include/drm/drmP.h: 1.10
sys/external/bsd/drm2/dist/include/drm/drm_crtc.h: 1.4
sys/external/bsd/drm2/dist/include/drm/drm_modes.h: 1.3
sys/external/bsd/drm2/dist/uapi/drm/i915_drm.h: 1.2
sys/external/bsd/drm2/drm/drm_cache.c: 1.4-1.6
sys/external/bsd/drm2/drm/drm_drv.c: 1.14
sys/external/bsd/drm2/drm/drm_module.c: 1.10
sys/external/bsd/drm2/drm/drm_sysctl.c: 1.5
sys/external/bsd/drm2/drm/drm_vma_manager.c: 1.2
sys/external/bsd/drm2/drm/drmfb.c: 1.1
sys/external/bsd/drm2/drm/files.drmkms: 1.10, 1.11
sys/external/bsd/drm2/i2c/drm_encoder_slave.c: 1.1
sys/external/bsd/drm2/i915drm/files.i915drmkms: 1.7, 1.10
sys/external/bsd/drm2/i915drm/intelfb.c: 1.11, 1.12
sys/external/bsd/drm2/include/asm/io.h: 1.4
sys/external/bsd/drm2/include/asm/unaligned.h: 1.2, 1.3
sys/external/bsd/drm2/include/drm/drm_encoder_slave.h: 1.1
sys/external/bsd/drm2/include/drm/drm_wait_netbsd.h: 1.7-1.11
sys/external/bsd/drm2/include/drm/drmfb.h: 1.1
sys/external/bsd/drm2/include/drm/drmfb_pci.h: 1.1, 1.2
sys/external/bsd/drm2/include/linux/bitops.h: 1.9
sys/external/bsd/drm2/include/linux/i2c.h: 1.7, 1.8
sys/external/bsd/drm2/include/linux/io-mapping.h: 1.5
sys/external/bsd/drm2/include/linux/moduleparam.h: 1.5
sys/external/bsd/drm2/include/linux/pci.h: 1.12-1.15
sys/external/bsd/drm2/include/linux/pm.h: 1.4
sys/external/bsd/drm2/include/linux/reboot.h: 1.2
sys/external/bsd/drm2/include/linux/slab.h: 1.5
sys/external/bsd/drm2/include/linux/string.h: 1.4
sys/external/bsd/drm2/include/linux/vgaarb.h: 1.3
sys/external/bsd/drm2/include/linux/ww_mutex.h: 1.10
sys/external/bsd/drm2/linux/files.drmkms_linux: 1.8
sys/external/bsd/drm2/linux/linux_i2c.c: 1.3
sys/external/bsd/drm2/linux/linux_ww_mutex.c: 1.1
sys/external/bsd/drm2/nouveau/files.nouveau: 1.5-1.8
sys/external/bsd/drm2/nouveau/nouveau_pci.c: 1.1-1.3
sys/external/bsd/drm2/nouveau/nouveau_pci.h: 1.1
sys/external/bsd/drm2/nouveau/nouveau_sysfs.c: 1.1
sys/external/bsd/drm2/nouveau/nouveau_vga.c: 1.1
sys/external/bsd/drm2/nouveau/nouveaufb.c: 1.1
sys/external/bsd/drm2/nouveau/nouveaufb.h: 1.1
sys/external/bsd/drm2/pci/drm_pci.c: 1.10-1.12
sys/external/bsd/drm2/pci/drm_pci_module.c: 1.4
sys/external/bsd/drm2/pci/drmfb_pci.c: 1.1-1.3
sys/external/bsd/drm2/pci/files.drmkms_pci: 1.5
sys/external/bsd/drm2/radeon/radeon_pci.c: 1.5-1.7
sys/modules/drmkms/Makefile: 1.8, 1.9
sys/modules/drmkms_linux/Makefile: 1.6
sys/modules/drmkms_pci/Makefile: 1.5
sync drm2 with HEAD.
 1.1.2.2 10-Aug-2014  tls Rebase.
 1.1.2.1 06-Aug-2014  tls file reboot.h was added on branch tls-earlyentropy on 2014-08-10 06:55:39 +0000
 1.2.18.2 08-Apr-2020  martin Merge changes from current as of 20200406
 1.2.18.1 10-Jun-2019  christos Sync with HEAD
 1.2.16.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.3 19-Dec-2021  riastradh i915: intel_engine_pm.c and i915_active.c

...with a little less heinous abuse of C, and an attempt to
disentangle the tentacular abstraction violations rampant in these
components
 1.2 19-Dec-2021  riastradh Linux refcount API
 1.1 19-Dec-2021  riastradh Create stub headers for files included by drm code.


Author: Maya Rashish <maya@NetBSD.org>
 1.1 19-Dec-2021  riastradh More Linux header stubs.

Let's just use empty header files until we actually populate these.
Save a bit of disk space...
 1.18 19-Dec-2021  riastradh Rename reservation_object -> dma_resv.
 1.17 19-Dec-2021  riastradh const const const const const reservations
 1.16 19-Dec-2021  riastradh Add some more reservation API.

Define reservation_object_assert_held.

Just declare reservation_object_copy_fences for now, will implement
later.
 1.15 19-Dec-2021  riastradh Rename more fields that Linux treats as part of the API, not opaque.
 1.14 19-Dec-2021  riastradh Let's try spelling the member the same way Linux does.
 1.13 19-Dec-2021  riastradh Linux API wants seqcount exposed in reservation object, so do that.
 1.12 19-Dec-2021  riastradh Define reservation_object_has_excl_fence as substitute for abstrusion.
 1.11 19-Dec-2021  riastradh reservation_object_lock/lock_interruptible/trylock/unlock
 1.10 19-Dec-2021  riastradh reservation_object_get_excl_rcu
 1.9 19-Dec-2021  riastradh fence -> dma_fence in <linux/reservation.h>.
 1.8 27-Aug-2018  riastradh Implement poll for reservations and dma bufs.
 1.7 27-Aug-2018  riastradh Draft reservation_object_get_fences_rcu.
 1.6 27-Aug-2018  riastradh Apparently one can reserve_shared only once in a row. Simplify.
 1.5 27-Aug-2018  riastradh Draft implementation of the Linux reservation and fence APIs.
 1.4 27-Aug-2018  riastradh More <linux/reservation.h> stubs.
 1.3 27-Aug-2018  riastradh Fix include guards.
 1.2 27-Aug-2018  riastradh Add some reservation stubs.
 1.1 16-Jul-2014  riastradh branches: 1.1.2; 1.1.6; 1.1.30; 1.1.32;
First whack at radeon driver.

No hardware to test yet, but it builds.
 1.1.32.1 10-Jun-2019  christos Sync with HEAD
 1.1.30.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.1.6.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.6.1 16-Jul-2014  tls file reservation.h was added on branch tls-maxphys on 2014-08-20 00:04:21 +0000
 1.1.2.2 10-Aug-2014  tls Rebase.
 1.1.2.1 16-Jul-2014  tls file reservation.h was added on branch tls-earlyentropy on 2014-08-10 06:55:39 +0000
 1.1 27-Aug-2018  riastradh branches: 1.1.2; 1.1.6;
More Linux header file stubs.
 1.1.6.2 10-Jun-2019  christos Sync with HEAD
 1.1.6.1 27-Aug-2018  christos file reset.h was added on branch phil-wifi on 2019-06-10 22:08:32 +0000
 1.1.2.2 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.1.2.1 27-Aug-2018  pgoyette file reset.h was added on branch pgoyette-compat on 2018-09-06 06:56:36 +0000
 1.5 19-Dec-2021  riastradh linux/rwsem: Reorder members to avoid confusing lockdebug.
 1.4 19-Dec-2021  riastradh linux: Teach rw semaphores about lockdebug.
 1.3 19-Dec-2021  riastradh linux: Draft rwsem with bodgy semantics.
 1.2 27-Aug-2018  riastradh Add down_read_trylock and downgrade_write.
 1.1 16-Jul-2014  riastradh branches: 1.1.2; 1.1.6; 1.1.30; 1.1.32;
First whack at radeon driver.

No hardware to test yet, but it builds.
 1.1.32.1 10-Jun-2019  christos Sync with HEAD
 1.1.30.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.1.6.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.6.1 16-Jul-2014  tls file rwsem.h was added on branch tls-maxphys on 2014-08-20 00:04:21 +0000
 1.1.2.2 10-Aug-2014  tls Rebase.
 1.1.2.1 16-Jul-2014  tls file rwsem.h was added on branch tls-earlyentropy on 2014-08-10 06:55:39 +0000
 1.8 19-Dec-2021  riastradh linux: Side-load asm/io.h in linux/scatterlist.h.
 1.7 19-Dec-2021  riastradh drm: Destroy dma map in sg_table_free.

Helps to reduce a little diff.
 1.6 19-Dec-2021  riastradh i915: another whack at it
 1.5 19-Dec-2021  riastradh drm: Another pass over i915. Most of i915 gem builds now.
 1.4 19-Dec-2021  riastradh drm: Another pass over i915 and some supporting logic.

This makes a shim around sg_table, which essentially represents two
things:

1. an array of pages (roughly corresponding to bus_dma_segment_t[])
2. an array of DMA addresses stored in a bus_dmamap_t

Both parts are optional; different parts of i915 use sg_tables to
pass around one or both of the two parts. This helps to reduce the
ifdefs by quite a bit, although it's not always clear which part of
an sg_table any particular interface is actually using which is why I
was reluctant to do this before.
 1.3 19-Dec-2021  riastradh Side-load <linux/mm.h> in a few places.
 1.2 19-Dec-2021  riastradh Side load <linux/types.h> here, because why not?
 1.1 19-Dec-2021  riastradh Stub linux compiler.h, scatterlist.h, seqlock.h, sort.h.
 1.23 27-Dec-2021  riastradh drm: Define TASK_INTERRUPTIBLE so we can reduce diffs a little.
 1.22 19-Dec-2021  riastradh linux: Define need_resched as alias for preempt_needed.

No need to open-code this (nor to do it slightly wrong).
 1.21 19-Dec-2021  riastradh drm: Timeout audit -- linux/sched.h.
 1.20 19-Dec-2021  riastradh amdgpu: Stub out irq domain stuff with a finer grain.
 1.19 19-Dec-2021  riastradh Make intel_psr.c build
netbsd-ify
Stub out intel_lpe_audio.c (for now?).
Hammer intel_opregion.c into shape.
Hack up intel_lrc.c
Adapt intel_reset.c
Stub out intel_region_lmem.c
Adapt intel_ring_submission.c
Adapt intel_rps.c
Adapt intel_sdvo.c
Adapt intel_runtime_pm.c
Adapt intel_sideband.c
Adapt intel_sprite.c
Adapt intel_tv.c
Adapt intel_tc.c
Adapt intel_sseu.c
Adapt intel_timeline.c
Adapt intel_uc_fw.c and fix typo
Fix up intel_uncore.c
intel_vga.c
intel_wakeref.c
intel_vdsc.c
intel_wopcm.c
intel_workarounds.c
i915_globals.c
Fix up intelfb.c
Stub out intel_guc_log.c
Stub out intel_dsi_dcs_backlight.c
i915_perf.c
intel_hdmi.c
intel_hdcp.c


Author: Maya Rashish <maya@NetBSD.org>
Committer: Taylor R Campbell <riastradh@NetBSD.org>
 1.18 19-Dec-2021  riastradh Revert "Give up on finding how linux side-loads these"

Found it.
 1.17 19-Dec-2021  riastradh misc drm hacks
 1.16 19-Dec-2021  riastradh Expand some <linux/sched.h> definitions.
 1.15 03-Jul-2020  maxv hardclock_ticks -> getticks()
 1.14 14-Mar-2020  ad - Hide the details of SPCF_SHOULDYIELD and related behind a couple of small
functions: preempt_point() and preempt_needed().

- preempt(): if the LWP has exceeded its timeslice in kernel, strip it of
any priority boost gained earlier from blocking.
 1.13 28-Sep-2019  christos fixed signed compare.
 1.12 23-Oct-2018  riastradh Clamp timeout to INT_MAX to avoid the bad kind of integer truncation.

XXX pullup-7
XXX pullup-8
 1.11 23-Oct-2018  riastradh DELAY takes microseconds, not ticks.

XXX pullup-7
XXX pullup-8
 1.10 27-Aug-2018  riastradh Hazard a guess about a reliable MAX_SCHEDULE_TIMEOUT.
 1.9 27-Aug-2018  riastradh Define cond_resched to preempt if SPCF_SHOULDYIELD.
 1.8 27-Aug-2018  riastradh provide pr_notice
avoid needing unregister_oom_notifier
use intel_register_dsm_handler(dev), as older drm does
provide dummy async_schedule
provide atomic_or
match side-loading


Author: coypu <coypu@sdf.org>
Committer: Taylor R Campbell <riastradh@NetBSD.org>
 1.7 27-Aug-2018  riastradh begin fixing -Werror build:

Provide missing declarations from older drm
provide more definitions used by code
no idea what might_lock is, but it might be some error-checking
lockdep thing.


Author: coypu <coypu@sdf.org>
Committer: Taylor R Campbell <riastradh@NetBSD.org>
 1.6 27-Aug-2018  riastradh match linux side loading


Author: coypu <coypu@sdf.org>
Committer: Taylor R Campbell <riastradh@NetBSD.org>
 1.5 08-Nov-2014  nonaka branches: 1.5.18; 1.5.20;
return correct remaining jiffies.
fix X server hang when screen blank by DPMS.
 1.4 22-Oct-2014  nonaka Don't call kpause(9) if cold.
 1.3 16-Jul-2014  riastradh branches: 1.3.2; 1.3.4;
Make it build and boot on my test machines.

Screen blanks on boot on the Ivy Bridge system with

DRM error in cpt_serr_int_handler: PCH transcoder A FIFO underrun

But after that everything is OK. Appears to be an upstream problem.
To investigate...

I think there's a cache flushing issue somewhere -- there are little
display artefacts on my T60.
 1.2 18-Mar-2014  riastradh branches: 1.2.2; 1.2.4; 1.2.6;
Merge riastradh-drm2 to HEAD.
 1.1 24-Jul-2013  riastradh branches: 1.1.2;
file sched.h was initially added on branch riastradh-drm2.
 1.1.2.2 24-Jul-2013  riastradh #define current curproc, and add task_pid_nr, in <linux/sched.h>.
 1.1.2.1 24-Jul-2013  riastradh Add stubs for Linux header files for drm.
 1.2.6.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.2.6.1 18-Mar-2014  yamt file sched.h was added on branch yamt-pagecache on 2014-05-22 11:40:56 +0000
 1.2.4.2 18-May-2014  rmind sync with head
 1.2.4.1 18-Mar-2014  rmind file sched.h was added on branch rmind-smpnet on 2014-05-18 17:46:01 +0000
 1.2.2.1 10-Aug-2014  tls Rebase.
 1.3.4.3 03-Dec-2017  jdolecek update from HEAD
 1.3.4.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.3.4.1 16-Jul-2014  tls file sched.h was added on branch tls-maxphys on 2014-08-20 00:04:21 +0000
 1.3.2.2 11-Nov-2014  martin Pull up following revision(s) (requested by nonaka in ticket #198):
sys/external/bsd/drm2/include/linux/sched.h: revision 1.5
return correct remaining jiffies.
fix X server hang when screen blank by DPMS.
 1.3.2.1 30-Oct-2014  martin Pull up following revision(s) (requested by nonaka in ticket #161):
sys/external/bsd/drm2/include/linux/sched.h: revision 1.4
Don't call kpause(9) if cold.
 1.5.20.3 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.5.20.2 08-Apr-2020  martin Merge changes from current as of 20200406
 1.5.20.1 10-Jun-2019  christos Sync with HEAD
 1.5.18.2 26-Nov-2018  pgoyette Sync with HEAD, resolve a couple of conflicts
 1.5.18.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.1 06-Aug-2014  riastradh branches: 1.1.2; 1.1.6;
More Linux goo.
 1.1.6.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.6.1 06-Aug-2014  tls file screen_info.h was added on branch tls-maxphys on 2014-08-20 00:04:21 +0000
 1.1.2.2 10-Aug-2014  tls Rebase.
 1.1.2.1 06-Aug-2014  tls file screen_info.h was added on branch tls-earlyentropy on 2014-08-10 06:55:39 +0000
 1.1 19-Dec-2021  riastradh Add some Linux header stubs.
 1.5 19-Dec-2021  riastradh drm: Make some legacy UMS crap build.
 1.4 19-Dec-2021  riastradh match linux side-loading


Author: Maya Rashish <maya@NetBSD.org>
 1.3 19-Dec-2021  riastradh Declare struct seq_file; save some debugfs/sysfs ifdef trouble.
 1.2 18-Mar-2014  riastradh branches: 1.2.4; 1.2.6; 1.2.10;
Merge riastradh-drm2 to HEAD.
 1.1 24-Jul-2013  riastradh branches: 1.1.2;
file seq_file.h was initially added on branch riastradh-drm2.
 1.1.2.1 24-Jul-2013  riastradh Add stubs for Linux header files for drm.
 1.2.10.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.2.10.1 18-Mar-2014  tls file seq_file.h was added on branch tls-maxphys on 2014-08-20 00:04:21 +0000
 1.2.6.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.2.6.1 18-Mar-2014  yamt file seq_file.h was added on branch yamt-pagecache on 2014-05-22 11:40:56 +0000
 1.2.4.2 18-May-2014  rmind sync with head
 1.2.4.1 18-Mar-2014  rmind file seq_file.h was added on branch rmind-smpnet on 2014-05-18 17:46:01 +0000
 1.5 19-Dec-2021  riastradh const const const const const
 1.4 19-Dec-2021  riastradh raw_read_seqcount
 1.3 19-Dec-2021  riastradh Revamp seqlock. Fix some stupid bugs. Add seqcount.
 1.2 19-Dec-2021  riastradh Implement <linux/seqlock.h>.
 1.1 19-Dec-2021  riastradh Stub linux compiler.h, scatterlist.h, seqlock.h, sort.h.
 1.5 20-Aug-2022  riastradh x86: Move definition of struct pmap to pmap_private.h.

This makes pmap_resident_count and pmap_wired_count out-of-line
functions instead of inline. No functional change intended
otherwise.
 1.4 19-Dec-2021  riastradh drm: Need write lock on vmobjlock for pgo_put.
 1.3 19-Dec-2021  riastradh drm: Another pass over i915. Most of i915 gem builds now.
 1.2 18-Mar-2014  riastradh branches: 1.2.4; 1.2.6; 1.2.10;
Merge riastradh-drm2 to HEAD.
 1.1 24-Jul-2013  riastradh branches: 1.1.2;
file shmem_fs.h was initially added on branch riastradh-drm2.
 1.1.2.1 24-Jul-2013  riastradh Add stubs for Linux header files for drm.
 1.2.10.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.2.10.1 18-Mar-2014  tls file shmem_fs.h was added on branch tls-maxphys on 2014-08-20 00:04:21 +0000
 1.2.6.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.2.6.1 18-Mar-2014  yamt file shmem_fs.h was added on branch yamt-pagecache on 2014-05-22 11:40:56 +0000
 1.2.4.2 18-May-2014  rmind sync with head
 1.2.4.1 18-Mar-2014  rmind file shmem_fs.h was added on branch rmind-smpnet on 2014-05-18 17:46:01 +0000
 1.5 19-Dec-2021  riastradh Expand shrinker stubs.
 1.4 27-Aug-2018  riastradh Add some shrinker and oom notifier stubs.
 1.3 16-Jul-2014  riastradh branches: 1.3.4; 1.3.28; 1.3.30;
Make it build and boot on my test machines.

Screen blanks on boot on the Ivy Bridge system with

DRM error in cpt_serr_int_handler: PCH transcoder A FIFO underrun

But after that everything is OK. Appears to be an upstream problem.
To investigate...

I think there's a cache flushing issue somewhere -- there are little
display artefacts on my T60.
 1.2 18-Mar-2014  riastradh branches: 1.2.2; 1.2.4; 1.2.6;
Merge riastradh-drm2 to HEAD.
 1.1 24-Jul-2013  riastradh branches: 1.1.2;
file shrinker.h was initially added on branch riastradh-drm2.
 1.1.2.2 24-Jul-2013  riastradh Fill struct shrink_control with nr_to_scan in <linux/shrinker.h>.

i915_gem wants to use it.
 1.1.2.1 24-Jul-2013  riastradh Add stub <linux/shrinker.h>.

Abstraction for the system to request that caches be shrunk.
Currently does nothing.
 1.2.6.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.2.6.1 18-Mar-2014  yamt file shrinker.h was added on branch yamt-pagecache on 2014-05-22 11:40:56 +0000
 1.2.4.2 18-May-2014  rmind sync with head
 1.2.4.1 18-Mar-2014  rmind file shrinker.h was added on branch rmind-smpnet on 2014-05-18 17:46:01 +0000
 1.2.2.1 10-Aug-2014  tls Rebase.
 1.3.30.1 10-Jun-2019  christos Sync with HEAD
 1.3.28.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.3.4.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.3.4.1 16-Jul-2014  tls file shrinker.h was added on branch tls-maxphys on 2014-08-20 00:04:21 +0000
 1.4 19-Dec-2021  riastradh Make intel_psr.c build
netbsd-ify
Stub out intel_lpe_audio.c (for now?).
Hammer intel_opregion.c into shape.
Hack up intel_lrc.c
Adapt intel_reset.c
Stub out intel_region_lmem.c
Adapt intel_ring_submission.c
Adapt intel_rps.c
Adapt intel_sdvo.c
Adapt intel_runtime_pm.c
Adapt intel_sideband.c
Adapt intel_sprite.c
Adapt intel_tv.c
Adapt intel_tc.c
Adapt intel_sseu.c
Adapt intel_timeline.c
Adapt intel_uc_fw.c and fix typo
Fix up intel_uncore.c
intel_vga.c
intel_wakeref.c
intel_vdsc.c
intel_wopcm.c
intel_workarounds.c
i915_globals.c
Fix up intelfb.c
Stub out intel_guc_log.c
Stub out intel_dsi_dcs_backlight.c
i915_perf.c
intel_hdmi.c
intel_hdcp.c


Author: Maya Rashish <maya@NetBSD.org>
Committer: Taylor R Campbell <riastradh@NetBSD.org>
 1.3 19-Dec-2021  riastradh drm/linux: moar sizes
 1.2 19-Dec-2021  riastradh drm/linux: Add memset32, SZ_64K, atomic_sub_return.
 1.1 19-Dec-2021  riastradh linux/sizes.h
 1.7 27-Aug-2018  riastradh gfp.h and slab.h are now used in kernel.h, so move to common.
 1.6 27-Aug-2018  riastradh Implement kvfree by free(9); assume kmalloc/vmalloc use malloc(9).
 1.5 02-Mar-2015  riastradh branches: 1.5.16; 1.5.18;
Fix broken error checking in kmalloc_array/kcalloc.
 1.4 16-Jul-2014  riastradh branches: 1.4.2; 1.4.4; 1.4.6;
First whack at radeon driver.

No hardware to test yet, but it builds.
 1.3 16-Jul-2014  riastradh Make it build and boot on my test machines.

Screen blanks on boot on the Ivy Bridge system with

DRM error in cpt_serr_int_handler: PCH transcoder A FIFO underrun

But after that everything is OK. Appears to be an upstream problem.
To investigate...

I think there's a cache flushing issue somewhere -- there are little
display artefacts on my T60.
 1.2 18-Mar-2014  riastradh branches: 1.2.2; 1.2.4; 1.2.6;
Merge riastradh-drm2 to HEAD.
 1.1 24-Jul-2013  riastradh branches: 1.1.2;
file slab.h was initially added on branch riastradh-drm2.
 1.1.2.10 21-Jan-2014  riastradh Make Linux kmalloc handle a few more gfp flags.
 1.1.2.9 30-Dec-2013  riastradh Avoid dividing by zero when allocating empty array in kcalloc.
 1.1.2.8 24-Jul-2013  riastradh Allow kfree(NULL).
 1.1.2.7 24-Jul-2013  riastradh Fix sense of kassert in kcalloc.
 1.1.2.6 24-Jul-2013  riastradh Move GFP (`get free page') constants to <linux/gfp.h>.

Declare alloc_page and __free_page there too, to be implemented soon.
 1.1.2.5 24-Jul-2013  riastradh Add GFP_ATOMIC, meaning M_NOWAIT, to <linux/slab.h>.
 1.1.2.4 24-Jul-2013  riastradh Add kcalloc to <linux/slab.h>.
 1.1.2.3 24-Jul-2013  riastradh Implement krealloc in <linux/slab.h>.
 1.1.2.2 24-Jul-2013  riastradh Add Linux-style kmalloc &c. to <linux/slab.h>.

Defined in terms of malloc(9) with M_TEMP for now, since Linux's
kfree doesn't pass the size, so using kmem(9) is inexpedient.
 1.1.2.1 24-Jul-2013  riastradh Add stubs for Linux header files for drm.
 1.2.6.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.2.6.1 18-Mar-2014  yamt file slab.h was added on branch yamt-pagecache on 2014-05-22 11:40:56 +0000
 1.2.4.2 18-May-2014  rmind sync with head
 1.2.4.1 18-Mar-2014  rmind file slab.h was added on branch rmind-smpnet on 2014-05-18 17:46:01 +0000
 1.2.2.1 10-Aug-2014  tls Rebase.
 1.4.6.1 06-Apr-2015  skrll Sync with HEAD
 1.4.4.3 03-Dec-2017  jdolecek update from HEAD
 1.4.4.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.4.4.1 16-Jul-2014  tls file slab.h was added on branch tls-maxphys on 2014-08-20 00:04:21 +0000
 1.4.2.1 06-Mar-2015  snj Pull up following revision(s) (requested by mrg in ticket #573):
sys/external/bsd/common/include/linux/kernel.h: 1.5, 1.6
sys/external/bsd/drm2/dist/drm/drm_ioctl.c: 1.4
sys/external/bsd/drm2/dist/drm/drm_irq.c: 1.6-1.8
sys/external/bsd/drm2/dist/drm/i915/i915_dma.c: 1.13-1.15
sys/external/bsd/drm2/dist/drm/i915/i915_gem.c: 1.23-1.27
sys/external/bsd/drm2/dist/drm/i915/i915_gem_execbuffer.c: 1.5
sys/external/bsd/drm2/dist/drm/i915/intel_display.c: 1.14, 1.15
sys/external/bsd/drm2/dist/drm/i915/intel_dp.c: 1.10
sys/external/bsd/drm2/dist/drm/i915/intel_drv.h: 1.8
sys/external/bsd/drm2/dist/drm/i915/intel_i2c.c: 1.8-1.13
sys/external/bsd/drm2/dist/drm/i915/intel_pm.c: 1.6
sys/external/bsd/drm2/dist/drm/i915/intel_ringbuffer.c: 1.5, 1.6
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/device/nouveau_engine_device_base.c: 1.4
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/fifo/nouveau_engine_fifo_nvc0.c: 1.3, 1.4
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/fifo/nouveau_engine_fifo_nve0.c: 1.3, 1.4
sys/external/bsd/drm2/dist/drm/nouveau/core/include/core/device.h: 1.4
sys/external/bsd/drm2/dist/drm/nouveau/core/include/subdev/mc.h: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/include/subdev/pwr.h: 1.3, 1.4
sys/external/bsd/drm2/dist/drm/nouveau/core/os.h: 1.4, 1.5
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/bios/nouveau_subdev_bios_base.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/bios/nouveau_subdev_bios_pll.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/clock/nouveau_subdev_clock_base.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/clock/nouveau_subdev_clock_nv50.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/devinit/fbmem.h: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/devinit/nouveau_subdev_devinit_nv04.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/fb/nouveau_subdev_fb_nv50.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/fb/nouveau_subdev_fb_nvc0.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/fb/nv50.h: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/fb/nvc0.h: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/mc/nouveau_subdev_mc_base.c: 1.2, 1.3
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/mxm/nouveau_subdev_mxm_nv50.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/pwr/nouveau_subdev_pwr_base.c: 1.3, 1.4
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/therm/nouveau_subdev_therm_ic.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/timer/nouveau_subdev_timer_nv04.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/vm/nouveau_subdev_vm_base.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/vm/nouveau_subdev_vm_nv04.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/vm/nouveau_subdev_vm_nv44.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/vm/nv04.h: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_bo.h: 1.3
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_drm.c: 1.4, 1.5
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_fbcon.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_nv50_display.c: 1.3
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_nv84_fence.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_ttm.c: 1.3
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_ttm.h: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_vga.h: 1.2
sys/external/bsd/drm2/dist/drm/radeon/radeon_fence.c: 1.6-1.8
sys/external/bsd/drm2/dist/drm/radeon/radeon_pm.c: 1.3
sys/external/bsd/drm2/dist/drm/radeon/rs400.c: 1.3
sys/external/bsd/drm2/dist/drm/via/via_dmablit.c: 1.3, 1.4
sys/external/bsd/drm2/dist/drm/via/via_drv.h: 1.3
sys/external/bsd/drm2/dist/drm/via/via_irq.c: 1.3, 1.4
sys/external/bsd/drm2/dist/drm/via/via_video.c: 1.3, 1.4
sys/external/bsd/drm2/dist/include/drm/drmP.h: 1.10
sys/external/bsd/drm2/dist/include/drm/drm_crtc.h: 1.4
sys/external/bsd/drm2/dist/include/drm/drm_modes.h: 1.3
sys/external/bsd/drm2/dist/uapi/drm/i915_drm.h: 1.2
sys/external/bsd/drm2/drm/drm_cache.c: 1.4-1.6
sys/external/bsd/drm2/drm/drm_drv.c: 1.14
sys/external/bsd/drm2/drm/drm_module.c: 1.10
sys/external/bsd/drm2/drm/drm_sysctl.c: 1.5
sys/external/bsd/drm2/drm/drm_vma_manager.c: 1.2
sys/external/bsd/drm2/drm/drmfb.c: 1.1
sys/external/bsd/drm2/drm/files.drmkms: 1.10, 1.11
sys/external/bsd/drm2/i2c/drm_encoder_slave.c: 1.1
sys/external/bsd/drm2/i915drm/files.i915drmkms: 1.7, 1.10
sys/external/bsd/drm2/i915drm/intelfb.c: 1.11, 1.12
sys/external/bsd/drm2/include/asm/io.h: 1.4
sys/external/bsd/drm2/include/asm/unaligned.h: 1.2, 1.3
sys/external/bsd/drm2/include/drm/drm_encoder_slave.h: 1.1
sys/external/bsd/drm2/include/drm/drm_wait_netbsd.h: 1.7-1.11
sys/external/bsd/drm2/include/drm/drmfb.h: 1.1
sys/external/bsd/drm2/include/drm/drmfb_pci.h: 1.1, 1.2
sys/external/bsd/drm2/include/linux/bitops.h: 1.9
sys/external/bsd/drm2/include/linux/i2c.h: 1.7, 1.8
sys/external/bsd/drm2/include/linux/io-mapping.h: 1.5
sys/external/bsd/drm2/include/linux/moduleparam.h: 1.5
sys/external/bsd/drm2/include/linux/pci.h: 1.12-1.15
sys/external/bsd/drm2/include/linux/pm.h: 1.4
sys/external/bsd/drm2/include/linux/reboot.h: 1.2
sys/external/bsd/drm2/include/linux/slab.h: 1.5
sys/external/bsd/drm2/include/linux/string.h: 1.4
sys/external/bsd/drm2/include/linux/vgaarb.h: 1.3
sys/external/bsd/drm2/include/linux/ww_mutex.h: 1.10
sys/external/bsd/drm2/linux/files.drmkms_linux: 1.8
sys/external/bsd/drm2/linux/linux_i2c.c: 1.3
sys/external/bsd/drm2/linux/linux_ww_mutex.c: 1.1
sys/external/bsd/drm2/nouveau/files.nouveau: 1.5-1.8
sys/external/bsd/drm2/nouveau/nouveau_pci.c: 1.1-1.3
sys/external/bsd/drm2/nouveau/nouveau_pci.h: 1.1
sys/external/bsd/drm2/nouveau/nouveau_sysfs.c: 1.1
sys/external/bsd/drm2/nouveau/nouveau_vga.c: 1.1
sys/external/bsd/drm2/nouveau/nouveaufb.c: 1.1
sys/external/bsd/drm2/nouveau/nouveaufb.h: 1.1
sys/external/bsd/drm2/pci/drm_pci.c: 1.10-1.12
sys/external/bsd/drm2/pci/drm_pci_module.c: 1.4
sys/external/bsd/drm2/pci/drmfb_pci.c: 1.1-1.3
sys/external/bsd/drm2/pci/files.drmkms_pci: 1.5
sys/external/bsd/drm2/radeon/radeon_pci.c: 1.5-1.7
sys/modules/drmkms/Makefile: 1.8, 1.9
sys/modules/drmkms_linux/Makefile: 1.6
sys/modules/drmkms_pci/Makefile: 1.5
sync drm2 with HEAD.
 1.5.18.1 10-Jun-2019  christos Sync with HEAD
 1.5.16.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.5 29-Dec-2023  chs drm: put_cpu() should enable preemption, not disable it again
 1.4 19-Dec-2021  riastradh branches: 1.4.4;
Make intel_psr.c build
netbsd-ify
Stub out intel_lpe_audio.c (for now?).
Hammer intel_opregion.c into shape.
Hack up intel_lrc.c
Adapt intel_reset.c
Stub out intel_region_lmem.c
Adapt intel_ring_submission.c
Adapt intel_rps.c
Adapt intel_sdvo.c
Adapt intel_runtime_pm.c
Adapt intel_sideband.c
Adapt intel_sprite.c
Adapt intel_tv.c
Adapt intel_tc.c
Adapt intel_sseu.c
Adapt intel_timeline.c
Adapt intel_uc_fw.c and fix typo
Fix up intel_uncore.c
intel_vga.c
intel_wakeref.c
intel_vdsc.c
intel_wopcm.c
intel_workarounds.c
i915_globals.c
Fix up intelfb.c
Stub out intel_guc_log.c
Stub out intel_dsi_dcs_backlight.c
i915_perf.c
intel_hdmi.c
intel_hdcp.c


Author: Maya Rashish <maya@NetBSD.org>
Committer: Taylor R Campbell <riastradh@NetBSD.org>
 1.3 19-Dec-2021  riastradh i915: another whack at it
 1.2 19-Dec-2021  riastradh sys/cpu.h for cpu_index


Author: Maya Rashish <maya@NetBSD.org>
 1.1 19-Dec-2021  riastradh get_cpu/put_cpu in <linux/smp.h>.
 1.4.4.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@.
 1.3 19-Dec-2021  riastradh We need to allocate a singular temporary slot, not many.

This also indirectly fixes a panic when nelem == 0.


Author: Maya Rashish <maya@NetBSD.org>
Committer: Taylor R Campbell <riastradh@NetBSD.org>
 1.2 19-Dec-2021  riastradh Hokey Linux sort routine. Doesn't support swap argument.
 1.1 19-Dec-2021  riastradh Stub linux compiler.h, scatterlist.h, seqlock.h, sort.h.
 1.15 25-Oct-2022  riastradh linux/spinlock.h: spin_lock_bh, spin_unlock_bh

Nothing special needed here; NetBSD mutex(9) at IPL_* giving spin
locks already blocks `BH' (i.e., softints -- although I'm not sure
softints are relevant to the one use of this in vmwgfx).
 1.14 19-Dec-2021  riastradh i915: intel_engine_pm.c and i915_active.c

...with a little less heinous abuse of C, and an attempt to
disentangle the tentacular abstraction violations rampant in these
components
 1.13 19-Dec-2021  riastradh provide spin_trylock_irqsave


Author: Maya Rashish <maya@NetBSD.org>
Committer: Taylor R Campbell <riastradh@NetBSD.org>
 1.12 19-Dec-2021  riastradh i915: hack hack hack
 1.11 19-Dec-2021  riastradh linux: Odds and ends.
 1.10 19-Dec-2021  riastradh spin_lock_nested
 1.9 19-Dec-2021  riastradh Move Linux lockdep stuff to its own header file.
 1.8 27-Aug-2018  riastradh begin fixing -Werror build:

Provide missing declarations from older drm
provide more definitions used by code
no idea what might_lock is, but it might be some error-checking
lockdep thing.


Author: coypu <coypu@sdf.org>
Committer: Taylor R Campbell <riastradh@NetBSD.org>
 1.7 13-Apr-2016  riastradh branches: 1.7.16; 1.7.18;
Provide reader/writer semantics with recursive readers.
 1.6 01-Jan-2015  mrg due to hangs seen by several folks, for now revert:
http://mail-index.netbsd.org/source-changes/2014/11/04/msg060120.html

Log Message:
This code should be MP-safe. Use IPL_SCHED in place of IPL_DRM/IPL_VM and set
D_MPSAFE flag in cdevsw.
 1.5 04-Nov-2014  jmcneill branches: 1.5.2;
This code should be MP-safe. Use IPL_SCHED in place of IPL_DRM/IPL_VM and set
D_MPSAFE flag in cdevsw.
 1.4 23-Aug-2014  riastradh Another round of nouveau whack-a-mole.
 1.3 06-Aug-2014  riastradh branches: 1.3.2; 1.3.4;
More Linux goo.
 1.2 18-Mar-2014  riastradh branches: 1.2.2; 1.2.4; 1.2.6;
Merge riastradh-drm2 to HEAD.
 1.1 24-Jul-2013  riastradh branches: 1.1.2;
file spinlock.h was initially added on branch riastradh-drm2.
 1.1.2.9 08-Sep-2013  riastradh Create Linux spin locks at IPL_VM for now.
 1.1.2.8 24-Jul-2013  riastradh Add assert_spin_locked to <linux/spinlock.h>.
 1.1.2.7 24-Jul-2013  riastradh spin_(un)lock_irq in drm2 <linux/spinlock.h>.
 1.1.2.6 24-Jul-2013  riastradh Tag the spinlock struct in <linux/spinlock.h>.
 1.1.2.5 24-Jul-2013  riastradh Add (unauthentic) spin_lock_destroy to <linux/spinlock.h>.
 1.1.2.4 24-Jul-2013  riastradh Define spin_is_locked in <linux/spinlock.h>.
 1.1.2.3 24-Jul-2013  riastradh It's spin_unlock_irqrestore, not spin_lock_irqrestore.
 1.1.2.2 24-Jul-2013  riastradh Implement Linux spin lock in terms of kmutex_t in drm2's <linux/spinlock.h>.

Currently a spin lock will be an adaptive mutex, until I identify
cases in drm2 that actually require spinning and interrupt deferral.
 1.1.2.1 24-Jul-2013  riastradh Add stubs for Linux header files for drm.
 1.2.6.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.2.6.1 18-Mar-2014  yamt file spinlock.h was added on branch yamt-pagecache on 2014-05-22 11:40:56 +0000
 1.2.4.2 18-May-2014  rmind sync with head
 1.2.4.1 18-Mar-2014  rmind file spinlock.h was added on branch rmind-smpnet on 2014-05-18 17:46:01 +0000
 1.2.2.1 10-Aug-2014  tls Rebase.
 1.3.4.3 03-Dec-2017  jdolecek update from HEAD
 1.3.4.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.3.4.1 06-Aug-2014  tls file spinlock.h was added on branch tls-maxphys on 2014-08-20 00:04:21 +0000
 1.3.2.2 15-Apr-2016  snj Pull up following revision(s) (requested by riastradh in ticket #1157):
sys/external/bsd/drm2/dist/drm/nouveau/core/core/nouveau_core_subdev.c: revision 1.3
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/device/nouveau_engine_device_base.c: revisions 1.9, 1.10
sys/external/bsd/drm2/dist/drm/nouveau/core/include/core/namedb.h: revision 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/bar/nouveau_subdev_bar_base.c: revisions 1.4, 1.5
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/instmem/nouveau_subdev_instmem_nv40.c: revision 1.3
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_drm.c: revision 1.8
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_drm.h: revision 1.4
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_fence.c: revision 1.4
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_nv10_fence.c: revision 1.3
sys/external/bsd/drm2/include/linux/delay.h: revision 1.4
sys/external/bsd/drm2/include/linux/spinlock.h: revision 1.7
sys/external/bsd/drm2/nouveau/files.nouveau: revision 1.14
sys/external/bsd/drm2/nouveau/nouveau_pci.c: revision 1.7
Set nouveau to a more reasonable debug level.
Match the compile-time and default run-time settings in Linux.
--
Pass a sensible device state pointer to nouveau suspend/resume ops.
Gives nouveau half a chance of suspending and resuming -- not that it
works on my test laptop yet, but it's a start.
--
Fix bus_space_subregion error branch.
Return error code, not 0 (!), on bus_space_subregion failure.
In answer to `XXX error branch' comment: if nouveau_barobj_ctor
fails, then the caller will call nouveau_barobj_dtor too. So there's
no leak here.
Unlikely to fix any observed bugs with nouveau -- there's no error
branch in the Linux side here. But maybe it will catch some other
bug earlier.
--
Map the same mmio size as Linux does.
Unlikely to have practical consequences -- just reduces differences
in behaviour from upstream, to rule them out.
--
Print error code for failure to map PRAMIN BAR.
--
In msleep use mdelay if cold
--
Use only the low 32 bits of the bar object's vma offset as intended.
Should fix PR kern/50372, seen by everyone trying to use nouveau on
amd64 with hardware that uses nv50-style BARs and not nvc0-style
BARs.
--
Destroy the lock before caller frees memory.
--
Destroy spin locks appropriately.
--
Destroy the mutex before free.
--
Provide reader/writer semantics with recursive readers.
--
Exclude VRAM and FIFO regions from MMIO register mapping.
Nouveau maps those separately, and it is not trivial to convert those
mappings to bus_space_subregion.
 1.3.2.1 21-Sep-2014  snj Pull up following revision(s) (requested by riastradh in ticket #95):
sys/external/bsd/drm2/dist/drm/nouveau/core/include/subdev/fb.h: revision 1.2
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_nv10_fence.c: revision 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/bar/nouveau_subdev_bar_base.c: revision 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/include/engine/device.h: revision 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/include/subdev/pwr.h: revision 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/nouveau_engine_xtensa.c: revision 1.2
sys/external/bsd/drm2/include/linux/bitops.h: revision 1.8
sys/external/bsd/drm2/dist/drm/nouveau/dispnv04/nouveau_dispnv04_tvnv17.c: revision 1.3
sys/external/bsd/drm2/dist/drm/nouveau/dispnv04/nouveau_dispnv04_tvmodesnv17.c: revision 1.3
sys/external/bsd/drm2/dist/drm/nouveau/core/include/core/device.h: revision 1.3
sys/external/bsd/drm2/include/drm/drm_agp_netbsd.h: revision 1.4
sys/external/bsd/drm2/include/linux/spinlock.h: revision 1.4
sys/external/bsd/drm2/include/linux/pm_runtime.h: revision 1.3
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/crypt/nouveau_engine_crypt_nv98.c: revision 1.2
sys/external/bsd/drm2/nouveau/files.nouveau: revision 1.3
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/disp/nouveau_engine_disp_dacnv50.c: revision 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/fifo/nouveau_engine_fifo_nve0.c: revision 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/disp/nouveau_engine_disp_nv50.c: revision 1.2
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_gem.c: revision 1.3
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_bo.c: revision 1.5
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/perfmon/nouveau_engine_perfmon_base.c: revision 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/crypt/nouveau_engine_crypt_nv84.c: revision 1.2
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_fence.c: revision 1.3
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/graph/nouveau_engine_graph_nv50.c: revision 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/fifo/nouveau_engine_fifo_nvc0.c: revision 1.2
sys/external/bsd/drm2/include/linux/vmalloc.h: revision 1.4
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/fifo/nve0.h: revision 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/instmem/nv04.h: revision 1.2
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_drm.c: revision 1.3
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_drm.h: revision 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/fifo/nouveau_engine_fifo_base.c: revision 1.3
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/disp/nouveau_engine_disp_nvd0.c: revision 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/disp/nouveau_engine_disp_nv04.c: revision 1.2
sys/external/bsd/drm2/nouveau/nouveau_module.c: revision 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/instmem/nouveau_subdev_instmem_nv40.c: revision 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/graph/nouveau_engine_graph_gm107.c: revision 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/graph/nouveau_engine_graph_ctxnvd7.c: revision 1.2
sys/external/bsd/drm2/include/linux/mutex.h: revision 1.7
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/disp/nv50.h: revision 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/device/nouveau_engine_device_base.c: revision 1.3
sys/external/bsd/drm2/include/linux/i2c.h: revision 1.6
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/graph/nouveau_engine_graph_nvc0.c: revision 1.2
sys/external/bsd/drm2/include/linux/pagemap.h: revision 1.3
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/instmem/nouveau_subdev_instmem_nv04.c: revision 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/copy/nouveau_engine_copy_nva3.c: revision 1.2
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_nv50_display.c: revision 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/include/subdev/bar.h: revision 1.3
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/pwr/nouveau_subdev_pwr_base.c: revision 1.2
Another round of nouveau whack-a-mole.
 1.5.2.2 22-Apr-2016  skrll Sync with HEAD
 1.5.2.1 06-Apr-2015  skrll Sync with HEAD
 1.7.18.1 10-Jun-2019  christos Sync with HEAD
 1.7.16.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.1 19-Dec-2021  riastradh More Linux header stubs.

Let's just use empty header files until we actually populate these.
Save a bit of disk space...
 1.3 19-Dec-2021  riastradh Move Linux SRCU to common.
 1.2 19-Dec-2021  riastradh Draft SRCU implementation.
 1.1 19-Dec-2021  riastradh Stub <linux/srcu.h>.
 1.2 19-Dec-2021  riastradh grab stackdepot.h from openbsd


Author: Maya Rashish <maya@NetBSD.org>
Committer: Taylor R Campbell <riastradh@NetBSD.org>
 1.1 19-Dec-2021  riastradh Create stub headers for files included by drm code.


Author: Maya Rashish <maya@NetBSD.org>
 1.1 19-Dec-2021  riastradh <linux/stacktrace.h>
 1.2 18-Mar-2014  riastradh branches: 1.2.4; 1.2.6; 1.2.10;
Merge riastradh-drm2 to HEAD.
 1.1 24-Jul-2013  riastradh branches: 1.1.2;
file stat.h was initially added on branch riastradh-drm2.
 1.1.2.1 24-Jul-2013  riastradh Add stubs for Linux header files for drm.
 1.2.10.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.2.10.1 18-Mar-2014  tls file stat.h was added on branch tls-maxphys on 2014-08-20 00:04:21 +0000
 1.2.6.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.2.6.1 18-Mar-2014  yamt file stat.h was added on branch yamt-pagecache on 2014-05-22 11:40:56 +0000
 1.2.4.2 18-May-2014  rmind sync with head
 1.2.4.1 18-Mar-2014  rmind file stat.h was added on branch rmind-smpnet on 2014-05-18 17:46:01 +0000
 1.2 19-Dec-2021  riastradh Draft stop_machine. Hope the callback runs quickly under splhigh...
 1.1 19-Dec-2021  riastradh Bunch more Linux header file stubs.
 1.11 19-Dec-2021  riastradh i915: more work
 1.10 19-Dec-2021  riastradh drm/linux: Add memset32, SZ_64K, atomic_sub_return.
 1.9 19-Dec-2021  riastradh match_string
 1.8 19-Dec-2021  riastradh provide str_has_prefix


Author: Maya Rashish <maya@NetBSD.org>
 1.7 19-Dec-2021  riastradh memset64, memset_p
 1.6 19-Dec-2021  riastradh Implement strscpy.
 1.5 27-Aug-2018  riastradh Add Linux kstrdup.
 1.4 25-Feb-2015  riastradh branches: 1.4.16; 1.4.18;
Add kstrndup.
 1.3 16-Jul-2014  riastradh branches: 1.3.2; 1.3.4; 1.3.6;
Make it build and boot on my test machines.

Screen blanks on boot on the Ivy Bridge system with

DRM error in cpt_serr_int_handler: PCH transcoder A FIFO underrun

But after that everything is OK. Appears to be an upstream problem.
To investigate...

I think there's a cache flushing issue somewhere -- there are little
display artefacts on my T60.
 1.2 18-Mar-2014  riastradh branches: 1.2.2; 1.2.4; 1.2.6;
Merge riastradh-drm2 to HEAD.
 1.1 24-Jul-2013  riastradh branches: 1.1.2;
file string.h was initially added on branch riastradh-drm2.
 1.1.2.3 24-Jul-2013  riastradh <linux/string.h> needs <sys/null.h> for NULL.
 1.1.2.2 24-Jul-2013  riastradh Add memchr_inv to <linux/string.h>.
 1.1.2.1 24-Jul-2013  riastradh Add stubs for Linux header files for drm.
 1.2.6.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.2.6.1 18-Mar-2014  yamt file string.h was added on branch yamt-pagecache on 2014-05-22 11:40:56 +0000
 1.2.4.2 18-May-2014  rmind sync with head
 1.2.4.1 18-Mar-2014  rmind file string.h was added on branch rmind-smpnet on 2014-05-18 17:46:01 +0000
 1.2.2.1 10-Aug-2014  tls Rebase.
 1.3.6.1 06-Apr-2015  skrll Sync with HEAD
 1.3.4.3 03-Dec-2017  jdolecek update from HEAD
 1.3.4.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.3.4.1 16-Jul-2014  tls file string.h was added on branch tls-maxphys on 2014-08-20 00:04:21 +0000
 1.3.2.1 06-Mar-2015  snj Pull up following revision(s) (requested by mrg in ticket #573):
sys/external/bsd/common/include/linux/kernel.h: 1.5, 1.6
sys/external/bsd/drm2/dist/drm/drm_ioctl.c: 1.4
sys/external/bsd/drm2/dist/drm/drm_irq.c: 1.6-1.8
sys/external/bsd/drm2/dist/drm/i915/i915_dma.c: 1.13-1.15
sys/external/bsd/drm2/dist/drm/i915/i915_gem.c: 1.23-1.27
sys/external/bsd/drm2/dist/drm/i915/i915_gem_execbuffer.c: 1.5
sys/external/bsd/drm2/dist/drm/i915/intel_display.c: 1.14, 1.15
sys/external/bsd/drm2/dist/drm/i915/intel_dp.c: 1.10
sys/external/bsd/drm2/dist/drm/i915/intel_drv.h: 1.8
sys/external/bsd/drm2/dist/drm/i915/intel_i2c.c: 1.8-1.13
sys/external/bsd/drm2/dist/drm/i915/intel_pm.c: 1.6
sys/external/bsd/drm2/dist/drm/i915/intel_ringbuffer.c: 1.5, 1.6
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/device/nouveau_engine_device_base.c: 1.4
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/fifo/nouveau_engine_fifo_nvc0.c: 1.3, 1.4
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/fifo/nouveau_engine_fifo_nve0.c: 1.3, 1.4
sys/external/bsd/drm2/dist/drm/nouveau/core/include/core/device.h: 1.4
sys/external/bsd/drm2/dist/drm/nouveau/core/include/subdev/mc.h: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/include/subdev/pwr.h: 1.3, 1.4
sys/external/bsd/drm2/dist/drm/nouveau/core/os.h: 1.4, 1.5
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/bios/nouveau_subdev_bios_base.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/bios/nouveau_subdev_bios_pll.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/clock/nouveau_subdev_clock_base.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/clock/nouveau_subdev_clock_nv50.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/devinit/fbmem.h: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/devinit/nouveau_subdev_devinit_nv04.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/fb/nouveau_subdev_fb_nv50.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/fb/nouveau_subdev_fb_nvc0.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/fb/nv50.h: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/fb/nvc0.h: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/mc/nouveau_subdev_mc_base.c: 1.2, 1.3
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/mxm/nouveau_subdev_mxm_nv50.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/pwr/nouveau_subdev_pwr_base.c: 1.3, 1.4
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/therm/nouveau_subdev_therm_ic.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/timer/nouveau_subdev_timer_nv04.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/vm/nouveau_subdev_vm_base.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/vm/nouveau_subdev_vm_nv04.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/vm/nouveau_subdev_vm_nv44.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/vm/nv04.h: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_bo.h: 1.3
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_drm.c: 1.4, 1.5
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_fbcon.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_nv50_display.c: 1.3
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_nv84_fence.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_ttm.c: 1.3
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_ttm.h: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_vga.h: 1.2
sys/external/bsd/drm2/dist/drm/radeon/radeon_fence.c: 1.6-1.8
sys/external/bsd/drm2/dist/drm/radeon/radeon_pm.c: 1.3
sys/external/bsd/drm2/dist/drm/radeon/rs400.c: 1.3
sys/external/bsd/drm2/dist/drm/via/via_dmablit.c: 1.3, 1.4
sys/external/bsd/drm2/dist/drm/via/via_drv.h: 1.3
sys/external/bsd/drm2/dist/drm/via/via_irq.c: 1.3, 1.4
sys/external/bsd/drm2/dist/drm/via/via_video.c: 1.3, 1.4
sys/external/bsd/drm2/dist/include/drm/drmP.h: 1.10
sys/external/bsd/drm2/dist/include/drm/drm_crtc.h: 1.4
sys/external/bsd/drm2/dist/include/drm/drm_modes.h: 1.3
sys/external/bsd/drm2/dist/uapi/drm/i915_drm.h: 1.2
sys/external/bsd/drm2/drm/drm_cache.c: 1.4-1.6
sys/external/bsd/drm2/drm/drm_drv.c: 1.14
sys/external/bsd/drm2/drm/drm_module.c: 1.10
sys/external/bsd/drm2/drm/drm_sysctl.c: 1.5
sys/external/bsd/drm2/drm/drm_vma_manager.c: 1.2
sys/external/bsd/drm2/drm/drmfb.c: 1.1
sys/external/bsd/drm2/drm/files.drmkms: 1.10, 1.11
sys/external/bsd/drm2/i2c/drm_encoder_slave.c: 1.1
sys/external/bsd/drm2/i915drm/files.i915drmkms: 1.7, 1.10
sys/external/bsd/drm2/i915drm/intelfb.c: 1.11, 1.12
sys/external/bsd/drm2/include/asm/io.h: 1.4
sys/external/bsd/drm2/include/asm/unaligned.h: 1.2, 1.3
sys/external/bsd/drm2/include/drm/drm_encoder_slave.h: 1.1
sys/external/bsd/drm2/include/drm/drm_wait_netbsd.h: 1.7-1.11
sys/external/bsd/drm2/include/drm/drmfb.h: 1.1
sys/external/bsd/drm2/include/drm/drmfb_pci.h: 1.1, 1.2
sys/external/bsd/drm2/include/linux/bitops.h: 1.9
sys/external/bsd/drm2/include/linux/i2c.h: 1.7, 1.8
sys/external/bsd/drm2/include/linux/io-mapping.h: 1.5
sys/external/bsd/drm2/include/linux/moduleparam.h: 1.5
sys/external/bsd/drm2/include/linux/pci.h: 1.12-1.15
sys/external/bsd/drm2/include/linux/pm.h: 1.4
sys/external/bsd/drm2/include/linux/reboot.h: 1.2
sys/external/bsd/drm2/include/linux/slab.h: 1.5
sys/external/bsd/drm2/include/linux/string.h: 1.4
sys/external/bsd/drm2/include/linux/vgaarb.h: 1.3
sys/external/bsd/drm2/include/linux/ww_mutex.h: 1.10
sys/external/bsd/drm2/linux/files.drmkms_linux: 1.8
sys/external/bsd/drm2/linux/linux_i2c.c: 1.3
sys/external/bsd/drm2/linux/linux_ww_mutex.c: 1.1
sys/external/bsd/drm2/nouveau/files.nouveau: 1.5-1.8
sys/external/bsd/drm2/nouveau/nouveau_pci.c: 1.1-1.3
sys/external/bsd/drm2/nouveau/nouveau_pci.h: 1.1
sys/external/bsd/drm2/nouveau/nouveau_sysfs.c: 1.1
sys/external/bsd/drm2/nouveau/nouveau_vga.c: 1.1
sys/external/bsd/drm2/nouveau/nouveaufb.c: 1.1
sys/external/bsd/drm2/nouveau/nouveaufb.h: 1.1
sys/external/bsd/drm2/pci/drm_pci.c: 1.10-1.12
sys/external/bsd/drm2/pci/drm_pci_module.c: 1.4
sys/external/bsd/drm2/pci/drmfb_pci.c: 1.1-1.3
sys/external/bsd/drm2/pci/files.drmkms_pci: 1.5
sys/external/bsd/drm2/radeon/radeon_pci.c: 1.5-1.7
sys/modules/drmkms/Makefile: 1.8, 1.9
sys/modules/drmkms_linux/Makefile: 1.6
sys/modules/drmkms_pci/Makefile: 1.5
sync drm2 with HEAD.
 1.4.18.1 10-Jun-2019  christos Sync with HEAD
 1.4.16.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.2 19-Dec-2021  riastradh Delete wrong linux/stringify.h.
 1.1 27-Aug-2018  riastradh branches: 1.1.2; 1.1.6;
local versions of headers required


Author: coypu <coypu@sdf.org>
Committer: Taylor R Campbell <riastradh@NetBSD.org>
 1.1.6.2 10-Jun-2019  christos Sync with HEAD
 1.1.6.1 27-Aug-2018  christos file stringify.h was added on branch phil-wifi on 2019-06-10 22:08:32 +0000
 1.1.2.2 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.1.2.1 27-Aug-2018  pgoyette file stringify.h was added on branch pgoyette-compat on 2018-09-06 06:56:36 +0000
 1.4 25-Oct-2022  riastradh linux/suspend.h: Stubs for (un)register_pm_notifier.
 1.3 19-Dec-2021  riastradh linux: Misc empty stubs for amdgpu.
 1.2 18-Mar-2014  riastradh branches: 1.2.4; 1.2.6; 1.2.10;
Merge riastradh-drm2 to HEAD.
 1.1 24-Jul-2013  riastradh branches: 1.1.2;
file suspend.h was initially added on branch riastradh-drm2.
 1.1.2.1 24-Jul-2013  riastradh Add stubs for Linux header files for drm.
 1.2.10.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.2.10.1 18-Mar-2014  tls file suspend.h was added on branch tls-maxphys on 2014-08-20 00:04:21 +0000
 1.2.6.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.2.6.1 18-Mar-2014  yamt file suspend.h was added on branch yamt-pagecache on 2014-05-22 11:40:56 +0000
 1.2.4.2 18-May-2014  rmind sync with head
 1.2.4.1 18-Mar-2014  rmind file suspend.h was added on branch rmind-smpnet on 2014-05-18 17:46:01 +0000
 1.2 18-Mar-2014  riastradh branches: 1.2.4; 1.2.6; 1.2.10;
Merge riastradh-drm2 to HEAD.
 1.1 24-Jul-2013  riastradh branches: 1.1.2;
file swap.h was initially added on branch riastradh-drm2.
 1.1.2.1 24-Jul-2013  riastradh Add stubs for Linux header files for drm.
 1.2.10.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.2.10.1 18-Mar-2014  tls file swap.h was added on branch tls-maxphys on 2014-08-20 00:04:21 +0000
 1.2.6.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.2.6.1 18-Mar-2014  yamt file swap.h was added on branch yamt-pagecache on 2014-05-22 11:40:56 +0000
 1.2.4.2 18-May-2014  rmind sync with head
 1.2.4.1 18-Mar-2014  rmind file swap.h was added on branch rmind-smpnet on 2014-05-18 17:46:01 +0000
 1.1 16-Jul-2014  riastradh branches: 1.1.2; 1.1.6;
First whack at radeon driver.

No hardware to test yet, but it builds.
 1.1.6.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.6.1 16-Jul-2014  tls file swiotlb.h was added on branch tls-maxphys on 2014-08-20 00:04:21 +0000
 1.1.2.2 10-Aug-2014  tls Rebase.
 1.1.2.1 16-Jul-2014  tls file swiotlb.h was added on branch tls-earlyentropy on 2014-08-10 06:55:39 +0000
 1.5 17-Jul-2022  riastradh linux: Add missing symbol namespacing for tasklet, sync_file.
 1.4 19-Dec-2021  riastradh Draft sync_file.
 1.3 19-Dec-2021  riastradh Work out sync file construction API.
 1.2 19-Dec-2021  riastradh <linux/sync_file.h> stubs.
 1.1 19-Dec-2021  riastradh Stub linux interval_tree_generic.h, mem_encrypt.h, sync_file.h.
 1.1 19-Dec-2021  riastradh Add some Linux header stubs.
 1.2 18-Mar-2014  riastradh branches: 1.2.4; 1.2.6; 1.2.10;
Merge riastradh-drm2 to HEAD.
 1.1 24-Jul-2013  riastradh branches: 1.1.2;
file sysfs.h was initially added on branch riastradh-drm2.
 1.1.2.1 24-Jul-2013  riastradh Add stubs for Linux header files for drm.
 1.2.10.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.2.10.1 18-Mar-2014  tls file sysfs.h was added on branch tls-maxphys on 2014-08-20 00:04:21 +0000
 1.2.6.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.2.6.1 18-Mar-2014  yamt file sysfs.h was added on branch yamt-pagecache on 2014-05-22 11:40:56 +0000
 1.2.4.2 18-May-2014  rmind sync with head
 1.2.4.1 18-Mar-2014  rmind file sysfs.h was added on branch rmind-smpnet on 2014-05-18 17:46:01 +0000
 1.3 16-Sep-2017  maya include linux/kernel.h (and thus sys/cdefs.h) for __unused
 1.2 18-Mar-2014  riastradh branches: 1.2.4; 1.2.6; 1.2.10;
Merge riastradh-drm2 to HEAD.
 1.1 24-Jul-2013  riastradh branches: 1.1.2;
file sysrq.h was initially added on branch riastradh-drm2.
 1.1.2.2 08-Sep-2013  riastradh Miscellaneous Linux header file crud.
 1.1.2.1 24-Jul-2013  riastradh Add stubs for Linux header files for drm.
 1.2.10.3 03-Dec-2017  jdolecek update from HEAD
 1.2.10.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.2.10.1 18-Mar-2014  tls file sysrq.h was added on branch tls-maxphys on 2014-08-20 00:04:21 +0000
 1.2.6.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.2.6.1 18-Mar-2014  yamt file sysrq.h was added on branch yamt-pagecache on 2014-05-22 11:40:56 +0000
 1.2.4.2 18-May-2014  rmind sync with head
 1.2.4.1 18-Mar-2014  rmind file sysrq.h was added on branch rmind-smpnet on 2014-05-18 17:46:01 +0000
 1.11 19-Dec-2021  riastradh drm: Make via build again.
 1.10 19-Dec-2021  riastradh Match linux side-loading


Author: Maya Rashish <maya@NetBSD.org>
Committer: Taylor R Campbell <riastradh@NetBSD.org>
 1.9 19-Dec-2021  riastradh provide USEC_PER_MSEC


Author: Maya Rashish <maya@NetBSD.org>
 1.8 19-Dec-2021  riastradh time_after32
 1.7 19-Dec-2021  riastradh Define NSEC_PER_SEC and side-load <linux/math64.h>.
 1.6 19-Dec-2021  riastradh struct timespec serves as a perfectly adequate struct timespec64.
 1.5 27-Aug-2018  riastradh Const parameter.
 1.4 27-Aug-2018  riastradh merge in old drm

better match linux del_timer_sync by returning something
(XXX return value?)


Author: coypu <coypu@sdf.org>
Committer: Taylor R Campbell <riastradh@NetBSD.org>
 1.3 16-Jul-2014  riastradh branches: 1.3.4; 1.3.28; 1.3.30;
Make it build and boot on my test machines.

Screen blanks on boot on the Ivy Bridge system with

DRM error in cpt_serr_int_handler: PCH transcoder A FIFO underrun

But after that everything is OK. Appears to be an upstream problem.
To investigate...

I think there's a cache flushing issue somewhere -- there are little
display artefacts on my T60.
 1.2 18-Mar-2014  riastradh branches: 1.2.2; 1.2.4; 1.2.6;
Merge riastradh-drm2 to HEAD.
 1.1 24-Jul-2013  riastradh branches: 1.1.2;
file time.h was initially added on branch riastradh-drm2.
 1.1.2.2 08-Sep-2013  riastradh More miscellaneous Linux header cruft. See patch for details.
 1.1.2.1 24-Jul-2013  riastradh Add <linux/time.h> with get_seconds, hacked to return time_t.
 1.2.6.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.2.6.1 18-Mar-2014  yamt file time.h was added on branch yamt-pagecache on 2014-05-22 11:40:56 +0000
 1.2.4.2 18-May-2014  rmind sync with head
 1.2.4.1 18-Mar-2014  rmind file time.h was added on branch rmind-smpnet on 2014-05-18 17:46:01 +0000
 1.2.2.1 10-Aug-2014  tls Rebase.
 1.3.30.1 10-Jun-2019  christos Sync with HEAD
 1.3.28.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.3.4.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.3.4.1 16-Jul-2014  tls file time.h was added on branch tls-maxphys on 2014-08-20 00:04:21 +0000
 1.17 19-Dec-2021  riastradh drm: Fix semantics of del_timer, del_timer_sync.
 1.16 19-Dec-2021  riastradh linux: Add del_timer return value.
 1.15 19-Dec-2021  riastradh linux: Fix return value of del_timer_sync.
 1.14 19-Dec-2021  riastradh drm: Eliminate hrtimer_destroy and teardown_timer.

These are non-Linux shims added to the Linux API to pair with
hrtimer_setup and setup_timer, but they really only serve to call
callout_destroy, which is not strictly necessary in the NetBSD API.
So although we lose a little bit of diagnostic help this way, we also
reduce diffs a bit and save some trouble that bit us last week.
 1.13 19-Dec-2021  riastradh Make intel_psr.c build
netbsd-ify
Stub out intel_lpe_audio.c (for now?).
Hammer intel_opregion.c into shape.
Hack up intel_lrc.c
Adapt intel_reset.c
Stub out intel_region_lmem.c
Adapt intel_ring_submission.c
Adapt intel_rps.c
Adapt intel_sdvo.c
Adapt intel_runtime_pm.c
Adapt intel_sideband.c
Adapt intel_sprite.c
Adapt intel_tv.c
Adapt intel_tc.c
Adapt intel_sseu.c
Adapt intel_timeline.c
Adapt intel_uc_fw.c and fix typo
Fix up intel_uncore.c
intel_vga.c
intel_wakeref.c
intel_vdsc.c
intel_wopcm.c
intel_workarounds.c
i915_globals.c
Fix up intelfb.c
Stub out intel_guc_log.c
Stub out intel_dsi_dcs_backlight.c
i915_perf.c
intel_hdmi.c
intel_hdcp.c


Author: Maya Rashish <maya@NetBSD.org>
Committer: Taylor R Campbell <riastradh@NetBSD.org>
 1.12 19-Dec-2021  riastradh linux: Fix timer_setup -- pass timer, not flags, as argument.
 1.11 19-Dec-2021  riastradh linux: Odds and ends.
 1.10 19-Dec-2021  riastradh Revert "Give up on finding how linux side-loads these"

Found it.
 1.9 19-Dec-2021  riastradh Match argument name, and uintptr_t has a size-match to void*, might be a better fit.


Author: Maya Rashish <maya@NetBSD.org>
 1.8 19-Dec-2021  riastradh Update Linux timer API from ulong cookie to container_of.
 1.7 13-Oct-2019  christos cast function pointer type. there is already an XXX there...
 1.6 27-Aug-2018  riastradh merge in old drm

better match linux del_timer_sync by returning something
(XXX return value?)


Author: coypu <coypu@sdf.org>
Committer: Taylor R Campbell <riastradh@NetBSD.org>
 1.5 26-Aug-2014  riastradh branches: 1.5.18; 1.5.20;
Add Linux timer_pending and del_timer.
 1.4 16-Jul-2014  riastradh branches: 1.4.2; 1.4.4;
Make it build and boot on my test machines.

Screen blanks on boot on the Ivy Bridge system with

DRM error in cpt_serr_int_handler: PCH transcoder A FIFO underrun

But after that everything is OK. Appears to be an upstream problem.
To investigate...

I think there's a cache flushing issue somewhere -- there are little
display artefacts on my T60.
 1.3 06-Jul-2014  riastradh Modify Linux timer API to add teardown_timer.

del_timer_sync does not actually destroy the timer so it can't be
reused again -- but Linux has no routine to do that. So we'll have
to add that in where appropriate.
 1.2 18-Mar-2014  riastradh branches: 1.2.2; 1.2.4; 1.2.6;
Merge riastradh-drm2 to HEAD.
 1.1 24-Jul-2013  riastradh branches: 1.1.2;
file timer.h was initially added on branch riastradh-drm2.
 1.1.2.4 08-Sep-2013  riastradh More miscellaneous Linux header cruft. See patch for details.
 1.1.2.3 24-Jul-2013  riastradh Bogus definition of round_jiffies_up in drm2 <linux/timer.h>.
 1.1.2.2 24-Jul-2013  riastradh Fix mod_timer to use absolute timeouts in <linux/timer.h>.
 1.1.2.1 24-Jul-2013  riastradh Implement a subset of Linux's struct timer_list with callouts.
 1.2.6.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.2.6.1 18-Mar-2014  yamt file timer.h was added on branch yamt-pagecache on 2014-05-22 11:40:56 +0000
 1.2.4.2 18-May-2014  rmind sync with head
 1.2.4.1 18-Mar-2014  rmind file timer.h was added on branch rmind-smpnet on 2014-05-18 17:46:01 +0000
 1.2.2.1 10-Aug-2014  tls Rebase.
 1.4.4.3 03-Dec-2017  jdolecek update from HEAD
 1.4.4.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.4.4.1 16-Jul-2014  tls file timer.h was added on branch tls-maxphys on 2014-08-20 00:04:21 +0000
 1.4.2.1 21-Sep-2014  snj Pull up following revision(s) (requested by riastradh in ticket #96):
sys/external/bsd/drm2/include/linux/timer.h: revision 1.5
Add Linux timer_pending and del_timer.
 1.5.20.2 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.5.20.1 10-Jun-2019  christos Sync with HEAD
 1.5.18.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.4 19-Dec-2021  riastradh linux: Define trace_*_enabled too, to return false.
 1.3 19-Dec-2021  riastradh DECLARE_EVENT_CLASS, DEFINE_EVENT stubs
 1.2 19-Dec-2021  riastradh trivial linux tracepoint macro stubs
 1.1 27-Aug-2018  riastradh branches: 1.1.2; 1.1.6;
local versions of headers required


Author: coypu <coypu@sdf.org>
Committer: Taylor R Campbell <riastradh@NetBSD.org>
 1.1.6.2 10-Jun-2019  christos Sync with HEAD
 1.1.6.1 27-Aug-2018  christos file tracepoint.h was added on branch phil-wifi on 2019-06-10 22:08:32 +0000
 1.1.2.2 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.1.2.1 27-Aug-2018  pgoyette file tracepoint.h was added on branch pgoyette-compat on 2018-09-06 06:56:36 +0000
 1.2 18-Mar-2014  riastradh branches: 1.2.4; 1.2.6; 1.2.10;
Merge riastradh-drm2 to HEAD.
 1.1 24-Jul-2013  riastradh branches: 1.1.2;
file tty.h was initially added on branch riastradh-drm2.
 1.1.2.1 24-Jul-2013  riastradh Add stubs for Linux header files for drm.
 1.2.10.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.2.10.1 18-Mar-2014  tls file tty.h was added on branch tls-maxphys on 2014-08-20 00:04:21 +0000
 1.2.6.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.2.6.1 18-Mar-2014  yamt file tty.h was added on branch yamt-pagecache on 2014-05-22 11:40:56 +0000
 1.2.4.2 18-May-2014  rmind sync with head
 1.2.4.1 18-Mar-2014  rmind file tty.h was added on branch rmind-smpnet on 2014-05-18 17:46:01 +0000
 1.10 19-Dec-2021  riastradh Move <linux/types.h> to common.
 1.9 27-Aug-2018  riastradh Add a copy of __user (empty) to <linux/types.h> for expedience.
 1.8 27-Aug-2018  riastradh Implement some of the Linux RCU API.
 1.7 27-Aug-2018  riastradh Add S*_C, U*_C.
 1.6 27-Aug-2018  riastradh Fix definition of DEFINE_BITMAP.
 1.5 27-Aug-2018  riastradh match linux side loading of headers

more bring in OLD drm code to unbreak the build
matching netbsd types etc. to get the build going


Author: coypu <coypu@sdf.org>
Committer: Taylor R Campbell <riastradh@NetBSD.org>
 1.4 16-Jul-2014  riastradh branches: 1.4.4; 1.4.28; 1.4.30;
First whack at radeon driver.

No hardware to test yet, but it builds.
 1.3 16-Jul-2014  riastradh Make it build and boot on my test machines.

Screen blanks on boot on the Ivy Bridge system with

DRM error in cpt_serr_int_handler: PCH transcoder A FIFO underrun

But after that everything is OK. Appears to be an upstream problem.
To investigate...

I think there's a cache flushing issue somewhere -- there are little
display artefacts on my T60.
 1.2 18-Mar-2014  riastradh branches: 1.2.2; 1.2.4; 1.2.6;
Merge riastradh-drm2 to HEAD.
 1.1 24-Jul-2013  riastradh branches: 1.1.2;
file types.h was initially added on branch riastradh-drm2.
 1.1.2.8 08-Sep-2013  riastradh More miscellaneous Linux header cruft. See patch for details.
 1.1.2.7 24-Jul-2013  riastradh Use bus_addr_t, not bus_size_t, for resource_size_t; add phys_addr_t.
 1.1.2.6 24-Jul-2013  riastradh Add __le16, __le32, and __le64 to <linux/types.h>.

As far as I'm aware, these aliases are correct, and the type doesn't
actually have any effect on the byte order of reads and writes.
 1.1.2.5 24-Jul-2013  riastradh Define cycles_t to be unsigned long long for now in <linux/types.h>.
 1.1.2.4 24-Jul-2013  riastradh Define resource_size_t to be bus_size_t in <linux/types.h>.
 1.1.2.3 24-Jul-2013  riastradh Add u64, s8, s16, s32, and s64 to <linux/types.h>.
 1.1.2.2 24-Jul-2013  riastradh Add types u8, u16, u32 to drm2's <linux/types.h> shim.
 1.1.2.1 24-Jul-2013  riastradh Add stubs for Linux header files for drm.
 1.2.6.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.2.6.1 18-Mar-2014  yamt file types.h was added on branch yamt-pagecache on 2014-05-22 11:40:56 +0000
 1.2.4.2 18-May-2014  rmind sync with head
 1.2.4.1 18-Mar-2014  rmind file types.h was added on branch rmind-smpnet on 2014-05-18 17:46:01 +0000
 1.2.2.1 10-Aug-2014  tls Rebase.
 1.4.30.1 10-Jun-2019  christos Sync with HEAD
 1.4.28.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.4.4.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.4.4.1 16-Jul-2014  tls file types.h was added on branch tls-maxphys on 2014-08-20 00:04:21 +0000
 1.2 18-Mar-2014  riastradh branches: 1.2.4; 1.2.6; 1.2.10;
Merge riastradh-drm2 to HEAD.
 1.1 24-Jul-2013  riastradh branches: 1.1.2;
file uaccess.h was initially added on branch riastradh-drm2.
 1.1.2.2 24-Jul-2013  riastradh Define copy_{to,from}_user in <linux/uaccess.h> & <asm/uaccess.h>.
 1.1.2.1 24-Jul-2013  riastradh Add stubs for Linux header files for drm.
 1.2.10.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.2.10.1 18-Mar-2014  tls file uaccess.h was added on branch tls-maxphys on 2014-08-20 00:04:21 +0000
 1.2.6.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.2.6.1 18-Mar-2014  yamt file uaccess.h was added on branch yamt-pagecache on 2014-05-22 11:40:56 +0000
 1.2.4.2 18-May-2014  rmind sync with head
 1.2.4.1 18-Mar-2014  rmind file uaccess.h was added on branch rmind-smpnet on 2014-05-18 17:46:01 +0000
 1.2 18-Mar-2014  riastradh branches: 1.2.4; 1.2.6; 1.2.10;
Merge riastradh-drm2 to HEAD.
 1.1 24-Jul-2013  riastradh branches: 1.1.2;
file uidgid.h was initially added on branch riastradh-drm2.
 1.1.2.1 24-Jul-2013  riastradh Add shim <linux/uidgid.h>.
 1.2.10.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.2.10.1 18-Mar-2014  tls file uidgid.h was added on branch tls-maxphys on 2014-08-20 00:04:21 +0000
 1.2.6.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.2.6.1 18-Mar-2014  yamt file uidgid.h was added on branch yamt-pagecache on 2014-05-22 11:40:56 +0000
 1.2.4.2 18-May-2014  rmind sync with head
 1.2.4.1 18-Mar-2014  rmind file uidgid.h was added on branch rmind-smpnet on 2014-05-18 17:46:01 +0000
 1.4 19-Dec-2021  riastradh i915: another whack at it
 1.3 19-Dec-2021  riastradh i915: Adapt i915_perf.c.
 1.2 19-Dec-2021  riastradh Define UUID_STRING_LEN.
 1.1 19-Dec-2021  riastradh Bunch more Linux header file stubs.
 1.1 19-Dec-2021  riastradh Add some Linux header stubs.
 1.4 19-Dec-2021  riastradh linux: Misc empty stubs for amdgpu.
 1.3 19-Dec-2021  riastradh Trivial vga_switcheroo stub.
 1.2 18-Mar-2014  riastradh branches: 1.2.4; 1.2.6; 1.2.10;
Merge riastradh-drm2 to HEAD.
 1.1 24-Jul-2013  riastradh branches: 1.1.2;
file vga_switcheroo.h was initially added on branch riastradh-drm2.
 1.1.2.1 24-Jul-2013  riastradh Add stubs for Linux header files for drm.
 1.2.10.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.2.10.1 18-Mar-2014  tls file vga_switcheroo.h was added on branch tls-maxphys on 2014-08-20 00:04:21 +0000
 1.2.6.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.2.6.1 18-Mar-2014  yamt file vga_switcheroo.h was added on branch yamt-pagecache on 2014-05-22 11:40:56 +0000
 1.2.4.2 18-May-2014  rmind sync with head
 1.2.4.1 18-Mar-2014  rmind file vga_switcheroo.h was added on branch rmind-smpnet on 2014-05-18 17:46:01 +0000
 1.4 19-Dec-2021  riastradh stub vga_remove_vgacon


Author: Maya Rashish <maya@NetBSD.org>
 1.3 25-Feb-2015  riastradh <linux/vgaarb.h> needs <sys/types.h> and <sys/errno.h>.
 1.2 18-Mar-2014  riastradh branches: 1.2.4; 1.2.6; 1.2.8; 1.2.10; 1.2.12;
Merge riastradh-drm2 to HEAD.
 1.1 24-Jul-2013  riastradh branches: 1.1.2;
file vgaarb.h was initially added on branch riastradh-drm2.
 1.1.2.2 24-Jul-2013  riastradh Add dummy vga_client_register stub to <linux/vgaarb.h>.
 1.1.2.1 24-Jul-2013  riastradh Add stubs for Linux header files for drm.
 1.2.12.1 06-Apr-2015  skrll Sync with HEAD
 1.2.10.3 03-Dec-2017  jdolecek update from HEAD
 1.2.10.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.2.10.1 18-Mar-2014  tls file vgaarb.h was added on branch tls-maxphys on 2014-08-20 00:04:21 +0000
 1.2.8.1 06-Mar-2015  snj Pull up following revision(s) (requested by mrg in ticket #573):
sys/external/bsd/common/include/linux/kernel.h: 1.5, 1.6
sys/external/bsd/drm2/dist/drm/drm_ioctl.c: 1.4
sys/external/bsd/drm2/dist/drm/drm_irq.c: 1.6-1.8
sys/external/bsd/drm2/dist/drm/i915/i915_dma.c: 1.13-1.15
sys/external/bsd/drm2/dist/drm/i915/i915_gem.c: 1.23-1.27
sys/external/bsd/drm2/dist/drm/i915/i915_gem_execbuffer.c: 1.5
sys/external/bsd/drm2/dist/drm/i915/intel_display.c: 1.14, 1.15
sys/external/bsd/drm2/dist/drm/i915/intel_dp.c: 1.10
sys/external/bsd/drm2/dist/drm/i915/intel_drv.h: 1.8
sys/external/bsd/drm2/dist/drm/i915/intel_i2c.c: 1.8-1.13
sys/external/bsd/drm2/dist/drm/i915/intel_pm.c: 1.6
sys/external/bsd/drm2/dist/drm/i915/intel_ringbuffer.c: 1.5, 1.6
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/device/nouveau_engine_device_base.c: 1.4
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/fifo/nouveau_engine_fifo_nvc0.c: 1.3, 1.4
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/fifo/nouveau_engine_fifo_nve0.c: 1.3, 1.4
sys/external/bsd/drm2/dist/drm/nouveau/core/include/core/device.h: 1.4
sys/external/bsd/drm2/dist/drm/nouveau/core/include/subdev/mc.h: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/include/subdev/pwr.h: 1.3, 1.4
sys/external/bsd/drm2/dist/drm/nouveau/core/os.h: 1.4, 1.5
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/bios/nouveau_subdev_bios_base.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/bios/nouveau_subdev_bios_pll.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/clock/nouveau_subdev_clock_base.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/clock/nouveau_subdev_clock_nv50.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/devinit/fbmem.h: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/devinit/nouveau_subdev_devinit_nv04.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/fb/nouveau_subdev_fb_nv50.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/fb/nouveau_subdev_fb_nvc0.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/fb/nv50.h: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/fb/nvc0.h: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/mc/nouveau_subdev_mc_base.c: 1.2, 1.3
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/mxm/nouveau_subdev_mxm_nv50.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/pwr/nouveau_subdev_pwr_base.c: 1.3, 1.4
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/therm/nouveau_subdev_therm_ic.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/timer/nouveau_subdev_timer_nv04.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/vm/nouveau_subdev_vm_base.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/vm/nouveau_subdev_vm_nv04.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/vm/nouveau_subdev_vm_nv44.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/vm/nv04.h: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_bo.h: 1.3
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_drm.c: 1.4, 1.5
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_fbcon.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_nv50_display.c: 1.3
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_nv84_fence.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_ttm.c: 1.3
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_ttm.h: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_vga.h: 1.2
sys/external/bsd/drm2/dist/drm/radeon/radeon_fence.c: 1.6-1.8
sys/external/bsd/drm2/dist/drm/radeon/radeon_pm.c: 1.3
sys/external/bsd/drm2/dist/drm/radeon/rs400.c: 1.3
sys/external/bsd/drm2/dist/drm/via/via_dmablit.c: 1.3, 1.4
sys/external/bsd/drm2/dist/drm/via/via_drv.h: 1.3
sys/external/bsd/drm2/dist/drm/via/via_irq.c: 1.3, 1.4
sys/external/bsd/drm2/dist/drm/via/via_video.c: 1.3, 1.4
sys/external/bsd/drm2/dist/include/drm/drmP.h: 1.10
sys/external/bsd/drm2/dist/include/drm/drm_crtc.h: 1.4
sys/external/bsd/drm2/dist/include/drm/drm_modes.h: 1.3
sys/external/bsd/drm2/dist/uapi/drm/i915_drm.h: 1.2
sys/external/bsd/drm2/drm/drm_cache.c: 1.4-1.6
sys/external/bsd/drm2/drm/drm_drv.c: 1.14
sys/external/bsd/drm2/drm/drm_module.c: 1.10
sys/external/bsd/drm2/drm/drm_sysctl.c: 1.5
sys/external/bsd/drm2/drm/drm_vma_manager.c: 1.2
sys/external/bsd/drm2/drm/drmfb.c: 1.1
sys/external/bsd/drm2/drm/files.drmkms: 1.10, 1.11
sys/external/bsd/drm2/i2c/drm_encoder_slave.c: 1.1
sys/external/bsd/drm2/i915drm/files.i915drmkms: 1.7, 1.10
sys/external/bsd/drm2/i915drm/intelfb.c: 1.11, 1.12
sys/external/bsd/drm2/include/asm/io.h: 1.4
sys/external/bsd/drm2/include/asm/unaligned.h: 1.2, 1.3
sys/external/bsd/drm2/include/drm/drm_encoder_slave.h: 1.1
sys/external/bsd/drm2/include/drm/drm_wait_netbsd.h: 1.7-1.11
sys/external/bsd/drm2/include/drm/drmfb.h: 1.1
sys/external/bsd/drm2/include/drm/drmfb_pci.h: 1.1, 1.2
sys/external/bsd/drm2/include/linux/bitops.h: 1.9
sys/external/bsd/drm2/include/linux/i2c.h: 1.7, 1.8
sys/external/bsd/drm2/include/linux/io-mapping.h: 1.5
sys/external/bsd/drm2/include/linux/moduleparam.h: 1.5
sys/external/bsd/drm2/include/linux/pci.h: 1.12-1.15
sys/external/bsd/drm2/include/linux/pm.h: 1.4
sys/external/bsd/drm2/include/linux/reboot.h: 1.2
sys/external/bsd/drm2/include/linux/slab.h: 1.5
sys/external/bsd/drm2/include/linux/string.h: 1.4
sys/external/bsd/drm2/include/linux/vgaarb.h: 1.3
sys/external/bsd/drm2/include/linux/ww_mutex.h: 1.10
sys/external/bsd/drm2/linux/files.drmkms_linux: 1.8
sys/external/bsd/drm2/linux/linux_i2c.c: 1.3
sys/external/bsd/drm2/linux/linux_ww_mutex.c: 1.1
sys/external/bsd/drm2/nouveau/files.nouveau: 1.5-1.8
sys/external/bsd/drm2/nouveau/nouveau_pci.c: 1.1-1.3
sys/external/bsd/drm2/nouveau/nouveau_pci.h: 1.1
sys/external/bsd/drm2/nouveau/nouveau_sysfs.c: 1.1
sys/external/bsd/drm2/nouveau/nouveau_vga.c: 1.1
sys/external/bsd/drm2/nouveau/nouveaufb.c: 1.1
sys/external/bsd/drm2/nouveau/nouveaufb.h: 1.1
sys/external/bsd/drm2/pci/drm_pci.c: 1.10-1.12
sys/external/bsd/drm2/pci/drm_pci_module.c: 1.4
sys/external/bsd/drm2/pci/drmfb_pci.c: 1.1-1.3
sys/external/bsd/drm2/pci/files.drmkms_pci: 1.5
sys/external/bsd/drm2/radeon/radeon_pci.c: 1.5-1.7
sys/modules/drmkms/Makefile: 1.8, 1.9
sys/modules/drmkms_linux/Makefile: 1.6
sys/modules/drmkms_pci/Makefile: 1.5
sync drm2 with HEAD.
 1.2.6.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.2.6.1 18-Mar-2014  yamt file vgaarb.h was added on branch yamt-pagecache on 2014-05-22 11:40:56 +0000
 1.2.4.2 18-May-2014  rmind sync with head
 1.2.4.1 18-Mar-2014  rmind file vgaarb.h was added on branch rmind-smpnet on 2014-05-18 17:46:01 +0000
 1.12 26-Feb-2022  rillig drm2: do not try to return a value from a void function

lint complained:
vmalloc.h(79): error: void function vfree cannot return value [213]

No functional change.
 1.11 19-Dec-2021  riastradh linux: Use kmem directly for Linux kmalloc.

Take advantage of this to do LOCKDEBUG_MEM_CHECK at the point of
kfree_rcu rather than in the RCU GC thread.
 1.10 19-Dec-2021  riastradh Side-load <linux/mm.h> in a few places.
 1.9 19-Dec-2021  riastradh Stub vmap purge notifiers.
 1.8 19-Dec-2021  riastradh Define Linux array_size function and expose via vmalloc.h.
 1.7 27-Aug-2018  riastradh Linux vfree accepts NULL as noop. Match semantics.

From mrg@.
 1.6 27-Aug-2018  riastradh Implement kvfree by free(9); assume kmalloc/vmalloc use malloc(9).
 1.5 06-Aug-2018  riastradh Use uvm_km_alloc(kernel_map) and pmap_kenter, not uvm_pagermapin.

XXX pullup
 1.4 23-Aug-2014  riastradh branches: 1.4.12; 1.4.18; 1.4.20;
Another round of nouveau whack-a-mole.
 1.3 16-Jul-2014  riastradh branches: 1.3.2; 1.3.4;
Make it build and boot on my test machines.

Screen blanks on boot on the Ivy Bridge system with

DRM error in cpt_serr_int_handler: PCH transcoder A FIFO underrun

But after that everything is OK. Appears to be an upstream problem.
To investigate...

I think there's a cache flushing issue somewhere -- there are little
display artefacts on my T60.
 1.2 18-Mar-2014  riastradh branches: 1.2.2; 1.2.4; 1.2.6;
Merge riastradh-drm2 to HEAD.
 1.1 24-Jul-2013  riastradh branches: 1.1.2;
file vmalloc.h was initially added on branch riastradh-drm2.
 1.1.2.3 24-Jul-2013  riastradh Add vzalloc to <linux/vmalloc.h>.
 1.1.2.2 24-Jul-2013  riastradh Implement vmalloc_user and vfree with malloc(9) in <linux/vmalloc.h>.

XXX Probably not the right thing here -- uvm_km_alloc is probably
more appropriate, but Linux doesn't pass the size to vfree, so this
is more expedient for now.
 1.1.2.1 24-Jul-2013  riastradh Add stubs for Linux header files for drm.
 1.2.6.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.2.6.1 18-Mar-2014  yamt file vmalloc.h was added on branch yamt-pagecache on 2014-05-22 11:40:56 +0000
 1.2.4.2 18-May-2014  rmind sync with head
 1.2.4.1 18-Mar-2014  rmind file vmalloc.h was added on branch rmind-smpnet on 2014-05-18 17:46:01 +0000
 1.2.2.1 10-Aug-2014  tls Rebase.
 1.3.4.3 03-Dec-2017  jdolecek update from HEAD
 1.3.4.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.3.4.1 16-Jul-2014  tls file vmalloc.h was added on branch tls-maxphys on 2014-08-20 00:04:21 +0000
 1.3.2.1 21-Sep-2014  snj Pull up following revision(s) (requested by riastradh in ticket #95):
sys/external/bsd/drm2/dist/drm/nouveau/core/include/subdev/fb.h: revision 1.2
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_nv10_fence.c: revision 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/bar/nouveau_subdev_bar_base.c: revision 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/include/engine/device.h: revision 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/include/subdev/pwr.h: revision 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/nouveau_engine_xtensa.c: revision 1.2
sys/external/bsd/drm2/include/linux/bitops.h: revision 1.8
sys/external/bsd/drm2/dist/drm/nouveau/dispnv04/nouveau_dispnv04_tvnv17.c: revision 1.3
sys/external/bsd/drm2/dist/drm/nouveau/dispnv04/nouveau_dispnv04_tvmodesnv17.c: revision 1.3
sys/external/bsd/drm2/dist/drm/nouveau/core/include/core/device.h: revision 1.3
sys/external/bsd/drm2/include/drm/drm_agp_netbsd.h: revision 1.4
sys/external/bsd/drm2/include/linux/spinlock.h: revision 1.4
sys/external/bsd/drm2/include/linux/pm_runtime.h: revision 1.3
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/crypt/nouveau_engine_crypt_nv98.c: revision 1.2
sys/external/bsd/drm2/nouveau/files.nouveau: revision 1.3
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/disp/nouveau_engine_disp_dacnv50.c: revision 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/fifo/nouveau_engine_fifo_nve0.c: revision 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/disp/nouveau_engine_disp_nv50.c: revision 1.2
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_gem.c: revision 1.3
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_bo.c: revision 1.5
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/perfmon/nouveau_engine_perfmon_base.c: revision 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/crypt/nouveau_engine_crypt_nv84.c: revision 1.2
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_fence.c: revision 1.3
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/graph/nouveau_engine_graph_nv50.c: revision 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/fifo/nouveau_engine_fifo_nvc0.c: revision 1.2
sys/external/bsd/drm2/include/linux/vmalloc.h: revision 1.4
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/fifo/nve0.h: revision 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/instmem/nv04.h: revision 1.2
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_drm.c: revision 1.3
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_drm.h: revision 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/fifo/nouveau_engine_fifo_base.c: revision 1.3
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/disp/nouveau_engine_disp_nvd0.c: revision 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/disp/nouveau_engine_disp_nv04.c: revision 1.2
sys/external/bsd/drm2/nouveau/nouveau_module.c: revision 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/instmem/nouveau_subdev_instmem_nv40.c: revision 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/graph/nouveau_engine_graph_gm107.c: revision 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/graph/nouveau_engine_graph_ctxnvd7.c: revision 1.2
sys/external/bsd/drm2/include/linux/mutex.h: revision 1.7
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/disp/nv50.h: revision 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/device/nouveau_engine_device_base.c: revision 1.3
sys/external/bsd/drm2/include/linux/i2c.h: revision 1.6
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/graph/nouveau_engine_graph_nvc0.c: revision 1.2
sys/external/bsd/drm2/include/linux/pagemap.h: revision 1.3
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/instmem/nouveau_subdev_instmem_nv04.c: revision 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/copy/nouveau_engine_copy_nva3.c: revision 1.2
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_nv50_display.c: revision 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/include/subdev/bar.h: revision 1.3
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/pwr/nouveau_subdev_pwr_base.c: revision 1.2
Another round of nouveau whack-a-mole.
 1.4.20.1 10-Jun-2019  christos Sync with HEAD
 1.4.18.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.4.12.1 31-Aug-2018  martin Pull up following revision(s) (requested by riastradh in ticket #997):

sys/external/bsd/drm2/i915drm/intel_gtt.c: revision 1.6
sys/external/bsd/drm2/include/linux/delay.h: revision 1.5
sys/external/bsd/common/include/linux/kernel.h: revision 1.9
sys/external/bsd/drm2/include/linux/vmalloc.h: revision 1.5
sys/external/bsd/drm2/include/linux/bitops.h: revision 1.12
sys/external/bsd/drm2/include/linux/bitops.h: revision 1.13

hweight32 should take uint32_t, not uint16_t. OOPS.
XXX pullup

Fix find_first_zero_bit to find the high bits of 64-bit words...oops.
XXX pullup

Use uvm_km_alloc(kernel_map) and pmap_kenter, not uvm_pagermapin.
XXX pullup

Flush chipset writes after GGTT update.

Echoes Linux commit:

commit 8516673a996870ea0ceb337ee4f83c33c5ec3111
Author: Chris Wilson <chris%chris-wilson.co.uk@localhost>
Date: Fri Dec 8 21:46:16 2017 +0000
agp/intel: Flush all chipset writes after updating the GGTT
Before accessing the GGTT we must flush the PTE writes and make them
visible to the chipset, or else the indirect access may end up in the
wrong page. In commit 3497971a71d8 ("agp/intel: Flush chipset writes
after updating a single PTE"), we noticed corruption of the uploads for
pwrite and for capturing GPU error states, but it was presumed that the
explicit calls to intel_gtt_chipset_flush() were sufficient for the
execbuffer path. However, we have not been flushing the chipset between
the PTE writes and access via the GTT itself.
For simplicity, do the flush after any PTE update rather than try and
batch the flushes on a just-in-time basis.
References: 3497971a71d8 ("agp/intel: Flush chipset writes after updating a single PTE")
Signed-off-by: Chris Wilson <chris%chris-wilson.co.uk@localhost>
Cc: Tvrtko Ursulin <tvrtko.ursulin%intel.com@localhost>
Cc: Mika Kuoppala <mika.kuoppala%intel.com@localhost>
Cc: drm-intel-fixes%lists.freedesktop.org@localhost
Reviewed-by: Joonas Lahtinen <joonas.lahtinen%linux.intel.com@localhost>
Link: https://patchwork.freedesktop.org/patch/msgid/20171208214616.30147-1-chris%chris-wilson.co.uk@localhost

XXX pullup


Round nsec up for usec delay.
XXX pullup


libkern min/max is 32-bit. Linux min/max is generic. @!*#@!$&
XXX pullup
 1.1 27-Aug-2018  riastradh branches: 1.1.2; 1.1.6;
local versions of headers required


Author: coypu <coypu@sdf.org>
Committer: Taylor R Campbell <riastradh@NetBSD.org>
 1.1.6.2 10-Jun-2019  christos Sync with HEAD
 1.1.6.1 27-Aug-2018  christos file vt.h was added on branch phil-wifi on 2019-06-10 22:08:32 +0000
 1.1.2.2 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.1.2.1 27-Aug-2018  pgoyette file vt.h was added on branch pgoyette-compat on 2018-09-06 06:56:36 +0000
 1.2 18-Mar-2014  riastradh branches: 1.2.4; 1.2.6; 1.2.10;
Merge riastradh-drm2 to HEAD.
 1.1 24-Jul-2013  riastradh branches: 1.1.2;
file wait.h was initially added on branch riastradh-drm2.
 1.1.2.1 24-Jul-2013  riastradh Add stubs for Linux header files for drm.
 1.2.10.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.2.10.1 18-Mar-2014  tls file wait.h was added on branch tls-maxphys on 2014-08-20 00:04:21 +0000
 1.2.6.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.2.6.1 18-Mar-2014  yamt file wait.h was added on branch yamt-pagecache on 2014-05-22 11:40:56 +0000
 1.2.4.2 18-May-2014  rmind sync with head
 1.2.4.1 18-Mar-2014  rmind file wait.h was added on branch rmind-smpnet on 2014-05-18 17:46:01 +0000
 1.4 19-Dec-2021  riastradh linux: Fix wait_bit semantics.

- wait_on_bit is supposed to wait until the bit is cleared, not set.

- wait_on_bit_timeout is supposed to return 0 on success, -EAGAIN on
faiure.

Omit wake_up_bit; nothing uses it and clear_and_wake_up_bit is a more
semantically coherent operation.
 1.3 19-Dec-2021  riastradh linux: Add clear_and_wake_up_bit.
 1.2 19-Dec-2021  riastradh wait_on_bit
 1.1 19-Dec-2021  riastradh linux/wait_bit.h
 1.5 24-Feb-2016  skrll Move linux_work.c and workqueue.h from sys/external/bsd/drm2 to
sys/external/common so that they can be used by others.

LGTM from riastradh@

These should really live outside sys/external, but that can be decided
later
 1.4 16-Jul-2014  riastradh branches: 1.4.2; 1.4.4; 1.4.6; 1.4.10;
First whack at radeon driver.

No hardware to test yet, but it builds.
 1.3 16-Jul-2014  riastradh Make it build and boot on my test machines.

Screen blanks on boot on the Ivy Bridge system with

DRM error in cpt_serr_int_handler: PCH transcoder A FIFO underrun

But after that everything is OK. Appears to be an upstream problem.
To investigate...

I think there's a cache flushing issue somewhere -- there are little
display artefacts on my T60.
 1.2 18-Mar-2014  riastradh branches: 1.2.2; 1.2.4; 1.2.6;
Merge riastradh-drm2 to HEAD.
 1.1 24-Jul-2013  riastradh branches: 1.1.2;
file workqueue.h was initially added on branch riastradh-drm2.
 1.1.2.12 30-Dec-2013  riastradh Add flush_scheduled_work back.
 1.1.2.11 30-Dec-2013  riastradh First (plausible) draft of Linux workqueue implementation rework.

Untested, but this looks better than what was there before, or any of
the drafts leading up to this which got torn out of the typewriter,
crumpled up, and crudely tossed in frustration toward the wastepaper
basket by my desk alongside the empty bottles of Jack Daniels that
fueled them, or something like that.

Can't use multiple CPUs per workqueue. That requires some explicit
management of per-CPU workqueue state, since NetBSD's workqueue(9)
doesn't provide that or cancellation or flushing. Oops.
 1.1.2.10 08-Sep-2013  riastradh Rework Linux `work' to use NetBSD workqueues, not callouts.

Callers expect to be able to allocate in the workers, which callouts
don't allow.

Delayed work uses callouts only to delay enqueueing work.

Linux `workqueues' are still stubs.
 1.1.2.9 08-Sep-2013  riastradh Buncha new cruft for <linux/*.h>.
 1.1.2.8 08-Sep-2013  riastradh Rename delayed_work::dw_work to delayed_work::work for Linux source.
 1.1.2.7 24-Jul-2013  riastradh Use a non-NULL value for bogus <linux/workqueue.h> stubs.
 1.1.2.6 24-Jul-2013  riastradh Add stubs for flush_workqueue and flush_scheduled_work that warn.
 1.1.2.5 24-Jul-2013  riastradh Add kludgey non-delayed work to <linux/workqueue.h>.
 1.1.2.4 24-Jul-2013  riastradh Fix signature of INIT_DELAYED_WORK.
 1.1.2.3 24-Jul-2013  riastradh Little pseudo-fixes for untested bogus delayed_work implementation.
 1.1.2.2 24-Jul-2013  riastradh Add callout-based delayed_work implementation to <linux/workqueue.h>.
 1.1.2.1 24-Jul-2013  riastradh Add stubs for Linux header files for drm.
 1.2.6.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.2.6.1 18-Mar-2014  yamt file workqueue.h was added on branch yamt-pagecache on 2014-05-22 11:40:56 +0000
 1.2.4.2 18-May-2014  rmind sync with head
 1.2.4.1 18-Mar-2014  rmind file workqueue.h was added on branch rmind-smpnet on 2014-05-18 17:46:01 +0000
 1.2.2.1 10-Aug-2014  tls Rebase.
 1.4.10.1 06-Sep-2016  skrll First pass at netbsd-7 updated with USB code from HEAD
 1.4.6.1 19-Mar-2016  skrll Sync with HEAD
 1.4.4.3 03-Dec-2017  jdolecek update from HEAD
 1.4.4.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.4.4.1 16-Jul-2014  tls file workqueue.h was added on branch tls-maxphys on 2014-08-20 00:04:21 +0000
 1.4.2.1 05-Apr-2017  snj Pull up following revision(s) (requested by skrll in ticket #1395):
share/man/man4/axe.4: netbsd-7-nhusb
share/man/man4/axen.4: netbsd-7-nhusb
share/man/man4/cdce.4: netbsd-7-nhusb
share/man/man4/uaudio.4: netbsd-7-nhusb
share/man/man4/ucom.4: netbsd-7-nhusb
share/man/man4/uep.4: netbsd-7-nhusb
share/man/man4/urtw.4: netbsd-7-nhusb
share/man/man4/usb.4: netbsd-7-nhusb
share/man/man4/uyap.4: netbsd-7-nhusb
share/man/man4/xhci.4: netbsd-7-nhusb
share/man/man9/usbdi.9: netbsd-7-nhusb
sys/arch/amd64/conf/ALL: netbsd-7-nhusb
sys/arch/amd64/conf/GENERIC: netbsd-7-nhusb
sys/arch/amiga/dev/slhci_zbus.c: netbsd-7-nhusb
sys/arch/arm/allwinner/awin_otg.c: netbsd-7-nhusb
sys/arch/arm/allwinner/awin_usb.c: netbsd-7-nhusb
sys/arch/arm/amlogic/amlogic_dwctwo.c: netbsd-7-nhusb
sys/arch/arm/at91/at91ohci.c: netbsd-7-nhusb
sys/arch/arm/broadcom/bcm2835_dwctwo.c: netbsd-7-nhusb
sys/arch/arm/broadcom/bcm53xx_usb.c: netbsd-7-nhusb
sys/arch/arm/ep93xx/epohci.c: netbsd-7-nhusb
sys/arch/arm/gemini/obio_ehci.c: netbsd-7-nhusb
sys/arch/arm/imx/files.imx23: netbsd-7-nhusb
sys/arch/arm/imx/imxusb.c: netbsd-7-nhusb
sys/arch/arm/imx/imxusbreg.h: netbsd-7-nhusb
sys/arch/arm/omap/obio_ohci.c: netbsd-7-nhusb
sys/arch/arm/omap/omap3_ehci.c: netbsd-7-nhusb
sys/arch/arm/omap/omapl1x_ohci.c: netbsd-7-nhusb
sys/arch/arm/omap/tiotg.c: netbsd-7-nhusb
sys/arch/arm/s3c2xx0/ohci_s3c24x0.c: netbsd-7-nhusb
sys/arch/arm/samsung/exynos_usb.c: netbsd-7-nhusb
sys/arch/arm/xscale/pxa2x0_ohci.c: netbsd-7-nhusb
sys/arch/arm/zynq/zynq_usb.c: netbsd-7-nhusb
sys/arch/hpcarm/dev/nbp_slhci.c: netbsd-7-nhusb
sys/arch/hpcmips/dev/plumohci.c: netbsd-7-nhusb
sys/arch/i386/conf/ALL: netbsd-7-nhusb
sys/arch/i386/conf/GENERIC: netbsd-7-nhusb
sys/arch/i386/pci/gcscehci.c: netbsd-7-nhusb
sys/arch/luna68k/conf/GENERIC: netbsd-7-nhusb
sys/arch/mips/adm5120/dev/ahci.c: netbsd-7-nhusb
sys/arch/mips/adm5120/dev/ahcivar.h: netbsd-7-nhusb
sys/arch/mips/alchemy/dev/ohci_aubus.c: netbsd-7-nhusb
sys/arch/mips/atheros/dev/ehci_arbus.c: netbsd-7-nhusb
sys/arch/mips/atheros/dev/ohci_arbus.c: netbsd-7-nhusb
sys/arch/mips/conf/files.adm5120: netbsd-7-nhusb
sys/arch/mips/ralink/ralink_ehci.c: netbsd-7-nhusb
sys/arch/mips/ralink/ralink_ohci.c: netbsd-7-nhusb
sys/arch/mips/rmi/rmixl_ehci.c: netbsd-7-nhusb
sys/arch/mips/rmi/rmixl_ohci.c: netbsd-7-nhusb
sys/arch/playstation2/dev/ohci_sbus.c: netbsd-7-nhusb
sys/arch/powerpc/booke/dev/pq3ehci.c: netbsd-7-nhusb
sys/arch/powerpc/ibm4xx/dev/dwctwo_plb.c: netbsd-7-nhusb
sys/arch/x68k/dev/slhci_intio.c: netbsd-7-nhusb
sys/conf/files: netbsd-7-nhusb
sys/dev/cardbus/ehci_cardbus.c: netbsd-7-nhusb
sys/dev/cardbus/ohci_cardbus.c: netbsd-7-nhusb
sys/dev/cardbus/uhci_cardbus.c: netbsd-7-nhusb
sys/dev/ic/sl811hs.c: netbsd-7-nhusb
sys/dev/ic/sl811hsvar.h: netbsd-7-nhusb
sys/dev/isa/slhci_isa.c: netbsd-7-nhusb
sys/dev/marvell/ehci_mv.c: netbsd-7-nhusb
sys/dev/pci/ehci_pci.c: netbsd-7-nhusb
sys/dev/pci/ohci_pci.c: netbsd-7-nhusb
sys/dev/pci/uhci_pci.c: netbsd-7-nhusb
sys/dev/pci/xhci_pci.c: netbsd-7-nhusb
sys/dev/pcmcia/slhci_pcmcia.c: netbsd-7-nhusb
sys/dev/usb/Makefile.usbdevs: netbsd-7-nhusb
sys/dev/usb/TODO: netbsd-7-nhusb
sys/dev/usb/TODO.usbmp: netbsd-7-nhusb
sys/dev/usb/aubtfwl.c: netbsd-7-nhusb
sys/dev/usb/auvitek.c: netbsd-7-nhusb
sys/dev/usb/auvitek_audio.c: netbsd-7-nhusb
sys/dev/usb/auvitek_dtv.c: netbsd-7-nhusb
sys/dev/usb/auvitek_i2c.c: netbsd-7-nhusb
sys/dev/usb/auvitek_video.c: netbsd-7-nhusb
sys/dev/usb/auvitekvar.h: netbsd-7-nhusb
sys/dev/usb/ehci.c: netbsd-7-nhusb
sys/dev/usb/ehcireg.h: netbsd-7-nhusb
sys/dev/usb/ehcivar.h: netbsd-7-nhusb
sys/dev/usb/emdtv.c: netbsd-7-nhusb
sys/dev/usb/emdtv_dtv.c: netbsd-7-nhusb
sys/dev/usb/emdtv_ir.c: netbsd-7-nhusb
sys/dev/usb/emdtvvar.h: netbsd-7-nhusb
sys/dev/usb/ezload.c: netbsd-7-nhusb
sys/dev/usb/ezload.h: netbsd-7-nhusb
sys/dev/usb/files.usb: netbsd-7-nhusb
sys/dev/usb/hid.c: netbsd-7-nhusb
sys/dev/usb/hid.h: netbsd-7-nhusb
sys/dev/usb/if_athn_usb.c: netbsd-7-nhusb
sys/dev/usb/if_athn_usb.h: netbsd-7-nhusb
sys/dev/usb/if_atu.c: netbsd-7-nhusb
sys/dev/usb/if_atureg.h: netbsd-7-nhusb
sys/dev/usb/if_aue.c: netbsd-7-nhusb
sys/dev/usb/if_auereg.h: netbsd-7-nhusb
sys/dev/usb/if_axe.c: netbsd-7-nhusb
sys/dev/usb/if_axen.c: netbsd-7-nhusb
sys/dev/usb/if_axenreg.h: netbsd-7-nhusb
sys/dev/usb/if_axereg.h: netbsd-7-nhusb
sys/dev/usb/if_cdce.c: netbsd-7-nhusb
sys/dev/usb/if_cdcereg.h: netbsd-7-nhusb
sys/dev/usb/if_cue.c: netbsd-7-nhusb
sys/dev/usb/if_cuereg.h: netbsd-7-nhusb
sys/dev/usb/if_kue.c: netbsd-7-nhusb
sys/dev/usb/if_kuereg.h: netbsd-7-nhusb
sys/dev/usb/if_otus.c: netbsd-7-nhusb
sys/dev/usb/if_otusvar.h: netbsd-7-nhusb
sys/dev/usb/if_rum.c: netbsd-7-nhusb
sys/dev/usb/if_rumreg.h: netbsd-7-nhusb
sys/dev/usb/if_rumvar.h: netbsd-7-nhusb
sys/dev/usb/if_run.c: netbsd-7-nhusb
sys/dev/usb/if_runvar.h: netbsd-7-nhusb
sys/dev/usb/if_smsc.c: netbsd-7-nhusb
sys/dev/usb/if_smscreg.h: netbsd-7-nhusb
sys/dev/usb/if_smscvar.h: netbsd-7-nhusb
sys/dev/usb/if_udav.c: netbsd-7-nhusb
sys/dev/usb/if_udavreg.h: netbsd-7-nhusb
sys/dev/usb/if_upgt.c: netbsd-7-nhusb
sys/dev/usb/if_upgtvar.h: netbsd-7-nhusb
sys/dev/usb/if_upl.c: netbsd-7-nhusb
sys/dev/usb/if_ural.c: netbsd-7-nhusb
sys/dev/usb/if_uralreg.h: netbsd-7-nhusb
sys/dev/usb/if_uralvar.h: netbsd-7-nhusb
sys/dev/usb/if_url.c: netbsd-7-nhusb
sys/dev/usb/if_urlreg.h: netbsd-7-nhusb
sys/dev/usb/if_urndis.c: netbsd-7-nhusb
sys/dev/usb/if_urndisreg.h: netbsd-7-nhusb
sys/dev/usb/if_urtw.c: netbsd-7-nhusb
sys/dev/usb/if_urtwn.c: netbsd-7-nhusb
sys/dev/usb/if_urtwn_data.h: netbsd-7-nhusb
sys/dev/usb/if_urtwnreg.h: netbsd-7-nhusb
sys/dev/usb/if_urtwnvar.h: netbsd-7-nhusb
sys/dev/usb/if_urtwreg.h: netbsd-7-nhusb
sys/dev/usb/if_zyd.c: netbsd-7-nhusb
sys/dev/usb/if_zydreg.h: netbsd-7-nhusb
sys/dev/usb/irmce.c: netbsd-7-nhusb
sys/dev/usb/moscom.c: netbsd-7-nhusb
sys/dev/usb/motg.c: netbsd-7-nhusb
sys/dev/usb/motgvar.h: netbsd-7-nhusb
sys/dev/usb/ohci.c: netbsd-7-nhusb
sys/dev/usb/ohcireg.h: netbsd-7-nhusb
sys/dev/usb/ohcivar.h: netbsd-7-nhusb
sys/dev/usb/pseye.c: netbsd-7-nhusb
sys/dev/usb/slurm.c: netbsd-7-nhusb
sys/dev/usb/stuirda.c: netbsd-7-nhusb
sys/dev/usb/u3g.c: netbsd-7-nhusb
sys/dev/usb/uark.c: netbsd-7-nhusb
sys/dev/usb/uatp.c: netbsd-7-nhusb
sys/dev/usb/uaudio.c: netbsd-7-nhusb
sys/dev/usb/uberry.c: netbsd-7-nhusb
sys/dev/usb/ubsa.c: netbsd-7-nhusb
sys/dev/usb/ubsa_common.c: netbsd-7-nhusb
sys/dev/usb/ubsavar.h: netbsd-7-nhusb
sys/dev/usb/ubt.c: netbsd-7-nhusb
sys/dev/usb/uchcom.c: netbsd-7-nhusb
sys/dev/usb/ucom.c: netbsd-7-nhusb
sys/dev/usb/ucomvar.h: netbsd-7-nhusb
sys/dev/usb/ucycom.c: netbsd-7-nhusb
sys/dev/usb/udl.c: netbsd-7-nhusb
sys/dev/usb/udl.h: netbsd-7-nhusb
sys/dev/usb/udsbr.c: netbsd-7-nhusb
sys/dev/usb/udsir.c: netbsd-7-nhusb
sys/dev/usb/uep.c: netbsd-7-nhusb
sys/dev/usb/uftdi.c: netbsd-7-nhusb
sys/dev/usb/uftdireg.h: netbsd-7-nhusb
sys/dev/usb/ugen.c: netbsd-7-nhusb
sys/dev/usb/ugensa.c: netbsd-7-nhusb
sys/dev/usb/uhci.c: netbsd-7-nhusb
sys/dev/usb/uhcireg.h: netbsd-7-nhusb
sys/dev/usb/uhcivar.h: netbsd-7-nhusb
sys/dev/usb/uhid.c: netbsd-7-nhusb
sys/dev/usb/uhidev.c: netbsd-7-nhusb
sys/dev/usb/uhidev.h: netbsd-7-nhusb
sys/dev/usb/uhmodem.c: netbsd-7-nhusb
sys/dev/usb/uhso.c: netbsd-7-nhusb
sys/dev/usb/uhub.c: netbsd-7-nhusb
sys/dev/usb/uipad.c: netbsd-7-nhusb
sys/dev/usb/uipaq.c: netbsd-7-nhusb
sys/dev/usb/uirda.c: netbsd-7-nhusb
sys/dev/usb/uirdavar.h: netbsd-7-nhusb
sys/dev/usb/ukbd.c: netbsd-7-nhusb
sys/dev/usb/ukbdmap.c: netbsd-7-nhusb
sys/dev/usb/ukyopon.c: netbsd-7-nhusb
sys/dev/usb/ukyopon.h: netbsd-7-nhusb
sys/dev/usb/ulpt.c: netbsd-7-nhusb
sys/dev/usb/umass.c: netbsd-7-nhusb
sys/dev/usb/umass_isdata.c: netbsd-7-nhusb
sys/dev/usb/umass_isdata.h: netbsd-7-nhusb
sys/dev/usb/umass_quirks.c: netbsd-7-nhusb
sys/dev/usb/umass_quirks.h: netbsd-7-nhusb
sys/dev/usb/umass_scsipi.c: netbsd-7-nhusb
sys/dev/usb/umass_scsipi.h: netbsd-7-nhusb
sys/dev/usb/umassvar.h: netbsd-7-nhusb
sys/dev/usb/umcs.c: netbsd-7-nhusb
sys/dev/usb/umct.c: netbsd-7-nhusb
sys/dev/usb/umidi.c: netbsd-7-nhusb
sys/dev/usb/umidi_quirks.c: netbsd-7-nhusb
sys/dev/usb/umidi_quirks.h: netbsd-7-nhusb
sys/dev/usb/umodem.c: netbsd-7-nhusb
sys/dev/usb/umodem_common.c: netbsd-7-nhusb
sys/dev/usb/umodemvar.h: netbsd-7-nhusb
sys/dev/usb/ums.c: netbsd-7-nhusb
sys/dev/usb/uplcom.c: netbsd-7-nhusb
sys/dev/usb/urio.c: netbsd-7-nhusb
sys/dev/usb/urio.h: netbsd-7-nhusb
sys/dev/usb/usb.c: netbsd-7-nhusb
sys/dev/usb/usb.h: netbsd-7-nhusb
sys/dev/usb/usb_mem.c: netbsd-7-nhusb
sys/dev/usb/usb_mem.h: netbsd-7-nhusb
sys/dev/usb/usb_quirks.c: netbsd-7-nhusb
sys/dev/usb/usb_quirks.h: netbsd-7-nhusb
sys/dev/usb/usb_subr.c: netbsd-7-nhusb
sys/dev/usb/usbdevices.config: netbsd-7-nhusb
sys/dev/usb/usbdevs: netbsd-7-nhusb
sys/dev/usb/usbdevs.h: netbsd-7-nhusb
sys/dev/usb/usbdevs_data.h: netbsd-7-nhusb
sys/dev/usb/usbdi.c: netbsd-7-nhusb
sys/dev/usb/usbdi.h: netbsd-7-nhusb
sys/dev/usb/usbdi_util.c: netbsd-7-nhusb
sys/dev/usb/usbdi_util.h: netbsd-7-nhusb
sys/dev/usb/usbdivar.h: netbsd-7-nhusb
sys/dev/usb/usbhid.h: netbsd-7-nhusb
sys/dev/usb/usbhist.h: netbsd-7-nhusb
sys/dev/usb/usbroothub.c: netbsd-7-nhusb
sys/dev/usb/usbroothub.h: netbsd-7-nhusb
sys/dev/usb/usbroothub_subr.c: delete
sys/dev/usb/usbroothub_subr.h: delete
sys/dev/usb/uscanner.c: netbsd-7-nhusb
sys/dev/usb/uslsa.c: netbsd-7-nhusb
sys/dev/usb/usscanner.c: netbsd-7-nhusb
sys/dev/usb/ustir.c: netbsd-7-nhusb
sys/dev/usb/uthum.c: netbsd-7-nhusb
sys/dev/usb/utoppy.c: netbsd-7-nhusb
sys/dev/usb/uts.c: netbsd-7-nhusb
sys/dev/usb/uvideo.c: netbsd-7-nhusb
sys/dev/usb/uvisor.c: netbsd-7-nhusb
sys/dev/usb/uvscom.c: netbsd-7-nhusb
sys/dev/usb/uyap.c: netbsd-7-nhusb
sys/dev/usb/uyap_firmware.h: netbsd-7-nhusb
sys/dev/usb/uyurex.c: netbsd-7-nhusb
sys/dev/usb/x1input_rdesc.h: netbsd-7-nhusb
sys/dev/usb/xhci.c: netbsd-7-nhusb
sys/dev/usb/xhcireg.h: netbsd-7-nhusb
sys/dev/usb/xhcivar.h: netbsd-7-nhusb
sys/dev/usb/xinput_rdesc.h: netbsd-7-nhusb
sys/external/bsd/common/conf/files.linux: netbsd-7-nhusb
sys/external/bsd/common/include/linux/err.h: netbsd-7-nhusb
sys/external/bsd/common/include/linux/kernel.h: netbsd-7-nhusb
sys/external/bsd/common/include/linux/workqueue.h: netbsd-7-nhusb
sys/external/bsd/common/linux/linux_work.c: netbsd-7-nhusb
sys/external/bsd/drm2/dist/drm/radeon/atombios_encoders.c: netbsd-7-nhusb
sys/external/bsd/drm2/dist/drm/radeon/radeon_legacy_encoders.c: netbsd-7-nhusb
sys/external/bsd/drm2/drm/files.drmkms: netbsd-7-nhusb
sys/external/bsd/drm2/i915drm/files.i915drmkms: netbsd-7-nhusb
sys/external/bsd/drm2/include/linux/err.h: delete
sys/external/bsd/drm2/include/linux/workqueue.h: delete
sys/external/bsd/drm2/linux/files.drmkms_linux: netbsd-7-nhusb
sys/external/bsd/drm2/linux/linux_work.c: delete
sys/external/bsd/dwc2/dwc2.c: netbsd-7-nhusb
sys/external/bsd/dwc2/dwc2.h: netbsd-7-nhusb
sys/external/bsd/dwc2/dwc2var.h: netbsd-7-nhusb
sys/external/bsd/dwc2/dwctwo2netbsd: netbsd-7-nhusb
sys/external/bsd/dwc2/conf/files.dwc2: netbsd-7-nhusb
sys/external/bsd/dwc2/dist/dwc2_core.c: netbsd-7-nhusb
sys/external/bsd/dwc2/dist/dwc2_core.h: netbsd-7-nhusb
sys/external/bsd/dwc2/dist/dwc2_coreintr.c: netbsd-7-nhusb
sys/external/bsd/dwc2/dist/dwc2_hcd.c: netbsd-7-nhusb
sys/external/bsd/dwc2/dist/dwc2_hcd.h: netbsd-7-nhusb
sys/external/bsd/dwc2/dist/dwc2_hcdddma.c: netbsd-7-nhusb
sys/external/bsd/dwc2/dist/dwc2_hcdintr.c: netbsd-7-nhusb
sys/external/bsd/dwc2/dist/dwc2_hcdqueue.c: netbsd-7-nhusb
sys/external/bsd/dwc2/dist/dwc2_hw.h: netbsd-7-nhusb
sys/modules/drmkms_linux/Makefile: netbsd-7-nhusb
sys/modules/i915drmkms/Makefile: netbsd-7-nhusb
sys/rump/dev/lib/libugenhc/ugenhc.c: netbsd-7-nhusb
sys/rump/dev/lib/libusb/Makefile: netbsd-7-nhusb
sys/rump/dev/lib/libusb/USB.ioconf: netbsd-7-nhusb
sys/rump/dev/lib/libusb/usb_at_ugenhc.c: delete
sys/rump/dev/lib/libusb/opt/opt_usb.h: delete
sys/rump/dev/lib/libusb/opt/opt_usbverbose.h: delete
sys/sys/mbuf.h: netbsd-7-nhusb
usr.sbin/usbdevs/usbdevs.8: netbsd-7-nhusb
usr.sbin/usbdevs/usbdevs.c: netbsd-7-nhusb
Merge netbsd-7-nhusb:
- API / infrastructure changes to support memory management changes.
- Memory management improvements and bug fixes.
- HCDs should now be MP safe
- conversion to KERNHIST based debug
- FS/LS isoc support on ehci(4).
- conversion to kmem(9)
- Some USB 3 support - mostly from Takahiro HAYASHI (t-hash).
- interrupt transfers now get proper DMA operations
- general bug fixes
- kern/48308
- uhub status notification improvements
- umass(4) probe fix (applied to HEAD already)
- ohci(4) short transfer fix
- Change the SOFTINT level from NET to SERIAL for the USB softint handler.
This gives the callback a chance of running when another softint handler
at SOFTINT_NET has blocked holding a lock, e.g. softnet_lock and most of
the network stack.
- kern/49065 - ifconfig tun0 ... sequence locks up system / lockup:
softnet_lock held across usb xfr
- kern/50491 - unkillable wait in usbd_transfer while using usmsc0
on raspberry pi 2
- kern/51395 - USB Ethernet makes xhci hang
- Various improvements to slhci(4)
- Various improvements to dwc2(4)
 1.15 17-Jul-2022  riastradh linux/ww_mutex: Make wwm_debug member unconditional.

This way LOCKDEBUG doesn't change any structure sizes. Shuffle
members around to make better use of padding, on both LP32 and LP64.
 1.14 19-Dec-2021  riastradh Implement dma_resv_locking_ctx more carefully.
 1.13 27-Aug-2018  riastradh Use Linux atomic64 for ww mutex class.

This way we can take advantage of the hash-locked atomic64 on
platforms that lack native atomic_inc_64_nv.
 1.12 27-Aug-2018  riastradh match linux side loading of headers

more bring in OLD drm code to unbreak the build
matching netbsd types etc. to get the build going


Author: coypu <coypu@sdf.org>
Committer: Taylor R Campbell <riastradh@NetBSD.org>
 1.11 21-May-2015  riastradh branches: 1.11.16; 1.11.18;
Adapt ww_mutex to use LOCKDEBUG.

Should help track down PR 49862.
 1.10 08-Jan-2015  riastradh Move Linux ww_mutex code into a .c file where it belongs.
 1.9 01-Jan-2015  mrg due to hangs seen by several folks, for now revert:
http://mail-index.netbsd.org/source-changes/2014/11/04/msg060120.html

Log Message:
This code should be MP-safe. Use IPL_SCHED in place of IPL_DRM/IPL_VM and set
D_MPSAFE flag in cdevsw.
 1.8 04-Nov-2014  jmcneill branches: 1.8.2;
This code should be MP-safe. Use IPL_SCHED in place of IPL_DRM/IPL_VM and set
D_MPSAFE flag in cdevsw.
 1.7 15-Sep-2014  riastradh Fix mistakes in Linux ww_mutex code.

I wrote some cases for the WW_WANTOWN state forgetting that there is
an acquisition context associated with it.

- On acceptance of a lock, allow WW_WANTOWN as well as WW_CTX.
- On unlock when WW_WANTOWN, decrement the context's acquire count.

Fixes KASSERT(ctx->wwx_acquired == 0) failure in ww_acquire_fini, and
would fix unlikely but possible kasserts in ww_mutex_lock* if another
lwp swoops in to lock without a context quickly enough.

While here, add some comments and kassert up the wazoo.
 1.6 13-Sep-2014  riastradh Omit vestigial notes on porting before the API was made to match.
 1.5 13-Sep-2014  riastradh Use KASSERTMSG in ww_acquire_fini to show number of locks held.
 1.4 26-Jul-2014  riastradh branches: 1.4.2; 1.4.4; 1.4.6;
Break overlong lines.
 1.3 26-Jul-2014  riastradh Don't forget to decrement the acquired count too.
 1.2 22-Jul-2014  riastradh Make Linux ww_mutex use a spin lock inside, not an adaptive lock.
 1.1 16-Jul-2014  riastradh First whack at radeon driver.

No hardware to test yet, but it builds.
 1.4.6.3 03-Dec-2017  jdolecek update from HEAD
 1.4.6.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.4.6.1 26-Jul-2014  tls file ww_mutex.h was added on branch tls-maxphys on 2014-08-20 00:04:21 +0000
 1.4.4.4 30-Jul-2015  snj Pull up following revision(s) (requested by riastradh in ticket #907):
sys/external/bsd/drm2/linux/linux_ww_mutex.c: revision 1.2
sys/external/bsd/drm2/include/linux/ww_mutex.h: revision 1.11
Adapt ww_mutex to use LOCKDEBUG.
Should help track down PR 49862.
 1.4.4.3 06-Mar-2015  snj Pull up following revision(s) (requested by mrg in ticket #573):
sys/external/bsd/common/include/linux/kernel.h: 1.5, 1.6
sys/external/bsd/drm2/dist/drm/drm_ioctl.c: 1.4
sys/external/bsd/drm2/dist/drm/drm_irq.c: 1.6-1.8
sys/external/bsd/drm2/dist/drm/i915/i915_dma.c: 1.13-1.15
sys/external/bsd/drm2/dist/drm/i915/i915_gem.c: 1.23-1.27
sys/external/bsd/drm2/dist/drm/i915/i915_gem_execbuffer.c: 1.5
sys/external/bsd/drm2/dist/drm/i915/intel_display.c: 1.14, 1.15
sys/external/bsd/drm2/dist/drm/i915/intel_dp.c: 1.10
sys/external/bsd/drm2/dist/drm/i915/intel_drv.h: 1.8
sys/external/bsd/drm2/dist/drm/i915/intel_i2c.c: 1.8-1.13
sys/external/bsd/drm2/dist/drm/i915/intel_pm.c: 1.6
sys/external/bsd/drm2/dist/drm/i915/intel_ringbuffer.c: 1.5, 1.6
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/device/nouveau_engine_device_base.c: 1.4
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/fifo/nouveau_engine_fifo_nvc0.c: 1.3, 1.4
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/fifo/nouveau_engine_fifo_nve0.c: 1.3, 1.4
sys/external/bsd/drm2/dist/drm/nouveau/core/include/core/device.h: 1.4
sys/external/bsd/drm2/dist/drm/nouveau/core/include/subdev/mc.h: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/include/subdev/pwr.h: 1.3, 1.4
sys/external/bsd/drm2/dist/drm/nouveau/core/os.h: 1.4, 1.5
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/bios/nouveau_subdev_bios_base.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/bios/nouveau_subdev_bios_pll.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/clock/nouveau_subdev_clock_base.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/clock/nouveau_subdev_clock_nv50.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/devinit/fbmem.h: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/devinit/nouveau_subdev_devinit_nv04.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/fb/nouveau_subdev_fb_nv50.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/fb/nouveau_subdev_fb_nvc0.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/fb/nv50.h: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/fb/nvc0.h: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/mc/nouveau_subdev_mc_base.c: 1.2, 1.3
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/mxm/nouveau_subdev_mxm_nv50.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/pwr/nouveau_subdev_pwr_base.c: 1.3, 1.4
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/therm/nouveau_subdev_therm_ic.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/timer/nouveau_subdev_timer_nv04.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/vm/nouveau_subdev_vm_base.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/vm/nouveau_subdev_vm_nv04.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/vm/nouveau_subdev_vm_nv44.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/vm/nv04.h: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_bo.h: 1.3
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_drm.c: 1.4, 1.5
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_fbcon.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_nv50_display.c: 1.3
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_nv84_fence.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_ttm.c: 1.3
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_ttm.h: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_vga.h: 1.2
sys/external/bsd/drm2/dist/drm/radeon/radeon_fence.c: 1.6-1.8
sys/external/bsd/drm2/dist/drm/radeon/radeon_pm.c: 1.3
sys/external/bsd/drm2/dist/drm/radeon/rs400.c: 1.3
sys/external/bsd/drm2/dist/drm/via/via_dmablit.c: 1.3, 1.4
sys/external/bsd/drm2/dist/drm/via/via_drv.h: 1.3
sys/external/bsd/drm2/dist/drm/via/via_irq.c: 1.3, 1.4
sys/external/bsd/drm2/dist/drm/via/via_video.c: 1.3, 1.4
sys/external/bsd/drm2/dist/include/drm/drmP.h: 1.10
sys/external/bsd/drm2/dist/include/drm/drm_crtc.h: 1.4
sys/external/bsd/drm2/dist/include/drm/drm_modes.h: 1.3
sys/external/bsd/drm2/dist/uapi/drm/i915_drm.h: 1.2
sys/external/bsd/drm2/drm/drm_cache.c: 1.4-1.6
sys/external/bsd/drm2/drm/drm_drv.c: 1.14
sys/external/bsd/drm2/drm/drm_module.c: 1.10
sys/external/bsd/drm2/drm/drm_sysctl.c: 1.5
sys/external/bsd/drm2/drm/drm_vma_manager.c: 1.2
sys/external/bsd/drm2/drm/drmfb.c: 1.1
sys/external/bsd/drm2/drm/files.drmkms: 1.10, 1.11
sys/external/bsd/drm2/i2c/drm_encoder_slave.c: 1.1
sys/external/bsd/drm2/i915drm/files.i915drmkms: 1.7, 1.10
sys/external/bsd/drm2/i915drm/intelfb.c: 1.11, 1.12
sys/external/bsd/drm2/include/asm/io.h: 1.4
sys/external/bsd/drm2/include/asm/unaligned.h: 1.2, 1.3
sys/external/bsd/drm2/include/drm/drm_encoder_slave.h: 1.1
sys/external/bsd/drm2/include/drm/drm_wait_netbsd.h: 1.7-1.11
sys/external/bsd/drm2/include/drm/drmfb.h: 1.1
sys/external/bsd/drm2/include/drm/drmfb_pci.h: 1.1, 1.2
sys/external/bsd/drm2/include/linux/bitops.h: 1.9
sys/external/bsd/drm2/include/linux/i2c.h: 1.7, 1.8
sys/external/bsd/drm2/include/linux/io-mapping.h: 1.5
sys/external/bsd/drm2/include/linux/moduleparam.h: 1.5
sys/external/bsd/drm2/include/linux/pci.h: 1.12-1.15
sys/external/bsd/drm2/include/linux/pm.h: 1.4
sys/external/bsd/drm2/include/linux/reboot.h: 1.2
sys/external/bsd/drm2/include/linux/slab.h: 1.5
sys/external/bsd/drm2/include/linux/string.h: 1.4
sys/external/bsd/drm2/include/linux/vgaarb.h: 1.3
sys/external/bsd/drm2/include/linux/ww_mutex.h: 1.10
sys/external/bsd/drm2/linux/files.drmkms_linux: 1.8
sys/external/bsd/drm2/linux/linux_i2c.c: 1.3
sys/external/bsd/drm2/linux/linux_ww_mutex.c: 1.1
sys/external/bsd/drm2/nouveau/files.nouveau: 1.5-1.8
sys/external/bsd/drm2/nouveau/nouveau_pci.c: 1.1-1.3
sys/external/bsd/drm2/nouveau/nouveau_pci.h: 1.1
sys/external/bsd/drm2/nouveau/nouveau_sysfs.c: 1.1
sys/external/bsd/drm2/nouveau/nouveau_vga.c: 1.1
sys/external/bsd/drm2/nouveau/nouveaufb.c: 1.1
sys/external/bsd/drm2/nouveau/nouveaufb.h: 1.1
sys/external/bsd/drm2/pci/drm_pci.c: 1.10-1.12
sys/external/bsd/drm2/pci/drm_pci_module.c: 1.4
sys/external/bsd/drm2/pci/drmfb_pci.c: 1.1-1.3
sys/external/bsd/drm2/pci/files.drmkms_pci: 1.5
sys/external/bsd/drm2/radeon/radeon_pci.c: 1.5-1.7
sys/modules/drmkms/Makefile: 1.8, 1.9
sys/modules/drmkms_linux/Makefile: 1.6
sys/modules/drmkms_pci/Makefile: 1.5
sync drm2 with HEAD.
 1.4.4.2 10-Nov-2014  martin Pull up following revision(s) (requested by snj in ticket #191):
sys/external/bsd/drm2/include/linux/io-mapping.h: revision 1.4
sys/external/bsd/drm2/dist/uapi/drm/drm.h: revision 1.5
sys/external/bsd/drm2/dist/drm/i915/intel_panel.c: revision 1.5
sys/external/bsd/drm2/dist/uapi/drm/drm.h: revision 1.6
sys/external/bsd/drm2/dist/drm/i915/intel_drv.h: revision 1.7
sys/external/bsd/drm2/include/linux/ww_mutex.h: revision 1.7
sys/external/bsd/drm2/dist/drm/i915/intel_dp.c: revision 1.8
sys/external/bsd/drm2/dist/drm/i915/i915_ums.c: revision 1.2
sys/external/bsd/drm2/dist/drm/i915/intel_pm.c: revision 1.5
sys/external/bsd/drm2/dist/drm/i915/i915_debugfs.c: revision 1.2
sys/external/bsd/drm2/dist/drm/i915/i915_drv.h: revision 1.9
sys/external/bsd/drm2/dist/drm/i915/i915_cmd_parser.c: revision 1.4
sys/external/bsd/drm2/dist/drm/i915/intel_dsi.c: revision 1.3
sys/external/bsd/drm2/dist/drm/i915/intel_display.c: revision 1.11
sys/external/bsd/drm2/dist/drm/i915/intel_hdmi.c: revision 1.5
sys/external/bsd/drm2/dist/drm/i915/intel_display.c: revision 1.12
sys/external/bsd/drm2/include/asm/processor.h: revision 1.3
sys/external/bsd/drm2/dist/drm/i915/intel_crt.c: revision 1.5
sys/external/bsd/drm2/dist/drm/i915/intel_sideband.c: revision 1.2
sys/external/bsd/drm2/dist/drm/i915/intel_ddi.c: revision 1.5
sys/external/bsd/drm2/dist/drm/i915/intel_tv.c: revision 1.5
sys/external/bsd/drm2/dist/drm/i915/i915_dma.c: revision 1.11
sys/external/bsd/drm2/dist/drm/i915/i915_irq.c: revision 1.10
sys/external/bsd/drm2/dist/drm/i915/i915_gem.c: revision 1.16
sys/external/bsd/drm2/dist/drm/i915/i915_gem.c: revision 1.17
sys/external/bsd/drm2/ttm/ttm_bo_vm.c: revision 1.6
sys/external/bsd/drm2/ttm/ttm_bo_vm.c: revision 1.7
sys/external/bsd/drm2/drm/drm_module.c: revision 1.8
sys/external/bsd/drm2/dist/drm/i915/intel_sprite.c: revision 1.2
sys/external/bsd/drm2/dist/drm/i915/intel_dsi_cmd.c: revision 1.2
sys/external/bsd/drm2/i915drm/intelfb.c: revision 1.10
sys/external/bsd/drm2/dist/drm/i915/intel_dvo.c: revision 1.2
sys/external/bsd/drm2/dist/drm/i915/intel_sdvo.c: revision 1.6
sys/external/bsd/drm2/dist/drm/i915/intel_lvds.c: revision 1.6
Code cleanup and minor bugfixes for drm2.
 1.4.4.1 21-Sep-2014  snj Pull up following revision(s) (requested by riastradh in ticket #102):
sys/external/bsd/drm2/include/linux/ww_mutex.h: revisions 1.5, 1.6
Use KASSERTMSG in ww_acquire_fini to show number of locks held.
Omit vestigial notes on porting before the API was made to match.
 1.4.2.2 10-Aug-2014  tls Rebase.
 1.4.2.1 26-Jul-2014  tls file ww_mutex.h was added on branch tls-earlyentropy on 2014-08-10 06:55:39 +0000
 1.8.2.2 06-Jun-2015  skrll Sync with HEAD
 1.8.2.1 06-Apr-2015  skrll Sync with HEAD
 1.11.18.1 10-Jun-2019  christos Sync with HEAD
 1.11.16.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.9 19-Dec-2021  riastradh linux: Rework radix tree shims.
 1.8 19-Dec-2021  riastradh linux: Draft half-arsed xarray shims
 1.7 19-Dec-2021  riastradh linux: namespace xa_destroy
 1.6 19-Dec-2021  riastradh linux: Define XA_FLAGS_ALLOC to 0 for now.
 1.5 19-Dec-2021  riastradh More xarray declarations.
 1.4 19-Dec-2021  riastradh Add some more xarray stub declarations.
 1.3 19-Dec-2021  riastradh Start xarray stubs.
 1.2 19-Dec-2021  riastradh stub xarray.h and dma-resv.h

Add some upstream side-loads and empty structs.


Author: Maya Rashish <maya@NetBSD.org>
 1.1 19-Dec-2021  riastradh Create stub headers for files included by drm code.


Author: Maya Rashish <maya@NetBSD.org>
 1.1 19-Dec-2021  riastradh Create stub headers for files included by drm code.


Author: Maya Rashish <maya@NetBSD.org>
 1.1 27-Aug-2018  riastradh branches: 1.1.2; 1.1.6;
local versions of headers required


Author: coypu <coypu@sdf.org>
Committer: Taylor R Campbell <riastradh@NetBSD.org>
 1.1.6.2 10-Jun-2019  christos Sync with HEAD
 1.1.6.1 27-Aug-2018  christos file consumer.h was added on branch phil-wifi on 2019-06-10 22:08:32 +0000
 1.1.2.2 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.1.2.1 27-Aug-2018  pgoyette file consumer.h was added on branch pgoyette-compat on 2018-09-06 06:56:36 +0000
 1.1 19-Dec-2021  riastradh Create stub headers for files included by drm code.


Author: Maya Rashish <maya@NetBSD.org>
 1.1 19-Dec-2021  riastradh Add some Linux header stubs.
 1.1 19-Dec-2021  riastradh Create stub headers for files included by drm code.


Author: Maya Rashish <maya@NetBSD.org>
 1.1 19-Dec-2021  riastradh Create stub headers for files included by drm code.


Author: Maya Rashish <maya@NetBSD.org>
 1.1 19-Dec-2021  riastradh Create stub headers for files included by drm code.


Author: Maya Rashish <maya@NetBSD.org>
 1.5 19-Nov-2018  maya branches: 1.5.4;
include machine/limits.h for INT_MAX
 1.4 27-Aug-2018  riastradh branches: 1.4.2;
Make this compile.
 1.3 27-Aug-2018  riastradh Protect #include "opt_*.h" by #ifdef _KERNEL_OPT.
 1.2 27-Aug-2018  riastradh Copy regulator API from fdtbus.
 1.1 27-Aug-2018  riastradh Stub <linux/regulator/consumer.h>.
 1.4.2.3 26-Nov-2018  pgoyette Sync with HEAD, resolve a couple of conflicts
 1.4.2.2 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.4.2.1 27-Aug-2018  pgoyette file consumer.h was added on branch pgoyette-compat on 2018-09-06 06:56:36 +0000
 1.5.4.2 10-Jun-2019  christos Sync with HEAD
 1.5.4.1 19-Nov-2018  christos file consumer.h was added on branch phil-wifi on 2019-06-10 22:08:32 +0000
 1.3 19-Dec-2021  riastradh <linux/sched/clock.h> side loads <linux/smp.h>.
 1.2 19-Dec-2021  riastradh Hokey local_clock.
 1.1 19-Dec-2021  riastradh More Linux header stubs.

Let's just use empty header files until we actually populate these.
Save a bit of disk space...
 1.4 19-Dec-2021  riastradh amdgpu: make most of amdgpu_vm.c build

Not quite done yet -- need to adapt the DMA address logic to use
bus_dmamap_t.
 1.3 19-Dec-2021  riastradh linux: Shim fs_reclaim_acquire/release to reduce diff.
 1.2 19-Dec-2021  riastradh drm: Another pass over i915. Most of i915 gem builds now.
 1.1 19-Dec-2021  riastradh Bunch more Linux header file stubs.
 1.4 19-Dec-2021  riastradh Make intel_psr.c build
netbsd-ify
Stub out intel_lpe_audio.c (for now?).
Hammer intel_opregion.c into shape.
Hack up intel_lrc.c
Adapt intel_reset.c
Stub out intel_region_lmem.c
Adapt intel_ring_submission.c
Adapt intel_rps.c
Adapt intel_sdvo.c
Adapt intel_runtime_pm.c
Adapt intel_sideband.c
Adapt intel_sprite.c
Adapt intel_tv.c
Adapt intel_tc.c
Adapt intel_sseu.c
Adapt intel_timeline.c
Adapt intel_uc_fw.c and fix typo
Fix up intel_uncore.c
intel_vga.c
intel_wakeref.c
intel_vdsc.c
intel_wopcm.c
intel_workarounds.c
i915_globals.c
Fix up intelfb.c
Stub out intel_guc_log.c
Stub out intel_dsi_dcs_backlight.c
i915_perf.c
intel_hdmi.c
intel_hdcp.c


Author: Maya Rashish <maya@NetBSD.org>
Committer: Taylor R Campbell <riastradh@NetBSD.org>
 1.3 19-Dec-2021  riastradh i915: more work
 1.2 19-Dec-2021  riastradh Side load <linux/sched.h> in <linux/sched/signal.h>.
 1.1 19-Dec-2021  riastradh More Linux header stubs.

Let's just use empty header files until we actually populate these.
Save a bit of disk space...
 1.1 19-Dec-2021  riastradh Add some Linux header stubs.

RSS XML Feed