Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
160 commits
Select commit Hold shift + click to select a range
84ef8e4
drm/asahi: m3: restore the 7.1.12 T8122 runtime sources, unwired
scottjones Oct 23, 2026
e16c5bb
drm/asahi: m3: map each VM's dummy page where the firmware expects it
scottjones Oct 23, 2026
eae5bfa
drm/asahi: m3: quarantine a failed job's VM before signalling its fence
scottjones Oct 23, 2026
c9dcc61
drm/asahi: m3: keep the adopted UAT until ASC stops on a failed start
scottjones Oct 23, 2026
34b754f
drm/asahi: m3: don't let the compute stream debug read fail a job
scottjones Oct 23, 2026
6b505f4
drm/asahi: m3: start the GPU firmware once per boot
scottjones Oct 26, 2026
00311a5
drm/asahi: m3: don't quarantine VMs for packets the firmware never saw
scottjones Oct 26, 2026
c297e5a
drm/asahi: align M3 Air startup diagnostics with board defaults
chriskearney Oct 26, 2026
6cdb981
drm/asahi: m3: take the start pin with try_module_get
scottjones Oct 26, 2026
ba17f5a
drm/asahi: m3: admit clients that ask for the parameters up to the HA…
DjDeveloperr Oct 28, 2026
8bf9ec2
drm/asahi: accept the T8122 25G83 mailbox compatible list
satchlj Oct 31, 2026
dfb9d8b
drm/asahi: describe the T8122 extended firmware profile and owned IO …
satchlj Oct 31, 2026
32ad468
drm/asahi: construct and publish extended T8122 initialization data
satchlj Oct 31, 2026
ee69dab
drm/asahi: prepare extended firmware queues and controller handoff
satchlj Oct 31, 2026
c5e1b35
drm/asahi: dispatch G15 compute through extended T8122 firmware
satchlj Oct 31, 2026
ec30b22
drm/asahi: enable J613 extended firmware render and retirement
satchlj Oct 31, 2026
efcd402
drm/asahi: admit authorized HIGH queues on Extended T8122
satchlj Nov 3, 2026
c1c0e23
drm/asahi: test the M3 host priority mapping alongside admission
satchlj Nov 3, 2026
ba872b9
ci: register the M3 queue priority admission tests
satchlj Nov 4, 2026
bd92c01
drm/asahi: back off interrupt-assisted M3 completion waits
satchlj Nov 3, 2026
9f3b310
drm/asahi: omit no-op M3 module pins without unload support
satchlj Nov 3, 2026
8f8374b
Merge branch 'satchlj/t8122-api-fixes-20261104' into satchlj/port-347…
satchlj Nov 5, 2026
40c0f57
selftests: asahi: match the 7.3 capability argument type
satchlj Nov 5, 2026
032b604
selftests: asahi: accept explicitly registered test-prefix scripts
satchlj Nov 5, 2026
841394c
Merge branch 'satchlj/port-346-20261104' into satchlj/port-347-20261104
satchlj Nov 5, 2026
b11c52b
Merge branch 'satchlj/t8122-api-fixes-20261104' into satchlj/port-302…
satchlj Nov 5, 2026
94d141f
Merge branch 'satchlj/t8122-api-fixes-20261104' into satchlj/port-303…
satchlj Nov 5, 2026
28caf6d
Merge branch 'satchlj/t8122-api-fixes-20261104' into satchlj/port-304…
satchlj Nov 5, 2026
2284c4e
Merge branch 'satchlj/t8122-api-fixes-20261104' into satchlj/port-305…
satchlj Nov 5, 2026
c3910f7
Merge branch 'satchlj/t8122-api-fixes-20261104' into satchlj/port-306…
satchlj Nov 5, 2026
a64da66
Merge branch 'satchlj/t8122-api-fixes-20261104' into satchlj/port-307…
satchlj Nov 5, 2026
3822ecc
Merge branch 'satchlj/t8122-api-fixes-20261104' into satchlj/port-346…
satchlj Nov 5, 2026
82aaf1b
Merge branch 'satchlj/t8122-api-fixes-20261104' into satchlj/port-347…
satchlj Nov 5, 2026
7660bed
Prepare the original context for carried T8122 commit ad52c9b317f6
satchlj Nov 5, 2026
e45af19
drm/asahi: m3: start the T8122 runtime on 7.2
scottjones Oct 23, 2026
3810c8b
Prepare the original context for carried T8122 commit 8a31fe185686
satchlj Nov 5, 2026
0486865
drm/asahi: prepare supported M3 native GPU defaults
chriskearney Oct 26, 2026
2d76bce
drm/asahi: adapt the carried T8122 foundation to Aurora 7.3
satchlj Nov 5, 2026
3f4f1a4
drm/asahi: use the existing F32 bit accessor on 7.3
satchlj Nov 5, 2026
1694a19
Prepare the original context for the carried M3 timestamp dependency
satchlj Nov 5, 2026
a8f092b
drm/asahi: sync the G17 driver with aurora-silicon at d3cf19be
DjDeveloperr Oct 25, 2026
10e8e3a
drm/asahi: compose the carried timestamp adapter with Aurora 7.3
satchlj Nov 5, 2026
90ee783
Merge branch 'satchlj/t8122-api-fixes-20261104' into satchlj/port-302…
satchlj Nov 5, 2026
0a00e92
Merge branch 'satchlj/t8122-api-fixes-20261104' into satchlj/port-303…
satchlj Nov 5, 2026
c6ab2ef
Merge branch 'satchlj/t8122-api-fixes-20261104' into satchlj/port-304…
satchlj Nov 5, 2026
167dcfe
Merge branch 'satchlj/t8122-api-fixes-20261104' into satchlj/port-305…
satchlj Nov 5, 2026
4425ded
Merge branch 'satchlj/t8122-api-fixes-20261104' into satchlj/port-306…
satchlj Nov 5, 2026
8363fbb
Merge branch 'satchlj/t8122-api-fixes-20261104' into satchlj/port-307…
satchlj Nov 5, 2026
ae10e3b
Merge branch 'satchlj/t8122-api-fixes-20261104' into satchlj/port-346…
satchlj Nov 5, 2026
a3cf48e
Merge branch 'satchlj/t8122-api-fixes-20261104' into satchlj/port-347…
satchlj Nov 5, 2026
f4b1301
selftests: asahi: account for the paired-header fixture through its r…
satchlj Nov 5, 2026
81d2a56
Merge branch 'satchlj/t8122-api-fixes-20261104' into satchlj/port-302…
satchlj Nov 5, 2026
bdb27ea
Merge branch 'satchlj/t8122-api-fixes-20261104' into satchlj/port-303…
satchlj Nov 5, 2026
5f64a63
Merge branch 'satchlj/t8122-api-fixes-20261104' into satchlj/port-304…
satchlj Nov 5, 2026
9130710
Merge branch 'satchlj/t8122-api-fixes-20261104' into satchlj/port-305…
satchlj Nov 5, 2026
2cbb206
Merge branch 'satchlj/t8122-api-fixes-20261104' into satchlj/port-306…
satchlj Nov 5, 2026
7879118
Merge branch 'satchlj/t8122-api-fixes-20261104' into satchlj/port-307…
satchlj Nov 5, 2026
79d45bd
Merge branch 'satchlj/t8122-api-fixes-20261104' into satchlj/port-346…
satchlj Nov 5, 2026
d7be34e
Merge branch 'satchlj/t8122-api-fixes-20261104' into satchlj/port-347…
satchlj Nov 5, 2026
d92133b
Merge branch 'satchlj/port-301-20261104' into satchlj/port-303-20261104
satchlj Nov 5, 2026
471a4a4
Merge branch 'satchlj/port-302-20261104' into satchlj/port-303-20261104
satchlj Nov 5, 2026
cb3408f
Merge branch 'satchlj/port-303-20261104' into satchlj/port-304-20261104
satchlj Nov 5, 2026
d5fcae0
Merge branch 'satchlj/port-304-20261104' into satchlj/port-305-20261104
satchlj Nov 5, 2026
e71fbb0
Merge branch 'satchlj/port-305-20261104' into satchlj/port-306-20261104
satchlj Nov 5, 2026
72b6142
Merge branch 'satchlj/port-306-20261104' into satchlj/port-307-20261104
satchlj Nov 5, 2026
66eb34e
Merge branch 'satchlj/port-307-20261104' into satchlj/port-346-20261104
satchlj Nov 5, 2026
03692e5
Merge branch 'satchlj/port-346-20261104' into satchlj/port-347-20261104
satchlj Nov 5, 2026
95f3e2a
drm/asahi: use the 7.3 MMIO mapping transaction and ownership contract
satchlj Nov 5, 2026
917daa2
Merge branch 'satchlj/t8122-api-fixes-20261104' into satchlj/port-302…
satchlj Nov 5, 2026
a84b3dd
Merge branch 'satchlj/t8122-api-fixes-20261104' into satchlj/port-303…
satchlj Nov 5, 2026
f157192
Merge branch 'satchlj/t8122-api-fixes-20261104' into satchlj/port-304…
satchlj Nov 5, 2026
05524e2
Merge branch 'satchlj/t8122-api-fixes-20261104' into satchlj/port-305…
satchlj Nov 5, 2026
a0d0a49
Merge branch 'satchlj/t8122-api-fixes-20261104' into satchlj/port-306…
satchlj Nov 5, 2026
34de4e4
Merge branch 'satchlj/t8122-api-fixes-20261104' into satchlj/port-307…
satchlj Nov 5, 2026
119f1ea
Merge branch 'satchlj/t8122-api-fixes-20261104' into satchlj/port-346…
satchlj Nov 5, 2026
020e3f8
Merge branch 'satchlj/t8122-api-fixes-20261104' into satchlj/port-347…
satchlj Nov 5, 2026
4abcf66
drm/asahi: expose adopted upper-root selection to the T8122 backend
satchlj Nov 5, 2026
41dd5d5
Merge branch 'satchlj/t8122-api-fixes-20261104' into satchlj/port-302…
satchlj Nov 5, 2026
1f39fce
Merge branch 'satchlj/t8122-api-fixes-20261104' into satchlj/port-303…
satchlj Nov 5, 2026
4583d2a
Merge branch 'satchlj/t8122-api-fixes-20261104' into satchlj/port-304…
satchlj Nov 5, 2026
44442b3
Merge branch 'satchlj/t8122-api-fixes-20261104' into satchlj/port-305…
satchlj Nov 5, 2026
032486e
Merge branch 'satchlj/t8122-api-fixes-20261104' into satchlj/port-306…
satchlj Nov 5, 2026
2436856
Merge branch 'satchlj/t8122-api-fixes-20261104' into satchlj/port-307…
satchlj Nov 5, 2026
49a678e
Merge branch 'satchlj/t8122-api-fixes-20261104' into satchlj/port-346…
satchlj Nov 5, 2026
523b9eb
Merge branch 'satchlj/t8122-api-fixes-20261104' into satchlj/port-347…
satchlj Nov 5, 2026
fc2cccf
Merge branch 'satchlj/port-302-20261104' into satchlj/port-303-20261104
satchlj Nov 5, 2026
f6c563e
Merge branch 'satchlj/port-303-20261104' into satchlj/port-304-20261104
satchlj Nov 5, 2026
610a513
Merge branch 'satchlj/port-304-20261104' into satchlj/port-305-20261104
satchlj Nov 5, 2026
ea7c050
Merge branch 'satchlj/port-305-20261104' into satchlj/port-306-20261104
satchlj Nov 5, 2026
ef875a1
Merge branch 'satchlj/port-306-20261104' into satchlj/port-307-20261104
satchlj Nov 5, 2026
44c5989
Merge branch 'satchlj/port-307-20261104' into satchlj/port-346-20261104
satchlj Nov 5, 2026
c89fd6e
Merge branch 'satchlj/port-346-20261104' into satchlj/port-347-20261104
satchlj Nov 5, 2026
9f442fa
drm/asahi: adapt T8122 resources and module pins to 7.3
satchlj Nov 5, 2026
477d9d3
Merge branch 'satchlj/t8122-api-fixes-20261104' into satchlj/port-302…
satchlj Nov 5, 2026
1d28b76
Merge branch 'satchlj/t8122-api-fixes-20261104' into satchlj/port-303…
satchlj Nov 5, 2026
f7ac189
Merge branch 'satchlj/t8122-api-fixes-20261104' into satchlj/port-304…
satchlj Nov 5, 2026
fc87ce0
Merge branch 'satchlj/t8122-api-fixes-20261104' into satchlj/port-305…
satchlj Nov 5, 2026
f163501
Merge branch 'satchlj/t8122-api-fixes-20261104' into satchlj/port-306…
satchlj Nov 5, 2026
57d2141
Merge branch 'satchlj/t8122-api-fixes-20261104' into satchlj/port-307…
satchlj Nov 5, 2026
9a28266
Merge branch 'satchlj/t8122-api-fixes-20261104' into satchlj/port-346…
satchlj Nov 5, 2026
d798e55
Merge branch 'satchlj/t8122-api-fixes-20261104' into satchlj/port-347…
satchlj Nov 5, 2026
85dfdef
Merge branch 'satchlj/port-302-20261104' into satchlj/port-303-20261104
satchlj Nov 5, 2026
03c778b
Merge branch 'satchlj/port-303-20261104' into satchlj/port-304-20261104
satchlj Nov 5, 2026
07c5d35
Merge branch 'satchlj/port-304-20261104' into satchlj/port-305-20261104
satchlj Nov 5, 2026
b17b5ec
Merge branch 'satchlj/port-305-20261104' into satchlj/port-306-20261104
satchlj Nov 5, 2026
ea85d43
Merge branch 'satchlj/port-306-20261104' into satchlj/port-307-20261104
satchlj Nov 5, 2026
33dcc77
Merge branch 'satchlj/port-307-20261104' into satchlj/port-346-20261104
satchlj Nov 5, 2026
1ac0d6b
Merge branch 'satchlj/port-346-20261104' into satchlj/port-347-20261104
satchlj Nov 5, 2026
46d759b
Merge commit '33313096c66f4afdff4ef7060d20fe9bedebc34c' into satchlj/…
satchlj Nov 5, 2026
837aa24
Merge commit '33313096c66f4afdff4ef7060d20fe9bedebc34c' into satchlj/…
satchlj Nov 5, 2026
a8afe80
Merge commit '33313096c66f4afdff4ef7060d20fe9bedebc34c' into satchlj/…
satchlj Nov 5, 2026
ae91e26
Merge commit '33313096c66f4afdff4ef7060d20fe9bedebc34c' into satchlj/…
satchlj Nov 5, 2026
368d1dc
Merge commit '33313096c66f4afdff4ef7060d20fe9bedebc34c' into satchlj/…
satchlj Nov 5, 2026
076b28b
Merge commit '33313096c66f4afdff4ef7060d20fe9bedebc34c' into satchlj/…
satchlj Nov 5, 2026
c34bce8
Merge commit '33313096c66f4afdff4ef7060d20fe9bedebc34c' into satchlj/…
satchlj Nov 5, 2026
bbf8435
Merge commit '33313096c66f4afdff4ef7060d20fe9bedebc34c' into satchlj/…
satchlj Nov 5, 2026
8994247
Merge branch 'satchlj/port-301-20261104' into satchlj/port-303-20261104
satchlj Nov 5, 2026
bc9af1f
Merge branch 'satchlj/port-302-20261104' into satchlj/port-303-20261104
satchlj Nov 5, 2026
379b08b
Merge branch 'satchlj/port-303-20261104' into satchlj/port-304-20261104
satchlj Nov 5, 2026
f13e806
Merge branch 'satchlj/port-304-20261104' into satchlj/port-305-20261104
satchlj Nov 5, 2026
0a7d334
Merge branch 'satchlj/port-305-20261104' into satchlj/port-306-20261104
satchlj Nov 5, 2026
0d31784
Merge branch 'satchlj/port-306-20261104' into satchlj/port-307-20261104
satchlj Nov 5, 2026
f1e8a99
Merge branch 'satchlj/port-307-20261104' into satchlj/port-346-20261104
satchlj Nov 5, 2026
b73d1f9
Merge branch 'satchlj/port-346-20261104' into satchlj/port-347-20261104
satchlj Nov 5, 2026
c816139
Merge commit 'b50066848322c6799c1433ee3a358aab2e9faabb' into satchlj/…
satchlj Nov 5, 2026
1864556
Merge commit 'b50066848322c6799c1433ee3a358aab2e9faabb' into satchlj/…
satchlj Nov 5, 2026
d655162
Merge commit 'b50066848322c6799c1433ee3a358aab2e9faabb' into satchlj/…
satchlj Nov 5, 2026
1d520b6
Merge commit 'b50066848322c6799c1433ee3a358aab2e9faabb' into satchlj/…
satchlj Nov 5, 2026
8d07b11
Merge commit 'b50066848322c6799c1433ee3a358aab2e9faabb' into satchlj/…
satchlj Nov 5, 2026
c81410e
Merge commit 'b50066848322c6799c1433ee3a358aab2e9faabb' into satchlj/…
satchlj Nov 5, 2026
cd9eac9
Merge commit 'b50066848322c6799c1433ee3a358aab2e9faabb' into satchlj/…
satchlj Nov 5, 2026
1f5c951
Merge commit 'b50066848322c6799c1433ee3a358aab2e9faabb' into satchlj/…
satchlj Nov 5, 2026
e957f8e
Merge branch 'satchlj/port-301-20261104' into satchlj/port-303-20261104
satchlj Nov 5, 2026
aa8d159
Merge branch 'satchlj/port-302-20261104' into satchlj/port-303-20261104
satchlj Nov 5, 2026
ac13353
Merge branch 'satchlj/port-303-20261104' into satchlj/port-304-20261104
satchlj Nov 5, 2026
b166d93
Merge branch 'satchlj/port-304-20261104' into satchlj/port-305-20261104
satchlj Nov 5, 2026
58c89f5
Merge branch 'satchlj/port-305-20261104' into satchlj/port-306-20261104
satchlj Nov 5, 2026
9b2e8cf
Merge branch 'satchlj/port-306-20261104' into satchlj/port-307-20261104
satchlj Nov 5, 2026
e7936d8
Merge branch 'satchlj/port-307-20261104' into satchlj/port-346-20261104
satchlj Nov 5, 2026
7b88ebb
Merge branch 'satchlj/port-346-20261104' into satchlj/port-347-20261104
satchlj Nov 5, 2026
2d5d159
Merge integration/aurora into satchlj/port-302-20261104
satchlj Nov 5, 2026
dfff108
Merge satchlj/port-302-20261104 into satchlj/port-303-20261104
satchlj Nov 5, 2026
5941c36
Merge satchlj/port-303-20261104 into satchlj/port-304-20261104
satchlj Nov 5, 2026
166cbbb
Merge integration/aurora into satchlj/port-302-20261104
DjDeveloperr Nov 7, 2026
6ca4d4f
drm/asahi: initialize the M3 backend slot in the M5 and G18 probes
DjDeveloperr Nov 7, 2026
a53a714
Merge satchlj/port-303-20261104 into satchlj/port-304-20261104
DjDeveloperr Nov 7, 2026
b8aec2f
Merge satchlj/port-302-20261104 into satchlj/port-303-20261104
DjDeveloperr Nov 7, 2026
25afe62
Merge satchlj/port-304-20261104 into satchlj/port-305-20261104
DjDeveloperr Nov 7, 2026
bb25219
Merge satchlj/port-305-20261104 into satchlj/port-306-20261104
DjDeveloperr Nov 7, 2026
cc7dc16
Merge satchlj/port-306-20261104 into satchlj/port-307-20261104
DjDeveloperr Nov 7, 2026
b3a9f65
Merge satchlj/port-307-20261104 into satchlj/port-346-20261104
DjDeveloperr Nov 7, 2026
25f9051
Merge satchlj/port-346-20261104 into satchlj/port-347-20261104
DjDeveloperr Nov 7, 2026
9840daa
Merge pull request #977 from aurora-silicon/satchlj/port-347-20261104
RyanTheTide Nov 10, 2026
27d860d
Merge pull request #976 from aurora-silicon/satchlj/port-346-20261104
RyanTheTide Nov 10, 2026
fe20293
Merge pull request #969 from aurora-silicon/satchlj/port-307-20261104
RyanTheTide Nov 10, 2026
f8002c6
Merge pull request #968 from aurora-silicon/satchlj/port-306-20261104
RyanTheTide Nov 10, 2026
e9fe095
Merge pull request #967 from aurora-silicon/satchlj/port-305-20261104
RyanTheTide Nov 10, 2026
dcab88c
Merge pull request #966 from aurora-silicon/satchlj/port-304-20261104
RyanTheTide Nov 10, 2026
66d4fde
Merge pull request #965 from aurora-silicon/satchlj/port-303-20261104
RyanTheTide Nov 10, 2026
968321a
Merge branch 'integration/aurora' into satchlj/port-302-20261104
RyanTheTide Nov 10, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -2794,9 +2794,11 @@ F: tools/asahi/apple-pwm-pm-tests.py
F: drivers/reset/reset-apple-cio.c
F: drivers/rtc/rtc-macsmc.c
F: drivers/soc/apple/*
F: tools/asahi/m3-uapi-*
F: drivers/soc/apple/clpc.kunitconfig
F: tools/asahi/pmp-bootargs-tests.rs
F: drivers/spi/spi-apple-test.c
F: tools/asahi/test-m3-uapi.py
F: drivers/spi/spi-apple.c
F: drivers/spmi/spmi-apple-controller.c
F: drivers/thermal/apple-pmp*
Expand Down
1 change: 1 addition & 0 deletions arch/arm64/configs/asahi.config
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ CONFIG_DRM=y
CONFIG_DRM_ASAHI=m
CONFIG_DRM_ASAHI_G15=y
CONFIG_DRM_ASAHI_G16=y
CONFIG_DRM_ASAHI_M3_T8122=y
CONFIG_DRM_ADP=m
CONFIG_DRM_APPLE=m
CONFIG_DRM_APPLE_DCP_T8132=y
Expand Down
16 changes: 16 additions & 0 deletions drivers/gpu/drm/asahi/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,22 @@ config DRM_ASAHI_DEBUG_ALLOCATOR
Say N unless you are debugging firmware structures or porting to a
new firmware version.

config DRM_ASAHI_M3_T8122
bool "M3 MacBook Air GPU runtime (T8122, 14.8.3 firmware)"
depends on DRM_ASAHI
# The runtime adopts the firmware's UAT through the G15 backend's handoff helpers.
depends on DRM_ASAHI_G15
select CRYPTO_LIB_SHA256
default n
help
Build the M3 runtime that starts the GPU of the M3 MacBook Air
(J613, J615) on the 14.8.3 GPU firmware the boot loader leaves
loaded. On the listed Air boards it starts after the boot loader
handed the GPU over and resource/firmware identity checks pass.
asahi.t8122_start=0 keeps startup disabled for recovery. Unknown
boards and firmware do not gain automatic admission. Other GPUs
are not affected.

config DRM_ASAHI_G15
bool "Apple M3 Pro/Max (G15) support"
depends on DRM_ASAHI
Expand Down
7 changes: 7 additions & 0 deletions drivers/gpu/drm/asahi/debug.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,13 @@ pub(crate) enum DebugFlags {
DeviceControlCh = 21,
FwCtlCh = 22,

// Host submission/completion timestamps without verbose firmware tracing.
SubmitTiming = 23,
// Low-volume M3 command/geometry totals without per-IRQ printk.
M3SubmitSummary = 24,
// Per-slot retired timestamps, without enabling firmware ktrace.
M3PassTiming = 25,

// 32-35: Allocator debugging
FillAllocations = 32,
DebugAllocations = 33,
Expand Down
62 changes: 62 additions & 0 deletions drivers/gpu/drm/asahi/driver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ pub(crate) struct AsahiPlatformDriverData<'bound> {
g17: Option<Arc<g17::Gpu>>,
#[cfg(CONFIG_DRM_ASAHI_G16)]
pub(crate) g16: Option<Arc<crate::g16::Gpu>>,
m3: Option<M3Backend>,
/// Raw `struct device *` of the platform device. Stored once at probe
/// time so the `Drop` impl can find the sysfs file on unregister.
raw_dev: *mut bindings::device,
Expand All @@ -65,6 +66,11 @@ unsafe impl Send for AsahiPlatformDriverData<'_> {}
// SAFETY: As above.
unsafe impl Sync for AsahiPlatformDriverData<'_> {}

#[cfg(CONFIG_DRM_ASAHI_M3_T8122)]
type M3Backend = Arc<crate::m3::m3_drm::Backend>;
#[cfg(not(CONFIG_DRM_ASAHI_M3_T8122))]
type M3Backend = core::convert::Infallible;

/// Holds a reference to the top-level GPU object.
#[pin_data]
pub(crate) struct AsahiDrmRegistrationData<'drm> {
Expand Down Expand Up @@ -245,6 +251,10 @@ impl platform::Driver for AsahiPlatformDriver {
// Driver data is dropped after devres, so CPU control must happen in unbind.
gpu.shutdown();
}
#[cfg(CONFIG_DRM_ASAHI_M3_T8122)]
if let Some(m3) = this.m3.as_ref() {
m3.stop();
}
this.close_binding();
}

Expand All @@ -264,6 +274,8 @@ impl platform::Driver for AsahiPlatformDriver {
let cfg = match info.ok_or(ENODEV)? {
ProbeConfig::Legacy(cfg) => *cfg,
ProbeConfig::G17(cfg) => return AsahiPlatformDriver::probe_g17(pdev, cfg),
#[cfg(CONFIG_DRM_ASAHI_M3_T8122)]
ProbeConfig::M3(crate::m3::Chip::T8122) => return AsahiPlatformDriver::probe_t8122(pdev),
ProbeConfig::M3(chip) => return Err(crate::m3::refuse_probe(pdev, *chip)),
#[cfg(CONFIG_DRM_ASAHI_M5)]
ProbeConfig::M5 => return AsahiPlatformDriver::probe_m5(pdev),
Expand Down Expand Up @@ -351,6 +363,7 @@ impl platform::Driver for AsahiPlatformDriver {
_device: reg.device().into(),
_reg: reg,
g17: None,
m3: None,
#[cfg(CONFIG_DRM_ASAHI_G16)]
g16: None,
raw_dev,
Expand Down Expand Up @@ -388,6 +401,7 @@ impl AsahiPlatformDriver {
_device: reg.device().into(),
_reg: reg,
g17: None,
m3: None,
#[cfg(CONFIG_DRM_ASAHI_G16)]
g16: None,
raw_dev: core::ptr::null_mut(),
Expand All @@ -396,6 +410,46 @@ impl AsahiPlatformDriver {
})
}

/// The M3 MacBook Air (T8122): the M3 runtime, started only when its identity gate, the
/// backend selection and the start experiment (`asahi.t8122_start=1`) admit it; otherwise
/// the probe is refused as without the runtime.
#[cfg(CONFIG_DRM_ASAHI_M3_T8122)]
fn probe_t8122<'bound>(
pdev: &'bound platform::Device<Core<'_>>,
) -> Result<AsahiPlatformDriverData<'bound>> {
let soc = crate::m3::t8122_admitted(pdev)?;
// SAFETY: The admitted M3 GPU's UAT outputs 42-bit physical addresses.
unsafe { pdev.dma_set_mask_and_coherent(DmaMask::try_new(42)?)? };
let resources = regs::Resources::new(pdev)?;
let drm = drm::UnregisteredDevice::<AsahiDrmDriver>::new(pdev, Ok(()))?;
let binding = unsafe { crate::binding::Owner::new(pdev.as_ref(), &drm)? };
let backend = crate::m3::m3_drm::Backend::start(pdev, &drm, soc)?;
let gpu = backend.clone() as Arc<dyn gpu::Gpu>;
let data = try_pin_init!(AsahiDrmRegistrationData { gpu, resources });
// SAFETY: The registration is stored and unregistered by platform data destruction,
// which drops the runtime with it.
let reg = match unsafe { drm::Registration::new(pdev.as_ref(), drm, data, 0) } {
Ok(reg) => reg,
Err(error) => {
backend.stop();
return Err(error);
}
};
dev_info!(pdev.as_ref(), "M3: firmware ready; common DRM GEM/VM frontend registered\n");
Ok(AsahiPlatformDriverData {
binding,
#[cfg(CONFIG_DRM_ASAHI_G16)]
g16: None,
_device: reg.device().into(),
_reg: reg,
g17: None,
m3: Some(backend),
raw_dev: core::ptr::null_mut(),
raw_stats: core::ptr::null_mut(),
stats: None,
})
}

fn probe_g17<'bound>(
pdev: &'bound platform::Device<Core<'_>>,
cfg: &'static g17::Config,
Expand Down Expand Up @@ -451,6 +505,7 @@ impl AsahiPlatformDriver {
_device: reg.device().into(),
_reg: reg,
g17: Some(gpu),
m3: None,
#[cfg(CONFIG_DRM_ASAHI_G16)]
g16: None,
raw_dev,
Expand Down Expand Up @@ -486,6 +541,7 @@ impl AsahiPlatformDriver {
_device: reg.device().into(),
_reg: reg,
g17: None,
m3: None,
#[cfg(CONFIG_DRM_ASAHI_G16)]
g16: None,
raw_dev: core::ptr::null_mut(),
Expand Down Expand Up @@ -524,6 +580,7 @@ impl AsahiPlatformDriver {
_device: reg.device().into(),
_reg: reg,
g17: None,
m3: None,
g16: Some(gpu),
raw_dev,
raw_stats,
Expand Down Expand Up @@ -579,6 +636,7 @@ impl AsahiPlatformDriver {
_device: reg.device().into(),
_reg: reg,
g17: None,
m3: None,
#[cfg(CONFIG_DRM_ASAHI_G16)]
g16: None,
raw_dev: core::ptr::null_mut(),
Expand Down Expand Up @@ -608,5 +666,9 @@ impl Drop for AsahiPlatformDriverData<'_> {
// Also covers failure to allocate platform driver data after the probe body returned.
gpu.shutdown();
}
#[cfg(CONFIG_DRM_ASAHI_M3_T8122)]
if let Some(m3) = self.m3.as_ref() {
m3.stop();
}
}
}
26 changes: 23 additions & 3 deletions drivers/gpu/drm/asahi/file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,9 @@ pub(crate) struct File {
mem: Arc<memacct::Client>,
/// Completed engine time, retained by queues after handle destruction.
usage: Arc<crate::usage::Client>,
/// Largest size this file has asked GET_PARAMS for the global parameters with
/// ([`gpu::Gpu::admit_vm`]).
params_size: core::sync::atomic::AtomicU64,
/// The queues were drained once for an exiting task.
drained: AtomicBool,
}
Expand Down Expand Up @@ -376,6 +379,7 @@ impl File {
(*slot).user_range = user_range;
addr_of_mut!((*slot).mem).write(mem);
addr_of_mut!((*slot).usage).write(usage);
addr_of_mut!((*slot).params_size).write(core::sync::atomic::AtomicU64::new(0));
addr_of_mut!((*slot).drained).write(AtomicBool::new(false));
Ok(())
})
Expand Down Expand Up @@ -480,6 +484,9 @@ impl File {
core::slice::from_raw_parts(core::ptr::from_ref(&params).cast::<u8>(), size)
})?;

file.inner()
.params_size
.fetch_max(data.size, core::sync::atomic::Ordering::Relaxed);
Ok(0)
}

Expand Down Expand Up @@ -551,6 +558,13 @@ impl File {
// Every other runtime here reports DRM_ASAHI_GPU_HAL_LEGACY.
return Err(EINVAL);
}
reg_data.gpu.admit_vm(
device.as_ref().as_ref(),
file.inner()
.params_size
.load(core::sync::atomic::Ordering::Relaxed),
data.flags,
)?;

let kernel_range = data.kernel_start..data.kernel_end;
let user_range = file.inner().user_range.clone();
Expand Down Expand Up @@ -647,7 +661,7 @@ impl File {
}
let dummy_mapping = dummy_obj.map_at(
&vm,
gpu.uat_geometry().unk_page(),
gpu.unknown_page(),
mmu::PROT_GPU_SHARED_RW,
true,
)?;
Expand Down Expand Up @@ -1378,9 +1392,15 @@ impl File {
cls_pr_debug!(Errors, "queue_create: Invalid priority\n");
return Err(EINVAL);
}
// HIGH has only been run on G17; G13 and G14 keep refusing it.
// Keep support tied to a backend and admitted profile. G13/G14 and
// unqualified M3 profiles retain their previous rejection.
let high_supported = reg_data.gpu.as_any().is::<crate::g17::Gpu>();
#[cfg(CONFIG_DRM_ASAHI_M3_T8122)]
let high_supported = high_supported || reg_data.gpu.as_any()
.downcast_ref::<crate::m3::m3_drm::Backend>()
.is_some_and(|gpu| gpu.supports_high_priority());
if data.priority == uapi::drm_asahi_priority_DRM_ASAHI_PRIORITY_HIGH
&& !reg_data.gpu.as_any().is::<crate::g17::Gpu>()
&& !high_supported
{
cls_pr_debug!(
Errors,
Expand Down
10 changes: 5 additions & 5 deletions drivers/gpu/drm/asahi/float.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,16 @@ struct F32U {
}

impl F32 {
/// Return the IEEE-754 binary32 representation.
pub(crate) const fn to_bits(self) -> u32 {
self.0
}

/// Convert a raw 32-bit representation into an F32
pub(crate) const fn from_bits(u: u32) -> F32 {
F32(u)
}

/// Convert to the raw IEEE 754 bits.
pub(crate) const fn to_bits(self) -> u32 {
self.0
}

// Convert a `f32` value into an F32
//
// This must ONLY be used in const context. Use the `f32!{}` macro to do it safely.
Expand Down
4 changes: 2 additions & 2 deletions drivers/gpu/drm/asahi/g15/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,10 @@ mod pools;
mod power;
mod queue;
mod recovery;
mod regs;
pub(crate) mod regs;
mod slots;
mod timestamp;
mod uat;
pub(crate) mod uat;
mod vm;
mod wire;

Expand Down
15 changes: 15 additions & 0 deletions drivers/gpu/drm/asahi/g15/regs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,21 @@ impl Mapping {
pub(crate) fn phys(&self) -> u64 {
self.phys
}

/// Cleans the whole mapping to the point of coherency when it is the kernel's cacheable
/// mapping of reserved System RAM ([`Self::region`]); device and write-combined mappings
/// need nothing.
pub(crate) fn clean_poc(&self) {
if self.kind != Kind::WriteBack {
return;
}
let start = self.raw.addr();
// SAFETY: `start..start + maxsize` is this live mapping; cleaning a cacheable range has
// no other effect.
unsafe {
bindings::dcache_clean_poc(start as _, (start + self.raw.size()) as _);
}
}
}

impl Drop for Mapping {
Expand Down
33 changes: 29 additions & 4 deletions drivers/gpu/drm/asahi/g15/uat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -202,16 +202,41 @@ pub(crate) struct Window {
impl Window {
/// Maps the UAT handoff regions ([`Mapping::region`]).
pub(crate) fn new(adt: &super::adt::GpuAdt) -> Result<Self> {
Self::from_regions(adt.handoff.start, adt.ttbs.start, adt.tables.start, adt.shared_l2.start)
}

/// Maps the UAT handoff regions at the given physical addresses: the handoff page, the
/// TTBAT, the firmware kernel root and the shared L2 page. The M3 T8122 runtime takes them
/// from its admitted reserved-memory regions.
pub(crate) fn from_regions(handoff: u64, ttbs: u64, root: u64, shared_l2: u64) -> Result<Self> {
Ok(Self {
handoff: Mapping::region(adt.handoff.start, hw::HANDOFF_SIZE as usize)?,
ttbs: Mapping::region(adt.ttbs.start, hw::TTBS_SIZE as usize)?,
root: Mapping::region(adt.tables.start, hw::PAGE as usize)?,
shared_l2: Mapping::region(adt.shared_l2.start, hw::SHARED_L2_SIZE as usize)?,
handoff: Mapping::region(handoff, hw::HANDOFF_SIZE as usize)?,
ttbs: Mapping::region(ttbs, hw::TTBS_SIZE as usize)?,
root: Mapping::region(root, hw::PAGE as usize)?,
shared_l2: Mapping::region(shared_l2, hw::SHARED_L2_SIZE as usize)?,
image: KVec::from_elem(0u64, ENTRIES, GFP_KERNEL)?,
snapshot: KVec::from_elem(0u64, ENTRIES, GFP_KERNEL)?,
})
}

/// [`Self::sync_range`] over the whole host window, then [`Self::clean_tables`].
pub(crate) fn sync_all(&mut self, uat: &mmu::Uat) -> Result {
self.sync_inner(uat, None)?;
self.clean_tables();
Ok(())
}

/// Cleans the firmware-walked pages this window writes (the kernel root, the shared L2,
/// the TTBAT and the handoff page) to the point of coherency. Only a region that is
/// reserved System RAM, mapped cacheable, has anything to clean: the UAT walker does not
/// snoop the CPU caches. The M3 T8122 runtime calls it after [`Self::bootstrap`].
pub(crate) fn clean_tables(&self) {
for map in [&self.root, &self.shared_l2, &self.ttbs, &self.handoff] {
map.clean_poc();
}
mb();
}

/// Cold-start check: all 128 TTBAT words are zero.
pub(crate) fn ttbat_is_clear(&self) -> Result<bool> {
let t = self.ttbs.io();
Expand Down
8 changes: 8 additions & 0 deletions drivers/gpu/drm/asahi/gpu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,14 @@ pub(crate) trait Gpu: Send + Sync {
fn base_clock_hz(&self) -> u32;
/// Return the GPU address space geometry.
fn uat_geometry(&self) -> mmu::UatGeometry;
/// Admit a client's parameter ABI before creating its VM.
fn admit_vm(&self, _dev: &kernel::device::Device, _params_size: u64, _flags: u32) -> Result {
Ok(())
}
/// GPU VA of each VM's dummy page, which must match the address the firmware was given.
fn unknown_page(&self) -> u64 {
self.uat_geometry().unk_page()
}
/// Create a new `Vm` with the given range reserved for kernel-managed objects.
fn new_vm(&self, kernel_range: Range<u64>) -> Result<mmu::Vm>;
/// Create a VM charged to a DRM file when the backend bounds retained bindings.
Expand Down
Loading
Loading