summaryrefslogtreecommitdiffstats
path: root/sys/dev/pci/drm/ttm (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Call ttm_tt_unpopulate() instead of directly calling ttm_tt_unpopulatejsg2020-12-081-1/+1
| | | | | | function pointer in ttm_tt_swapout(). Reduces the diff to linux. ok kettenis@
* correct ttm_tt error paths if bus_dmamap_create() failsjsg2020-12-081-2/+9
| | | | | | | | Avoids a double free of gtt in amdgpu_ttm_tt_create() if the bus_dmamap_create() call in ttm_sg_tt_init() fails and ttm_tt_destroy() calls amdgpu_ttm_backend_destroy(). feedback from and ok kettenis@
* use RWLOCK_INITIALIZER() in DEFINE_MUTEX()jsg2020-11-121-1/+1
| | | | | | | | | | Gives rwlocks defined this way a non-NULL rwl_name. Move ttm_pool_shrink_scan() DEFINE_MUTEX use out of function scope to fix build with WITNESS after this change and expand macro to have a better name than "lock". Found by and ok semarie@
* Remove unused `anon' argument from uvmfault_unlockall().mpi2020-11-061-2/+2
| | | | | | | | | It won't be used when amap and anon locking will be introduced. This "fixes" passing a unrelated/uninitialized pointer in an error path in case of memory shortage. ok kettenis@
* Constify and use C99 initializer for "struct uvm_pagerops".mpi2020-10-211-1/+1
| | | | | | | | | While here put some KERNEL_ASSERT_LOCKED() in the functions called from the page fault handler. The removal of locking of `uobj' will need to be revisited and these are good indicator that something is missing and that many comments are lying. ok kettenis
* Fix several bugs in the TTM page fault handler and porperly integrate all thekettenis2020-10-181-89/+193
| | | | | | changes made to Linux 5.7. Pointed out by jsg@. ok jsg@
* drm/ttm: fix offset in VMAs with a pg_offs in ttm_bo_vm_accessjsg2020-08-261-1/+3
| | | | | | From Felix Kuehling be580abecf13ebdcf6c16ec79d941c35017c94be in linux 5.7.y/5.7.18 c0001213d195d1bac83e0744c06ff06dd5a8ba53 in mainline linux
* drm/ttm/nouveau: don't call tt destroy callback on alloc failure.jsg2020-08-221-3/+0
| | | | | | From Dave Airlie 7387ad86fe8ef830e88a586b021b322eef316211 in linux 5.7.y/5.7.16 5de5b6ecf97a021f29403aa272cb4e03318ef586 in mainline linux
* drm/ttm: Fix dma_fence refcnt leak when adding move fencejsg2020-07-161-1/+3
| | | | | | From Xiyu Yang bfd4297fd74ebb18d05044e49f1ff2fedd2ece8d in linux 5.7.y/5.7.9 11425c4519e2c974a100fc984867046d905b9380 in mainline linux
* drm/ttm: Fix dma_fence refcnt leak in ttm_bo_vm_fault_reservedjsg2020-07-161-0/+2
| | | | | | From Xiyu Yang f5e6ec57e3cbe37cd3ef52d18de6be9953ee105a in linux 5.7.y/5.7.9 37cc4b95d13f311c04aa8e9daacca3905ad45ca7 in mainline linux
* reduce the diff to linux in local versions of functionsjsg2020-07-141-9/+14
| | | | | | | | | brings in changes from 'drm/ttm: stop always moving BOs on the LRU on page fault' 5d50fcbda7b0acd301bb1fc3d828df0aa29237b8 and some other minor changes ok kettenis@
* change some drm locks from IPL_TTY to IPL_NONEjsg2020-07-131-1/+1
| | | | | | | | In drm linux spinlocks are mapped to mutex(9). Locks without calls to spin_lock_irqsave(), spin_lock_irq() and the like (which block interrupts) can be changed to IPL_NONE. ok kettenis@
* rename our kunmap() to kunmap_va()jsg2020-06-141-1/+1
| | | | | | | In linux kunmap() has a page struct * argument our kunmap() has a void * argument which results in uncoverted uses building but doing the wrong thing. Renaming will catch any codepaths that need to be changed at compile time.
* update drm to linux 5.7jsg2020-06-0810-699/+998
| | | | | | | | | | adds kernel support for amdgpu: vega20, raven2, renoir, navi10, navi14 inteldrm: icelake, tigerlake Thanks to the OpenBSD Foundation for sponsoring this work, kettenis@ for helping, patrick@ for helping adapt rockchip drm and many developers for testing.
* Make ttm_bo_unmap_virtual_locked() actually unmap things. Fixes cursorkettenis2020-01-221-0/+27
| | | | | | | | issues and suspend/resume on amdgpu(4). Might help radeondrm(4) issues as well. tested by mortimer@, abieber@, krw@ ok jsg@
* drm/ttm: fix incrementing the page pointer for huge pagesjsg2020-01-171-2/+2
| | | | | | From Christian Koenig 8c2cdfb2c81bb533b9e6a3874ee5399102c4c580 in linux 4.19.y/4.19.97 453393369dc9806d2455151e329c599684762428 in mainline linux
* drm/ttm: fix start page for huge page check in ttm_put_pages()jsg2020-01-171-2/+2
| | | | | | From Christian Koenig 83a88fb92950ef34b9924c39ff7554ae92c9af69 in linux 4.19.y/4.19.97 ac1e516d5a4c56bf0cb4a3dfc0672f689131cfd4 in mainline linux
* implement unregister_shrinker()jsg2019-12-261-2/+0
| | | | ok kettenis@
* enable shrinker for ttmjsg2019-12-261-7/+0
| | | | ok kettenis@
* drm/ttm: Restore ttm prefaultingjsg2019-10-301-9/+7
| | | | | | From Thomas Hellstrom 11377c3e997eca9c9ff562fc4fc7a41a455bddf6 in linux 4.19.y/4.19.81 941f2f72dbbe0cf8c2d6e0b180a8021a0ec477fa in mainline linux
* define CONFIG_X86* in autoconf.h as needed and reduce diff to linuxjsg2019-08-191-1/+1
| | | | ok kettenis@
* 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.