From 7d20cd47628688f46b49c15874f93aaa48e1fb9c Mon Sep 17 00:00:00 2001 From: Ryan Murray Date: Fri, 23 Oct 2026 12:48:29 +1100 Subject: [PATCH 1/2] media: apple: isp: Keep T8140 off the T6040 setfile and main memory paths Two changes in the T6040 series also act on the T8140 (MacBook Neo), which runs the same H17 firmware interface: - Commit ed7b2a4d3a7f ("media: apple: isp: Zero the lens shading strides of H17 setfiles") rewrites the lens shading records of every setfile loaded on H17 firmware. It was only seen to matter on T6040, and the T8140 camera streams with its setfiles unchanged. - Commit 316136216030 ("media: apple: isp: Add T6040 support") reads a "data" memory-region for every SoC, maps zeroed pages above it, and fails the probe when it does not fit the heap. The T8140 regions come from the bootloader, and nothing has checked how that would behave there. Limit both to ISP_GEN_T6040, so the T8140 boot and capture paths stay as they were until they are tested on that machine. Assisted-by: LLM Signed-off-by: Ryan Murray --- drivers/media/platform/apple/isp/isp-cam.c | 3 ++- drivers/media/platform/apple/isp/isp-drv.c | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/media/platform/apple/isp/isp-cam.c b/drivers/media/platform/apple/isp/isp-cam.c index a5881c35ffe15..a266c60609614 100644 --- a/drivers/media/platform/apple/isp/isp-cam.c +++ b/drivers/media/platform/apple/isp/isp-cam.c @@ -425,7 +425,8 @@ static int isp_ch_load_setfile(struct apple_isp *isp, u32 ch) memcpy(isp->data_surf->virt, fw->data, len); memset(isp->data_surf->virt + len, 0, setfile->size - len); release_firmware(fw); - if (isp->hw->fw_abi == ISP_FW_ABI_H17) + /* Seen on T6040 only; T8140 runs its setfiles as they are. */ + if (isp->hw->gen == ISP_GEN_T6040) isp_setfile_fixup_h17(isp->data_surf->virt, len); return isp_cmd_ch_set_file_load(isp, ch, isp->data_surf->iova, diff --git a/drivers/media/platform/apple/isp/isp-drv.c b/drivers/media/platform/apple/isp/isp-drv.c index 12d17070c7d4a..da9d459dd8bdb 100644 --- a/drivers/media/platform/apple/isp/isp-drv.c +++ b/drivers/media/platform/apple/isp/isp-drv.c @@ -203,7 +203,9 @@ static int apple_isp_init_iommu(struct apple_isp *isp) * firmware's main memory only up to the end of it. The rest, up to * the heap top, is the host's to back. */ - err = isp_of_region_iova(dev, "data", &data_base, &data_size); + err = -ENOENT; + if (isp->hw->gen == ISP_GEN_T6040) + err = isp_of_region_iova(dev, "data", &data_base, &data_size); if (!err) { isp->fw.data_top = data_base + data_size; if (isp->fw.data_top <= isp->fw.heap_base || From 0ffd22188c3dbb2e8bb2df216ee8e03d71e14bfb Mon Sep 17 00:00:00 2001 From: Ryan Murray Date: Fri, 23 Oct 2026 12:48:29 +1100 Subject: [PATCH 2/2] drm/asahi: Keep refusing HIGH queue priority on G13 and G14 Commit 2321a1bc6ea6 ("drm/asahi: allow HIGH queue priority with CAP_SYS_NICE or DRM master") makes queue_create accept HIGH on every GPU, and its message says the G13 and G14 priority-1 pipes it then reaches are untested. Those are the M1 and M2 Macs, which run Asahi's firmware tables, and a Mesa that starts asking for HIGH would move compositor work onto them. Accept HIGH only on G17, where it was run, and keep EINVAL elsewhere, as before. Assisted-by: LLM Signed-off-by: Ryan Murray --- drivers/gpu/drm/asahi/file.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/gpu/drm/asahi/file.rs b/drivers/gpu/drm/asahi/file.rs index d8e628cc11709..82b3c71481759 100644 --- a/drivers/gpu/drm/asahi/file.rs +++ b/drivers/gpu/drm/asahi/file.rs @@ -1231,6 +1231,13 @@ 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. + if data.priority == uapi::drm_asahi_priority_DRM_ASAHI_PRIORITY_HIGH + && !reg_data.gpu.as_any().is::() + { + cls_pr_debug!(Errors, "queue_create: HIGH priority is not supported on this GPU\n"); + return Err(EINVAL); + } // SAFETY: capable() only reads the calling task's credentials (ioctl process context). if data.priority == uapi::drm_asahi_priority_DRM_ASAHI_PRIORITY_HIGH && !unsafe { bindings::capable(bindings::CAP_SYS_NICE as _) }