Skip to content
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

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

Closed
wants to merge 1,233 commits into from

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 <lina@asahilina.net>
(cherry picked from commit d1bae00 https://github.com/AsahiLinux/linux)
Signed-off-by: John Cabaj <john.cabaj@canonical.com>
(cherry picked from commit 750079d https://github.com/AsahiLinux/linux)
Signed-off-by: John Cabaj <john.cabaj@canonical.com>
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 <lina@asahilina.net>
(cherry picked from commit 0d2ab4b https://github.com/AsahiLinux/linux)
Signed-off-by: John Cabaj <john.cabaj@canonical.com>
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 <john.cabaj@canonical.com>
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 <lina@asahilina.net>
(cherry picked from commit 6b2e8d3 https://github.com/AsahiLinux/linux)
Signed-off-by: John Cabaj <john.cabaj@canonical.com>
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 <lina@asahilina.net>
(cherry picked from commit 76775ff https://github.com/AsahiLinux/linux)
Signed-off-by: John Cabaj <john.cabaj@canonical.com>
Fixes build error after Box -> KBox conversion.

Signed-off-by: Janne Grunau <j@jannau.net>
(cherry picked from commit 44de788 https://github.com/AsahiLinux/linux)
Signed-off-by: John Cabaj <john.cabaj@canonical.com>
Analogous to drm_gpuvm_bo_unmap_ops_create, this is a callback-driven
unmap function for a given BO.

Signed-off-by: Asahi Lina <lina@asahilina.net>
(cherry picked from commit 5c59860 https://github.com/AsahiLinux/linux)
Signed-off-by: John Cabaj <john.cabaj@canonical.com>
Signed-off-by: Asahi Lina <lina@asahilina.net>
(cherry picked from commit 72d456a https://github.com/AsahiLinux/linux)
Signed-off-by: John Cabaj <john.cabaj@canonical.com>
(cherry picked from commit 74de534 https://github.com/AsahiLinux/linux)
Signed-off-by: John Cabaj <john.cabaj@canonical.com>
Required by the asahi driver.

Signed-off-by: Janne Grunau <j@jannau.net>
(cherry picked from commit 6f52b3f https://github.com/AsahiLinux/linux)
Signed-off-by: John Cabaj <john.cabaj@canonical.com>
To be dropped when use in asahi driver is removed.

Signed-off-by: Janne Grunau <j@jannau.net>
(cherry picked from commit 09d225e https://github.com/AsahiLinux/linux)
Signed-off-by: John Cabaj <john.cabaj@canonical.com>
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 <lina@asahilina.net>
(cherry picked from commit 5d9ff4b https://github.com/AsahiLinux/linux)
Signed-off-by: John Cabaj <john.cabaj@canonical.com>
Signed-off-by: Asahi Lina <lina@asahilina.net>
(cherry picked from commit a181b46 https://github.com/AsahiLinux/linux)
Signed-off-by: John Cabaj <john.cabaj@canonical.com>
Signed-off-by: Asahi Lina <lina@asahilina.net>
(cherry picked from commit 7b2b8ea https://github.com/AsahiLinux/linux)
Signed-off-by: John Cabaj <john.cabaj@canonical.com>
(cherry picked from commit 03dadf3 https://github.com/AsahiLinux/linux)
Signed-off-by: John Cabaj <john.cabaj@canonical.com>
Signed-off-by: Asahi Lina <lina@asahilina.net>
(cherry picked from commit ca142e0 https://github.com/AsahiLinux/linux)
Signed-off-by: John Cabaj <john.cabaj@canonical.com>
Signed-off-by: Asahi Lina <lina@asahilina.net>
(cherry picked from commit 8514c7e https://github.com/AsahiLinux/linux)
Signed-off-by: John Cabaj <john.cabaj@canonical.com>
(cherry picked from commit 5f27855 https://github.com/AsahiLinux/linux)
Signed-off-by: John Cabaj <john.cabaj@canonical.com>
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 <lina@asahilina.net>
(cherry picked from commit 6dd659c https://github.com/AsahiLinux/linux)
Signed-off-by: John Cabaj <john.cabaj@canonical.com>
(cherry picked from commit a44560d https://github.com/AsahiLinux/linux)
Signed-off-by: John Cabaj <john.cabaj@canonical.com>
Signed-off-by: Asahi Lina <lina@asahilina.net>
(cherry picked from commit d487713 https://github.com/AsahiLinux/linux)
Signed-off-by: John Cabaj <john.cabaj@canonical.com>
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 <lina@asahilina.net>
(cherry picked from commit 9d56b02 https://github.com/AsahiLinux/linux)
Signed-off-by: John Cabaj <john.cabaj@canonical.com>
(cherry picked from commit a405cf9 https://github.com/AsahiLinux/linux)
Signed-off-by: John Cabaj <john.cabaj@canonical.com>
Signed-off-by: Asahi Lina <lina@asahilina.net>
(cherry picked from commit 0216283 https://github.com/AsahiLinux/linux)
Signed-off-by: John Cabaj <john.cabaj@canonical.com>
Signed-off-by: Asahi Lina <lina@asahilina.net>
(cherry picked from commit 38a0e74 https://github.com/AsahiLinux/linux)
Signed-off-by: John Cabaj <john.cabaj@canonical.com>
Signed-off-by: Asahi Lina <lina@asahilina.net>
(cherry picked from commit 0921082 https://github.com/AsahiLinux/linux)
Signed-off-by: John Cabaj <john.cabaj@canonical.com>
Only affects unk_534 getting shifted over for G13X.

Signed-off-by: Asahi Lina <lina@asahilina.net>
(cherry picked from commit 8fdb6ad https://github.com/AsahiLinux/linux)
Signed-off-by: John Cabaj <john.cabaj@canonical.com>
Signed-off-by: Asahi Lina <lina@asahilina.net>
(cherry picked from commit 8eb140f https://github.com/AsahiLinux/linux)
Signed-off-by: John Cabaj <john.cabaj@canonical.com>
Signed-off-by: Asahi Lina <lina@asahilina.net>
(cherry picked from commit d4e810b https://github.com/AsahiLinux/linux)
Signed-off-by: John Cabaj <john.cabaj@canonical.com>
asahilina and others added 27 commits January 20, 2025 09:18
Signed-off-by: Asahi Lina <lina@asahilina.net>
(cherry picked from commit ecc9d77 https://github.com/AsahiLinux/linux)
Signed-off-by: John Cabaj <john.cabaj@canonical.com>
Signed-off-by: Asahi Lina <lina@asahilina.net>
(cherry picked from commit d8d4c79 https://github.com/AsahiLinux/linux)
Signed-off-by: John Cabaj <john.cabaj@canonical.com>
Signed-off-by: Hector Martin <marcan@marcan.st>
(cherry picked from commit de69629 https://github.com/AsahiLinux/linux)
Signed-off-by: John Cabaj <john.cabaj@canonical.com>
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 <j@jannau.net>
(cherry picked from commit 3aaf037 https://github.com/AsahiLinux/linux)
Signed-off-by: John Cabaj <john.cabaj@canonical.com>
This makes adding support easier.

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

Signed-off-by: Hector Martin <marcan@marcan.st>
(cherry picked from commit 682c6b4 https://github.com/AsahiLinux/linux)
Signed-off-by: John Cabaj <john.cabaj@canonical.com>
Signed-off-by: Hector Martin <marcan@marcan.st>
(cherry picked from commit 6c1725b https://github.com/AsahiLinux/linux)
Signed-off-by: John Cabaj <john.cabaj@canonical.com>
Fixes lockdep splats because we do surface stuff with this held, which
takes a mutex.

Signed-off-by: Hector Martin <marcan@marcan.st>
(cherry picked from commit 8b69a4b https://github.com/AsahiLinux/linux)
Signed-off-by: John Cabaj <john.cabaj@canonical.com>
Signed-off-by: Eileen Yoon <eyn@gmx.com>
(cherry picked from commit 16011c1 https://github.com/AsahiLinux/linux)
Signed-off-by: John Cabaj <john.cabaj@canonical.com>
… fixes

Use __free() for scope based cleanup of device_node.

Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Julia Lawall <julia.lawall@inria.fr>
Closes: https://lore.kernel.org/r/202410021337.EQ74x7c7-lkp@intel.com/
Signed-off-by: Janne Grunau <j@jannau.net>
(cherry picked from commit 9ec4aa5 https://github.com/AsahiLinux/linux)
Signed-off-by: John Cabaj <john.cabaj@canonical.com>
… 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 <lkp@intel.com>
Reported-by: Julia Lawall <julia.lawall@inria.fr>
Closes: https://lore.kernel.org/r/202410021337.EQ74x7c7-lkp@intel.com/
Signed-off-by: Janne Grunau <j@jannau.net>
(cherry picked from commit 48bf5ae https://github.com/AsahiLinux/linux)
Signed-off-by: John Cabaj <john.cabaj@canonical.com>
Signed-off-by: Sasha Finkelstein <fnkl.kernel@gmail.com>
(cherry picked from commit 6fba218 https://github.com/AsahiLinux/linux)
Signed-off-by: John Cabaj <john.cabaj@canonical.com>
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 <fnkl.kernel@gmail.com>
(cherry picked from commit df220a4 https://github.com/AsahiLinux/linux)
Signed-off-by: John Cabaj <john.cabaj@canonical.com>
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 <fnkl.kernel@gmail.com>
(cherry picked from commit db932ae https://github.com/AsahiLinux/linux)
Signed-off-by: John Cabaj <john.cabaj@canonical.com>
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 <fnkl.kernel@gmail.com>
(cherry picked from commit 704682f https://github.com/AsahiLinux/linux)
Signed-off-by: John Cabaj <john.cabaj@canonical.com>
Signed-off-by: Sasha Finkelstein <fnkl.kernel@gmail.com>
(cherry picked from commit fda68e8 https://github.com/AsahiLinux/linux)
Signed-off-by: John Cabaj <john.cabaj@canonical.com>
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 <fnkl.kernel@gmail.com>
(cherry picked from commit 2949dc4 https://github.com/AsahiLinux/linux)
Signed-off-by: John Cabaj <john.cabaj@canonical.com>
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 <j@jannau.net>
(cherry picked from commit 1e80c45 https://github.com/AsahiLinux/linux)
Signed-off-by: John Cabaj <john.cabaj@canonical.com>
Add missing dependency on SND_DMAENGINE_PCM

Signed-off-by: Janne Grunau <j@jannau.net>
(cherry picked from commit e44dd34 https://github.com/AsahiLinux/linux)
Signed-off-by: John Cabaj <john.cabaj@canonical.com>
Signed-off-by: Asahi Lina <lina@asahilina.net>
(cherry picked from commit d853329 https://github.com/AsahiLinux/linux)
Signed-off-by: John Cabaj <john.cabaj@canonical.com>
Signed-off-by: John Cabaj <john.cabaj@canonical.com>
Ignore: yes
Signed-off-by: John Cabaj <john.cabaj@canonical.com>
Signed-off-by: John Cabaj <john.cabaj@canonical.com>
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 <vinicius.peixoto@canonical.com>
Signed-off-by: Juerg Haefliger <juerg.haefliger@canonical.com>
Acked-by: Vinicius Peixoto <vinicius.peixoto@canonical.com>
Acked-by: John Cabaj <john.cabaj@canonical.com>
Signed-off-by: John Cabaj <john.cabaj@canonical.com>
Ignore: yes
Signed-off-by: John Cabaj <john.cabaj@canonical.com>
Signed-off-by: John Cabaj <john.cabaj@canonical.com>
@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 <j@jannau.net>
(cherry picked from commit bd65c1c https://github.com/AsahiLinux/linux)
Signed-off-by: John Cabaj <john.cabaj@canonical.com>
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 <sven@svenpeter.dev>
(cherry picked from commit 865f23f https://github.com/AsahiLinux/linux)
Signed-off-by: John Cabaj <john.cabaj@canonical.com>
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