summaryrefslogtreecommitdiffstats
path: root/sys/dev/pci/drm/ttm (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Use km_alloc() instead of mallocarray() when allocating ttm dma segmentsjsg2019-06-111-7/+10
| | | | to avoid running out of kmem space. Suggested by and ok kettenis@
* Let drm(4) allocate memory without constraints if the hardware supportskettenis2019-06-091-2/+8
| | | | | | | | | 64-bit DMA. Should reduce the pressure on DMA-reachable memory, which is important since there are still cases where the pagedaemon ends up being triggered continuously if we run out of DMA-reachable memory but have plenty of memory left. ok jsg@
* drm/ttm: fix out-of-bounds read in ttm_put_pages() v2jsg2019-04-271-2/+3
| | | | | | From Christian Koenig 96800ba9e565ab752774cd88328f96aed28a1436 in linux 4.19.y/4.19.37 a66477b0efe511d98dde3e4aaeb189790e6f0a39 in mainline linux
* drm/ttm: Fix bo_global and mem_global kfree errorjsg2019-04-202-10/+0
| | | | | | From Trigger Huang b10cc08374728ea79555a1cd98f962b0f942e942 in linux 4.19.y/4.19.36 30f33126feca0fe16df9e9302ffc28a953e2eb37 in mainline linux
* Update shared drm code, inteldrm(4) and radeondrm(4) from linux 4.4 tojsg2019-04-1417-3495/+2173
| | | | | | | | | | | | | | | | | | | linux 4.19.34. Adds support for more Intel hardware: Broxton/Apollo Lake (was is_preliminary in 4.4) Amber Lake (another Kaby Lake refresh) Gemini Lake Coffee Lake Whiskey Lake Cannon Lake (though no hardware with Intel graphics ever shipped) Ice Lake (alpha support, hardware not released) This does not add support for new radeon hardware on the AMD side as newer radeons have a different kernel driver (amdgpu). Thanks to the OpenBSD Foundation for sponsoring this work, kettenis@ for helping and a bunch of other developers for testing.
* Add arm64 support. On ARM write-combining translates into the normal uncachedkettenis2018-08-201-4/+5
| | | | | | | | | memory attribute and uncached translates into device-nGnRnE memory. This complicates the mapping onto PMAP_WC, PMAP_NOCACHE and PMAP_DEVICE a bit since the requirements of the drm(4) subsystem don't quite match the natural definitions for these. ok jsg@, mpi@, visa@
* Cached tests moved from callers into ttm_io_prot() with linux 3.18jsg2018-08-202-2/+4
| | | | | which was partly missed when the 4.4 ttm changes went in. Prompted by a patch from kettenis@
* update ttm and radeondrm(4) to Linux 4.4.129jsg2018-04-2522-2489/+2374
| | | | | | | Compared to the previous Linux 3.8 based port this adds support for KAVERI/KABINI/MULLINS APUs and OLAND/BONAIRE/HAINAN/HAWAII GPUs. Thanks to the OpenBSD Foundation for sponsoring this work.
* revert to 2018/04/20 10:00:00, before oopsnaddy2018-04-205-0/+1415
|
* oops, snapshot tests not ready yetderaadt2018-04-2016-1221/+1094
|
* syncderaadt2018-04-2021-2509/+1221
|
* Update inteldrm(4) to code based on Linux 4.4.70. This brings us support forkettenis2017-07-011-2/+3
| | | | | | | | Skylake and Cherryview and better support for Broadwell and Valleyview. Also adds MST support. Some tweaks to the TTM code and radeondrm(4) to keep it working with the updated generic DRM code needed for inteldrm(4). Tested by many.
* Switch the TTM code over to the generic DRM VMA manager.kettenis2017-06-046-176/+74
| | | | ok jsg@
* Split out the generic GEM code (like Linux did) and switch it over tokettenis2016-04-051-1/+4
| | | | | | | the vma offset manager. This brings us a little bit more isolation between applications as GEM buffers are now tied to a specific /dev/drmX clone. ok jsg@
* Fix uvm_object reference counting. While these reference counts aren't reaalykettenis2015-10-232-3/+5
| | | | | | | | | | | used (ttm bo's have their own reference counts), we can't let the reference count go negative as this will freak out the upper uvm layers. Since the uvm_object reference count is still a useful debugging tool (ddb will display it for example), adjust it such that the uvm_object reference count represents the number of references held by the uvm layer. tested by matthieu@ ok jsg@
* Implement set_pages_array_wb() and set_pages_array_wc() for powerpc. Sincekettenis2015-10-081-5/+7
| | | | | | | powerpc doesn't actually implement write-combining fall back to uncached mappings. ok mpi@, jsg@
* Switch remaining users of the FreeBSD refcount apis back to the originaljsg2015-09-2710-111/+154
| | | | | | linux kref/kobject use. ok kettenis@
* Update inteldrm to the code from Linux 3.14.52 (which corresponds tokettenis2015-09-232-14/+4
| | | | | | | | | | | | | | | | | commit 48f8f36a6c8018c2b36ea207aaf68ef5326c5075 on the linux-3.14.y branch of the linux-stable tree). This brings preliminary support for the GPU on Intel's Broadwell CPUs. Don't expect these to work perfectly yet. There are some remaining issues with older hardware as well, but no significant regressions have been uncovered. This also updates some of drm core code. The radeondrm code remains based on Linux 3.8 with some minimal canges to adjust to changes in the core drm APIs. Joint effort with jsg@, who did the initial update of the relevant drm core bits. Committing this early to make sure it gets more testing and make it possible for others to help getting the remaining wrinkles straightened out.
* Make use of recent drm_linux.h additions to further reduce thejsg2015-07-112-28/+15
| | | | | | diff to linux. ok kettenis@
* another round of reducing the diff to linuxjsg2015-04-186-20/+20
|
* Switch back to ioread32 and iowrite32 for cases where bus_space_vaddr isjsg2015-04-121-5/+1
| | | | used instead of bus_space_read/bus_space_write.
* make wait_queue_head a struct with a mutexjsg2015-04-125-13/+7
| | | | better matches linux behaviour
* change back to spinlock_t/DEFINE_SPINLOCKjsg2015-04-113-6/+6
|
* change back to memcpy_toio/memcpy_fromio/memset_iojsg2015-04-081-2/+2
|
* ttm has it's own version of kmap/kunmap that usesjsg2015-04-082-74/+2
| | | | | | | | | | | kernel_map/uvm_km_valloc and i915 has a version that uses phys_map/uvm_km_valloc_wait as calling code assumes kmap would sleep if no memory is available. Move these and ttm's vmap/vunmap into the linux compat files and make them all use phys_map/uvm_km_valloc_wait. looks good kettenis@
* move some inline linux compat into the dedicated filesjsg2015-04-062-5/+2
|
* add and use macros for wake_up/wake_up_all/wake_up_all_lockedjsg2015-04-063-16/+16
|
* Another round of reducing diffs with Linux. This one moves the variouskettenis2015-04-051-5/+5
| | | | | | | | | | copy_to_user and copy_from_user functions into drm_linux.h and uses them instead of copyin/copyout and DRM_COPY_*. Also move the timespec functions, and put i915_gem_object_is_purgable() where it belongs. Uncovered a bug where the arguments to copyout() were in the wrong order. ok jsg@
* Translate PAGE_MASK usage for the way it is defined in our kernel.jsg2015-04-031-3/+3
| | | | This code is not called.
* Add and use macros for linux memory barriers. Fix the call injsg2015-02-121-2/+2
| | | | i915_gem_object_flush_fence() to be mb() not wmb() while here.
* switch some free calls back to kfreejsg2015-02-121-2/+3
|
* Switch most printf style functions calls back to linux function namesjsg2015-02-116-49/+49
| | | | and move DRM_INFO/pr_info/dev_info messages under DRMDEBUG.
* switch most mtx_* calls back to linux spinlocksjsg2015-02-1010-163/+167
|
* switch most rwlock calls back to their linux equivalentsjsg2015-02-106-51/+51
|
* we want to defer work traditionally (in openbsd) handled in andlg2015-02-091-2/+2
| | | | | | | | | | | | | | | | | | | | | interrupt context to a taskq running in a thread. however, there is a concern that if we do that then we allow accidental use of sleeping APIs in this work, which will make it harder to move the work back to interrupts in the future. guenther and kettenis came up with the idea of marking a proc with CANTSLEEP which the sleep paths can check and panic on. this builds on that so you create taskqs that run with CANTSLEEP set except when they need to sleep for more tasks to run. the taskq_create api is changed to take a flags argument so users can specify CANTSLEEP. MPSAFE is also passed via this flags field now. this means archs that defined IPL_MPSAFE to 0 can now create mpsafe taskqs too. lots of discussion at s2k15 ok guenther@ miod@ mpi@ tedu@ pelikan@
* remove the second void * argument on tasks.dlg2015-01-272-7/+7
| | | | | | | | | | | | | | | | | | | | | when workqs were introduced, we provided a second argument so you could pass a thing and some context to work on it in. there were very few things that took advantage of the second argument, so when i introduced pools i suggested removing it. since tasks were meant to replace workqs, it was requested that we keep the second argument to make porting from workqs to tasks easier. now that workqs are gone, i had a look at the use of the second argument again and found only one good use of it (vdsp(4) on sparc64 if you're interested) and a tiny handful of questionable uses. the vast majority of tasks only used a single argument. i have since modified all tasks that used two args to only use one, so now we can remove the second argument. so this is a mechanical change. all tasks only passed NULL as their second argument, so we can just remove it. ok krw@
* Replace a plethora of historical protection options with justderaadt2014-11-162-7/+7
| | | | | | | PROT_NONE, PROT_READ, PROT_WRITE, and PROT_EXEC from mman.h. PROT_MASK is introduced as the one true way of extracting those bits. Remove UVM_ADV_* wrapper, using the standard names. ok doug guenther kettenis
* Make use of the red-black tree as the original Linux code did insteadjsg2014-09-231-3/+6
| | | | | | of interating over the tree like a list. From Andriy Gapon in FreeBSD. ok kettenis@
* drm/ttm: don't oops if no invalidate_caches()jsg2014-04-121-4/+6
| | | | | | From Rob Clark 8af4707afcb6d191b9cc75dfd73b9550e8276253 in ubuntu 3.8 9ef7506f7eff3fc42724269f62e30164c141661f in mainline linux
* Reduce uvm include madness. Use <uvm/uvm_extern.h> instead ofmpi2014-03-281-2/+2
| | | | | | <uvm/uvm.h> if possible and remove double inclusions. ok beck@, mlarkin@, deraadt@
* Remove and shuffle some includes to reduce their number since drmP.hmpi2014-03-251-2/+2
| | | | is included by a lot of files.
* Reduce dmesg spam. Apologies to stsp@ for rejecting his larger diff thatkettenis2014-02-241-2/+1
| | | | | | contained this bit. ok deraadt@
* drm/ttm: Fix memory type compatibility checkjsg2014-02-101-13/+21
| | | | | | From Thomas Hellstrom 04623382c8e829413c2b69f740a9455e2e764ab7 in ubuntu 3.8 59c8e66378fb78adbcd05f0d09783dde6fef282b in mainline linux
* drm/ttm: Fix ttm_bo_move_memcpyjsg2014-02-101-12/+18
| | | | | | From Thomas Hellstrom 1fe70122dd9b926e84b14d1603202ae2ef2c5edd in ubuntu 3.8 da95c788ef0c645378ffccb7060a0df1a33aee38 in mainline linux
* drm/ttm: Handle in-memory region copiesjsg2014-02-101-2/+4
| | | | | | From Jakob Bornecrantz f8f0599d88fb76646bdd8b735dc2574ad80c625d in ubuntu 3.8 9a0599ddeae012a771bba5e23393fc52d8a59d89 in mainline linux
* drm/ttm: fix the tt_populated check in ttm_tt_destroy()jsg2014-02-101-2/+2
| | | | | | From Ben Skeggs 43a1ab9ba9d7c0d97e7079a09438fe1b4209e318 in ubuntu 3.8 182b17c8dc4e83aab000ce86587b6810e515da87 in mainline linux
* use linux style memory allocations in ttmjsg2014-02-097-42/+42
|
* add static back to the ttm functionsjsg2013-12-087-354/+156
| | | | ok kettenis@
* deprecate taskq_systq() and replace it with extern struct taskqdlg2013-10-301-4/+4
| | | | | | | | *const systq defined in task.h this reduces the cost of using the system taskq and looks less ugly. requested by and ok kettenis@
* Move most of the uses of workqs in drm to the new task/taskq api.jsg2013-10-294-21/+19
| | | | | | | | | Prevents unintended multiple additions to workqs that was causing hangs on radeon, and lets us remove tasks more closely matching the behaviour of the original linux code. ok kettenis@ cause of the ttm/radeon hangs debugged by claudio@ and kettenis@