summaryrefslogtreecommitdiffstats
path: root/sys/dev/pci/drm
AgeCommit message (Collapse)AuthorFilesLines
2021-03-05ansijsg1-1/+1
2021-02-20remove warning about amdgpu userptr ioctl being unimplementedjsg1-1/+0
matches radeon and i915 reported by Benjamin Baier
2021-02-14correct drm work flush behaviourjsg2-6/+10
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-02-08Simplify sleep_setup API to two operations in preparation for splittingmpi1-7/+5
the SCHED_LOCK(). Putting a thread on a sleep queue is reduce to the following: sleep_setup(); /* check condition or release lock */ sleep_finish(); Previous version ok cheloha@, jmatthew@, ok claudio@
2021-01-13revert drm vmalloc changesjsg3-126/+39
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 withkettenis3-39/+126
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-31don't oversleep when waiting on fencesjsg1-15/+17
original diff from and ok cheloha@
2020-12-25Refactor klist insertion and removalvisa1-4/+4
Rename klist_{insert,remove}() to klist_{insert,remove}_locked(). These functions assume that the caller has locked the klist. The current state of locking remains intact because the kernel lock is still used with all klists. Add new functions klist_insert() and klist_remove() that lock the klist internally. This allows some code simplification. OK mpi@
2020-12-20sync with i915_pciids.hjsg1-2/+0
2020-12-20drm/i915: Remove dubious Valleyview PCI IDsjsg1-3/+1
From Alexei Podtelezhnikov f2bde2546b81b64fb58aa04888fdd82a090b3908 in mainline linux
2020-12-20remove duplicate device id caused by subids in INTEL_IVB_Q_IDSjsg1-1/+0
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-13set scatterlist to NULL after freejsg1-1/+2
2020-12-13remove unused wait interfacesjsg2-23/+3
2020-12-10use jiffies var instead of ticks when checking for timeoutjsg2-10/+11
2020-12-10remove timespec_to_jiffies() which no longer exists in linuxjsg1-12/+0
2020-12-08Call ttm_tt_unpopulate() instead of directly calling ttm_tt_unpopulatejsg1-1/+1
function pointer in ttm_tt_swapout(). Reduces the diff to linux. ok kettenis@
2020-12-08correct ttm_tt error paths if bus_dmamap_create() failsjsg1-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@
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-30Use DC_FP_START()/DC_FP_END() around dcn2.1 paths known to causejsg1-0/+6
SSE FP exception traps, update_bw_bounding_box() and dcn20_populate_dml_pipes_from_context(). The scope around the dcn20_fast_validate_bw() call is large to match DC_FP_START()/DC_FP_END() use in dcn20_resource.c and avoid the situation where a dcn2.0 path would have nested DC_FP_START() calls. ok kettenis@
2020-11-21Add barriers in the IO helper functions just like what was done for amdgpu(4).kettenis1-6/+22
ok patrick@, jsg@
2020-11-19The conversion of the IO BAR access did not completely mirror thepatrick1-6/+22
behaviour of Linux' implementation: arm64's bus space operations have no barriers, so while Linux' iowrite32/ioread32 explicitly contain barriers, using bus space read/write is not enough on arm64. Add read barriers after a read to make sure that all reads have completed before the following reads. Add write barriers before a write to make sure all previous writes have completed before that write. This fixes panics on the HoneyComb LX2K with amdgpu(4). ok kettenis@
2020-11-17remove unused definitions which no longer exist in linuxjsg4-8/+2
2020-11-17remove setup_timer() interface linux removed in 2017jsg2-8/+10
2020-11-17fix time_after32() macrojsg1-1/+1
2020-11-17adjust for reversed outb arguments linux usesjsg1-0/+4
2020-11-14Revise the initialization of the DRM Linux emulation layer such that wekettenis2-30/+33
only call it when the first drm(4) instance attaches. Also add a cleanup function that gets called when the last drm(4) instance detaches. This makes sure that statically initialized IDR instances always work. ok jsg@, semarie@
2020-11-14idr limit should be inclusivejsg1-3/+7
ok kettenis@
2020-11-14Bring IDR function prototypes in line with modern Linux and implementkettenis2-37/+23
IDA functions in terms of IDR. Fixes issues with running out of PASIDs in amdgpu(4). ok jsg@
2020-11-14whitespacekettenis1-2/+2
2020-11-14We should only grab the drm_global_mutex lock for legacy drivers.kettenis1-1/+3
Spotted thanks to debugging work by semarie@ ok jsg@, semarie@
2020-11-12use RWLOCK_INITIALIZER() in DEFINE_MUTEX()jsg2-2/+2
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 pathjsg2-15/+22
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-08vblank seqlock is used from interrupt context so use IPL_TTYjsg1-1/+1
2020-11-07change from rwlock(9) to mutex(9) for linux rwlocksjsg4-12/+8
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-06Remove unused `anon' argument from uvmfault_unlockall().mpi1-3/+3
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@
2020-11-06Remove unused `anon' argument from uvmfault_unlockall().mpi3-9/+9
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@
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-29Silence "using MMIO for ATOM IIO" error message, since that is normal onkettenis1-0/+2
POWER9 machines. ok jsg@
2020-10-28Switch from bus_space_read/write to linux io.h interfaces for alljsg6-71/+30
pci "memory space" io. Further reduces the diff to linux. ok kettenis@
2020-10-28Use the function from <linux/io.h> for all "Memory Space" IO. This reduceskettenis5-24/+21
the diffs to Linux and makes sure we use memory barriers in the same way as Linux does. ok jsg@ (who added the doorbell changes)
2020-10-26Make mapping the "I/O Space" BAR optional. POWER9 systems don't supportkettenis1-14/+7
"I/O Space" on their PCIe host bridges and for most (all) Radeon variants there is an alternative method to access the relevant registers. ok jsg@
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