summaryrefslogtreecommitdiff
path: root/sys/dev/pci/drm/include
AgeCommit message (Collapse)Author
2020-11-17remove unused definitions which no longer exist in linuxJonathan Gray
2020-11-17remove setup_timer() interface linux removed in 2017Jonathan Gray
2020-11-17fix time_after32() macroJonathan Gray
2020-11-14Bring IDR function prototypes in line with modern Linux and implementMark Kettenis
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()Jonathan Gray
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 pathJonathan Gray
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 atomic64Jonathan Gray
2020-11-07change from rwlock(9) to mutex(9) for linux rwlocksJonathan Gray
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.hJonathan Gray
2020-10-29We need more memory barriers on powerpc.Mark Kettenis
ok tobhe@
2020-10-26Improve I/O functions to match Linux:Mark Kettenis
- 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 definesJonathan Gray
2020-10-26use __membar() where possibleJonathan Gray
2020-10-26use lwsync and eieio for smp barriers on powerpcJonathan Gray
ok kettenis@
2020-10-21handle capable(CAP_SYS_NICE) for allowing high priority contextsJonathan Gray
2020-10-21change drm_vma function arguments to take struct drm_file *Jonathan Gray
reduces the diff to linux 5.7.y ok kettenis@
2020-10-20use drm_mm from linux 5.7.yJonathan Gray
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 includeJonathan Gray
2020-10-16implement linux interval tree functionsJonathan Gray
Adapt kettenis' amdgpu interval tree replacement functions for the interval_tree.h functions radeondrm uses on cayman, aruba and GCN.
2020-10-14remove unused locally added drm_driver struct membersJonathan Gray
2020-10-11Align pool items on CACHELINESIZE when replacing linux kmem_cache withJonathan Gray
SLAB_HWCACHE_ALIGN flag. tested by semarie@
2020-10-05drm/i915/tgl: Add new PCI IDs to TGLJonathan Gray
From Swathi Dhanavanthri 3882581753d1cca0d32b5a8ad81791b79fb35d67 in mainline linux
2020-10-01avoid uninitialised var use in drm_syncobj.cJonathan Gray
We don't walk the chain in dma_fence_chain_for_each() but can provide the first fence.
2020-09-13use drm_cache.c from linux 5.7.yJonathan Gray
ok kettenis@
2020-09-13add an ipi for wbinvd and a linux style wbinvd_on_all_cpus() functionJonathan Gray
ok kettenis@ deraadt@
2020-09-11Include <sys/systm.h> directly instead of relying on hidden UVM includes.Martin Pieuchot
The header is being pulled via db_machdep.h -> uvm_extern.h -> uvm_map.h
2020-08-25enable more of the syncobj codeJonathan Gray
avoids unimplemented function warnings when running Mesa iris driver
2020-08-18Our usleep_range(min, max) implementation today is only taking accountMarcus Glocker
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-12drm/drm_fb_helper: fix fbdev with sparc64Jonathan Gray
From Sam Ravnborg cea0a7943a30a6d0320c8558a844dd27e8f0aa8b in linux 5.7.y/5.7.15 2a1658bf922ffd9b7907e270a7d9cdc9643fc45d in mainline linux
2020-08-03remove timeval conversion interfaces no longer in linuxJonathan Gray
2020-07-29change ktime to nanoseconds in drmJonathan Gray
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()Jonathan Gray
2020-07-07drm: use hi-res time to implement ktime_get(), ktime_get_real()cheloha
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 linuxJonathan Gray
2020-07-02powerpc64 has ci_idepthJonathan Gray
2020-07-02use intr_barrier(9) for synchronize_irq() and synchronize_hardirq()Jonathan Gray
2020-06-30use intr_restore() when restoring interruptsJonathan Gray
ok kettenis@
2020-06-29use time since epoch not time since boot for 'real' interfacesJonathan Gray
2020-06-29remove unused getrawmonotonic() and ktime_mono_to_real()Jonathan Gray
2020-06-29remove unused interfaces which were removed from linuxJonathan Gray
2020-06-29use attributes for __maybe_unused and __always_inlineJonathan Gray
2020-06-29reduce disabled warnings with clangJonathan Gray
2020-06-29make fbops const to avoid warning about discarding constJonathan Gray
found the hard way by deraadt@ on sparc64 fix suggested by kettenis@
2020-06-28set fb_set_par and have register_framebuffer() do initial modesetJonathan Gray
2020-06-28call fb_set_par() function pointer in register_framebuffer() if setJonathan Gray
ok stsp@ kettenis@
2020-06-26add readx_poll_timeout() required for 5.7.6 drmJonathan Gray
with help from cheloha@
2020-06-24kernel: use gettime(9)/getuptime(9) in lieu of time_second(9)/time_uptime(9)cheloha
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@
2020-06-22apart from the lock wait_queue_head struct is unused so replace itJonathan Gray
2020-06-22don't try to decrement if completion flag is UINT_MAXJonathan Gray
2020-06-22in wait_for_completion_* return 0 on timeout -ERESTARTSYS on signalJonathan Gray
matches how the interfaces are documented