Commit 9a9b862
drm/asahi: Add the Asahi driver for Apple AGX GPUs
drm/asahi: alloc: Support tagging array allocs
It's hard to tell what a given array buffer is just from the type, so
add support for explicitly adding a u32 tag. This can help us
differentiate between allocs in the debug codepaths or when dumping
memory.
To more easily debug GPU/FW-side overreads, use the alloc tag to fill
the padding instead of using a constant.
drm/asahi: buffer,render: Identify and provide layer meta buf
It looks like one of the "heapmeta" pointers is actually a layer
metadata pointer, that macOS just allocates contiguously with the
tilemap headers and heap meta buffers. Size seems to always be 0x100.
Let's allocate it after the heapmeta, which will make debugging easier.
drm/asahi: compute/render: Implement bindless samplers
drm/asahi: fw,queue: Implement helper programs
Also expose no preemption flag (?) separately.
drm/asahi: render: Identify and set Z/S strides for layered rendering
drm/asahi: Add verbose UAPI error reporting
drm/asahi: Identify and allocate clustered layering metadata buf
Turns out multi-cluster machines also need a clustered buffer for
layered rendering.
Fixes layered rendering on G13X with barriers (I guess if you don't
flush memory this stays in some kind of cache and somehow doesn't
matter?).
drm/asahi: Identify and implement helper config register
drm/asahi: alloc: Do not allocate memory to free memory
The existing garbage mechanism could allocate a relatively unbounded vec
when freeing garbage, which was hurting memory exhaustion scenarios.
The only reason we need that buffer is to move garbage out of the lock
so we can drop it without deadlocks. Replace it with a 128-size
pre-allocated garbage buffer, and loop around reusing it.
drm/asahi: Don't lock up when unmapping PTEs fails
If a bug causes PTEs to be unmapped twice, the unmap loop gets stuck
spamming WARNs forever. Just skip a page and try again so we can make
forward progress.
drm/asahi: Convert to GPUVM and implement more VM_BIND ops
drm/asahi: Refactor address types
VAs are u64, PAs and sizes are usize.
drm/asahi: util: Add RangeExt helpers for Range<T>
drm/asahi: mmu: Convert to using Range
drm/asahi: Move the unknown dummy page to the top of the address space
drm/asahi: Convert more ranges to Range<>
drm/asahi: mmu: Fix lockdep issues with GpuVm
drm/asahi: Implement GEM objects sharing a single DMA resv
drm/asahi: queue: Split into Queue and QueueInner
Work around mutability issues when entity.new_job() takes a mutable
reference to the entity by moving all the fields used by the
submit_render() and submit_compute() functions to an inner struct,
eliminating the double-mutable-borrow.
drm/asahi: file: Update to newer VM_BIND API
drm/asahi: Signal soft fault support to userspace
drm/asahi: Fix u32 mult overflow on large tilebufs/TPCs
drm/asahi: Fix event tracking when JobSubmission is dropped
drm/asahi: gpu: Show unknown field in timeouts
drm/asahi: Handle channel errors
drm/asahi: event: Initialize stamps to different values
Makes debugging a bit easier.
drm/asahi: workqueue: Fix "Cannot submit, but queue is empty?" bug
drm/asahi: Clean up jobs in a workqueue
This eliminates a potential deadlock under load and improves the fence
signaling situation (for when we have a shrinker).
drm/asahi: Add robust_isolation kernel parameter
This only allows binding one VM context at once, which serializes GPU
usage between VMs and therefore prevents one faulting VM from affecting
others.
drm/asahi: HACK: Disable compute preemption for now
Possibly because we don't have support in the helper program, this is
broken and causes channel errors. Hack in high priority for now, which
works around it.
Use debug_flags 0x1000000000000 to re-enable for testing.
drm/asahi: Align kernel range to buffer::PAGE_SIZE
We only require alignment to the UAT page size from userspace, but
internally we need more, so just align it if userspace gives us lower
alignment.
drm/asahi: Implement missing ASAHI_BIND_OP_UNBIND
Trivial now that we have GPUVM.
drm/asahi: Implement ASAHI_GET_TIME
drm/asahi: gpu: Force Box move with manual Box<T>::into_inner()
TODO: Investigate why this doesn't work automatically.
drm/asahi: gpu: Collect garbage for private/gpuro together
Avoids double firmware flushes
drm/asahi: alloc: Be more verbose about failures
drm/asahi: gpu: Add a max object count garbage limit
This ensures the garbage Vec does not grow beyond what is reasonable,
and probably reduces jank by doing more smaller GCs instead of big ones.
drm/asahi: Document timestamp ops better, refactor fields
drm/asahi: workqueue: Restrict command objects to only job commands
drm/asahi: gpu: Implement mapping timestamp buffers
drm/asahi: file: Implement ASAHI_GEM_BIND_OBJECT
drm/asahi: fw, queue: Add UserTimestamp object to job structs
drm/asahi: queue: Plumb through objects XArray and add timestamp getter
drm/asahi: fw, queue: Plumb through UserTimestamps -> TimestampPointers
drm/asahi: queue/render,compute: Plumb through timestamps extension
drm/asahi: file: Add user_timestamp_frequency_hz to params
drm/asahi: Set a bit for internal non-render barriers on G14X
drm/asahi: Add the USER_TIMESTAMPS feature
drm/asahi: mmu: Change step_remap() to new api
Fixes deadlock. Also fix missing TLB inval
drm/asahi: file: Reject gem_bind past the end of the object
drm/asahi: mmu: Fix 2x step_remap case
drm/asahi: workqueue: Defer freeing the last completed work item
Maybe helps with firmware crashes?
drm/asahi: mmu: Fix deadlock on remap ops
drm/asahi: mmu: Change step_remap() to new api
drm/asahi: mmu: UAT change for rust page table rewrite
Originally from:
arm64: dts: apple: Remove no-map from pagetables region
This should still be compatible with older kernels, since this region is
always mapped cached.
drm/asahi: debug: Add PgTable debug category
drm/asahi: mmu: Add some barriers
Just being paranoid.
drm/asahi: Implement ASAHI_BIND_SINGLE_PAGE (uapi)
drm/asahi: port to new UAPI
Signed-off-by: Asahi Lina <lina@asahilina.net>
Co-developed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Signed-off-by: Janne Grunau <j@jannau.net>1 parent af0d4e1 commit 9a9b862
45 files changed
Lines changed: 19717 additions & 0 deletions
File tree
- drivers/gpu/drm
- asahi
- fw
- hw
- queue
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
294 | 294 | | |
295 | 295 | | |
296 | 296 | | |
| 297 | + | |
| 298 | + | |
297 | 299 | | |
298 | 300 | | |
299 | 301 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
215 | 215 | | |
216 | 216 | | |
217 | 217 | | |
| 218 | + | |
218 | 219 | | |
219 | 220 | | |
220 | 221 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
0 commit comments