Skip to content

Commit 35903ba

Browse files
committed
Merge branch 'refs/heads/bits/210-gpu' into asahi-wip
2 parents 2b7e3a8 + b4bc918 commit 35903ba

143 files changed

Lines changed: 30203 additions & 1076 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22
*.[ch] diff=cpp
33
*.dts diff=dts
44
*.dts[io] diff=dts
5+
*.rs diff=rust

Documentation/process/changes.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ you probably needn't concern yourself with pcmciautils.
3131
====================== =============== ========================================
3232
GNU C 5.1 gcc --version
3333
Clang/LLVM (optional) 11.0.0 clang --version
34-
Rust (optional) 1.62.0 rustc --version
34+
Rust (optional) 1.68.2 rustc --version
3535
bindgen (optional) 0.56.0 bindgen --version
3636
GNU make 3.82 make --version
3737
bash 4.2 bash --version

Documentation/rust/arch-support.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ support corresponds to ``S`` values in the ``MAINTAINERS`` file.
1515
============ ================ ==============================================
1616
Architecture Level of support Constraints
1717
============ ================ ==============================================
18+
``arm64`` Maintained None.
1819
``um`` Maintained ``x86_64`` only.
1920
``x86`` Maintained ``x86_64`` only.
2021
============ ================ ==============================================

Documentation/rust/quick-start.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@ and run::
3838

3939
rustup override set $(scripts/min-tool-version.sh rustc)
4040

41-
Otherwise, fetch a standalone installer or install ``rustup`` from:
41+
Otherwise, fetch a standalone installer from:
4242

43-
https://www.rust-lang.org
43+
https://forge.rust-lang.org/infra/other-installation-methods.html#standalone
4444

4545

4646
Rust standard library source

arch/arm64/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,7 @@ config ARM64
217217
select HAVE_FUNCTION_ARG_ACCESS_API
218218
select MMU_GATHER_RCU_TABLE_FREE
219219
select HAVE_RSEQ
220+
select HAVE_RUST
220221
select HAVE_STACKPROTECTOR
221222
select HAVE_SYSCALL_TRACEPOINTS
222223
select HAVE_KPROBES

arch/arm64/Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ KBUILD_CFLAGS += -mgeneral-regs-only \
4141
KBUILD_CFLAGS += $(call cc-disable-warning, psabi)
4242
KBUILD_AFLAGS += $(compat_vdso)
4343

44+
KBUILD_RUSTFLAGS += -C target-feature="-neon,-fp-armv8"
45+
4446
KBUILD_CFLAGS += $(call cc-option,-mabi=lp64)
4547
KBUILD_AFLAGS += $(call cc-option,-mabi=lp64)
4648

@@ -65,9 +67,11 @@ endif
6567

6668
ifeq ($(CONFIG_ARM64_BTI_KERNEL),y)
6769
KBUILD_CFLAGS += -mbranch-protection=pac-ret+bti
70+
KBUILD_RUSTFLAGS += -Z branch-protection=bti,pac-ret,leaf
6871
else ifeq ($(CONFIG_ARM64_PTR_AUTH_KERNEL),y)
6972
ifeq ($(CONFIG_CC_HAS_BRANCH_PROT_PAC_RET),y)
7073
KBUILD_CFLAGS += -mbranch-protection=pac-ret
74+
KBUILD_RUSTFLAGS += -Z branch-protection=pac-ret,leaf
7175
else
7276
KBUILD_CFLAGS += -msign-return-address=non-leaf
7377
endif

drivers/gpu/drm/Kconfig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,8 @@ config DRM_VKMS
277277

278278
If M is selected the module will be called vkms.
279279

280+
source "drivers/gpu/drm/asahi/Kconfig"
281+
280282
source "drivers/gpu/drm/exynos/Kconfig"
281283

282284
source "drivers/gpu/drm/rockchip/Kconfig"

drivers/gpu/drm/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,3 +195,4 @@ obj-y += gud/
195195
obj-$(CONFIG_DRM_HYPERV) += hyperv/
196196
obj-y += solomon/
197197
obj-$(CONFIG_DRM_SPRD) += sprd/
198+
obj-$(CONFIG_DRM_ASAHI) += asahi/

drivers/gpu/drm/asahi/Kconfig

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# SPDX-License-Identifier: GPL-2.0
2+
3+
config RUST_DRM_SCHED
4+
bool
5+
select DRM_SCHED
6+
7+
config RUST_DRM_GEM_SHMEM_HELPER
8+
bool
9+
select DRM_GEM_SHMEM_HELPER
10+
11+
config RUST_APPLE_RTKIT
12+
bool
13+
select APPLE_RTKIT
14+
select APPLE_MBOX
15+
16+
config DRM_ASAHI
17+
tristate "Asahi (DRM support for Apple AGX GPUs)"
18+
depends on RUST
19+
depends on DRM
20+
depends on (ARM64 && ARCH_APPLE) || (COMPILE_TEST && !GENERIC_ATOMIC64)
21+
depends on MMU
22+
select RUST_DRM_SCHED
23+
select IOMMU_SUPPORT
24+
select IOMMU_IO_PGTABLE_LPAE
25+
select RUST_DRM_GEM_SHMEM_HELPER
26+
select RUST_APPLE_RTKIT
27+
help
28+
DRM driver for Apple AGX GPUs (G13x, found in the M1 SoC family)
29+
30+
config DRM_ASAHI_DEBUG_ALLOCATOR
31+
bool "Use debug allocator"
32+
depends on DRM_ASAHI
33+
help
34+
Use an alternate, simpler allocator which significantly reduces
35+
performance, but can help find firmware- or GPU-side memory safety
36+
issues. However, it can also trigger firmware bugs more easily,
37+
so expect GPU crashes.
38+
39+
Say N unless you are debugging firmware structures or porting to a
40+
new firmware version.

drivers/gpu/drm/asahi/Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# SPDX-License-Identifier: GPL-2.0
2+
3+
obj-$(CONFIG_DRM_ASAHI) += asahi.o

0 commit comments

Comments
 (0)