Home | History | Annotate | Download | only in i915
History log of /src/sys/external/bsd/drm2/dist/drm/i915/i915_gem.c
RevisionDateAuthorComments
 1.75  19-Dec-2021  riastradh i915: mutex_init/destroy and spin_lock_init/destroy audit
 1.74  19-Dec-2021  riastradh drm: Allow multiple concurrent io_mapping_map_wc on the same space.

(This should maybe check that there aren't overlapping maps of the
same parts of the space.)
 1.73  19-Dec-2021  riastradh i915: Fill out i915_gem_phys_pwrite.
 1.72  19-Dec-2021  riastradh i915: Omit more unnecessary local diffs.
 1.71  19-Dec-2021  riastradh i915: Restore i915_gem.c shmem_pwrite.

This was ifdef'd out back when it was a fast path shmem_pwrite_fast
using __copy_in_user_inatomic, but the ifdef got merged anyway into a
different function that is not a fast path.
 1.70  19-Dec-2021  riastradh i915: machete
 1.69  19-Dec-2021  riastradh Add missing header, NetBSD-ify


Author: Maya Rashish <maya@NetBSD.org>
Committer: Taylor R Campbell <riastradh@NetBSD.org>
 1.68  19-Dec-2021  riastradh Stub out some functions.

We can probably do without the fast path, and let's see whether
we get to i915_gem_phys_pwrite at all.


Author: Maya Rashish <maya@NetBSD.org>
Committer: Taylor R Campbell <riastradh@NetBSD.org>
 1.67  19-Dec-2021  riastradh i915: Move linux/nbsd-namespace.h to end of includes.
 1.66  19-Dec-2021  riastradh Distribute local changes from i915_dma.c
 1.65  19-Dec-2021  riastradh Don't ifdef __NetBSD__ around ALIGN; just patch to round_up.


Author: Maya Rashish <maya@NetBSD.org>
 1.64  19-Dec-2021  riastradh Sync i915_gem_fault. Hack up the rest of i915_gem.c enough to build.
 1.63  19-Dec-2021  riastradh First pass at i915, far from complete.

HEAVILY MODIFIED IN MERGE - maya
 1.62  18-Dec-2021  riastradh Merge linux-drm-v5-6-rc3
 1.61  23-Feb-2020  ad UVM locking changes, proposed on tech-kern:

- Change the lock on uvm_object, vm_amap and vm_anon to be a RW lock.
- Break v_interlock and vmobjlock apart. v_interlock remains a mutex.
- Do partial PV list locking in the x86 pmap. Others to follow later.
 1.60  22-Feb-2020  chs do not wait for memory in pgo_fault methods, just return ENOMEM
and let the uvm_fault code wait if it is appropriate.
 1.59  14-Feb-2020  maya Reduce diffs by side-loading some header files like Linux.

From riastradh
 1.58  14-Feb-2020  riastradh Use a header file hack to cope with Linux/NetBSD namespace clashes.

Currently serves for:

ALIGN
mutex_init
mutex_destroy
 1.57  14-Feb-2020  riastradh Eliminate -Wpointer-arith patches; use -Wno-pointer-arith instead.
 1.56  17-Jan-2020  ad Apply patch from kamil@: vmobjlock needs to be held for uvm_pagemarkdirty().
 1.55  15-Jan-2020  ad Merge from yamt-pagecache (after much testing):

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

- Reduce the number of pmap operations by tracking page dirtiness more
precisely in uvm layer.
 1.54  27-Aug-2018  riastradh branches: 1.54.6;
Draft support for drm prime.
 1.53  27-Aug-2018  riastradh Handle uvm object reference counts in uvm_map more carefully.

Acquire a reference unconditionally first; then let uvm_map consume
it on success, and release it ourselves on failure.

As we did before -- acquiring a fresh reference on success -- another
thread might release the reference with a concurrent uvm_unmap before
we could acquire it back, thereby destroying the object.

XXX pullup-7 in part (i915_gem_fault)
XXX pullup-8 in part (i915_gem_fault)
 1.52  27-Aug-2018  riastradh Work around ioctl ABI mistake in i915 drm.

A flags argument was added to the I915_GEM_MMAP ioctl. The version
of xf86-video-intel we imported was compiled to use the new ioctl
structure including the flags argument, but without initializing the
flags argument, so it would be userland stack garbage causing
i915_gem_mmap_ioctl to fail.

Newer xf86-video-intel will query the mmap version first before
trying to use either the older ioctl structure, with the original
shorter argument and thus no stack garbage (which will be padded with
to the full length in the kernel by drm_ioctl), or the newer ioctl
structure, with the argument initialized.

libdrm does not appear to be affected by this -- it zeroes the longer
structure before passing it in.

Patch from mrg@, diagnosis and explanation by me.
 1.51  27-Aug-2018  riastradh Need irq_lock to wait on irq_queue. From mrg@.
 1.50  27-Aug-2018  riastradh Sprinkle idr_preload/idr_preload_end.

Try to do these outside all mutex locks.

Tricky case is i915_gem_context, where the struct mutex is held for a
long time.
 1.49  27-Aug-2018  riastradh With <asm/cpufeature.h>, we can now use cpu_has_pat.
 1.48  27-Aug-2018  riastradh Guess what uvm criterion means we should discard backing pages.
 1.47  27-Aug-2018  riastradh Don't forget to set .uio_offset and to call UIO_SETUP_SYSSPACE.
 1.46  27-Aug-2018  riastradh Reduce diff by going back to just using ACCESS_ONCE.
 1.45  27-Aug-2018  riastradh Implement i915_gem_object_invalidate with PGO_DEACTIVATE.
 1.44  27-Aug-2018  riastradh Implement set_page_dirty. Reduce diff a little.
 1.43  27-Aug-2018  riastradh Rename drm_gem_object::gemo_shm_uao -> drm_gem_object::filp.

The Linux member that is basically analogous to this is named so,
which means we can eliminate a few diffs this way.
 1.42  27-Aug-2018  riastradh Compute the number of bytes written as expected.
 1.41  27-Aug-2018  riastradh Rework how we map i915 drm gem objects.

The old way made no sense at all. This way might make sense.
 1.40  27-Aug-2018  riastradh Missed a missed_irq.
 1.39  27-Aug-2018  riastradh Fix some merge mistakes, 64-bit printfs, &c.
 1.38  27-Aug-2018  riastradh #ifdef custodial service
 1.37  27-Aug-2018  riastradh bring in old drm changes
panic(XXX) out parts that need attention


Author: coypu <coypu@sdf.org>
Committer: Taylor R Campbell <riastradh@NetBSD.org>
 1.36  27-Aug-2018  riastradh merge linux-drm-v4-4-143
 1.35  27-Aug-2018  riastradh Handle uvm object reference counts in uvm_map more carefully.

Acquire a reference unconditionally first; then let uvm_map consume
it on success, and release it ourselves on failure.

As we did before -- acquiring a fresh reference on success -- another
thread might release the reference with a concurrent uvm_unmap before
we could acquire it back, thereby destroying the object.

XXX pullup-7
XXX pullup-8
 1.34  28-Oct-2017  pgoyette branches: 1.34.2; 1.34.4;
Update the kernhist(9) kernel history code to address issues identified
in PR kern/52639, as well as some general cleaning-up...

(As proposed on tech-kern@ with additional changes and enhancements.)

Details of changes:

* All history arguments are now stored as uintmax_t values[1], both in
the kernel and in the structures used for exporting the history data
to userland via sysctl(9). This avoids problems on some architectures
where passing a 64-bit (or larger) value to printf(3) can cause it to
process the value as multiple arguments. (This can be particularly
problematic when printf()'s format string is not a literal, since in
that case the compiler cannot know how large each argument should be.)

* Update the data structures used for exporting kernel history data to
include a version number as well as the length of history arguments.

* All [2] existing users of kernhist(9) have had their format strings
updated. Each format specifier now includes an explicit length
modifier 'j' to refer to numeric values of the size of uintmax_t.

* All [2] existing users of kernhist(9) have had their format strings
updated to replace uses of "%p" with "%#jx", and the pointer
arguments are now cast to (uintptr_t) before being subsequently cast
to (uintmax_t). This is needed to avoid compiler warnings about
casting "pointer to integer of a different size."

* All [2] existing users of kernhist(9) have had instances of "%s" or
"%c" format strings replaced with numeric formats; several instances
of mis-match between format string and argument list have been fixed.

* vmstat(1) has been modified to handle the new size of arguments in the
history data as exported by sysctl(9).

* vmstat(1) now provides a warning message if the history requested with
the -u option does not exist (previously, this condition was silently
ignored, with only a single blank line being printed).

* vmstat(1) now checks the version and argument length included in the
data exported via sysctl(9) and exits if they do not match the values
with which vmstat was built.

* The kernhist(9) man-page has been updated to note the additional
requirements imposed on the format strings, along with several other
minor changes and enhancements.

[1] It would have been possible to use an explicit length (for example,
uint64_t) for the history arguments. But that would require another
"rototill" of all the users in the future when we add support for an
architecture that supports a larger size. Also, the printf(3) format
specifiers for explicitly-sized values, such as "%"PRIu64, are much
more verbose (and less aesthetically appealing, IMHO) than simply
using "%ju".

[2] I've tried very hard to find "all [the] existing users of kernhist(9)"
but it is possible that I've missed some of them. I would be glad to
update any stragglers that anyone identifies.
 1.33  26-Nov-2015  martin branches: 1.33.10;
We never exec(2) with a kernel vmspace, so do not test for that, but instead
KASSERT() that we don't.
When calculating the load address for the interpreter (e.g. ld.elf_so),
we need to take into account wether the exec'd process will run with
topdown memory or bottom up. We can not use the current vmspace's flags
to test for that, as this happens too early. Luckily the execpack already
knows what the new state will be later, so instead of testing the current
vmspace, pass the info as additional argument to struct emul
e_vm_default_addr.
Fix all such functions and adopt all callers.
 1.32  01-Aug-2015  tsutsui Pull upstream fix to avoid kernel panic on starting X on Intel 855GM machines.

Reported in PR kern/49875, and ok'ed to commit by riastradh@.

Should be pulled up to netbsd-7.
 1.31  25-Jun-2015  chs fix Xorg coredumps that have started happening recently.
the problem is that we get a SIGALRM while we're sleeping during a page fault
on a mapping of a GEM object, and since we're sleeping interruptibly,
the GEM operation fails with EINTR. this error is returned all the way back
through uvm_fault() to the trap handler, which responds to that error
by delivering a SIGSEGV.

fix this by doing like the linux version of the GEM fault handler and converting
EINTR into success, which results in delivering the original signal and
retrying the fault.
 1.30  13-May-2015  riastradh Remove workaround for PR kern/49195.

Problem seems to have been properly fixed in rev. 1.25.
 1.29  03-Apr-2015  riastradh Use pmap_pv(9) to remove mappings of Intel graphics aperture pages.

Proposed on tech-kern with no objections:

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

Further background at:

https://mail-index.netbsd.org/tech-kern/2014/07/23/msg017392.html
 1.28  06-Mar-2015  christos Dedup the NetBSD portion of the code (ok Riastradh), no functional change.
 1.27  05-Mar-2015  riastradh Mark pages dirty after use for write in the aperture (`GTT').
 1.26  05-Mar-2015  riastradh Unwire pages when we're done in i915_gem_object_attach_phys.
 1.25  03-Mar-2015  riastradh Re-enable prints to diagnose PR 49195.

I believe I fixed this problem by fixing __wait_seqno, but before I
remove the workaround I'll try to make sure it's not getting hit any
more.
 1.24  02-Mar-2015  riastradh Make sure wedged actually gets set on all code paths.

Otherwise GCC helpfully realizes we're invoking undefined behaviour
and optimizes away the possibility that this routine will return
success, without saying a word about it.
 1.23  28-Feb-2015  riastradh Make timed and untimed cases of __wait_seqno agree on return value.
 1.22  26-Feb-2015  riastradh ...aaaaand one more fix for __wait_seqno return value.
 1.21  26-Feb-2015  riastradh Fix return code of __wait_seqno.

MAX(ret, 0) is 0 if ret is negative, but if ret is negative we want
to return that negative value, meaning error. Should've been
MIN(ret, 0), but I'll just rewrite it to clarify a wee bit.

If the GPU reset, call i915_gem_check_wedge and always return failure
like Linux does. Caller must retry in that case.
 1.20  26-Feb-2015  riastradh Fix returned timeout in wait_seqno: remaining time, not time slept.
 1.19  30-Dec-2014  nonaka Also need to flush an object from CPU domain.
 1.18  03-Nov-2014  christos branches: 1.18.2;
When moving an object to inactive, make sure that we first flush it from
the GTT domain in case it belonged there. Also, fix some compilation issues
when turning on WATCH_GTT and WATCH_LISTS, although this is a lost cause;
most of the code has rotted beyond repair.
 1.17  01-Nov-2014  christos fix uninitialized
 1.16  17-Sep-2014  riastradh Avoid container_of-inspired &obj->base == NULL nonsense.
 1.15  20-Aug-2014  riastradh Drop take the {ttm,gem} vmobjlock in the fault handler.

- We don't need this lock.
- uvm does nothing between taking it and calling the fault handler.
- Now that the uvm_aobj shares vmobjlock with the {ttm,gem} uvm
object, we must not hold the lock when we call uvm_obj_wirepages on
the uvm_aobj.

XXX pullup to netbsd-7
 1.14  16-Jul-2014  riastradh branches: 1.14.2; 1.14.4;
Explain why i915_gem_release_mmap is broken.
 1.13  16-Jul-2014  riastradh Make it build and boot on my test machines.

Screen blanks on boot on the Ivy Bridge system with

DRM error in cpt_serr_int_handler: PCH transcoder A FIFO underrun

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

I think there's a cache flushing issue somewhere -- there are little
display artefacts on my T60.
 1.12  16-Jul-2014  riastradh fix merge conflicts
 1.11  12-Jun-2014  riastradh Constrain addresses of pages backing i915 GEM objects.

Use the new uao_set_pgfl and x86_select_freelist for the purpose.
 1.10  03-Jun-2014  riastradh Ensure we call uvmfault_unlockall on every exit from i915_gem_fault.
 1.9  20-May-2014  riastradh branches: 1.9.2;
Oops -- drop the GEM object reference on error too.
 1.8  20-May-2014  riastradh Don't map the GEM uvm_aobj copy-on-write -- what was I thinking?

Do transfer the GEM object reference to the uvm_aobj reference --
these are not the same thing. (There's another uvm object whose
references are the same thing as the GEM object references, but
that's not the uao.)

With these changes, it looks like the GPU is no longer trying to draw
graphics all over kernel data structures. Wish I had that month of
debugging back!
 1.7  14-May-2014  riastradh Fix sense of test in last commit, noted by Robert Swindells.
 1.6  14-May-2014  riastradh Reject 32-bit paddrs on 965.

XXX Doing the check here is wrong; it serves only to report an
earlier problem, which is that there's on way to express constraints
on paddrs to uvm_obj_wirepages. bus_dmamem_alloc can do this, but it
gives us pages out of thin air, not pages backing a uvm object. I
was hoping this wouldn't manifest as a real problem, but evidently it
does.
 1.5  14-May-2014  riastradh Fix >40-bit paddr error branch in i915_gem_object_get_pages_gtt.
 1.4  01-May-2014  riastradh Tweak some DRM GEM page indexing crap.

- Fix order of subtraction in drm_mmap_paddr_locked.
- Address GEM objects' pages from 0, not from the mmap cookie.
- Check page alignment earlier in mmap code paths.
- Sprinkle kasserts throughout.

Still doesn't fix the garbage that is sometimes being scribbled all
over kernel memory!
 1.3  26-Apr-2014  riastradh Convert pending_flip_lock to spin lock -- interrupt handlers take it.
 1.2  18-Mar-2014  riastradh branches: 1.2.2;
Merge riastradh-drm2 to HEAD.
 1.1  23-Jul-2013  riastradh branches: 1.1.1;
Initial revision
 1.1.1.4  18-Dec-2021  riastradh Import drm from Linux v5.6-rc3 (commit f8788d86ab28f61f7b46eb6be375f8a726783636)

drivers/gpu/drm -> sys/external/bsd/drm2/dist/drm
include/drm -> sys/external/bsd/drm2/dist/include/drm
include/uapi/drm -> sys/external/bsd/drm2/dist/include/uapi/drm

GPL exclusions in dist/drm:

- amd/amdgpu/amdgpu_atpx_handler.c
- arc/
- arm/
- armada/
- aspeed/
- atmel-hlcdc/
- bochs/
- bridge/
- cirrus/
- drm_dp_cec.c
- drm_dp_mst_topology_internal.h
- drm_edid_load.c
- drm_format_helper.c
- drm_gem_cma_helper.c
- drm_gem_framebuffer_helper.c
- drm_gem_shmem_helper.c
- drm_gem_ttm_helper.c
- drm_gem_vram_helper.c
- drm_hdcp.c
- drm_lease.c
- drm_mipi_dbi.c
- drm_simple_kms_helper.c
- drm_sysfs.c
- drm_trace.h
- drm_vram_helper_common.c
- drm_writeback.c
- etnaviv/
- exynos/
- fsl-dcu/
- gma500/
- hisilicon/
- i2c/tda9950.c
- i2c/tda998x_drv.c
- i915/gt/selftest_context.c
- i915/gt/selftest_engine.c
- i915/gt/selftest_engine.h
- i915/gt/selftest_engine_cs.c
- i915/gt/selftest_engine_pm.c
- i915/i915_trace.h
- i915/selftests/i915_live_selftests.h
- i915/selftests/i915_mock_selftests.h
- i915/selftests/i915_perf_selftests.h
- i915/selftests/lib_sw_fence.h
- imx/
- ingenic/
- lima/
- mcde/
- mediatek/
- meson/
- mgag200/
- msm/
- mxsfb/
- omapdrm/
- panel/
- panfrost/
- pl111/
- radeon/radeon_atpx_handler.c
- rcar-du/
- rockchip/
- selftests/drm_cmdline_selftests.h
- selftests/drm_modeset_selftests.h
- selftests/test-drm_cmdline_parser.c
- selftests/test-drm_damage_helper.c
- selftests/test-drm_dp_mst_helper.c
- selftests/test-drm_format.c
- selftests/test-drm_framebuffer.c
- selftests/test-drm_modeset_common.c
- selftests/test-drm_modeset_common.h
- selftests/test-drm_plane_helper.c
- selftests/test-drm_rect.c
- shmobile/
- sti/
- stm/
- sun4i/
- tegra/
- tilcdc/
- tiny/
- tve200/
- udl/
- v3d/
- vc4/
- virtio/virtgpu_trace.h
- virtio/virtgpu_trace_points.c
- vkms/
- vmwgfx/device_include/vmware_pack_begin.h
- vmwgfx/device_include/vmware_pack_end.h
- zte/

Exceptions -- these all appear to be files to which someone added
an SPDX license header automatically by a script that is not aware
of the default MIT licensing under drivers/gpu/drm:

- ast/ast_dp501.c
- ast/ast_dram_tables.h
- lib/drm_random.c
- lib/drm_random.h
- i915/display/intel_acpi.c
- i915/selftests/mock_gem_device.h
- i915/selftests/i915_mock_selftests.h
- i915/selftests/i915_live_selftests.h
- r128/ati_pcigart.h
- selftests/drm_mm_selftests.h
- selftests/test-drm_mm.c
- vmwgfx/device_include/vm_basic_types.h

GPL exclusions in dist/include/drm:

- bridge
- drm_client.h
- drm_fb_cma_helper.h
- drm_format_helper.h
- drm_gem_cma_helper.h
- drm_gem_shmem_helper.h
- drm_gem_ttm_helper.h
- drm_gem_vram_helper.h
- drm_lease.h
- drm_mipi_dbi.h
- drm_mipi_dsi.h
- drm_of.h
- drm_simple_kms_helper.h
- drm_sysfs.h
- drm_writeback.h
- gma_drm.h
- i2c/tda998x.h
- i915_mei_hdcp_interface.h
- intel-gtt.h

Exceptions:
- drm_agpsupport.h - was in original drm; wrong spdx header auto-added

GPL exclusions in dist/include/uapi/drm:

- armada_drm.h
- etnaviv_drm.h
- exynos_drm.h
- lima_drm.h
- omap_drm.h

Exceptions:
- i810_drm.h - was in original drm; spdx header is wrong
 1.1.1.3  27-Aug-2018  riastradh Import drm from Linux v4.4.143 (commit a8ea6276d00555387deaaa5eaeb380cd5c17bdc9).

drivers/gpu/drm -> sys/external/bsd/drm2/dist/drm
include/drm -> sys/external/bsd/drm2/dist/include/drm
include/uapi/drm -> sys/external/bsd/drm2/dist/uapi/drm

GPL sources excluded.
 1.1.1.2  16-Jul-2014  riastradh Import drm from Linux 3.15 (commitid 1860e379875dfe7271c649058aeddffe5afd9d0d).

drivers/gpu/drm -> sys/external/bsd/drm2/dist/drm
include/drm -> sys/external/bsd/drm2/dist/include/drm
include/uapi/drm -> sys/external/bsd/drm2/dist/uapi/drm

GPL sources excluded.
 1.1.1.1  23-Jul-2013  riastradh branches: 1.1.1.1.2; 1.1.1.1.4;
Import drm sources from Linux v3.8-rc6.
(commit id 88b62b915b0b7e25870eb0604ed9a92ba4bfc9f7)

Linux NetBSD
drivers/gpu/drm sys/external/bsd/drm2/dist/drm
include/drm sys/external/bsd/drm2/dist/include/drm
include/uapi/drm sys/external/bsd/drm2/dist/uapi/drm

Files/subtrees excluded because of licence issues, to be either
revisited later (particularly nouveau and radeon, which are mostly
permissively licensed but a number of whose files have no licence
statements), rewritten/ignored, or imported later as kernel modules
under external/gpl2 instead:

include/drm/drm_fb_cma_helper.h
include/drm/drm_gem_cma_helper.h
include/drm/drm_os_linux.h
include/drm/drm_pciids.h
include/drm/drm_sysfs.h
include/drm/drm_usb.h
include/drm/exynos_drm.h
include/drm/gma_drm.h
include/drm/intel-gtt.h
drm/cirrus
drm/drm_edid_load.c
drm/drm_fb_cma_helper.c
drm/drm_gem_cma_helper.c
drm/drm_sysfs.c
drm/drm_trace.h
drm/drm_trace_points.c
drm/drm_usb.c
drm/exynos
drm/gma500
drm/i915/i915_trace.h
drm/i915/i915_trace_points.c
drm/i915/intel_acpi.c
drm/mgag200
drm/nouveau
drm/radeon
drm/shmobile
drm/tegra
drm/udl
uapi/exynos_drm.h
 1.1.1.1.4.3  18-May-2014  rmind sync with head
 1.1.1.1.4.2  28-Aug-2013  rmind sync with head
 1.1.1.1.4.1  23-Jul-2013  rmind file i915_gem.c was added on branch rmind-smpnet on 2013-08-28 23:59:33 +0000
 1.1.1.1.2.22  06-Mar-2014  riastradh Take the vmobjlock in i915_gem_release_mmap around pmap_page_protect.
 1.1.1.1.2.21  05-Mar-2014  riastradh Implement and use non-interruptible DRM_WAIT_* gizmos.
 1.1.1.1.2.20  21-Jan-2014  riastradh Return EINTR too in __wait_seqno.
 1.1.1.1.2.19  21-Jan-2014  riastradh uobj->pgops->pgo_put requires uobj->vmobjlock.
 1.1.1.1.2.18  21-Jan-2014  riastradh i915_gem_object_get_page takes a page number, not byte offset.
 1.1.1.1.2.17  15-Jan-2014  riastradh Use dev_priv->irq_lock for ring->irq_queue, not dev->struct_mutex.

We need to use a spin lock here, because we need to exclude interrupt
handlers.
 1.1.1.1.2.16  30-Dec-2013  riastradh Initialize and destroy the pending flip lock.
 1.1.1.1.2.15  08-Sep-2013  riastradh Still more error branch cleanup.
 1.1.1.1.2.14  08-Sep-2013  riastradh Check that GEM wired pages use at most 40 bits of physical addresses.

Can't express this constraint to uvm_obj_wirepages at the moment, so
at least fail early and noisily if we violate it.
 1.1.1.1.2.13  08-Sep-2013  riastradh The bus_dmamap_load_raw got moved to i915_gem_gtt but not committed.
 1.1.1.1.2.12  08-Sep-2013  riastradh Use dev->struct_mutex, not drm_global_mutex, for ring->irq_queue.
 1.1.1.1.2.11  08-Sep-2013  riastradh Fix a bunch of i915 error branches.

Some of these fixes are necessary only on NetBSD because we require
mutex_destroy, while Linux doesn't.
 1.1.1.1.2.10  08-Sep-2013  riastradh Hook up the i915_gem uvm pager ops.
 1.1.1.1.2.9  08-Sep-2013  riastradh Use pmap_enter_default, not pmap_enter.

Seems to be a problem with modules referring to weak aliases?
 1.1.1.1.2.8  08-Sep-2013  riastradh Adapt the i915 GEM code to NetBSD.
 1.1.1.1.2.7  08-Sep-2013  riastradh Add missing includes to i915_gem.c.
 1.1.1.1.2.6  24-Jul-2013  riastradh Replace ALIGN by round_up in i915_gem.c.

ALIGN means something else in NetBSD.
 1.1.1.1.2.5  24-Jul-2013  riastradh Don't mess with guts of struct completion in i915_gem.c.
 1.1.1.1.2.4  24-Jul-2013  riastradh i915_gem.c needs <asm/param.h> for HZ.
 1.1.1.1.2.3  24-Jul-2013  riastradh Convert struct intel_ringbuffer::irq_queue to drm waitqueues.
 1.1.1.1.2.2  23-Jul-2013  riastradh sync with HEAD and actually get the drm2 import
 1.1.1.1.2.1  23-Jul-2013  riastradh file i915_gem.c was added on branch riastradh-drm2 on 2013-07-23 21:28:22 +0000
 1.2.2.1  10-Aug-2014  tls Rebase.
 1.9.2.2  22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.9.2.1  20-May-2014  yamt file i915_gem.c was added on branch yamt-pagecache on 2014-05-22 11:40:53 +0000
 1.14.4.3  03-Dec-2017  jdolecek update from HEAD
 1.14.4.2  20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.14.4.1  16-Jul-2014  tls file i915_gem.c was added on branch tls-maxphys on 2014-08-20 00:04:09 +0000
 1.14.2.11  04-Aug-2015  snj Pull up following revision(s) (requested by tsutsui in ticket #931):
sys/external/bsd/drm2/dist/drm/i915/i915_gem.c: revision 1.32
Pull upstream fix to avoid kernel panic on starting X on Intel 855GM machines.
Reported in PR kern/49875, and ok'ed to commit by riastradh@.
 1.14.2.10  30-Jul-2015  snj Pull up following revision(s) (requested by riastradh in ticket #901):
sys/external/bsd/drm2/dist/drm/i915/i915_gem.c: revision 1.30
Remove workaround for PR kern/49195.
Problem seems to have been properly fixed in rev. 1.25.
 1.14.2.9  05-Jul-2015  snj Pull up following revision(s) (requested by chs in ticket #854):
sys/external/bsd/drm2/dist/drm/i915/i915_gem.c: revision 1.31
fix Xorg coredumps that have started happening recently.
the problem is that we get a SIGALRM while we're sleeping during a page fault
on a mapping of a GEM object, and since we're sleeping interruptibly,
the GEM operation fails with EINTR. this error is returned all the way back
through uvm_fault() to the trap handler, which responds to that error
by delivering a SIGSEGV.
fix this by doing like the linux version of the GEM fault handler and converting
EINTR into success, which results in delivering the original signal and
retrying the fault.
 1.14.2.8  23-Apr-2015  snj Pull up following revision(s) (requested by mrg in ticket #718):
sys/arch/x86/include/pmap.h: revision 1.56
sys/arch/x86/x86/pmap.c: revision 1.188
sys/dev/pci/agp_amd64.c: revision 1.8
sys/dev/pci/agp_i810.c: revision 1.118
sys/external/bsd/drm2/dist/drm/i915/i915_dma.c: revision 1.16
sys/external/bsd/drm2/dist/drm/i915/i915_gem.c: revision 1.29
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_agp.c: revision 1.3
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_ttm.c: revision 1.4
sys/external/bsd/drm2/dist/drm/radeon/atombios_crtc.c: revision 1.3
sys/external/bsd/drm2/dist/drm/radeon/radeon_agp.c: revision 1.3
sys/external/bsd/drm2/dist/drm/radeon/radeon_display.c: revision 1.3
sys/external/bsd/drm2/dist/drm/radeon/radeon_legacy_crtc.c: revision 1.2
sys/external/bsd/drm2/dist/drm/radeon/radeon_object.c: revision 1.3
sys/external/bsd/drm2/dist/drm/radeon/radeon_ttm.c: revision 1.7
sys/external/bsd/drm2/dist/drm/ttm/ttm_bo.c: revisions 1.7-1.10
sys/external/bsd/drm2/dist/drm/ttm/ttm_bo_util.c: revision 1.5
sys/external/bsd/drm2/i915drm/intelfb.c: revision 1.13
sys/external/bsd/drm2/include/drm/drm_wait_netbsd.h: revisions 1.12, 1.13
sys/external/bsd/drm2/include/linux/mm.h: revision 1.5
sys/external/bsd/drm2/include/linux/pci.h: revisions 1.16, 1.17
sys/external/bsd/drm2/nouveau/nouveaufb.c: revision 1.2
sys/external/bsd/drm2/radeon/radeon_pci.c: revisions 1.8, 1.9
sys/uvm/uvm_init.c: revision 1.46
Hack against the blank console problem:
Leave the CLUT alone on ancient cards. At least this leaves us with a
semi working console (red and blue are flipped). Leave an example of what
seems to be happening but disable it because colors are better than 444 bit
greyscale.
--
Initialize P->V tracking for unmanaged device pages in uvm_init.

Conditional on __HAVE_PMAP_PV_TRACK until we add it to all pmaps.

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

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

Proposed on tech-kern with no objections:

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

Proposed on tech-kern with no objections:

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

Further background at:

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

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

Proposed on tech-kern with no objections:

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

Further background at:

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

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

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

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

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

my old nforce4 box that can resume old drm (or could, last i tried
several years ago) while X and GL apps were running, can at least
survive a resume if X hasn't started. my one attempt so far with
X exited, but having run, did not work.
--
First attempt to make ttm_buffer_object_transfer less bogus.
--
Make sure mem.bus.is_iomem is initialized. PR 49833
 1.14.2.7  17-Mar-2015  riz Pull up following revision(s) (requested by snj in ticket #590):
sys/external/bsd/drm2/i915drm/intel_gtt.c: revision 1.5
sys/external/bsd/drm2/drm/drm_drv.c: revision 1.15
sys/external/bsd/drm2/dist/drm/i915/i915_gem.c: revision 1.28
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/clock/nouveau_subdev_clock_nv50.c: revision 1.3
sys/dev/pci/agp_i810.c: revision 1.115
sys/dev/pci/agp_i810.c: revision 1.116
sys/external/bsd/drm2/include/drm/intel-gtt.h: revision 1.5
sys/dev/pci/agp_i810.c: revision 1.117
sys/external/bsd/drm2/drm/drm_gem_vm.c: revision 1.6
sys/dev/pci/agp_i810var.h: revision 1.6
Issue a write barrier after updating the GTT.
Linux never used to do this...until a month:
<a rel="nofollow" href="https://bugs.freedesktop.org/show_bug.cgi?id=88191">https://bugs.freedesktop.org/show_bug.cgi?id=88191</a>
commit 983d308cb8f602d1920a8c40196eb2ab6cc07bd2
Author: Chris Wilson &lt;chris%chris-wilson.co.uk@localhost&gt;
Date: Mon Jan 26 10:47:10 2015 +0000
agp/intel: Serialise after GTT updates
Include &lt;sys/atomic.h&gt; for membar_producer.
(Why didn't this fail in my build?)
Pass cache-related flags through to the GTT on pre-SNB devices.
I had assumed for ages this would increase the amount of caching and
thereby increase the chance of stale caches leading to rendering
glitches. But apparently I was wrong, and failing to pass these
through was causing all sorts of problems!
Dedup the NetBSD portion of the code (ok Riastradh), no functional change.
Don't return events that are too large and leave them in the list.
Apply access control to gem mmap.
fix gcc is stupid.
 1.14.2.6  06-Mar-2015  snj Pull up following revision(s) (requested by mrg in ticket #573):
sys/external/bsd/common/include/linux/kernel.h: 1.5, 1.6
sys/external/bsd/drm2/dist/drm/drm_ioctl.c: 1.4
sys/external/bsd/drm2/dist/drm/drm_irq.c: 1.6-1.8
sys/external/bsd/drm2/dist/drm/i915/i915_dma.c: 1.13-1.15
sys/external/bsd/drm2/dist/drm/i915/i915_gem.c: 1.23-1.27
sys/external/bsd/drm2/dist/drm/i915/i915_gem_execbuffer.c: 1.5
sys/external/bsd/drm2/dist/drm/i915/intel_display.c: 1.14, 1.15
sys/external/bsd/drm2/dist/drm/i915/intel_dp.c: 1.10
sys/external/bsd/drm2/dist/drm/i915/intel_drv.h: 1.8
sys/external/bsd/drm2/dist/drm/i915/intel_i2c.c: 1.8-1.13
sys/external/bsd/drm2/dist/drm/i915/intel_pm.c: 1.6
sys/external/bsd/drm2/dist/drm/i915/intel_ringbuffer.c: 1.5, 1.6
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/device/nouveau_engine_device_base.c: 1.4
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/fifo/nouveau_engine_fifo_nvc0.c: 1.3, 1.4
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/fifo/nouveau_engine_fifo_nve0.c: 1.3, 1.4
sys/external/bsd/drm2/dist/drm/nouveau/core/include/core/device.h: 1.4
sys/external/bsd/drm2/dist/drm/nouveau/core/include/subdev/mc.h: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/include/subdev/pwr.h: 1.3, 1.4
sys/external/bsd/drm2/dist/drm/nouveau/core/os.h: 1.4, 1.5
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/bios/nouveau_subdev_bios_base.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/bios/nouveau_subdev_bios_pll.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/clock/nouveau_subdev_clock_base.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/clock/nouveau_subdev_clock_nv50.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/devinit/fbmem.h: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/devinit/nouveau_subdev_devinit_nv04.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/fb/nouveau_subdev_fb_nv50.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/fb/nouveau_subdev_fb_nvc0.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/fb/nv50.h: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/fb/nvc0.h: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/mc/nouveau_subdev_mc_base.c: 1.2, 1.3
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/mxm/nouveau_subdev_mxm_nv50.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/pwr/nouveau_subdev_pwr_base.c: 1.3, 1.4
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/therm/nouveau_subdev_therm_ic.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/timer/nouveau_subdev_timer_nv04.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/vm/nouveau_subdev_vm_base.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/vm/nouveau_subdev_vm_nv04.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/vm/nouveau_subdev_vm_nv44.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/vm/nv04.h: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_bo.h: 1.3
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_drm.c: 1.4, 1.5
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_fbcon.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_nv50_display.c: 1.3
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_nv84_fence.c: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_ttm.c: 1.3
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_ttm.h: 1.2
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_vga.h: 1.2
sys/external/bsd/drm2/dist/drm/radeon/radeon_fence.c: 1.6-1.8
sys/external/bsd/drm2/dist/drm/radeon/radeon_pm.c: 1.3
sys/external/bsd/drm2/dist/drm/radeon/rs400.c: 1.3
sys/external/bsd/drm2/dist/drm/via/via_dmablit.c: 1.3, 1.4
sys/external/bsd/drm2/dist/drm/via/via_drv.h: 1.3
sys/external/bsd/drm2/dist/drm/via/via_irq.c: 1.3, 1.4
sys/external/bsd/drm2/dist/drm/via/via_video.c: 1.3, 1.4
sys/external/bsd/drm2/dist/include/drm/drmP.h: 1.10
sys/external/bsd/drm2/dist/include/drm/drm_crtc.h: 1.4
sys/external/bsd/drm2/dist/include/drm/drm_modes.h: 1.3
sys/external/bsd/drm2/dist/uapi/drm/i915_drm.h: 1.2
sys/external/bsd/drm2/drm/drm_cache.c: 1.4-1.6
sys/external/bsd/drm2/drm/drm_drv.c: 1.14
sys/external/bsd/drm2/drm/drm_module.c: 1.10
sys/external/bsd/drm2/drm/drm_sysctl.c: 1.5
sys/external/bsd/drm2/drm/drm_vma_manager.c: 1.2
sys/external/bsd/drm2/drm/drmfb.c: 1.1
sys/external/bsd/drm2/drm/files.drmkms: 1.10, 1.11
sys/external/bsd/drm2/i2c/drm_encoder_slave.c: 1.1
sys/external/bsd/drm2/i915drm/files.i915drmkms: 1.7, 1.10
sys/external/bsd/drm2/i915drm/intelfb.c: 1.11, 1.12
sys/external/bsd/drm2/include/asm/io.h: 1.4
sys/external/bsd/drm2/include/asm/unaligned.h: 1.2, 1.3
sys/external/bsd/drm2/include/drm/drm_encoder_slave.h: 1.1
sys/external/bsd/drm2/include/drm/drm_wait_netbsd.h: 1.7-1.11
sys/external/bsd/drm2/include/drm/drmfb.h: 1.1
sys/external/bsd/drm2/include/drm/drmfb_pci.h: 1.1, 1.2
sys/external/bsd/drm2/include/linux/bitops.h: 1.9
sys/external/bsd/drm2/include/linux/i2c.h: 1.7, 1.8
sys/external/bsd/drm2/include/linux/io-mapping.h: 1.5
sys/external/bsd/drm2/include/linux/moduleparam.h: 1.5
sys/external/bsd/drm2/include/linux/pci.h: 1.12-1.15
sys/external/bsd/drm2/include/linux/pm.h: 1.4
sys/external/bsd/drm2/include/linux/reboot.h: 1.2
sys/external/bsd/drm2/include/linux/slab.h: 1.5
sys/external/bsd/drm2/include/linux/string.h: 1.4
sys/external/bsd/drm2/include/linux/vgaarb.h: 1.3
sys/external/bsd/drm2/include/linux/ww_mutex.h: 1.10
sys/external/bsd/drm2/linux/files.drmkms_linux: 1.8
sys/external/bsd/drm2/linux/linux_i2c.c: 1.3
sys/external/bsd/drm2/linux/linux_ww_mutex.c: 1.1
sys/external/bsd/drm2/nouveau/files.nouveau: 1.5-1.8
sys/external/bsd/drm2/nouveau/nouveau_pci.c: 1.1-1.3
sys/external/bsd/drm2/nouveau/nouveau_pci.h: 1.1
sys/external/bsd/drm2/nouveau/nouveau_sysfs.c: 1.1
sys/external/bsd/drm2/nouveau/nouveau_vga.c: 1.1
sys/external/bsd/drm2/nouveau/nouveaufb.c: 1.1
sys/external/bsd/drm2/nouveau/nouveaufb.h: 1.1
sys/external/bsd/drm2/pci/drm_pci.c: 1.10-1.12
sys/external/bsd/drm2/pci/drm_pci_module.c: 1.4
sys/external/bsd/drm2/pci/drmfb_pci.c: 1.1-1.3
sys/external/bsd/drm2/pci/files.drmkms_pci: 1.5
sys/external/bsd/drm2/radeon/radeon_pci.c: 1.5-1.7
sys/modules/drmkms/Makefile: 1.8, 1.9
sys/modules/drmkms_linux/Makefile: 1.6
sys/modules/drmkms_pci/Makefile: 1.5
sync drm2 with HEAD.
 1.14.2.5  27-Feb-2015  martin Pull up following revision(s) (requested by snj in ticket #553):
sys/external/bsd/drm2/dist/drm/i915/i915_gem.c: revision 1.20
sys/external/bsd/drm2/dist/drm/i915/i915_gem.c: revision 1.21
sys/external/bsd/drm2/dist/drm/i915/i915_gem.c: revision 1.22
sys/external/bsd/drm2/dist/drm/i915/intel_i2c.c: revision 1.5
sys/external/bsd/drm2/dist/drm/i915/intel_i2c.c: revision 1.6
sys/external/bsd/drm2/dist/drm/i915/intel_i2c.c: revision 1.7
sys/external/bsd/drm2/include/drm/drm_wait_netbsd.h: revision 1.6
Fix returned timeout in wait_seqno: remaining time, not time slept.
-
Fix return code of __wait_seqno.
-
MAX(ret, 0) is 0 if ret is negative, but if ret is negative we want
to return that negative value, meaning error. Should've been
MIN(ret, 0), but I'll just rewrite it to clarify a wee bit.
-
If the GPU reset, call i915_gem_check_wedge and always return failure
like Linux does. Caller must retry in that case.
-
Limit scope of ret and omit needless use of it to reduce confusion.
-
Make gmbus_wait_hw_status consistently use 50ms timeout like Linux.
-
Another attempt to fix the drm timed wait blarf blugh blahhh.
...aaaaand one more fix for __wait_seqno return value.
-
Also get the sense of the condition to wait until right.
 1.14.2.4  30-Dec-2014  martin Pull up following revision(s) (requested by nonaka in ticket #362):
sys/external/bsd/drm2/dist/drm/i915/i915_gem.c: revision 1.19
Also need to flush an object from CPU domain.
 1.14.2.3  10-Nov-2014  martin Pull up following revision(s) (requested by snj in ticket #191):
sys/external/bsd/drm2/include/linux/io-mapping.h: revision 1.4
sys/external/bsd/drm2/dist/uapi/drm/drm.h: revision 1.5
sys/external/bsd/drm2/dist/drm/i915/intel_panel.c: revision 1.5
sys/external/bsd/drm2/dist/uapi/drm/drm.h: revision 1.6
sys/external/bsd/drm2/dist/drm/i915/intel_drv.h: revision 1.7
sys/external/bsd/drm2/include/linux/ww_mutex.h: revision 1.7
sys/external/bsd/drm2/dist/drm/i915/intel_dp.c: revision 1.8
sys/external/bsd/drm2/dist/drm/i915/i915_ums.c: revision 1.2
sys/external/bsd/drm2/dist/drm/i915/intel_pm.c: revision 1.5
sys/external/bsd/drm2/dist/drm/i915/i915_debugfs.c: revision 1.2
sys/external/bsd/drm2/dist/drm/i915/i915_drv.h: revision 1.9
sys/external/bsd/drm2/dist/drm/i915/i915_cmd_parser.c: revision 1.4
sys/external/bsd/drm2/dist/drm/i915/intel_dsi.c: revision 1.3
sys/external/bsd/drm2/dist/drm/i915/intel_display.c: revision 1.11
sys/external/bsd/drm2/dist/drm/i915/intel_hdmi.c: revision 1.5
sys/external/bsd/drm2/dist/drm/i915/intel_display.c: revision 1.12
sys/external/bsd/drm2/include/asm/processor.h: revision 1.3
sys/external/bsd/drm2/dist/drm/i915/intel_crt.c: revision 1.5
sys/external/bsd/drm2/dist/drm/i915/intel_sideband.c: revision 1.2
sys/external/bsd/drm2/dist/drm/i915/intel_ddi.c: revision 1.5
sys/external/bsd/drm2/dist/drm/i915/intel_tv.c: revision 1.5
sys/external/bsd/drm2/dist/drm/i915/i915_dma.c: revision 1.11
sys/external/bsd/drm2/dist/drm/i915/i915_irq.c: revision 1.10
sys/external/bsd/drm2/dist/drm/i915/i915_gem.c: revision 1.16
sys/external/bsd/drm2/dist/drm/i915/i915_gem.c: revision 1.17
sys/external/bsd/drm2/ttm/ttm_bo_vm.c: revision 1.6
sys/external/bsd/drm2/ttm/ttm_bo_vm.c: revision 1.7
sys/external/bsd/drm2/drm/drm_module.c: revision 1.8
sys/external/bsd/drm2/dist/drm/i915/intel_sprite.c: revision 1.2
sys/external/bsd/drm2/dist/drm/i915/intel_dsi_cmd.c: revision 1.2
sys/external/bsd/drm2/i915drm/intelfb.c: revision 1.10
sys/external/bsd/drm2/dist/drm/i915/intel_dvo.c: revision 1.2
sys/external/bsd/drm2/dist/drm/i915/intel_sdvo.c: revision 1.6
sys/external/bsd/drm2/dist/drm/i915/intel_lvds.c: revision 1.6
Code cleanup and minor bugfixes for drm2.
 1.14.2.2  05-Nov-2014  snj Pull up following revision(s) (requested by sborrill in ticket #178):
sys/external/bsd/drm2/dist/drm/i915/i915_gem.c: revision 1.18
When moving an object to inactive, make sure that we first flush it from
the GTT domain in case it belonged there. Also, fix some compilation issues
when turning on WATCH_GTT and WATCH_LISTS, although this is a lost cause;
most of the code has rotted beyond repair.
 1.14.2.1  22-Aug-2014  martin Pull up following revision(s) (requested by riastradh in ticket #46):
sys/external/bsd/drm2/dist/drm/i915/i915_gem.c: revision 1.15
sys/external/bsd/drm2/ttm/ttm_bo_vm.c: revision 1.4
Do not take the {ttm,gem} vmobjlock in the fault handler.
- We don't need this lock.
- uvm does nothing between taking it and calling the fault handler.
- Now that the uvm_aobj shares vmobjlock with the {ttm,gem} uvm
object, we must not hold the lock when we call uvm_obj_wirepages on
the uvm_aobj.
 1.18.2.4  27-Dec-2015  skrll Sync with HEAD (as of 26th Dec)
 1.18.2.3  22-Sep-2015  skrll Sync with HEAD
 1.18.2.2  06-Jun-2015  skrll Sync with HEAD
 1.18.2.1  06-Apr-2015  skrll Sync with HEAD
 1.33.10.1  02-Nov-2017  snj Pull up following revision(s) (requested by pgoyette in ticket #335):
share/man/man9/kernhist.9: 1.5-1.8
sys/arch/acorn26/acorn26/pmap.c: 1.39
sys/arch/arm/arm32/fault.c: 1.105 via patch
sys/arch/arm/arm32/pmap.c: 1.350, 1.359
sys/arch/arm/broadcom/bcm2835_bsc.c: 1.7
sys/arch/arm/omap/if_cpsw.c: 1.20
sys/arch/arm/omap/tiotg.c: 1.7
sys/arch/evbarm/conf/RPI2_INSTALL: 1.3
sys/dev/ic/sl811hs.c: 1.98
sys/dev/usb/ehci.c: 1.256
sys/dev/usb/if_axe.c: 1.83
sys/dev/usb/motg.c: 1.18
sys/dev/usb/ohci.c: 1.274
sys/dev/usb/ucom.c: 1.119
sys/dev/usb/uhci.c: 1.277
sys/dev/usb/uhub.c: 1.137
sys/dev/usb/umass.c: 1.160-1.162
sys/dev/usb/umass_quirks.c: 1.100
sys/dev/usb/umass_scsipi.c: 1.55
sys/dev/usb/usb.c: 1.168
sys/dev/usb/usb_mem.c: 1.70
sys/dev/usb/usb_subr.c: 1.221
sys/dev/usb/usbdi.c: 1.175
sys/dev/usb/usbdi_util.c: 1.67-1.70
sys/dev/usb/usbroothub.c: 1.3
sys/dev/usb/xhci.c: 1.75
sys/external/bsd/drm2/dist/drm/i915/i915_gem.c: 1.34
sys/kern/kern_history.c: 1.15
sys/kern/kern_xxx.c: 1.74
sys/kern/vfs_bio.c: 1.275-1.276
sys/miscfs/genfs/genfs_io.c: 1.71
sys/sys/kernhist.h: 1.21
sys/ufs/ffs/ffs_balloc.c: 1.63
sys/ufs/lfs/lfs_vfsops.c: 1.361
sys/ufs/lfs/ulfs_inode.c: 1.21
sys/ufs/lfs/ulfs_vnops.c: 1.52
sys/ufs/ufs/ufs_inode.c: 1.102
sys/ufs/ufs/ufs_vnops.c: 1.239
sys/uvm/pmap/pmap.c: 1.37-1.39
sys/uvm/pmap/pmap_tlb.c: 1.22
sys/uvm/uvm_amap.c: 1.108
sys/uvm/uvm_anon.c: 1.64
sys/uvm/uvm_aobj.c: 1.126
sys/uvm/uvm_bio.c: 1.91
sys/uvm/uvm_device.c: 1.66
sys/uvm/uvm_fault.c: 1.201
sys/uvm/uvm_km.c: 1.144
sys/uvm/uvm_loan.c: 1.85
sys/uvm/uvm_map.c: 1.353
sys/uvm/uvm_page.c: 1.194
sys/uvm/uvm_pager.c: 1.111
sys/uvm/uvm_pdaemon.c: 1.109
sys/uvm/uvm_swap.c: 1.175
sys/uvm/uvm_vnode.c: 1.103
usr.bin/vmstat/vmstat.c: 1.219
Reorder to test for null before null deref in debug code
--
Reorder to test for null before null deref in debug code
--
KNF
--
No need for '\n' in UVMHIST_LOG
--
normalise a BIOHIST log message
--
Update the kernhist(9) kernel history code to address issues identified
in PR kern/52639, as well as some general cleaning-up...
(As proposed on tech-kern@ with additional changes and enhancements.)
Details of changes:
* All history arguments are now stored as uintmax_t values[1], both in
the kernel and in the structures used for exporting the history data
to userland via sysctl(9). This avoids problems on some architectures
where passing a 64-bit (or larger) value to printf(3) can cause it to
process the value as multiple arguments. (This can be particularly
problematic when printf()'s format string is not a literal, since in
that case the compiler cannot know how large each argument should be.)
* Update the data structures used for exporting kernel history data to
include a version number as well as the length of history arguments.
* All [2] existing users of kernhist(9) have had their format strings
updated. Each format specifier now includes an explicit length
modifier 'j' to refer to numeric values of the size of uintmax_t.
* All [2] existing users of kernhist(9) have had their format strings
updated to replace uses of "%p" with "%#jx", and the pointer
arguments are now cast to (uintptr_t) before being subsequently cast
to (uintmax_t). This is needed to avoid compiler warnings about
casting "pointer to integer of a different size."
* All [2] existing users of kernhist(9) have had instances of "%s" or
"%c" format strings replaced with numeric formats; several instances
of mis-match between format string and argument list have been fixed.
* vmstat(1) has been modified to handle the new size of arguments in the
history data as exported by sysctl(9).
* vmstat(1) now provides a warning message if the history requested with
the -u option does not exist (previously, this condition was silently
ignored, with only a single blank line being printed).
* vmstat(1) now checks the version and argument length included in the
data exported via sysctl(9) and exits if they do not match the values
with which vmstat was built.
* The kernhist(9) man-page has been updated to note the additional
requirements imposed on the format strings, along with several other
minor changes and enhancements.
[1] It would have been possible to use an explicit length (for example,
uint64_t) for the history arguments. But that would require another
"rototill" of all the users in the future when we add support for an
architecture that supports a larger size. Also, the printf(3)
format
specifiers for explicitly-sized values, such as "%"PRIu64, are much
more verbose (and less aesthetically appealing, IMHO) than simply
using "%ju".
[2] I've tried very hard to find "all [the] existing users of
kernhist(9)"
but it is possible that I've missed some of them. I would be glad
to
update any stragglers that anyone identifies.
--
For some reason this single kernel seems to have outgrown its declared
size as a result of the kernhist(9) changes. Bump the size.
XXX The amount of increase may be excessive - anyone with more detailed
XXX knowledge please feel free to further adjust the value
appropriately.
--
Misssed one cast of pointer --> uintptr_t in previous kernhist(9) commit
--
And yet another one. :(
--
Use correct mark-up for NetBSD version.
--
More improvements in grammar and readability.
--
Remove a stray '"' (obvious typo) and add a couple of casts that are
probably needed.
--
And replace an instance of "%p" conversion with "%#jx"
--
Whitespace fix. Give Bl tag table a width. Fix Xr.
 1.34.4.2  08-Apr-2020  martin Merge changes from current as of 20200406
 1.34.4.1  10-Jun-2019  christos Sync with HEAD
 1.34.2.1  06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.54.6.2  29-Feb-2020  ad Sync with head.
 1.54.6.1  17-Jan-2020  ad Sync with head.

RSS XML Feed