History log of /src/sys/external/bsd/drm2/linux/
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
Revision tags: perseant-exfatfs-base-20250801 netbsd-11-base netbsd-10-1-RELEASE perseant-exfatfs-base-20240630 perseant-exfatfs-base netbsd-10-0-RELEASE netbsd-10-0-RC6 netbsd-10-0-RC5 netbsd-10-0-RC4 netbsd-10-0-RC3 netbsd-10-0-RC2 thorpej-ifq-base thorpej-altq-separation-base netbsd-10-0-RC1 netbsd-10-base bouyer-sunxi-drm-base
1.43 09-Jul-2022 riastradh

linux/hdmi.h: Split out logic into .c file.

Shoulda done this ages ago.


1.42 27-Feb-2022 jakllsch

only build linux_acpi.c if we have acpi(4) in the kernel


1.41 27-Feb-2022 riastradh

drm: Move acpi_check_dsm &c. from intel_acpi.c to new linux_acpi.c.


1.40 19-Dec-2021 riastradh

drm: Move io_mapping to very own .c file.


1.39 19-Dec-2021 riastradh

drm: linux kthread stubs


1.38 19-Dec-2021 riastradh

linux: Rename linux_sg.c -> linux_sgt.c.

Avoids collision with compat_linux.


1.37 19-Dec-2021 riastradh

linux: Kludgey radix tree shims


1.36 19-Dec-2021 riastradh

linux: Draft half-arsed xarray shims


1.35 19-Dec-2021 riastradh

linux: dma fence array stubs


1.34 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.33 19-Dec-2021 riastradh

i915: more work


1.32 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.31 19-Dec-2021 riastradh

linux compat: Draft hrtimer shims.

(not actually high-resolution, just a wrapper around callout(9))


1.30 19-Dec-2021 riastradh

linux: Draft rwsem with bodgy semantics.


1.29 19-Dec-2021 riastradh

Narrow the CPPFLAGS for drm subsystems.

No need for the whole kernel to be built with -I flags for the drm
header files.


1.28 19-Dec-2021 riastradh

Move Linux firmware shims to their own .c file.


1.27 19-Dec-2021 riastradh

dma fence chain stubs


1.26 19-Dec-2021 riastradh

backlight stubs


1.25 19-Dec-2021 riastradh

Draft sync_file.


1.24 19-Dec-2021 riastradh

Rename reservation_object -> dma_resv.


1.23 19-Dec-2021 riastradh

Move Linux SRCU to common.


1.22 19-Dec-2021 riastradh

Draft stop_machine. Hope the callback runs quickly under splhigh...


1.21 19-Dec-2021 riastradh

Move Linux RCU to common.


1.20 19-Dec-2021 riastradh

linux/wait_bit.h


1.19 19-Dec-2021 riastradh

Draft SRCU implementation.


1.18 19-Dec-2021 riastradh

Rename fence -> dma_fence, step 2: files files.


Revision tags: netbsd-9-4-RELEASE netbsd-9-3-RELEASE thorpej-i2c-spi-conf2-base thorpej-futex2-base thorpej-cfargs2-base cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 netbsd-9-2-RELEASE cjep_staticlib_x-base thorpej-i2c-spi-conf-base thorpej-cfargs-base thorpej-futex-base netbsd-9-1-RELEASE bouyer-xenpvh-base2 phil-wifi-20200421 bouyer-xenpvh-base1 phil-wifi-20200411 bouyer-xenpvh-base is-mlppp-base phil-wifi-20200406 ad-namecache-base3 netbsd-9-0-RELEASE netbsd-9-0-RC2 ad-namecache-base2 ad-namecache-base1 ad-namecache-base netbsd-9-0-RC1 phil-wifi-20191119 netbsd-9-base phil-wifi-20190609 isaki-audio2-base pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906
1.17 27-Aug-2018 riastradh

Draft support for drm prime.


1.16 27-Aug-2018 riastradh

Hash-locked atomic64 to give ports like powerpc32 a chance at radeon.


1.15 27-Aug-2018 riastradh

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

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


1.14 27-Aug-2018 riastradh

Sort.


1.13 27-Aug-2018 riastradh

Draft implementation of the Linux reservation and fence APIs.


1.12 27-Aug-2018 riastradh

Implement some of the Linux RCU API.


1.11 27-Aug-2018 riastradh

Sort in the standard English alphabetical order, please.


1.10 27-Aug-2018 riastradh

Sort.


Revision tags: netbsd-8-3-RELEASE netbsd-8-2-RELEASE netbsd-8-1-RELEASE netbsd-8-1-RC1 pgoyette-compat-0728 netbsd-8-0-RELEASE phil-wifi-base pgoyette-compat-0625 netbsd-8-0-RC2 pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 netbsd-8-0-RC1 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base tls-maxphys-base-20171202 matt-nb8-mediatek-base nick-nhusb-base-20170825 perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 jdolecek-ncq-base pgoyette-localcount-20170320 nick-nhusb-base-20170204 bouyer-socketcan-base pgoyette-localcount-20170107 nick-nhusb-base-20161204 pgoyette-localcount-20161104 nick-nhusb-base-20161004 localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base nick-nhusb-base-20160907 nick-nhusb-base-20160529 nick-nhusb-base-20160422 nick-nhusb-base-20160319
1.9 24-Feb-2016 skrll

branches: 1.9.16; 1.9.18;
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


Revision tags: nick-nhusb-base-20151226 nick-nhusb-base-20150921 nick-nhusb-base-20150606 nick-nhusb-base-20150406
1.8 08-Jan-2015 riastradh

Move Linux ww_mutex code into a .c file where it belongs.


Revision tags: nick-nhusb-base tls-maxphys-base netbsd-7-base tls-earlyentropy-base
1.7 17-Jul-2014 riastradh

branches: 1.7.2; 1.7.4; 1.7.6;
Remove needless linux_gfp.c.

Trying to make do with Linux's page allocation interface is pretty
much always wrong: either we let uvm allocate pages in uvm objects
for us, or we use bus_dma.


1.6 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.


Revision tags: rmind-smpnet-base rmind-smpnet-nbase yamt-pagecache-base9
1.5 25-Apr-2014 riastradh

branches: 1.5.2; 1.5.4;
Implement Linux dmi_check_system API.

Use it to get a Thinkpad quirk for i915 graphics.

Patch from nonoka@, PR 48708.


Revision tags: riastradh-xf86-video-intel-2-7-1-pre-2-21-15
1.4 01-Apr-2014 riastradh

branches: 1.4.2;
Make drmkms find header files from sys/external/bsd/common.


1.3 31-Mar-2014 riastradh

Move the drmkms i2c dependencies to where they belong.


1.2 18-Mar-2014 riastradh

Merge riastradh-drm2 to HEAD.


Revision tags: riastradh-drm2-base3
1.1 04-Mar-2014 riastradh

branches: 1.1.2;
file files.drmkms_linux was initially added on branch riastradh-drm2.


Revision tags: perseant-exfatfs-base-20250801 netbsd-11-base netbsd-10-1-RELEASE perseant-exfatfs-base-20240630 perseant-exfatfs-base netbsd-10-0-RELEASE netbsd-10-0-RC6 netbsd-10-0-RC5 netbsd-10-0-RC4 netbsd-10-0-RC3 netbsd-10-0-RC2 thorpej-ifq-base thorpej-altq-separation-base netbsd-10-0-RC1 netbsd-10-base bouyer-sunxi-drm-base
1.2 28-Feb-2022 riastradh

drm: Fix ACPI crud in ALL kernel build.


1.1 27-Feb-2022 riastradh

drm: Move acpi_check_dsm &c. from intel_acpi.c to new linux_acpi.c.


Revision tags: perseant-exfatfs-base-20250801 netbsd-11-base netbsd-10-1-RELEASE perseant-exfatfs-base-20240630 perseant-exfatfs-base netbsd-9-4-RELEASE netbsd-10-0-RELEASE netbsd-10-0-RC6 netbsd-10-0-RC5 netbsd-10-0-RC4 netbsd-10-0-RC3 netbsd-10-0-RC2 thorpej-ifq-base thorpej-altq-separation-base netbsd-10-0-RC1 netbsd-10-base bouyer-sunxi-drm-base netbsd-9-3-RELEASE thorpej-i2c-spi-conf2-base thorpej-futex2-base thorpej-cfargs2-base cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 netbsd-9-2-RELEASE cjep_staticlib_x-base thorpej-i2c-spi-conf-base thorpej-cfargs-base thorpej-futex-base netbsd-9-1-RELEASE bouyer-xenpvh-base2 phil-wifi-20200421 bouyer-xenpvh-base1 phil-wifi-20200411 bouyer-xenpvh-base is-mlppp-base phil-wifi-20200406 ad-namecache-base3 netbsd-9-0-RELEASE netbsd-9-0-RC2 ad-namecache-base2 ad-namecache-base1 ad-namecache-base netbsd-9-0-RC1 phil-wifi-20191119 netbsd-9-base phil-wifi-20190609 isaki-audio2-base pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906
1.3 27-Aug-2018 riastradh

branches: 1.3.2; 1.3.6;
Implement atomic64_add_return and atomic64_inc_return.


1.2 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.1 27-Aug-2018 riastradh

Hash-locked atomic64 to give ports like powerpc32 a chance at radeon.


Revision tags: perseant-exfatfs-base-20250801 netbsd-11-base netbsd-10-1-RELEASE perseant-exfatfs-base-20240630 perseant-exfatfs-base netbsd-10-0-RELEASE netbsd-10-0-RC6 netbsd-10-0-RC5 netbsd-10-0-RC4 netbsd-10-0-RC3 netbsd-10-0-RC2 thorpej-ifq-base thorpej-altq-separation-base netbsd-10-0-RC1 netbsd-10-base bouyer-sunxi-drm-base
1.1 19-Dec-2021 riastradh

backlight stubs


Revision tags: perseant-exfatfs-base-20250801 netbsd-11-base perseant-exfatfs-base-20240630 perseant-exfatfs-base
1.17 20-May-2024 riastradh

drm: Fix missing bounds checks in dma buf mmap.


Revision tags: thorpej-ifq-base thorpej-altq-separation-base
1.16 21-Feb-2023 riastradh

drm: Teach dmabuf to handle lseek.

Needed by libdrm_amdgpu.

Based on patch from Jeff Frasca -- thanks!

XXX pullup-10


Revision tags: netbsd-10-base bouyer-sunxi-drm-base
1.15 09-Apr-2022 riastradh

branches: 1.15.4;
drm: Convert membar_enter/exit stragglers to membar_acquire/release.


1.14 17-Feb-2022 riastradh

drm: Fix membars around dma_buf_put reference count release.


1.13 19-Dec-2021 riastradh

amdgpu: amdgpu_dma_buf.c


1.12 19-Dec-2021 riastradh

drm: Omit half-baked dma_buf_file indirection.


1.11 19-Dec-2021 riastradh

drm: Note NetBSD->Linux errno conversion.


1.10 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.9 19-Dec-2021 riastradh

Rename reservation_object -> dma_resv.


1.8 19-Dec-2021 riastradh

Update dma-buf API enough to compile drm_prime.c.


1.7 19-Dec-2021 riastradh

No need for <linux/fence.h> in linux_dma_buf.c.


Revision tags: thorpej-i2c-spi-conf2-base thorpej-futex2-base thorpej-cfargs2-base cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 cjep_staticlib_x-base thorpej-i2c-spi-conf-base thorpej-cfargs-base thorpej-futex-base bouyer-xenpvh-base2 phil-wifi-20200421 bouyer-xenpvh-base1 phil-wifi-20200411 bouyer-xenpvh-base is-mlppp-base phil-wifi-20200406 ad-namecache-base3 ad-namecache-base2 ad-namecache-base1 ad-namecache-base phil-wifi-20191119
1.6 17-Oct-2019 maya

correct error handling.

from Ilja Van Sprundel, thanks.


Revision tags: netbsd-9-base phil-wifi-20190609 isaki-audio2-base pgoyette-compat-20190127 pgoyette-compat-20190118
1.5 04-Jan-2019 tnn

branches: 1.5.4; 1.5.6;
dma_buf_fd(): fd_putfile() does not belong here

PR kern/53834 ok riastradh@


Revision tags: pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906
1.4 27-Aug-2018 riastradh

branches: 1.4.2;
Implement poll for reservations and dma bufs.


1.3 27-Aug-2018 riastradh

Simplify. Destroy the mutex too.


1.2 27-Aug-2018 riastradh

Return the fd we just allocated.


1.1 27-Aug-2018 riastradh

Draft support for drm prime.


Revision tags: perseant-exfatfs-base-20250801 netbsd-11-base netbsd-10-1-RELEASE perseant-exfatfs-base-20240630 perseant-exfatfs-base netbsd-10-0-RELEASE netbsd-10-0-RC6 netbsd-10-0-RC5 netbsd-10-0-RC4 netbsd-10-0-RC3 netbsd-10-0-RC2 thorpej-ifq-base thorpej-altq-separation-base netbsd-10-0-RC1 netbsd-10-base bouyer-sunxi-drm-base
1.42 01-Sep-2022 riastradh

drm: Fix dma fence stub fix so the lock is actually initialized.

Tested but forgot to amend change before exporting to CVS again.


1.41 01-Sep-2022 riastradh

drm: Fix dma fence stub so it works with locking operations.


1.40 09-Apr-2022 riastradh

drm: Convert membar_enter/exit stragglers to membar_acquire/release.


1.39 19-Dec-2021 riastradh

drm: Use atomic_load_consume/relaxed to simplify code.


1.38 19-Dec-2021 riastradh

drm: Support 64-bit fence context and sequence numbers.


1.37 19-Dec-2021 riastradh

drm: Make sure dma_fence_wait gets traced too. Deduplicate.


1.36 19-Dec-2021 riastradh

drm: Add dtrace probes to fences.


1.35 19-Dec-2021 riastradh

drm: Fix signalling return value if no enable_signaling op.


1.34 19-Dec-2021 riastradh

drm: Use atomic_load_relaxed for fence->flags when not locked.

Shouldn't make a semantic difference on any machines we run on, but
will make sanitizers happier and emphasize to readers that the result
may not be reliable at these points.


1.33 19-Dec-2021 riastradh

drm: Assert dma_fence_wait internal return value.


1.32 19-Dec-2021 riastradh

drm: Rework timeout return code logic.


1.31 19-Dec-2021 riastradh

drm: Rework dma_fence_wait_any_timeout.

- Yield the first index, not the most recently signalled one.
- Check again after last wakeup.
- Make sure to return positive for nontimeout.
- Handle ip=null.


1.30 19-Dec-2021 riastradh

drm: Set fence->ops for stub fences too.


1.29 19-Dec-2021 riastradh

drm: set f_magic in the stub fence.


Author: phone <mrg@NetBSD.org>
Committer: Taylor R Campbell <riastradh@NetBSD.org>


1.28 19-Dec-2021 riastradh

drm: In dma_fence_wait_timeout, allow MAX_SCHEDULE_TIMEOUT.

In the Linux API, this means wait forever.


1.27 19-Dec-2021 riastradh

drm: Print bad timeout in dma_fence_wait_timeout kasserts.


1.26 19-Dec-2021 riastradh

drm: dma_fence_get allows fence to be null; fix assertion.

While here, update comments about semantics for dma_fence_get and
dma_fence_get_rcu (which does not allow null fence).


1.25 19-Dec-2021 riastradh

drm: Set fence timestamps -- i915 uses them.


1.24 19-Dec-2021 riastradh

drm: Sprinkle assertions about fence lifetime.


1.23 19-Dec-2021 riastradh

drm: Add a kassert for fence destruction.


1.22 19-Dec-2021 riastradh

drm: Skip enabling signalling for fence if already signalled.


1.21 19-Dec-2021 riastradh

drm: Ensure the fence callback is initialized on failure.


1.20 19-Dec-2021 riastradh

drm: Rework enable-signal logic to match Linux.


1.19 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.18 19-Dec-2021 riastradh

i915: Defer destroying request lock and fence until page destruction.


1.17 19-Dec-2021 riastradh

Add missing unlock at exit


Author: Maya Rashish <maya@NetBSD.org>
Committer: Taylor R Campbell <riastradh@NetBSD.org>


1.16 19-Dec-2021 riastradh

drm/dma-fence: Fix zero timeout semantics in dma_fence_default_wait.


1.15 19-Dec-2021 riastradh

linux dma-fence: Fix up more callback uses.


1.14 19-Dec-2021 riastradh

linux dma-fence: Use dma_fence_default_wait if .wait is null.


1.13 19-Dec-2021 riastradh

Fix typo.


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

First approximation of dma_fence_get_stub.


1.8 19-Dec-2021 riastradh

Issue __insn_barrier in dma_fence_get_rcu.

This way it is safe to use as dma_fence_get_rcu(*p) when concurrent
writes to *p might be happening, so that we load *p only once before
using the value.


1.7 19-Dec-2021 riastradh

Allow const volatile fence pointer pointers in dma_fence_get_rcu_safe.


1.6 19-Dec-2021 riastradh

We spell it ELAST.


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.


Revision tags: perseant-exfatfs-base-20250801 netbsd-11-base netbsd-10-1-RELEASE perseant-exfatfs-base-20240630 perseant-exfatfs-base netbsd-10-0-RELEASE netbsd-10-0-RC6 netbsd-10-0-RC5 netbsd-10-0-RC4 netbsd-10-0-RC3 netbsd-10-0-RC2 thorpej-ifq-base thorpej-altq-separation-base netbsd-10-0-RC1 netbsd-10-base bouyer-sunxi-drm-base
1.4 19-Dec-2021 riastradh

drm: Make dma fence array name strings match Linux.


1.3 19-Dec-2021 riastradh

drm: Another missing spin_lock_destroy.


1.2 19-Dec-2021 riastradh

drm: Draft dma-fence-array.


1.1 19-Dec-2021 riastradh

linux: dma fence array stubs


Revision tags: perseant-exfatfs-base-20250801 netbsd-11-base netbsd-10-1-RELEASE perseant-exfatfs-base-20240630 perseant-exfatfs-base netbsd-10-0-RELEASE netbsd-10-0-RC6 netbsd-10-0-RC5 netbsd-10-0-RC4 netbsd-10-0-RC3 netbsd-10-0-RC2 thorpej-ifq-base thorpej-altq-separation-base netbsd-10-0-RC1 netbsd-10-base bouyer-sunxi-drm-base
1.4 09-Apr-2022 riastradh

drm: Convert membar_enter/exit stragglers to membar_acquire/release.


1.3 19-Dec-2021 riastradh

drm: Implement dma fence chains.


1.2 19-Dec-2021 riastradh

drm: Release fence in dma_fence_chain_walk.


1.1 19-Dec-2021 riastradh

dma fence chain stubs


Revision tags: perseant-exfatfs-base-20250801 netbsd-11-base netbsd-10-1-RELEASE perseant-exfatfs-base-20240630 perseant-exfatfs-base netbsd-10-0-RELEASE netbsd-10-0-RC6 netbsd-10-0-RC5 netbsd-10-0-RC4 netbsd-10-0-RC3 netbsd-10-0-RC2 thorpej-ifq-base thorpej-altq-separation-base netbsd-10-0-RC1 netbsd-10-base bouyer-sunxi-drm-base
1.22 15-Feb-2022 riastradh

drm: Use KM_SLEEP to allocate reservation fence arrays.

Except as a fast path in an RCU reader.

The array sizes appear to be reasonably small and not trivially
controlled by userland, from what I can tell, so if my impression is
accurate, it is reasonable to sleep for allocation here.


1.21 19-Dec-2021 riastradh

drm: Fix comment about dma_resv_lock_* return values.


1.20 19-Dec-2021 riastradh

drm: Paranoia: handle fencep=null, fence!=null, and 0 shared.

Not sure this is possible but I don't know the API well enough to
prove it can't happen.


1.19 19-Dec-2021 riastradh

drm: Fix missing restart on race in dma_resv_get_fences_rcu.


1.18 19-Dec-2021 riastradh

drm: Support dma_resv_reserve_shared(..., num_fences>1).


1.17 19-Dec-2021 riastradh

drm: Implement drm_resv_get_fences_rcu with null fencep.


1.16 19-Dec-2021 riastradh

drm: Factor dma_fence_put out of multiple dma_resv_do_poll branches.


1.15 19-Dec-2021 riastradh

drm: Fix dma_resv_test_signaled_rcu and dma_resv_wait_timeout_rcu.

Make them implemented the semantics as documented like Linux does:
only test the exclusive fence if there's no shared fences.


1.14 19-Dec-2021 riastradh

drm: Make sure to check read ticket after reading shared fences.

Not entirely sure it was a bug not to do that, but let's make it easy
to prove that we got a consistent snapshot of the whole picture.


1.13 19-Dec-2021 riastradh

drm: Write comment for dma_resv_get_fences_rcu semantics.


1.12 19-Dec-2021 riastradh

drm: Factor out logic to read snapshot of fences in dma_resv.

Should make auditing a little easier.


1.11 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.10 19-Dec-2021 riastradh

drm: Fence leak audit. No functional change intended.

Sprinkle nulling out variables, add kasserts to reflect them, and
propagate their consequences to eliminate dead code. Should make it
easier to detect similar leak bugs.


1.9 19-Dec-2021 riastradh

drm: Fix sense of conditional to avoid null pointer dereference.


1.8 19-Dec-2021 riastradh

drm: Paranoia: null out fence if unreferenceable.


1.7 19-Dec-2021 riastradh

drm: Membar audit for dma_resv.

Try to pacify kcsan (untested) and make it clearer what ordering
matters.


1.6 19-Dec-2021 riastradh

drm: Use atomic_store_release/load_consume in linux_dma_resv.c.

At least, for robj->fence and robj->fence_excl. Need to review
list->shared_count and list->shared[i] too.


1.5 19-Dec-2021 riastradh

drm: Plug fence leak


1.4 19-Dec-2021 riastradh

Implement dma_resv_locking_ctx more carefully.


1.3 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.2 19-Dec-2021 riastradh

Add slow path versions of to drm_resv_lock.


1.1 19-Dec-2021 riastradh

Rename reservation_object -> dma_resv.


Revision tags: perseant-exfatfs-base-20250801 netbsd-11-base netbsd-10-1-RELEASE perseant-exfatfs-base-20240630 perseant-exfatfs-base netbsd-9-4-RELEASE netbsd-10-0-RELEASE netbsd-10-0-RC6 netbsd-10-0-RC5 netbsd-10-0-RC4 netbsd-10-0-RC3 netbsd-10-0-RC2 thorpej-ifq-base thorpej-altq-separation-base netbsd-10-0-RC1 netbsd-10-base bouyer-sunxi-drm-base netbsd-9-3-RELEASE thorpej-i2c-spi-conf2-base thorpej-futex2-base thorpej-cfargs2-base cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 netbsd-9-2-RELEASE cjep_staticlib_x-base thorpej-i2c-spi-conf-base thorpej-cfargs-base thorpej-futex-base netbsd-9-1-RELEASE bouyer-xenpvh-base2 phil-wifi-20200421 bouyer-xenpvh-base1 phil-wifi-20200411 bouyer-xenpvh-base is-mlppp-base phil-wifi-20200406 ad-namecache-base3 netbsd-9-0-RELEASE netbsd-9-0-RC2 ad-namecache-base2 ad-namecache-base1 ad-namecache-base netbsd-9-0-RC1 phil-wifi-20191119 netbsd-9-base phil-wifi-20190609 isaki-audio2-base pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906
1.2 27-Aug-2018 riastradh

Implement dmi_match.


Revision tags: netbsd-8-3-RELEASE netbsd-8-2-RELEASE netbsd-8-1-RELEASE netbsd-8-1-RC1 netbsd-7-2-RELEASE pgoyette-compat-0728 netbsd-8-0-RELEASE phil-wifi-base pgoyette-compat-0625 netbsd-8-0-RC2 pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 netbsd-8-0-RC1 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 netbsd-7-1-2-RELEASE pgoyette-compat-base netbsd-7-1-1-RELEASE tls-maxphys-base-20171202 matt-nb8-mediatek-base nick-nhusb-base-20170825 perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 jdolecek-ncq-base pgoyette-localcount-20170320 netbsd-7-1-RELEASE netbsd-7-1-RC2 nick-nhusb-base-20170204 netbsd-7-nhusb-base-20170116 bouyer-socketcan-base pgoyette-localcount-20170107 netbsd-7-1-RC1 nick-nhusb-base-20161204 pgoyette-localcount-20161104 netbsd-7-0-2-RELEASE nick-nhusb-base-20161004 localcount-20160914 netbsd-7-nhusb-base pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base nick-nhusb-base-20160907 nick-nhusb-base-20160529 netbsd-7-0-1-RELEASE nick-nhusb-base-20160422 nick-nhusb-base-20160319 nick-nhusb-base-20151226 netbsd-7-0-RELEASE nick-nhusb-base-20150921 netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 nick-nhusb-base-20150606 nick-nhusb-base-20150406 nick-nhusb-base tls-maxphys-base netbsd-7-base tls-earlyentropy-base rmind-smpnet-base rmind-smpnet-nbase yamt-pagecache-base9
1.1 25-Apr-2014 riastradh

branches: 1.1.2; 1.1.4; 1.1.6; 1.1.10; 1.1.34; 1.1.36;
Implement Linux dmi_check_system API.

Use it to get a Thinkpad quirk for i915 graphics.

Patch from nonoka@, PR 48708.


Revision tags: perseant-exfatfs-base-20250801 perseant-exfatfs-base-20240630 perseant-exfatfs-base bouyer-sunxi-drm-base
1.17 19-Dec-2021 riastradh

Rename fence -> dma_fence, step 1: files.


Revision tags: thorpej-i2c-spi-conf2-base thorpej-futex2-base thorpej-cfargs2-base cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 cjep_staticlib_x-base thorpej-i2c-spi-conf-base thorpej-cfargs-base thorpej-futex-base
1.16 03-Jul-2020 maxv

hardclock_ticks -> getticks()


Revision tags: netbsd-9-4-RELEASE netbsd-9-3-RELEASE netbsd-9-2-RELEASE netbsd-9-1-RELEASE bouyer-xenpvh-base2 phil-wifi-20200421 bouyer-xenpvh-base1 phil-wifi-20200411 bouyer-xenpvh-base is-mlppp-base phil-wifi-20200406 ad-namecache-base3 netbsd-9-0-RELEASE netbsd-9-0-RC2 ad-namecache-base2 ad-namecache-base1 ad-namecache-base netbsd-9-0-RC1 phil-wifi-20191119 netbsd-9-base phil-wifi-20190609 isaki-audio2-base
1.15 16-Apr-2019 mrg

branches: 1.15.4;
fix various problems i've seen where cv_*wait*() return ERESTART,
which is -3 in netbsd, which we have mapped linux ERESTARTSYS to.

this has a problem because linux code often returns errors and
pointers in the same value, and pointer values between -4095 and
-1 are considered as error returns, but -3 ends up as 3 and thus
is not considered an error, and mayhem ensues.

with this in place my kabylake system seems actually stable, i
have not triggered any of my prior issues in almost 4 weeks now.


Taylor asked me to write up a description and then wrote most of
the text below for me :-)


In Linux code, we always work with ERESTARTSYS so the code meaning
start over is a positive NetBSD errno safe for PTR_ERR/ERR_PTR.
To achieve this:
1. adapt all cv_waits that return to Linux so they map ERESTART to
ERESTARTSYS, and
2. adapt all returns to userland so they convert ERESTARTSYS to
ERESTART.
Leave EINTR and all other error codes alone.


Revision tags: pgoyette-compat-20190127 pgoyette-compat-20190118
1.14 05-Jan-2019 tnn

fence_referenced_p(): mark as __diagused


Revision tags: pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906
1.13 01-Sep-2018 riastradh

branches: 1.13.2;
Allow fence_get(NULL).

This is kind of silly: if the caller has exclusive access to the
fence, they should be able to guarantee it's there, so this could
serve to suppress legitimate bugs. But better to preserve Linux
semantics here than to be picky about API design.

Bug by me, fix from Tobias Ulmer in PR kern/53565.


1.12 28-Aug-2018 riastradh

Issue __insn_barrier after loading hardclock_ticks.

For some reason this isn't volatile...


1.11 28-Aug-2018 riastradh

Assert EWOULDBLOCK happens only with timeout.


1.10 28-Aug-2018 riastradh

With no timeout, fence_default_wait must return 1 on success, never 0.


1.9 27-Aug-2018 riastradh

KASSERT -> KASSERTMSG, to help debug panic observed by mrg@.


1.8 27-Aug-2018 riastradh

Linux fence_put accepts NULL as noop. Match this.

From mrg@.


1.7 27-Aug-2018 riastradh

Make extremely noisy fence trace output conditional.


1.6 27-Aug-2018 riastradh

Lotsa kasserts about referencedness of frences.


1.5 27-Aug-2018 riastradh

Add fence_is_later and fence_wait_any_timeout.


1.4 27-Aug-2018 riastradh

Fix prototype of function in comment.


1.3 27-Aug-2018 riastradh

Fence release callback may be absent; default to fence_free.


1.2 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.1 27-Aug-2018 riastradh

Draft implementation of the Linux reservation and fence APIs.


Revision tags: perseant-exfatfs-base-20250801 netbsd-11-base netbsd-10-1-RELEASE perseant-exfatfs-base-20240630 perseant-exfatfs-base netbsd-10-0-RELEASE netbsd-10-0-RC6 netbsd-10-0-RC5 netbsd-10-0-RC4 netbsd-10-0-RC3 netbsd-10-0-RC2 thorpej-ifq-base thorpej-altq-separation-base netbsd-10-0-RC1 netbsd-10-base bouyer-sunxi-drm-base
1.2 19-Dec-2021 riastradh

linux: request_firmware_direct


1.1 19-Dec-2021 riastradh

Move Linux firmware shims to their own .c file.


Revision tags: perseant-exfatfs-base-20250801 perseant-exfatfs-base-20240630 perseant-exfatfs-base bouyer-sunxi-drm-base cjep_sun2x-base cjep_staticlib_x-base1 cjep_staticlib_x-base thorpej-futex-base bouyer-xenpvh-base2 phil-wifi-20200421 bouyer-xenpvh-base1 phil-wifi-20200411 bouyer-xenpvh-base phil-wifi-20200406 ad-namecache-base3 ad-namecache-base2 ad-namecache-base1 ad-namecache-base isaki-audio2-base pgoyette-compat-merge-20190127 pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 pgoyette-compat-0728 pgoyette-compat-0625 pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base perseant-stdc-iso10646-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 pgoyette-localcount-20170320 bouyer-socketcan-base pgoyette-localcount-20170107 pgoyette-localcount-20161104 localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base tls-maxphys-base tls-earlyentropy-base
1.3 17-Jul-2014 riastradh

Remove needless linux_gfp.c.

Trying to make do with Linux's page allocation interface is pretty
much always wrong: either we let uvm allocate pages in uvm objects
for us, or we use bus_dma.


Revision tags: yamt-pagecache-base9 riastradh-xf86-video-intel-2-7-1-pre-2-21-15 rmind-smpnet-base rmind-smpnet-nbase
1.2 18-Mar-2014 riastradh

branches: 1.2.2; 1.2.4; 1.2.6;
Merge riastradh-drm2 to HEAD.


Revision tags: riastradh-drm2-base3
1.1 24-Jul-2013 riastradh

branches: 1.1.2;
file linux_gfp.c was initially added on branch riastradh-drm2.


Revision tags: perseant-exfatfs-base-20250801 netbsd-11-base netbsd-10-1-RELEASE perseant-exfatfs-base-20240630 perseant-exfatfs-base netbsd-10-0-RELEASE netbsd-10-0-RC6 netbsd-10-0-RC5 netbsd-10-0-RC4 netbsd-10-0-RC3 netbsd-10-0-RC2 thorpej-ifq-base thorpej-altq-separation-base netbsd-10-0-RC1 netbsd-10-base bouyer-sunxi-drm-base
1.10 10-Jul-2022 riastradh

linux/hdmi: Fix size of product id.


1.9 10-Jul-2022 riastradh

linux/hdmi: Fix return value in unpack.


1.8 09-Jul-2022 riastradh

linux/hdmi: Fix hdmi_infoframe_unpack to record the unpacked header.


1.7 09-Jul-2022 riastradh

linux/hdmi: Handle audio infoframes in hdmi_infoframe_pack.

Sort cases by type number.


1.6 09-Jul-2022 riastradh

linux/hdmi: Convert failure branch to kassert for internal invariant.


1.5 09-Jul-2022 riastradh

linux/hdmi: Use ssize_t for all hdmi_*_infoframe_pack functions.


1.4 09-Jul-2022 riastradh

linux/hdmi: Zero entire union hdmi_infoframe on unpack.

Don't just zero the part that we're about to initialize -- i915 does
memcmp on the whole structure.


1.3 09-Jul-2022 riastradh

linux/hdmi: Handle unpacking audio frames too. Sort by number.


1.2 09-Jul-2022 riastradh

linux/hdmi: Make some private functions static.


1.1 09-Jul-2022 riastradh

linux/hdmi.h: Split out logic into .c file.

Shoulda done this ages ago.


Revision tags: perseant-exfatfs-base-20250801 netbsd-11-base netbsd-10-1-RELEASE perseant-exfatfs-base-20240630 perseant-exfatfs-base netbsd-10-0-RELEASE netbsd-10-0-RC6 netbsd-10-0-RC5 netbsd-10-0-RC4 netbsd-10-0-RC3 netbsd-10-0-RC2 thorpej-ifq-base thorpej-altq-separation-base netbsd-10-0-RC1 netbsd-10-base bouyer-sunxi-drm-base
1.3 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.2 19-Dec-2021 riastradh

Add hrtimer_destroy


Author: Maya Rashish <maya@NetBSD.org>
Committer: Taylor R Campbell <riastradh@NetBSD.org>


1.1 19-Dec-2021 riastradh

linux compat: Draft hrtimer shims.

(not actually high-resolution, just a wrapper around callout(9))


Revision tags: perseant-exfatfs-base-20250801 netbsd-11-base netbsd-10-1-RELEASE perseant-exfatfs-base-20240630 perseant-exfatfs-base netbsd-10-0-RELEASE netbsd-10-0-RC6 netbsd-10-0-RC5 netbsd-10-0-RC4 netbsd-10-0-RC3 netbsd-10-0-RC2 thorpej-ifq-base thorpej-altq-separation-base netbsd-10-0-RC1 netbsd-10-base bouyer-sunxi-drm-base
1.7 22-May-2022 riastradh

linux: Repeat i2c transfer if driver fails with EAGAIN.

The Intel GMBUS (graphics management bus, i2c controller) relies on
this now to fall back from interrupt-driven xfers to bit-banging.


1.6 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.5 19-Dec-2021 riastradh

Provide a definition of I2C_M_STOP XXX


Author: Maya Rashish <maya@NetBSD.org>


1.4 19-Dec-2021 riastradh

Support i2c bus lock operations.


Revision tags: netbsd-8-3-RELEASE netbsd-9-4-RELEASE netbsd-9-3-RELEASE thorpej-i2c-spi-conf2-base thorpej-futex2-base thorpej-cfargs2-base cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 netbsd-9-2-RELEASE cjep_staticlib_x-base thorpej-i2c-spi-conf-base thorpej-cfargs-base thorpej-futex-base netbsd-9-1-RELEASE bouyer-xenpvh-base2 phil-wifi-20200421 bouyer-xenpvh-base1 phil-wifi-20200411 bouyer-xenpvh-base is-mlppp-base phil-wifi-20200406 netbsd-8-2-RELEASE ad-namecache-base3 netbsd-9-0-RELEASE netbsd-9-0-RC2 ad-namecache-base2 ad-namecache-base1 ad-namecache-base netbsd-9-0-RC1 phil-wifi-20191119 netbsd-9-base phil-wifi-20190609 netbsd-8-1-RELEASE netbsd-8-1-RC1 isaki-audio2-base pgoyette-compat-merge-20190127 pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 pgoyette-compat-0728 netbsd-8-0-RELEASE phil-wifi-base pgoyette-compat-0625 netbsd-8-0-RC2 pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 netbsd-8-0-RC1 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base tls-maxphys-base-20171202 matt-nb8-mediatek-base nick-nhusb-base-20170825 perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 jdolecek-ncq-base pgoyette-localcount-20170320 nick-nhusb-base-20170204 bouyer-socketcan-base pgoyette-localcount-20170107 nick-nhusb-base-20161204 pgoyette-localcount-20161104 nick-nhusb-base-20161004 localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base nick-nhusb-base-20160907 nick-nhusb-base-20160529 nick-nhusb-base-20160422 nick-nhusb-base-20160319 nick-nhusb-base-20151226 nick-nhusb-base-20150921 nick-nhusb-base-20150606 nick-nhusb-base-20150406
1.3 05-Mar-2015 riastradh

Reorganize Linux i2c header file and add a few more shims.


Revision tags: nick-nhusb-base tls-maxphys-base netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 rmind-smpnet-base rmind-smpnet-nbase
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.


Revision tags: riastradh-drm2-base3
1.1 24-Jul-2013 riastradh

branches: 1.1.2;
file linux_i2c.c was initially added on branch riastradh-drm2.


Revision tags: perseant-exfatfs-base-20250801 netbsd-11-base netbsd-10-1-RELEASE perseant-exfatfs-base-20240630 perseant-exfatfs-base netbsd-10-0-RELEASE netbsd-10-0-RC6 netbsd-10-0-RC5 netbsd-10-0-RC4 netbsd-10-0-RC3 netbsd-10-0-RC2 thorpej-ifq-base thorpej-altq-separation-base netbsd-10-0-RC1 netbsd-10-base bouyer-sunxi-drm-base
1.15 19-Dec-2021 riastradh

linux/idr: Remove meaningless stray membar.


1.14 19-Dec-2021 riastradh

Teach idr_remove to accept failure.

But teach it to return the data if it succeeds too.


1.13 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!


Revision tags: netbsd-9-4-RELEASE netbsd-9-3-RELEASE thorpej-i2c-spi-conf2-base thorpej-futex2-base thorpej-cfargs2-base cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 netbsd-9-2-RELEASE cjep_staticlib_x-base thorpej-i2c-spi-conf-base thorpej-cfargs-base thorpej-futex-base netbsd-9-1-RELEASE bouyer-xenpvh-base2 phil-wifi-20200421 bouyer-xenpvh-base1 phil-wifi-20200411 bouyer-xenpvh-base is-mlppp-base phil-wifi-20200406 ad-namecache-base3 netbsd-9-0-RELEASE netbsd-9-0-RC2 ad-namecache-base2 ad-namecache-base1 ad-namecache-base netbsd-9-0-RC1 phil-wifi-20191119 netbsd-9-base phil-wifi-20190609 isaki-audio2-base pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906
1.12 27-Aug-2018 riastradh

sdt probe naming style.


1.11 27-Aug-2018 riastradh

Work around broken empty expansion of SDT_PROBE* if !KDTRACE_HOOKS.


1.10 27-Aug-2018 riastradh

sdt dtrace probes for linux idr.


1.9 27-Aug-2018 riastradh

Zero-initialize idr cache.


1.8 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.7 27-Aug-2018 riastradh

Add idr_get_next and idr_for_each_entry.


Revision tags: pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625 pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base tls-maxphys-base-20171202 nick-nhusb-base-20170825
1.6 26-Jul-2017 riastradh

branches: 1.6.2; 1.6.4;
Tweak slightly sketchy logic in linux_idr.

1. idr_preload can fail if you don't set __GFP_WAIT.
2. If idr_preload fails, it is wrong for idr_alloc to assert.
3. There is no way for idr_alloc to know what flags idr_preload got.

Probably won't *fix* any bugs, but if there is a bug with a missing
__GFP_WAIT, then we will learn about a trifle sooner.


Revision tags: netbsd-8-0-RELEASE netbsd-8-0-RC2 netbsd-8-0-RC1 matt-nb8-mediatek-base perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 jdolecek-ncq-base pgoyette-localcount-20170320 nick-nhusb-base-20170204 bouyer-socketcan-base pgoyette-localcount-20170107 nick-nhusb-base-20161204 pgoyette-localcount-20161104 nick-nhusb-base-20161004 localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base nick-nhusb-base-20160907 nick-nhusb-base-20160529 nick-nhusb-base-20160422 nick-nhusb-base-20160319 nick-nhusb-base-20151226 nick-nhusb-base-20150921 nick-nhusb-base-20150606 nick-nhusb-base-20150406
1.5 01-Jan-2015 mrg

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


Revision tags: nick-nhusb-base
1.4 04-Nov-2014 jmcneill

branches: 1.4.2;
This code should be MP-safe. Use IPL_SCHED in place of IPL_DRM/IPL_VM and set
D_MPSAFE flag in cdevsw.


Revision tags: netbsd-7-2-RELEASE netbsd-7-1-2-RELEASE netbsd-7-1-1-RELEASE netbsd-7-1-RELEASE netbsd-7-1-RC2 netbsd-7-nhusb-base-20170116 netbsd-7-1-RC1 netbsd-7-0-2-RELEASE netbsd-7-nhusb-base netbsd-7-0-1-RELEASE netbsd-7-0-RELEASE netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 tls-maxphys-base netbsd-7-base tls-earlyentropy-base
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.


Revision tags: yamt-pagecache-base9 riastradh-xf86-video-intel-2-7-1-pre-2-21-15 rmind-smpnet-base rmind-smpnet-nbase
1.2 18-Mar-2014 riastradh

branches: 1.2.2; 1.2.4; 1.2.6;
Merge riastradh-drm2 to HEAD.


Revision tags: riastradh-drm2-base3
1.1 24-Jul-2013 riastradh

branches: 1.1.2;
file linux_idr.c was initially added on branch riastradh-drm2.


Revision tags: perseant-exfatfs-base-20250801 netbsd-11-base netbsd-10-1-RELEASE perseant-exfatfs-base-20240630 perseant-exfatfs-base netbsd-10-0-RELEASE netbsd-10-0-RC6 netbsd-10-0-RC5 netbsd-10-0-RC4 netbsd-10-0-RC3 netbsd-10-0-RC2 thorpej-ifq-base thorpej-altq-separation-base netbsd-10-0-RC1 netbsd-10-base bouyer-sunxi-drm-base
1.1 19-Dec-2021 riastradh

drm: Move io_mapping to very own .c file.


Revision tags: perseant-exfatfs-base-20250801 netbsd-11-base netbsd-10-1-RELEASE perseant-exfatfs-base-20240630 perseant-exfatfs-base netbsd-10-0-RELEASE netbsd-10-0-RC6 netbsd-10-0-RC5 netbsd-10-0-RC4 netbsd-10-0-RC3 netbsd-10-0-RC2 thorpej-ifq-base thorpej-altq-separation-base netbsd-10-0-RC1 netbsd-10-base bouyer-sunxi-drm-base
1.2 19-Dec-2021 riastradh

linux: Use pointer indirection for irq_work_cpu.

Can't store locks in percpu since it moves around.


1.1 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...


Revision tags: perseant-exfatfs-base-20250801 netbsd-11-base netbsd-10-1-RELEASE perseant-exfatfs-base-20240630 perseant-exfatfs-base netbsd-9-4-RELEASE netbsd-10-0-RELEASE netbsd-10-0-RC6 netbsd-10-0-RC5 netbsd-10-0-RC4 netbsd-10-0-RC3 netbsd-10-0-RC2 thorpej-ifq-base thorpej-altq-separation-base netbsd-10-0-RC1 netbsd-10-base bouyer-sunxi-drm-base netbsd-9-3-RELEASE thorpej-i2c-spi-conf2-base thorpej-futex2-base thorpej-cfargs2-base cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 netbsd-9-2-RELEASE cjep_staticlib_x-base thorpej-i2c-spi-conf-base thorpej-cfargs-base thorpej-futex-base netbsd-9-1-RELEASE bouyer-xenpvh-base2 phil-wifi-20200421 bouyer-xenpvh-base1 phil-wifi-20200411 bouyer-xenpvh-base is-mlppp-base phil-wifi-20200406 ad-namecache-base3 netbsd-9-0-RELEASE netbsd-9-0-RC2 ad-namecache-base2 ad-namecache-base1 ad-namecache-base netbsd-9-0-RC1 phil-wifi-20191119 netbsd-9-base phil-wifi-20190609 isaki-audio2-base pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906
1.16 27-Aug-2018 riastradh

Ifdef out label used only by !__HAVE_MM_MD_DIRECT_MAPPED_PHYS.


1.15 27-Aug-2018 riastradh

Work around `kmap' namespace clash another way.


1.14 27-Aug-2018 riastradh

Work around a namespacing clash between dtrace and linux symbol.


1.13 27-Aug-2018 riastradh

sdt dtrace probes for linux kmap.


Revision tags: netbsd-8-3-RELEASE netbsd-8-2-RELEASE netbsd-8-1-RELEASE netbsd-8-1-RC1 pgoyette-compat-0728 netbsd-8-0-RELEASE phil-wifi-base pgoyette-compat-0625 netbsd-8-0-RC2 pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 netbsd-8-0-RC1 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base tls-maxphys-base-20171202 matt-nb8-mediatek-base nick-nhusb-base-20170825 perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 jdolecek-ncq-base pgoyette-localcount-20170320 nick-nhusb-base-20170204 bouyer-socketcan-base pgoyette-localcount-20170107 nick-nhusb-base-20161204 pgoyette-localcount-20161104 nick-nhusb-base-20161004 localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base nick-nhusb-base-20160907 nick-nhusb-base-20160529 nick-nhusb-base-20160422 nick-nhusb-base-20160319 nick-nhusb-base-20151226 nick-nhusb-base-20150921 nick-nhusb-base-20150606 nick-nhusb-base-20150406
1.12 01-Jan-2015 mrg

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


Revision tags: nick-nhusb-base
1.11 04-Nov-2014 jmcneill

branches: 1.11.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.10 27-Aug-2014 riastradh

Use direct map if available in linux_kmap.

Yields 20% increase in glxgears framerate.


1.9 27-Aug-2014 riastradh

Tweak style.

No functional change intended. Assembly differences appear to be
only related to kassert line numbers.


1.8 27-Aug-2014 riastradh

__diagused, not __unused.


1.7 27-Aug-2014 riastradh

Assert sleepable in Linux kmap/kunmap.


1.6 27-Aug-2014 riastradh

Simplify empty test for linux_kmap_entries.


1.5 27-Aug-2014 riastradh

Convert linux_kmap_lock to an adaptive lock.

kmap/kunmap can't be used in interrupt context anyway, so there is no
need for this to be a spin lock.


Revision tags: tls-maxphys-base netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 rmind-smpnet-base rmind-smpnet-nbase
1.4 28-Mar-2014 riastradh

branches: 1.4.4; 1.4.6; 1.4.8; 1.4.10;
Don't leak KVA by forgetting to call uvm_km_free...oops!

From rmind@.


1.3 28-Mar-2014 riastradh

Remove needless splvm/splx calls.

From rmind@, who explained that the pmap(9) man page is wrong.


1.2 18-Mar-2014 riastradh

Merge riastradh-drm2 to HEAD.


Revision tags: riastradh-drm2-base3
1.1 24-Jul-2013 riastradh

branches: 1.1.2;
file linux_kmap.c was initially added on branch riastradh-drm2.


Revision tags: perseant-exfatfs-base-20250801 netbsd-11-base netbsd-10-1-RELEASE perseant-exfatfs-base-20240630 perseant-exfatfs-base netbsd-10-0-RELEASE netbsd-10-0-RC6 netbsd-10-0-RC5 netbsd-10-0-RC4 netbsd-10-0-RC3 netbsd-10-0-RC2 thorpej-ifq-base thorpej-altq-separation-base netbsd-10-0-RC1 netbsd-10-base bouyer-sunxi-drm-base
1.9 19-Dec-2021 riastradh

drm: Work around busted kthread_join.


1.8 19-Dec-2021 riastradh

drm: Fix error return for kthread_run: error pointer, not null.


1.7 19-Dec-2021 riastradh

drm: Take advantage of kthread interlock to reduce diff.


1.6 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.5 19-Dec-2021 riastradh

drm: Trigger `spurious' wakeup for kthread_stop too.


1.4 19-Dec-2021 riastradh

linux: In kthread_park, wake thread to re-check kthread_shouldpark.

Otherwise, the thread to pakr may be sleeping on some condvar not
noticing it has to notify kthread_park --> deadlock.


1.3 19-Dec-2021 riastradh

linux: Make kthread_park/stop work at IPL_VM.

Needed in order to hold spin locks around it.


1.2 19-Dec-2021 riastradh

linux: Paranoia: Don't read kt_shouldstop unlocked.


1.1 19-Dec-2021 riastradh

drm: linux kthread stubs


Revision tags: perseant-exfatfs-base-20250801 netbsd-11-base netbsd-10-1-RELEASE perseant-exfatfs-base-20240630 perseant-exfatfs-base netbsd-8-3-RELEASE netbsd-9-4-RELEASE netbsd-10-0-RELEASE netbsd-10-0-RC6 netbsd-10-0-RC5 netbsd-10-0-RC4 netbsd-10-0-RC3 netbsd-10-0-RC2 thorpej-ifq-base thorpej-altq-separation-base netbsd-10-0-RC1 netbsd-10-base bouyer-sunxi-drm-base netbsd-9-3-RELEASE thorpej-i2c-spi-conf2-base thorpej-futex2-base thorpej-cfargs2-base cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 netbsd-9-2-RELEASE cjep_staticlib_x-base thorpej-i2c-spi-conf-base thorpej-cfargs-base thorpej-futex-base netbsd-9-1-RELEASE bouyer-xenpvh-base2 phil-wifi-20200421 bouyer-xenpvh-base1 phil-wifi-20200411 bouyer-xenpvh-base is-mlppp-base phil-wifi-20200406 netbsd-8-2-RELEASE ad-namecache-base3 netbsd-9-0-RELEASE netbsd-9-0-RC2 ad-namecache-base2 ad-namecache-base1 ad-namecache-base netbsd-9-0-RC1 phil-wifi-20191119 netbsd-9-base phil-wifi-20190609 netbsd-8-1-RELEASE netbsd-8-1-RC1 isaki-audio2-base pgoyette-compat-merge-20190127 pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 netbsd-7-2-RELEASE pgoyette-compat-0728 netbsd-8-0-RELEASE phil-wifi-base pgoyette-compat-0625 netbsd-8-0-RC2 pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 netbsd-8-0-RC1 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 netbsd-7-1-2-RELEASE pgoyette-compat-base netbsd-7-1-1-RELEASE tls-maxphys-base-20171202 matt-nb8-mediatek-base nick-nhusb-base-20170825 perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 jdolecek-ncq-base pgoyette-localcount-20170320 netbsd-7-1-RELEASE netbsd-7-1-RC2 nick-nhusb-base-20170204 netbsd-7-nhusb-base-20170116 bouyer-socketcan-base pgoyette-localcount-20170107 netbsd-7-1-RC1 nick-nhusb-base-20161204 pgoyette-localcount-20161104 netbsd-7-0-2-RELEASE nick-nhusb-base-20161004 localcount-20160914 netbsd-7-nhusb-base pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base nick-nhusb-base-20160907 nick-nhusb-base-20160529 netbsd-7-0-1-RELEASE nick-nhusb-base-20160422 nick-nhusb-base-20160319 nick-nhusb-base-20151226 netbsd-7-0-RELEASE nick-nhusb-base-20150921 netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 nick-nhusb-base-20150606 nick-nhusb-base-20150406 nick-nhusb-base tls-maxphys-base netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 rmind-smpnet-base rmind-smpnet-nbase
1.2 18-Mar-2014 riastradh

branches: 1.2.4; 1.2.6; 1.2.10;
Merge riastradh-drm2 to HEAD.


Revision tags: riastradh-drm2-base3
1.1 24-Jul-2013 riastradh

branches: 1.1.2;
file linux_list_sort.c was initially added on branch riastradh-drm2.


Revision tags: perseant-exfatfs-base-20250801 netbsd-11-base netbsd-10-1-RELEASE perseant-exfatfs-base-20240630 perseant-exfatfs-base netbsd-10-0-RELEASE netbsd-10-0-RC6 netbsd-10-0-RC5 netbsd-10-0-RC4 netbsd-10-0-RC3 netbsd-10-0-RC2 thorpej-ifq-base thorpej-altq-separation-base netbsd-10-0-RC1 netbsd-10-base bouyer-sunxi-drm-base
1.14 01-Sep-2022 riastradh

drm: Fix dma fence stub so it works with locking operations.


1.13 19-Dec-2021 riastradh

drm: linux kthread stubs


1.12 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.11 19-Dec-2021 riastradh

linux/wait_bit.h


1.10 19-Dec-2021 riastradh

Draft Linux tasklet implementation.


Revision tags: netbsd-9-4-RELEASE netbsd-9-3-RELEASE thorpej-i2c-spi-conf2-base thorpej-futex2-base thorpej-cfargs2-base cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 netbsd-9-2-RELEASE cjep_staticlib_x-base thorpej-i2c-spi-conf-base thorpej-cfargs-base thorpej-futex-base netbsd-9-1-RELEASE bouyer-xenpvh-base2 phil-wifi-20200421 bouyer-xenpvh-base1 phil-wifi-20200411 bouyer-xenpvh-base is-mlppp-base phil-wifi-20200406 ad-namecache-base3 netbsd-9-0-RELEASE netbsd-9-0-RC2 ad-namecache-base2 ad-namecache-base1 ad-namecache-base netbsd-9-0-RC1 phil-wifi-20191119 netbsd-9-base phil-wifi-20190609 isaki-audio2-base pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906
1.9 27-Aug-2018 riastradh

Hash-locked atomic64 to give ports like powerpc32 a chance at radeon.


1.8 27-Aug-2018 riastradh

Draft implementation of the Linux reservation and fence APIs.


1.7 27-Aug-2018 riastradh

Implement some of the Linux RCU API.


Revision tags: netbsd-8-3-RELEASE netbsd-8-2-RELEASE netbsd-8-1-RELEASE netbsd-8-1-RC1 pgoyette-compat-0728 netbsd-8-0-RELEASE phil-wifi-base pgoyette-compat-0625 netbsd-8-0-RC2 pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 netbsd-8-0-RC1 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base tls-maxphys-base-20171202 matt-nb8-mediatek-base nick-nhusb-base-20170825 perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 jdolecek-ncq-base pgoyette-localcount-20170320 nick-nhusb-base-20170204 bouyer-socketcan-base pgoyette-localcount-20170107 nick-nhusb-base-20161204 pgoyette-localcount-20161104 nick-nhusb-base-20161004 localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base nick-nhusb-base-20160907 nick-nhusb-base-20160529 nick-nhusb-base-20160422 nick-nhusb-base-20160319 nick-nhusb-base-20151226 nick-nhusb-base-20150921 nick-nhusb-base-20150606
1.6 13-Apr-2015 pgoyette

branches: 1.6.16; 1.6.18;
Update module dependencies:

drmkms does not depend on iic
drmkms_linux depends on i2cexec


Revision tags: nick-nhusb-base-20150406 nick-nhusb-base
1.5 11-Nov-2014 christos

branches: 1.5.2;
finalize the idr code.


Revision tags: tls-maxphys-base netbsd-7-base tls-earlyentropy-base
1.4 16-Jul-2014 riastradh

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


Revision tags: rmind-smpnet-base rmind-smpnet-nbase yamt-pagecache-base9 riastradh-xf86-video-intel-2-7-1-pre-2-21-15
1.2 18-Mar-2014 riastradh

branches: 1.2.2; 1.2.4; 1.2.6;
Merge riastradh-drm2 to HEAD.


Revision tags: riastradh-drm2-base3
1.1 04-Mar-2014 riastradh

branches: 1.1.2;
file linux_module.c was initially added on branch riastradh-drm2.


Revision tags: perseant-exfatfs-base-20250801 netbsd-11-base netbsd-10-1-RELEASE perseant-exfatfs-base-20240630 perseant-exfatfs-base netbsd-10-0-RELEASE netbsd-10-0-RC6 netbsd-10-0-RC5 netbsd-10-0-RC4 netbsd-10-0-RC3 netbsd-10-0-RC2 thorpej-ifq-base thorpej-altq-separation-base netbsd-10-0-RC1 netbsd-10-base bouyer-sunxi-drm-base
1.2 19-Dec-2021 riastradh

Match function name to code


Author: Maya Rashish <maya@NetBSD.org>
Committer: Taylor R Campbell <riastradh@NetBSD.org>


1.1 19-Dec-2021 riastradh

i915: more work


Revision tags: perseant-exfatfs-base-20250801 netbsd-11-base perseant-exfatfs-base-20240630 perseant-exfatfs-base
1.30 24-Jun-2024 riastradh

linux_pci: Fix shifto in pci_get_class.

It looks like Linux's pci_get_class also matches the interface part
of the PCI class register (but not the revision part), and I hadn't
noticed that in the previous shim structured differently.


1.29 23-Jun-2024 riastradh

linux_pci: Nix pci enumeration kludges.

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


1.28 19-May-2024 riastradh

linux: Add a few more cases to pci_get_class.

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


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

drm: enable almost all PCIe functionality

linux_pci.c revisions 1.24 and 1.25 implemented most of the remaining
missing PCIe backends, but only enabled them for some amdgpu portions.

this enables all code marked with "XXX amdgpu pcie", "XXX radeon pcie",
and "XXX pcie speed". for most of it, simply removing #ifndefs __NetBSD__
to enable compliation was required, once the new "bus->max_bus_speed"
member was added to struct pci_bus. add an "always fails" backend for
pci_enable_atomic_ops_to_root() which seems to only be necessary
for virtual GPU functionality (and could be implemented if needed.)

tested on radeon 5450, 7750, R7 240 [radeon], and RX 550 [amdgpu], and
nvidia 750 and 1030 [nouveau].


this still does not quite work on nvidia cards. there are two problems
that remain:

- the call to set the link speed is skipped because the speed is set
to the default value of "-1". nvkm_pcie_set_link() will actually
determine the right value for this and for some cards, calling this
function if the current speed is -1 helps set the link speed. it
may be that on linux other paths we don't have enabled properly
would set this (there's one via debugfs, and a jetson specific one,
though perhaps setting either AC or DC speed values as boot options
(after hooking up these for netbsd) would currently work.

- worse, cards newer than kepler - geforce 900, 1000, and newer, are
all lacking the backing support to set pcie link speed. the GT 1030
card i have been testing with remains at pcie 1.0.


1.26 04-Sep-2023 mrg

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

OK riastradh@.


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

branches: 1.25.2;
add pcie capability and read request size linux compat, some pci root support

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

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

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

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

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


ok @riastradh


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

fill out more of the linux pci API compat

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

ok riastradh@


1.23 20-Jul-2022 riastradh

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


1.22 19-Jul-2022 riastradh

drm: Nix drm_agp_borrow.

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

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


1.21 27-Feb-2022 riastradh

drm: Deconditionalize pci_get_segment.


1.20 19-Dec-2021 riastradh

linux: pci_name


1.19 19-Dec-2021 riastradh

i915: another whack at it


1.18 19-Dec-2021 riastradh

drm: Remove local diffs for drm_pci_set_busid.

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


1.17 19-Dec-2021 riastradh

Include acpica.h for NACPICA.


1.16 19-Dec-2021 riastradh

Move acpi includes to linux_pci.c to avoid pollution.


1.15 19-Dec-2021 riastradh

Stub dev_is_pci


Author: Maya Rashish <maya@NetBSD.org>


1.14 19-Dec-2021 riastradh

Define pci_is_thunderbolt_attached (answer: no).


1.13 19-Dec-2021 riastradh

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


1.12 19-Dec-2021 riastradh

Define pci_get/set_drvdata properly.


1.11 19-Dec-2021 riastradh

pci_get_bus_and_slot -> pci_get_domain_bus_and_slot


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

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

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


1.9 07-Feb-2020 jmcneill

Turn MSI off again.


1.8 03-Feb-2020 jmcneill

Re-enable PCI MSI for DRM devices


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

Use pci_get_segment if available


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

branches: 1.6.2; 1.6.6; 1.6.10;
Rework PCI and AGP conditionalization.

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


1.5 27-Aug-2018 riastradh

Try agp_i810_borrow only if CONFIG_AGP is enabled.


1.4 27-Aug-2018 riastradh

Treat pre-enabled devices as 1 enablecnt.


1.3 27-Aug-2018 riastradh

Zero the whole thing for good measure.


1.2 27-Aug-2018 riastradh

Make sure the resources are marked unmapped initially.


1.1 27-Aug-2018 riastradh

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

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


Revision tags: perseant-exfatfs-base-20250801 netbsd-11-base netbsd-10-1-RELEASE perseant-exfatfs-base-20240630 perseant-exfatfs-base netbsd-10-0-RELEASE netbsd-10-0-RC6 netbsd-10-0-RC5 netbsd-10-0-RC4 netbsd-10-0-RC3 netbsd-10-0-RC2 thorpej-ifq-base thorpej-altq-separation-base netbsd-10-0-RC1 netbsd-10-base bouyer-sunxi-drm-base
1.4 19-Dec-2021 riastradh

linux: GFP_ATOMIC, not GFP_NOWAIT


1.3 19-Dec-2021 riastradh

linux: membar_exit not needed if we use locks here.


1.2 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.1 19-Dec-2021 riastradh

linux: Kludgey radix tree shims


Revision tags: perseant-exfatfs-base-20250801 perseant-exfatfs-base-20240630 perseant-exfatfs-base bouyer-sunxi-drm-base
1.9 19-Dec-2021 riastradh

Move Linux RCU to common.


1.8 19-Dec-2021 riastradh

Implement kfree_rcu.


1.7 19-Dec-2021 riastradh

Make sure the RCU GC thread processes all callbacks before dying.


1.6 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.


Revision tags: thorpej-i2c-spi-conf2-base thorpej-futex2-base thorpej-cfargs2-base thorpej-i2c-spi-conf-base
1.5 21-Jul-2021 skrll

need <sys/param.h> for COHERENCY_UNIT


Revision tags: netbsd-9-4-RELEASE netbsd-9-3-RELEASE cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 netbsd-9-2-RELEASE cjep_staticlib_x-base thorpej-cfargs-base thorpej-futex-base netbsd-9-1-RELEASE bouyer-xenpvh-base2 phil-wifi-20200421 bouyer-xenpvh-base1 phil-wifi-20200411 bouyer-xenpvh-base is-mlppp-base phil-wifi-20200406 ad-namecache-base3 netbsd-9-0-RELEASE netbsd-9-0-RC2 ad-namecache-base2 ad-namecache-base1 ad-namecache-base netbsd-9-0-RC1 phil-wifi-20191119 netbsd-9-base phil-wifi-20190609 isaki-audio2-base pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906
1.4 27-Aug-2018 riastradh

branches: 1.4.2; 1.4.6; 1.4.20;
dtrace sdt probes for linux rcu.


1.3 27-Aug-2018 riastradh

Make gc static. No need to use this private state elsewhere.


1.2 27-Aug-2018 riastradh

Don't forget to call kthread_exit.


1.1 27-Aug-2018 riastradh

Implement some of the Linux RCU API.


Revision tags: perseant-exfatfs-base-20250801 perseant-exfatfs-base-20240630 perseant-exfatfs-base bouyer-sunxi-drm-base
1.25 19-Dec-2021 riastradh

Rename reservation_object -> dma_resv.


1.24 19-Dec-2021 riastradh

Draft implementation of reservation_object_copy_fences.


1.23 19-Dec-2021 riastradh

Judiciously insert __insn_barrier into reservation logic.

Nothing is volatile here, so we must handle the barriers ourselves.

Also note where membar_producer is implied.


1.22 19-Dec-2021 riastradh

const const const const const reservations


1.21 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.20 19-Dec-2021 riastradh

Rename more fields that Linux treats as part of the API, not opaque.


1.19 19-Dec-2021 riastradh

Let's try spelling the member the same way Linux does.


1.18 19-Dec-2021 riastradh

Linux API wants seqcount exposed in reservation object, so do that.


1.17 19-Dec-2021 riastradh

reservation_object_lock/lock_interruptible/trylock/unlock


1.16 19-Dec-2021 riastradh

reservation_object_get_excl_rcu


1.15 19-Dec-2021 riastradh

fence -> dma_fence in linux_reservation.c.


Revision tags: thorpej-i2c-spi-conf2-base thorpej-futex2-base
1.14 02-Aug-2021 riastradh

drm: Plug another fence leak.

XXX pullup-9


1.13 02-Aug-2021 riastradh

drm: Release fence if we're about to return too.

Should fix another fence leak.

XXX pullup-9


Revision tags: thorpej-cfargs2-base thorpej-i2c-spi-conf-base
1.12 27-Jun-2021 riastradh

drm: Release fence after use.

May plug the dreaded radeon kmem memory leak.

XXX pullup-9


Revision tags: cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 netbsd-9-2-RELEASE cjep_staticlib_x-base thorpej-cfargs-base thorpej-futex-base netbsd-9-1-RELEASE bouyer-xenpvh-base2 phil-wifi-20200421 bouyer-xenpvh-base1 phil-wifi-20200411 bouyer-xenpvh-base is-mlppp-base phil-wifi-20200406 ad-namecache-base3 netbsd-9-0-RELEASE netbsd-9-0-RC2 ad-namecache-base2 ad-namecache-base1 ad-namecache-base netbsd-9-0-RC1 phil-wifi-20191119 netbsd-9-base phil-wifi-20190609 isaki-audio2-base pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906
1.11 03-Sep-2018 riastradh

branches: 1.11.2; 1.11.6; 1.11.8; 1.11.20;
Preserve signedness to return failure from fence_wait_timeout.

From mrg@.


1.10 27-Aug-2018 riastradh

Expand docstring for reservation_object_poll.


1.9 27-Aug-2018 riastradh

Let's try not to step on each others' toes, shall we?


1.8 27-Aug-2018 riastradh

Implement poll for reservations and dma bufs.


1.7 27-Aug-2018 riastradh

Clarify with comments and assertions.


1.6 27-Aug-2018 riastradh

There may not be an old list.

Nihil ex nihilo -- don't dereference null.


1.5 27-Aug-2018 riastradh

Acquire references in add_shared/excl.


1.4 27-Aug-2018 riastradh

Draft reservation_object_get_fences_rcu.


1.3 27-Aug-2018 riastradh

Apparently one can reserve_shared only once in a row. Simplify.


1.2 27-Aug-2018 riastradh

Wait for the read to be valid!


1.1 27-Aug-2018 riastradh

Draft implementation of the Linux reservation and fence APIs.


Revision tags: perseant-exfatfs-base-20250801 netbsd-11-base netbsd-10-1-RELEASE perseant-exfatfs-base-20240630 perseant-exfatfs-base netbsd-10-0-RELEASE netbsd-10-0-RC6 netbsd-10-0-RC5 netbsd-10-0-RC4 netbsd-10-0-RC3 netbsd-10-0-RC2 thorpej-ifq-base thorpej-altq-separation-base netbsd-10-0-RC1 netbsd-10-base bouyer-sunxi-drm-base
1.4 19-Dec-2021 riastradh

linux/rwsem: Work around broken lockdebug macros.


1.3 19-Dec-2021 riastradh

linux: Teach rw semaphores about lockdebug.


1.2 19-Dec-2021 riastradh

linux: Use IPL_VM for lock inside rw_semaphore.

down_read_trylock needs to work under a spin lock.


1.1 19-Dec-2021 riastradh

linux: Draft rwsem with bodgy semantics.


Revision tags: perseant-exfatfs-base-20250801 perseant-exfatfs-base-20240630 perseant-exfatfs-base bouyer-sunxi-drm-base
1.5 19-Dec-2021 riastradh

linux: Rename linux_sg.c -> linux_sgt.c.

Avoids collision with compat_linux.


1.4 19-Dec-2021 riastradh

linux: Accept multipage segments in sg_alloc_table_from_bus_dmamem.


1.3 19-Dec-2021 riastradh

i915: another whack at it


1.2 19-Dec-2021 riastradh

drm: Another pass over i915. Most of i915 gem builds now.


1.1 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.


Revision tags: perseant-exfatfs-base-20250801 netbsd-11-base netbsd-10-1-RELEASE perseant-exfatfs-base-20240630 perseant-exfatfs-base netbsd-10-0-RELEASE netbsd-10-0-RC6 netbsd-10-0-RC5 netbsd-10-0-RC4 netbsd-10-0-RC3 netbsd-10-0-RC2 thorpej-ifq-base thorpej-altq-separation-base netbsd-10-0-RC1 netbsd-10-base bouyer-sunxi-drm-base
1.4 24-Dec-2021 riastradh

drm: Sprinkle some assertions into sg dma logic.


1.3 19-Dec-2021 riastradh

drm: Destroy dma map in sg_table_free.

Helps to reduce a little diff.


1.2 19-Dec-2021 riastradh

linux: Fix dma mapping to set READ|WRITE if bidi; clarify cases.


1.1 19-Dec-2021 riastradh

linux: Rename linux_sg.c -> linux_sgt.c.

Avoids collision with compat_linux.


Revision tags: perseant-exfatfs-base-20250801 perseant-exfatfs-base-20240630 perseant-exfatfs-base bouyer-sunxi-drm-base
1.2 19-Dec-2021 riastradh

Move Linux SRCU to common.


1.1 19-Dec-2021 riastradh

Draft SRCU implementation.


Revision tags: perseant-exfatfs-base-20250801 netbsd-11-base netbsd-10-1-RELEASE perseant-exfatfs-base-20240630 perseant-exfatfs-base netbsd-10-0-RELEASE netbsd-10-0-RC6 netbsd-10-0-RC5 netbsd-10-0-RC4 netbsd-10-0-RC3 netbsd-10-0-RC2 thorpej-ifq-base thorpej-altq-separation-base netbsd-10-0-RC1 netbsd-10-base bouyer-sunxi-drm-base
1.4 09-Apr-2022 riastradh

sys: Use membar_release/acquire around reference drop.

This just goes through my recent reference count membar audit and
changes membar_exit to membar_release and membar_enter to
membar_acquire -- this should make everything cheaper on most CPUs
without hurting correctness, because membar_acquire is generally
cheaper than membar_enter.


1.3 12-Mar-2022 riastradh

sys: Membar audit around reference count releases.

If two threads are using an object that is freed when the reference
count goes to zero, we need to ensure that all memory operations
related to the object happen before freeing the object.

Using an atomic_dec_uint_nv(&refcnt) == 0 ensures that only one
thread takes responsibility for freeing, but it's not enough to
ensure that the other thread's memory operations happen before the
freeing.

Consider:

Thread A Thread B
obj->foo = 42; obj->baz = 73;
mumble(&obj->bar); grumble(&obj->quux);
/* membar_exit(); */ /* membar_exit(); */
atomic_dec -- not last atomic_dec -- last
/* membar_enter(); */
KASSERT(invariant(obj->foo,
obj->bar));
free_stuff(obj);

The memory barriers ensure that

obj->foo = 42;
mumble(&obj->bar);

in thread A happens before

KASSERT(invariant(obj->foo, obj->bar));
free_stuff(obj);

in thread B. Without them, this ordering is not guaranteed.

So in general it is necessary to do

membar_exit();
if (atomic_dec_uint_nv(&obj->refcnt) != 0)
return;
membar_enter();

to release a reference, for the `last one out hit the lights' style
of reference counting. (This is in contrast to the style where one
thread blocks new references and then waits under a lock for existing
ones to drain with a condvar -- no membar needed thanks to mutex(9).)

I searched for atomic_dec to find all these. Obviously we ought to
have a better abstraction for this because there's so much copypasta.
This is a stop-gap measure to fix actual bugs until we have that. It
would be nice if an abstraction could gracefully handle the different
styles of reference counting in use -- some years ago I drafted an
API for this, but making it cover everything got a little out of hand
(particularly with struct vnode::v_usecount) and I ended up setting
it aside to work on psref/localcount instead for better scalability.

I got bored of adding #ifdef __HAVE_ATOMIC_AS_MEMBAR everywhere, so I
only put it on things that look performance-critical on 5sec review.
We should really adopt membar_enter_preatomic/membar_exit_postatomic
or something (except they are applicable only to atomic r/m/w, not to
atomic_load/store_*, making the naming annoying) and get rid of all
the ifdefs.


1.2 19-Dec-2021 riastradh

Provisionally work around cycle in x86 header files.


1.1 19-Dec-2021 riastradh

Draft stop_machine. Hope the callback runs quickly under splhigh...


Revision tags: perseant-exfatfs-base-20250801 netbsd-11-base perseant-exfatfs-base-20240630 perseant-exfatfs-base
1.3 28-Apr-2024 riastradh

linux_sync_file: Fix missing init/fini steps.

Noted by rjs@.

PR kern/58210


Revision tags: netbsd-10-0-RELEASE netbsd-10-0-RC6 netbsd-10-0-RC5 netbsd-10-0-RC4 netbsd-10-0-RC3 netbsd-10-0-RC2 thorpej-ifq-base thorpej-altq-separation-base netbsd-10-0-RC1 netbsd-10-base bouyer-sunxi-drm-base
1.2 12-Feb-2022 thorpej

branches: 1.2.4;
Add inline functions to manipulate the klists that link up knotes
via kn_selnext:

- klist_init()
- klist_fini()
- klist_insert()
- klist_remove()

These provide some API insulation from the implementation details of these
lists (but not completely; see vn_knote_attach() and vn_knote_detach()).
Currently just a wrapper around SLIST(9).

This will make it significantly easier to switch kn_selnext linkage
to a different kind of list.


1.1 19-Dec-2021 riastradh

Draft sync_file.


Revision tags: perseant-exfatfs-base-20250801 netbsd-11-base netbsd-10-1-RELEASE perseant-exfatfs-base-20240630 perseant-exfatfs-base netbsd-10-0-RELEASE netbsd-10-0-RC6 netbsd-10-0-RC5 netbsd-10-0-RC4 netbsd-10-0-RC3 netbsd-10-0-RC2 thorpej-ifq-base thorpej-altq-separation-base netbsd-10-0-RC1 netbsd-10-base bouyer-sunxi-drm-base
1.5 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.4 19-Dec-2021 riastradh

linux: Add clear_and_wake_up_bit.


1.3 19-Dec-2021 riastradh

wait_on_bit


1.2 19-Dec-2021 riastradh

Fix thinko: ERESTART, not EWOULDBLOCK.


1.1 19-Dec-2021 riastradh

linux/wait_bit.h


Revision tags: perseant-exfatfs-base-20250801 perseant-exfatfs-base-20240630 perseant-exfatfs-base bouyer-sunxi-drm-base cjep_sun2x-base cjep_staticlib_x-base1 cjep_staticlib_x-base thorpej-futex-base bouyer-xenpvh-base2 phil-wifi-20200421 bouyer-xenpvh-base1 phil-wifi-20200411 bouyer-xenpvh-base phil-wifi-20200406 ad-namecache-base3 ad-namecache-base2 ad-namecache-base1 ad-namecache-base isaki-audio2-base pgoyette-compat-merge-20190127 pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 pgoyette-compat-0728 pgoyette-compat-0625 pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base perseant-stdc-iso10646-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 pgoyette-localcount-20170320 bouyer-socketcan-base pgoyette-localcount-20170107 pgoyette-localcount-20161104 localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base
1.13 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


Revision tags: nick-nhusb-base-20151226
1.12 15-Nov-2015 jakllsch

Avoid NULL dereference in linux_worker_intr() in WORK_DELAYED_CANCELLED case.

Potentially fixes PR#49560.


1.11 17-Oct-2015 jmcneill

include sys/cpu.h for CPU_INFO_ITERATOR


Revision tags: nick-nhusb-base-20150921 nick-nhusb-base-20150606 nick-nhusb-base-20150406
1.10 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.


Revision tags: nick-nhusb-base
1.9 04-Nov-2014 jmcneill

branches: 1.9.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.8 29-Aug-2014 riastradh

Don't forget to lock wq_lock around handling wq_delayed.


Revision tags: tls-maxphys-base netbsd-7-base tls-earlyentropy-base
1.7 29-Jul-2014 riastradh

branches: 1.7.2; 1.7.4;
Linux wq locks are taken with spin locks held, so need IPL_VM.


1.6 27-Jul-2014 riastradh

Linux work is queued in intr context, so block intrs when locking.

(Yes, this getting out of hand.)


1.5 25-Jul-2014 riastradh

This case is not supposed to fall through!


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.


Revision tags: rmind-smpnet-base rmind-smpnet-nbase yamt-pagecache-base9 riastradh-xf86-video-intel-2-7-1-pre-2-21-15
1.2 18-Mar-2014 riastradh

branches: 1.2.2; 1.2.4; 1.2.6;
Merge riastradh-drm2 to HEAD.


Revision tags: riastradh-drm2-base3
1.1 30-Dec-2013 riastradh

branches: 1.1.2;
file linux_work.c was initially added on branch riastradh-drm2.


Revision tags: perseant-exfatfs-base-20250801 netbsd-11-base netbsd-10-1-RELEASE perseant-exfatfs-base-20240630 perseant-exfatfs-base netbsd-10-0-RELEASE netbsd-10-0-RC6 netbsd-10-0-RC5 netbsd-10-0-RC4 netbsd-10-0-RC3 netbsd-10-0-RC2 thorpej-ifq-base thorpej-altq-separation-base netbsd-10-0-RC1 netbsd-10-base bouyer-sunxi-drm-base
1.9 19-Dec-2021 riastradh

Misc stubs.


Revision tags: netbsd-9-4-RELEASE netbsd-9-3-RELEASE thorpej-i2c-spi-conf2-base thorpej-futex2-base thorpej-cfargs2-base cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 netbsd-9-2-RELEASE cjep_staticlib_x-base thorpej-i2c-spi-conf-base thorpej-cfargs-base thorpej-futex-base netbsd-9-1-RELEASE bouyer-xenpvh-base2 phil-wifi-20200421 bouyer-xenpvh-base1 phil-wifi-20200411 bouyer-xenpvh-base is-mlppp-base phil-wifi-20200406 ad-namecache-base3 netbsd-9-0-RELEASE netbsd-9-0-RC2 ad-namecache-base2 ad-namecache-base1 ad-namecache-base netbsd-9-0-RC1 phil-wifi-20191119 netbsd-9-base phil-wifi-20190609 isaki-audio2-base pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906
1.8 27-Aug-2018 riastradh

KASSERT -> KASSERTMSG


1.7 27-Aug-2018 riastradh

phys_wc_to_mtrr_index got renamed to arch_phys_wc_index upstream.


1.6 14-Aug-2018 riastradh

Initialize n before mtrr_set in arch_phys_wc_del.

From mrg@.

XXX pullup-7
XXX pullup-8


1.5 14-Aug-2018 riastradh

Exit, don't reenter, the mutex...!@#*@$!&.

From mrg@.

XXX pullup-7
XXX pullup-8


Revision tags: netbsd-8-3-RELEASE netbsd-8-2-RELEASE netbsd-8-1-RELEASE netbsd-8-1-RC1 pgoyette-compat-0728 netbsd-8-0-RELEASE phil-wifi-base pgoyette-compat-0625 netbsd-8-0-RC2 pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 netbsd-8-0-RC1 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base tls-maxphys-base-20171202 matt-nb8-mediatek-base nick-nhusb-base-20170825 perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 jdolecek-ncq-base pgoyette-localcount-20170320 nick-nhusb-base-20170204 bouyer-socketcan-base pgoyette-localcount-20170107 nick-nhusb-base-20161204 pgoyette-localcount-20161104 nick-nhusb-base-20161004 localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base nick-nhusb-base-20160907 nick-nhusb-base-20160529 nick-nhusb-base-20160422 nick-nhusb-base-20160319 nick-nhusb-base-20151226
1.4 17-Oct-2015 jmcneill

branches: 1.4.16; 1.4.18;
only use mtrr api if options MTRR is present and we are on x86


Revision tags: nick-nhusb-base-20150921 nick-nhusb-base-20150606 nick-nhusb-base-20150406
1.3 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.


Revision tags: nick-nhusb-base
1.2 04-Nov-2014 jmcneill

branches: 1.2.2;
This code should be MP-safe. Use IPL_SCHED in place of IPL_DRM/IPL_VM and set
D_MPSAFE flag in cdevsw.


Revision tags: netbsd-7-2-RELEASE netbsd-7-1-2-RELEASE netbsd-7-1-1-RELEASE netbsd-7-1-RELEASE netbsd-7-1-RC2 netbsd-7-nhusb-base-20170116 netbsd-7-1-RC1 netbsd-7-0-2-RELEASE netbsd-7-nhusb-base netbsd-7-0-1-RELEASE netbsd-7-0-RELEASE netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 tls-maxphys-base netbsd-7-base tls-earlyentropy-base
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.


Revision tags: perseant-exfatfs-base-20250801 netbsd-11-base perseant-exfatfs-base-20240630 perseant-exfatfs-base thorpej-ifq-base thorpej-altq-separation-base
1.16 29-Jul-2023 riastradh

drm/linux_ww_mutex: Fix ww acquire context ordering.

XXX pullup-8
XXX pullup-9
XXX pullup-10


1.15 29-Jul-2023 riastradh

drm/linux_ww_mutex: Fix wait loops.

If cv_wait_sig returns because a signal is delivered, we may
nonetheless have been granted the lock. It is harmless for us to
ignore this fact in three of the four paths, but in
ww_mutex_state_wait_sig, we may now have ownership of the lock and
MUST NOT return failure because the caller MUST release the lock
before destroying the ww_acquire_ctx.

While here, restructure the other three loops for clarity, so they
match the structure of the fourth and so they have a little less
impenetrable negation.

PR kern/57537

XXX pullup-8
XXX pullup-9
XXX pullup-10


Revision tags: netbsd-10-base bouyer-sunxi-drm-base
1.14 18-Mar-2022 riastradh

branches: 1.14.4;
drm: In ww_mutex_unlock, do lockdebug check first.

This way we get a full lockdebug dump when LOCKDEBUG is enabled,
instead of just the panic message (which includes the lock address
you could pass to `show lock' in ddb, but let's get the dump by
default even if you don't enter ddb).

Also in the KASSERT print the mutex.


1.13 26-Dec-2021 riastradh

drm: Allow ww_mutex_lock after ww_acquire_done if we already hold it.

In other words, if ww_mutex_lock would return -EALREADY, that's OK and
does not warrant an assertion.

PR kern/56557


1.12 24-Dec-2021 riastradh

Revert "drm: Fix missing newline in DRM_WARN."

Accidentally included more than I intended here.


1.11 24-Dec-2021 riastradh

drm: Fix missing newline in DRM_WARN.


1.10 19-Dec-2021 riastradh

drm: Spruce up ww_mutex comments. Audit return values.


1.9 19-Dec-2021 riastradh

linux/ww_mutex: Disable locking-against-self asserts in trylock.

This seems to be done intentionally in Linux.


1.8 19-Dec-2021 riastradh

Implement dma_resv_locking_ctx more carefully.


Revision tags: netbsd-9-3-RELEASE thorpej-i2c-spi-conf2-base thorpej-futex2-base thorpej-cfargs2-base cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 netbsd-9-2-RELEASE cjep_staticlib_x-base thorpej-i2c-spi-conf-base thorpej-cfargs-base thorpej-futex-base netbsd-9-1-RELEASE bouyer-xenpvh-base2 phil-wifi-20200421 bouyer-xenpvh-base1 phil-wifi-20200411 bouyer-xenpvh-base is-mlppp-base phil-wifi-20200406 ad-namecache-base3 netbsd-9-0-RELEASE netbsd-9-0-RC2 ad-namecache-base2 ad-namecache-base1 ad-namecache-base netbsd-9-0-RC1 phil-wifi-20191119 netbsd-9-base phil-wifi-20190609
1.7 09-May-2019 ozaki-r

branches: 1.7.2;
Avoid prepending a timestamp to lock debug outputs on ddb

Lock printer functions (lockops_t#lo_dump) use printf_nolog to print, but
printf_nolog now prepends a timestamp which is unnecessary for ddb:

db{0}> show all locks/t
[Locks tracked through LWPs]
Locks held by an LWP (iperf):
Lock 0 (initialized at soinit)
lock address : 0xffffedeb84b06080 type : sleep/adaptive
initialized : 0xffffffff806d8c3f
shared holds : 0 exclusive: 1
shares wanted: 0 exclusive: 11
current cpu : 0 last held: 1
current lwp : 0xffffedeb849ff040 last held: 0xffffedeb7dfdb240
last locked* : 0xffffffff806d8335 unlocked : 0xffffffff806d8385
[ 79103.0868574] owner field : 0xffffedeb7dfdb240 wait/spin: 1/0

Fix it by passing a printer function to lo_dump functions, i.e., make the
functions use db_printf on ddb.


Revision tags: isaki-audio2-base
1.6 16-Apr-2019 mrg

fix various problems i've seen where cv_*wait*() return ERESTART,
which is -3 in netbsd, which we have mapped linux ERESTARTSYS to.

this has a problem because linux code often returns errors and
pointers in the same value, and pointer values between -4095 and
-1 are considered as error returns, but -3 ends up as 3 and thus
is not considered an error, and mayhem ensues.

with this in place my kabylake system seems actually stable, i
have not triggered any of my prior issues in almost 4 weeks now.


Taylor asked me to write up a description and then wrote most of
the text below for me :-)


In Linux code, we always work with ERESTARTSYS so the code meaning
start over is a positive NetBSD errno safe for PTR_ERR/ERR_PTR.
To achieve this:
1. adapt all cv_waits that return to Linux so they map ERESTART to
ERESTARTSYS, and
2. adapt all returns to userland so they convert ERESTARTSYS to
ERESTART.
Leave EINTR and all other error codes alone.


Revision tags: pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906
1.5 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.


Revision tags: pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625 pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base tls-maxphys-base-20171202
1.4 16-Sep-2017 christos

branches: 1.4.2; 1.4.4; 1.4.6;
more const


Revision tags: nick-nhusb-base-20170825
1.3 25-Aug-2017 riastradh

Fix lockdebug_locked annotations.

When thread A grants ownership to thread B waiting with a context,
thread B needs to assert lockdebug_locked; otherwise, when it
releases, lockdebug_unlocked thinks it's releasing an unlocked
ww_mutex.

Fixes LOCKDEBUG failure with radeon noticed by martin@.


Revision tags: netbsd-8-0-RELEASE netbsd-8-0-RC2 netbsd-8-0-RC1 matt-nb8-mediatek-base perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 jdolecek-ncq-base pgoyette-localcount-20170320 nick-nhusb-base-20170204 bouyer-socketcan-base pgoyette-localcount-20170107 nick-nhusb-base-20161204 pgoyette-localcount-20161104 nick-nhusb-base-20161004 localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base nick-nhusb-base-20160907 nick-nhusb-base-20160529 nick-nhusb-base-20160422 nick-nhusb-base-20160319 nick-nhusb-base-20151226 nick-nhusb-base-20150921 nick-nhusb-base-20150606
1.2 21-May-2015 riastradh

branches: 1.2.10;
Adapt ww_mutex to use LOCKDEBUG.

Should help track down PR 49862.


Revision tags: nick-nhusb-base-20150406
1.1 08-Jan-2015 riastradh

branches: 1.1.2; 1.1.4;
Move Linux ww_mutex code into a .c file where it belongs.


Revision tags: perseant-exfatfs-base-20250801 netbsd-11-base perseant-exfatfs-base-20240630 perseant-exfatfs-base
1.4 22-May-2024 riastradh

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@.


Revision tags: netbsd-10-0-RELEASE netbsd-10-0-RC6 netbsd-10-0-RC5 netbsd-10-0-RC4 netbsd-10-0-RC3 netbsd-10-0-RC2 thorpej-ifq-base thorpej-altq-separation-base netbsd-10-0-RC1 netbsd-10-base bouyer-sunxi-drm-base
1.3 19-Dec-2021 riastradh

branches: 1.3.4;
linux: Rework radix tree shims.


1.2 19-Dec-2021 riastradh

linux: Fix xa_find_after to actually find the entry _after_.


1.1 19-Dec-2021 riastradh

linux: Draft half-arsed xarray shims