Skip to content

Ubuntu-asahi-arm-6.12.0-1004.4 => Asahi patchset asahi-6.12.10-2 #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1,233 commits into from
Closed

Conversation

john-cabaj
Copy link
Member

Updating to base off of asahi-6.12.10-2, with Ubuntu Generic kernel version noted below:

Ubuntu-6.12.0-10.10 = asahi-6.12.10-2

asahilina and others added 30 commits January 20, 2025 09:18
The GPU scheduler manages scheduling GPU jobs and dependencies between
them. This Rust abstraction allows Rust DRM drivers to use this
functionality.

Signed-off-by: Asahi Lina <[email protected]>
(cherry picked from commit d1bae00 https://github.com/AsahiLinux/linux)
Signed-off-by: John Cabaj <[email protected]>
Drivers may want to support driver-private objects, which cannot be
shared. This allows them to share a single lock and enables other
optimizations.

Add an `exportable` field to drm_gem_object, which blocks PRIME export
if set to false. It is initialized to true in
drm_gem_private_object_init.

Signed-off-by: Asahi Lina <[email protected]>
(cherry picked from commit 0d2ab4b https://github.com/AsahiLinux/linux)
Signed-off-by: John Cabaj <[email protected]>
This allows drivers to control whether a given GEM object is allowed to
be exported via PRIME to other drivers.

(cherry picked from commit 79ec89e https://github.com/AsahiLinux/linux)
Signed-off-by: John Cabaj <[email protected]>
Since commit 21aa27d ("drm/shmem-helper: Switch to reservation
lock"), the drm_gem_shmem_vmap and drm_gem_shmem_vunmap functions
require that the caller holds the DMA reservation lock for the object.
Add lockdep assertions to help validate this.

Signed-off-by: Asahi Lina <[email protected]>
(cherry picked from commit 6b2e8d3 https://github.com/AsahiLinux/linux)
Signed-off-by: John Cabaj <[email protected]>
drm_sched_fini() currently leaves any pending jobs dangling, which
causes segfaults and other badness when job completion fences are
signaled after the scheduler is torn down.

Explicitly detach all jobs from their completion callbacks and free
them. This makes it possible to write a sensible safe abstraction for
drm_sched, without having to externally duplicate the tracking of
in-flight jobs.

This shouldn't regress any existing drivers, since calling
drm_sched_fini() with any pending jobs is broken and this change should
be a no-op if there are no pending jobs.

Signed-off-by: Asahi Lina <[email protected]>
(cherry picked from commit 76775ff https://github.com/AsahiLinux/linux)
Signed-off-by: John Cabaj <[email protected]>
Fixes build error after Box -> KBox conversion.

Signed-off-by: Janne Grunau <[email protected]>
(cherry picked from commit 44de788 https://github.com/AsahiLinux/linux)
Signed-off-by: John Cabaj <[email protected]>
Analogous to drm_gpuvm_bo_unmap_ops_create, this is a callback-driven
unmap function for a given BO.

Signed-off-by: Asahi Lina <[email protected]>
(cherry picked from commit 5c59860 https://github.com/AsahiLinux/linux)
Signed-off-by: John Cabaj <[email protected]>
Required by the asahi driver.

Signed-off-by: Janne Grunau <[email protected]>
(cherry picked from commit 6f52b3f https://github.com/AsahiLinux/linux)
Signed-off-by: John Cabaj <[email protected]>
To be dropped when use in asahi driver is removed.

Signed-off-by: Janne Grunau <[email protected]>
(cherry picked from commit 09d225e https://github.com/AsahiLinux/linux)
Signed-off-by: John Cabaj <[email protected]>
Allow a GEM object to share another object's DMA reservation, for use
with drm_gpuvm. To keep memory safety, we hold a reference to the GEM
object owning the resv, and drop it when the child object is freed.

Signed-off-by: Asahi Lina <[email protected]>
(cherry picked from commit 5d9ff4b https://github.com/AsahiLinux/linux)
Signed-off-by: John Cabaj <[email protected]>
Signed-off-by: Asahi Lina <[email protected]>
(cherry picked from commit a181b46 https://github.com/AsahiLinux/linux)
Signed-off-by: John Cabaj <[email protected]>
This lets us play around with unknown stuff from userspace, without
having to commit to adding it to the UAPI (or knowing whether it's safe
to expose at all).

Signed-off-by: Asahi Lina <[email protected]>
(cherry picked from commit 6dd659c https://github.com/AsahiLinux/linux)
Signed-off-by: John Cabaj <[email protected]>
This isn't available on t602x, so it was probably a bad guess. Just use
the known die count for the userspace info, from our HW info tables.

Signed-off-by: Asahi Lina <[email protected]>
(cherry picked from commit 9d56b02 https://github.com/AsahiLinux/linux)
Signed-off-by: John Cabaj <[email protected]>
Only affects unk_534 getting shifted over for G13X.

Signed-off-by: Asahi Lina <[email protected]>
(cherry picked from commit 8fdb6ad https://github.com/AsahiLinux/linux)
Signed-off-by: John Cabaj <[email protected]>
asahilina and others added 27 commits January 20, 2025 09:18
Required since t8112-isp uses a 32-bit address in the
CISP_CMD_CH_SET_FILE_LOAD command with the macOS 12.4 firmware.

Signed-off-by: Janne Grunau <[email protected]>
(cherry picked from commit 3aaf037 https://github.com/AsahiLinux/linux)
Signed-off-by: John Cabaj <[email protected]>
This makes adding support easier.

Signed-off-by: Hector Martin <[email protected]>
(cherry picked from commit 009fb57 https://github.com/AsahiLinux/linux)
Signed-off-by: John Cabaj <[email protected]>
This is used on j45[67].

Signed-off-by: Hector Martin <[email protected]>
(cherry picked from commit 682c6b4 https://github.com/AsahiLinux/linux)
Signed-off-by: John Cabaj <[email protected]>
Fixes lockdep splats because we do surface stuff with this held, which
takes a mutex.

Signed-off-by: Hector Martin <[email protected]>
(cherry picked from commit 8b69a4b https://github.com/AsahiLinux/linux)
Signed-off-by: John Cabaj <[email protected]>
… fixes

Use __free() for scope based cleanup of device_node.

Reported-by: kernel test robot <[email protected]>
Reported-by: Julia Lawall <[email protected]>
Closes: https://lore.kernel.org/r/[email protected]/
Signed-off-by: Janne Grunau <[email protected]>
(cherry picked from commit 9ec4aa5 https://github.com/AsahiLinux/linux)
Signed-off-by: John Cabaj <[email protected]>
… fixes

Use for_each_child_of_node_scoped() for scope based cleanup of child
device_node. Removes surprising but documented of_node_put() on error in
isp_of_read_coord().

Reported-by: kernel test robot <[email protected]>
Reported-by: Julia Lawall <[email protected]>
Closes: https://lore.kernel.org/r/[email protected]/
Signed-off-by: Janne Grunau <[email protected]>
(cherry picked from commit 48bf5ae https://github.com/AsahiLinux/linux)
Signed-off-by: John Cabaj <[email protected]>
This is the base device for a multi-function co-processor present
on certain Apple SoCs. On M-series Macs it is in charge of internal
microphones, and various environmental sensors.

Signed-off-by: Sasha Finkelstein <[email protected]>
(cherry picked from commit df220a4 https://github.com/AsahiLinux/linux)
Signed-off-by: John Cabaj <[email protected]>
Apple SoCs have their microphones connected to the AOP
co-processor, in order to among other things implement
the "voicetrigger" functionality. Add a driver for the
"High power audio input" AOP endpoint.

Signed-off-by: Sasha Finkelstein <[email protected]>
(cherry picked from commit db932ae https://github.com/AsahiLinux/linux)
Signed-off-by: John Cabaj <[email protected]>
The AOP co-processor present on certain Apple SoCs exposes
various environmental sensors as "HID" (really not) devices.
Add drivers for the ambient light and lid angle sensors
exposed that way.

Signed-off-by: Sasha Finkelstein <[email protected]>
(cherry picked from commit 704682f https://github.com/AsahiLinux/linux)
Signed-off-by: John Cabaj <[email protected]>
This is a co-processor in charge of various security-related
features on Apple SoCs. This driver only boots the firmware,
which is needed to unlock the mic secure disable on certain
laptop models.

Signed-off-by: Sasha Finkelstein <[email protected]>
(cherry picked from commit 2949dc4 https://github.com/AsahiLinux/linux)
Signed-off-by: John Cabaj <[email protected]>
At least with certain some rust / bindgen combinations compilation fails
with:

error[E0587]: type has conflicting packed and align representation hints
      --> /Transit/build/linux/rust/bindings/bindings_generated.rs:102244:1
       |
102244 | pub struct snd_dec_flac {
       | ^^^^^^^^^^^^^^^^^^^^^^^

Signed-off-by: Janne Grunau <[email protected]>
(cherry picked from commit 1e80c45 https://github.com/AsahiLinux/linux)
Signed-off-by: John Cabaj <[email protected]>
Add missing dependency on SND_DMAENGINE_PCM

Signed-off-by: Janne Grunau <[email protected]>
(cherry picked from commit e44dd34 https://github.com/AsahiLinux/linux)
Signed-off-by: John Cabaj <[email protected]>
Ignore: yes
Signed-off-by: John Cabaj <[email protected]>
Non-main kernels don't have linux-build-dev listed in the control file
so the if-package macro evaluates to an empty string which results in a
bash error. Fix that by adding an additional explicit guard.

Reported-by: Vinicius Peixoto <[email protected]>
Signed-off-by: Juerg Haefliger <[email protected]>
Acked-by: Vinicius Peixoto <[email protected]>
Acked-by: John Cabaj <[email protected]>
Ignore: yes
Signed-off-by: John Cabaj <[email protected]>
@john-cabaj john-cabaj closed this Jan 21, 2025
john-cabaj pushed a commit that referenced this pull request Jan 21, 2025
Simpledrm is "DMA" access is not limited. All CPU addressible memory
can be used via direct DMA mappings.

Fixes following warning on Apple silicon systems. Physical memory on
those systems starts at (1 << 35) or (1 << 40) so 32-bit direct DMA
mappings are not possible.
------------[ cut here ]------------
simple-framebuffer 9e5064000.framebuffer: swiotlb addr 0x00000009de654000+16384 overflow (mask ffffffff, bus limit 0).
WARNING: CPU: 3 PID: 961 at kernel/dma/swiotlb.c:928 swiotlb_map+0x1f4/0x2a0
Modules linked in: ...
CPU: 3 PID: 961 Comm: kwin_wayland Not tainted 6.5.0-asahi+ #1
Hardware name: Apple Mac mini (M2, 2023) (DT)
...
Call trace:
 swiotlb_map+0x1f4/0x2a0
 dma_direct_map_sg+0x8c/0x2a8
 dma_map_sgtable+0x5c/0xd0
 drm_gem_map_dma_buf+0x64/0xb8
 dma_buf_map_attachment+0xac/0x158
 dma_buf_map_attachment_unlocked+0x48/0x80
 drm_gem_prime_import_dev+0xa0/0x1a0
 drm_gem_prime_fd_to_handle+0xc8/0x218
 drm_prime_fd_to_handle_ioctl+0x34/0x50
 drm_ioctl_kernel+0xe4/0x160
 drm_ioctl+0x23c/0x3e0
...
---[ end trace 0000000000000000 ]---

Avoids using swiotbl bounce buffers on other platforms when the mapped
memory is above 4GB.

Fixes: 11e8f5f ("drm: Add simpledrm driver")
Signed-off-by: Janne Grunau <[email protected]>
(cherry picked from commit bd65c1c https://github.com/AsahiLinux/linux)
Signed-off-by: John Cabaj <[email protected]>
john-cabaj pushed a commit that referenced this pull request Jan 21, 2025
This drivers adds support for the display crossbar used to route
display controller streams to the three different modes
(DP AltMode, USB4 Tunnel #0/#1) of the Type-C ports.

Signed-off-by: Sven Peter <[email protected]>
(cherry picked from commit 865f23f https://github.com/AsahiLinux/linux)
Signed-off-by: John Cabaj <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants