summaryrefslogtreecommitdiffstats
path: root/sys/dev/pci/drm/include/linux
AgeCommit message (Collapse)AuthorFilesLines
2021-02-14correct drm work flush behaviourjsg1-2/+3
Don't set taskq to system_wq in INIT_WORK(). Test if taskq pointer is non-NULL before calling taskq_barrier() in flush functions. fixes a black screen on boot problem with 5.10.y drm using nano x1 bisected by jcs@ to 'drm/i915: Always flush the active worker before returning from the wait'
2021-01-13revert drm vmalloc changesjsg2-16/+38
It is suspected they were to blame for a machine with inteldrm running X (xterms and chromium) running out of resources after a few days. ok kettenis@
2021-01-08Bring the emulated Linux memory allocation interfaces more in line withkettenis2-38/+16
what Linux does. Let vmalloc() use km_alloc(9) instead of malloc(9) and let kvmalloc() only use malloc(9) for small (less than a page) allocations and atomic allocations. This should reduce the pressure on the "interrupt-safe" map. ok jsg@
2020-12-20test against [VM_MIN_ADDRESS, VM_MAXUSER_ADDRESS] in access_ok()jsg1-3/+8
ok kettenis@
2020-12-14remove unused include linux no longer hasjsg1-0/+0
2020-12-14remove unused (and wrong) disable_irq() and enable_irq() definesjsg1-3/+0
2020-12-13remove unused wait interfacesjsg1-13/+1
2020-12-10use jiffies var instead of ticks when checking for timeoutjsg1-6/+7
2020-12-10remove timespec_to_jiffies() which no longer exists in linuxjsg1-12/+0
2020-12-07remove unused (and wrong) page_address() macrojsg1-1/+0
this is supposed to return a va for a page not pa
2020-12-07change from bus_addr_t to paddr_t for phys_addr_t and resource_size_tjsg1-2/+2
Types stay unsigned long; we don't do 64 bit paddr_t on any 32 bit arch.
2020-11-17remove unused definitions which no longer exist in linuxjsg4-8/+2
2020-11-17remove setup_timer() interface linux removed in 2017jsg1-2/+1
2020-11-17fix time_after32() macrojsg1-1/+1
2020-11-14Bring IDR function prototypes in line with modern Linux and implementkettenis1-13/+12
IDA functions in terms of IDR. Fixes issues with running out of PASIDs in amdgpu(4). ok jsg@
2020-11-12use RWLOCK_INITIALIZER() in DEFINE_MUTEX()jsg1-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@
2020-11-09use a single preinitialised mutex for atomic64 fallback pathjsg1-14/+16
Previously we would initialise a variable specific mutex in ATOMIC64_INIT() or atomic64_set() but the drm code in multiple places zeroes memory and later accesses it without calling these resulting in a mutex with IPL_NONE instead of IPL_HIGH. Fixes a 'locking against myself' panic reported by Anthony Richardby on macppc with PowerBook5,6 and RV350. ok kettenis@
2020-11-09use 64 bit atomic builtins on i386 for atomic64jsg1-2/+4
2020-11-07change from rwlock(9) to mutex(9) for linux rwlocksjsg2-8/+4
Linux rwlocks are read/write spin locks which don't sleep. Fixes a panic claudio@ reported with a WITNESS kernel on inteldrm(4) 'panic: acquiring blockable sleep lock with spinlock or critical section held (rwlock) drmvma' Patch from kettenis@ with a small tweak from me. ok kettenis@
2020-11-06move definitions which should be in rwsem.hjsg3-6/+14
2020-10-29We need more memory barriers on powerpc.kettenis1-7/+13
ok tobhe@
2020-10-26Improve I/O functions to match Linux:kettenis1-9/+100
- Reverse byte order on big-endian architectures (except on sparc64) - Add memory barriers Note that sparc64 is special as we use a little-endian mapping for PCI bus space, so we shouldn't reverse the byte order there. ok jsg@
2020-10-26remove unused alpha memory barrier definesjsg1-5/+1
2020-10-26use __membar() where possiblejsg1-9/+9
2020-10-26use lwsync and eieio for smp barriers on powerpcjsg1-4/+11
ok kettenis@
2020-10-21handle capable(CAP_SYS_NICE) for allowing high priority contextsjsg1-3/+10
2020-10-20use drm_mm from linux 5.7.yjsg1-0/+2
Without this boot time tests from setting amdgpu_testing = 1 fail. For example on Vega 56: drm: GART: 512M 0x0000000000000000 - 0x000000001FFFFFFF ... [drm] Tested GTT->VRAM and VRAM->GTT copy for GTT offset 0xa00000 [drm] Tested GTT->VRAM and VRAM->GTT copy for GTT offset 0xb00000 ... [drm] Tested GTT->VRAM and VRAM->GTT copy for GTT offset 0x1fe00000 [drm] Tested GTT->VRAM and VRAM->GTT copy for GTT offset 0x1ff00000 [drm] *ERROR* 0xffff80000135f858 bind failed Error while testing BO move ok kettenis@
2020-10-16remove uneeded pool.h includejsg1-1/+0
2020-10-16implement linux interval tree functionsjsg2-36/+19
Adapt kettenis' amdgpu interval tree replacement functions for the interval_tree.h functions radeondrm uses on cayman, aruba and GCN.
2020-10-11Align pool items on CACHELINESIZE when replacing linux kmem_cache withjsg2-0/+6
SLAB_HWCACHE_ALIGN flag. tested by semarie@
2020-10-01avoid uninitialised var use in drm_syncobj.cjsg1-1/+3
We don't walk the chain in dma_fence_chain_for_each() but can provide the first fence.
2020-08-25enable more of the syncobj codejsg1-0/+33
avoids unimplemented function warnings when running Mesa iris driver
2020-08-18Our usleep_range(min, max) implementation today is only taking accountmglocker1-1/+1
of the min value to delay. On the iMac11,2 this was too short, causing a timeout in the DP AUX transaction retry loop, leaving the eDP dark after the KMS initialization attempt. Affected code line for reference: sys/dev/pci/drm/drm_dp_helper.c:771, revision 1.11 Therefore we change the behavior of usleep_range(min, max) to delay the average value of min and max instead, which finally fixes the KMS initialization on the iMac11,2. Help and ok jsg@
2020-08-03remove timeval conversion interfaces no longer in linuxjsg1-6/+1
2020-07-29change ktime to nanoseconds in drmjsg2-52/+49
Change from using timevals for ktime to 64 bit count of nanoseconds to closer match linux. tweak from and ok cheloha@ ok kettenis@ on an earlier version
2020-07-20use timeout_del_barrier(9) for del_timer_sync()jsg1-2/+2
2020-07-07drm: use hi-res time to implement ktime_get(), ktime_get_real()cheloha2-4/+4
There seems to have been some confusion about the granularity of certain time interfaces in the Linux kernel when our DRM compatibility layer was written. To be clear: the Linux ktime_get() and ktime_get_real() interfaces are *high resolution* clocks. We should to implement them with high resolution interfaces from our own kernel. Thus, use microuptime(9) to implement ktime_get() and microtime(9) to implement ktime_get_real(). While here, ktime_get_raw_ns() should use ktime_get_raw(), not ktime_get(). Discussed with kettenis@ and jsg@. ok jsg@
2020-07-02remove unused timespec interfaces no longer in linuxjsg1-38/+1
2020-07-02powerpc64 has ci_idepthjsg1-1/+1
2020-07-02use intr_barrier(9) for synchronize_irq() and synchronize_hardirq()jsg1-2/+0
2020-06-30use intr_restore() when restoring interruptsjsg1-2/+2
ok kettenis@
2020-06-29use time since epoch not time since boot for 'real' interfacesjsg1-5/+11
2020-06-29remove unused getrawmonotonic() and ktime_mono_to_real()jsg1-2/+0
2020-06-29remove unused interfaces which were removed from linuxjsg2-12/+1
2020-06-29use attributes for __maybe_unused and __always_inlinejsg1-4/+4
2020-06-29reduce disabled warnings with clangjsg1-4/+0
2020-06-29make fbops const to avoid warning about discarding constjsg1-1/+1
found the hard way by deraadt@ on sparc64 fix suggested by kettenis@
2020-06-28call fb_set_par() function pointer in register_framebuffer() if setjsg1-0/+8
ok stsp@ kettenis@
2020-06-26add readx_poll_timeout() required for 5.7.6 drmjsg1-0/+34
with help from cheloha@
2020-06-24kernel: use gettime(9)/getuptime(9) in lieu of time_second(9)/time_uptime(9)cheloha1-1/+1
time_second(9) and time_uptime(9) are widely used in the kernel to quickly get the system UTC or system uptime as a time_t. However, time_t is 64-bit everywhere, so it is not generally safe to use them on 32-bit platforms: you have a split-read problem if your hardware cannot perform atomic 64-bit reads. This patch replaces time_second(9) with gettime(9), a safer successor interface, throughout the kernel. Similarly, time_uptime(9) is replaced with getuptime(9). There is a performance cost on 32-bit platforms in exchange for eliminating the split-read problem: instead of two register reads you now have a lockless read loop to pull the values from the timehands. This is really not *too* bad in the grand scheme of things, but compared to what we were doing before it is several times slower. There is no performance cost on 64-bit (__LP64__) platforms. With input from visa@, dlg@, and tedu@. Several bugs squashed by visa@. ok kettenis@