From 1f7f70e4c1779f417fa32a0795398854ab8cde25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Berkay=20K=C3=B6sebay?= Date: Sun, 15 Nov 2026 21:27:08 +0100 Subject: [PATCH 01/10] drm/imagination: apple: Size an S8003 dataset's free list by its initial pages On the iPad 5, vkCreateDevice() fails with VK_ERROR_INITIALIZATION_FAILED. CREATE_HWRT_DATASET returns -EINVAL without a log line when Mesa creates the dummy render target used during device creation. The A9 allocates the parameter manager's pages itself. Its free list is not grown by pvr_free_list_create(), so current_pages stays zero, but hwrt_init_kernel_structure() still checks it against the minimum. For chips with own_pm_pages, check initial_num_pages instead. This is the limit used to size the S8003 parameter manager's render blocks. Affects the Apple A9 (S8003). The A10 is unchanged. Assisted-by: LLM --- ...apple-Size-an-S8003-dataset-s-free-l.patch | 64 +++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 kernel/patches/drivers/gpu/0026-drm-imagination-apple-Size-an-S8003-dataset-s-free-l.patch diff --git a/kernel/patches/drivers/gpu/0026-drm-imagination-apple-Size-an-S8003-dataset-s-free-l.patch b/kernel/patches/drivers/gpu/0026-drm-imagination-apple-Size-an-S8003-dataset-s-free-l.patch new file mode 100644 index 00000000..3f9cc12a --- /dev/null +++ b/kernel/patches/drivers/gpu/0026-drm-imagination-apple-Size-an-S8003-dataset-s-free-l.patch @@ -0,0 +1,64 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Berkay=20K=C3=B6sebay?= +Date: Sun, 15 Nov 2026 12:45:47 +0100 +Subject: [PATCH] drm/imagination: apple: Size an S8003 dataset's free list by + its initial pages + +On the iPad 5, vkCreateDevice() fails with VK_ERROR_INITIALIZATION_FAILED. +CREATE_HWRT_DATASET returns -EINVAL without a log line when Mesa creates +the dummy render target used during device creation. + +The A9 allocates the parameter manager's pages itself. Its free list is +not grown by pvr_free_list_create(), so current_pages stays zero, but +hwrt_init_kernel_structure() still checks it against the minimum. + +For chips with own_pm_pages, check initial_num_pages instead. This is +the limit used to size the S8003 parameter manager's render blocks. + +Affects the Apple A9 (S8003). The A10 is unchanged. + +Assisted-by: LLM +--- + drivers/gpu/drm/imagination/pvr_hwrt.c | 14 ++++++++++++-- + 1 file changed, 12 insertions(+), 2 deletions(-) + +diff --git a/drivers/gpu/drm/imagination/pvr_hwrt.c b/drivers/gpu/drm/imagination/pvr_hwrt.c +index ec50237..dd91ed9 100644 +--- a/drivers/gpu/drm/imagination/pvr_hwrt.c ++++ b/drivers/gpu/drm/imagination/pvr_hwrt.c +@@ -1,6 +1,7 @@ + // SPDX-License-Identifier: GPL-2.0-only OR MIT + /* Copyright (c) 2023 Imagination Technologies Ltd. */ + ++#include "pvr_apple.h" + #include "pvr_free_list.h" + #include "pvr_hwrt.h" + #include "pvr_gem.h" +@@ -45,6 +46,7 @@ hwrt_init_kernel_structure(struct pvr_file *pvr_file, + struct pvr_hwrt_dataset *hwrt) + { + struct pvr_device *pvr_dev = pvr_file->pvr_dev; ++ u32 local_pages; + int err; + + hwrt->pvr_dev = pvr_dev; +@@ -62,8 +64,16 @@ hwrt_init_kernel_structure(struct pvr_file *pvr_file, + } + } + +- if (hwrt->free_lists[ROGUE_FW_LOCAL_FREELIST]->current_pages < +- pvr_get_free_list_min_pages(pvr_dev)) { ++ /* ++ * On a chip that allocates the parameter manager's pages itself, a ++ * free list never holds pages (pvr_apple_free_list_has_pages()); its ++ * initial size is how many a render may take. ++ */ ++ local_pages = hwrt->free_lists[ROGUE_FW_LOCAL_FREELIST]->current_pages; ++ if (pvr_device_is_apple(pvr_dev) && !pvr_apple_free_list_has_pages(pvr_dev)) ++ local_pages = hwrt->free_lists[ROGUE_FW_LOCAL_FREELIST]->initial_num_pages; ++ ++ if (local_pages < pvr_get_free_list_min_pages(pvr_dev)) { + err = -EINVAL; + goto err_put_free_lists; + } + From 81b5e548f9a30fc69500a19325729fe6840a3990 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Berkay=20K=C3=B6sebay?= Date: Sun, 15 Nov 2026 21:27:08 +0100 Subject: [PATCH 02/10] drm/imagination: Don't free a job's command twice when its stream is rejected After a rejected command stream on the iPad 5, the next exec in another process oopses in free_bprm with a bad rss-counter. slub_debug reports "Object already free" on kmalloc-512: the object was allocated and freed in pvr_fw_cmd_init(), then freed again from pvr_job_put(). When stream parsing fails, pvr_job_process_stream() frees the command. The caller then releases the job, whose release path frees it again. Clear the command pointer and length after freeing the rejected command. Upstream has the same code. Affects every PowerVR device. Fixes: eaf01ee5ba28 ("drm/imagination: Implement job submission and scheduling") Assisted-by: LLM --- ...Don-t-free-a-job-s-command-twice-whe.patch | 42 +++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 kernel/patches/drivers/gpu/0027-drm-imagination-Don-t-free-a-job-s-command-twice-whe.patch diff --git a/kernel/patches/drivers/gpu/0027-drm-imagination-Don-t-free-a-job-s-command-twice-whe.patch b/kernel/patches/drivers/gpu/0027-drm-imagination-Don-t-free-a-job-s-command-twice-whe.patch new file mode 100644 index 00000000..a69f3590 --- /dev/null +++ b/kernel/patches/drivers/gpu/0027-drm-imagination-Don-t-free-a-job-s-command-twice-whe.patch @@ -0,0 +1,42 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Berkay=20K=C3=B6sebay?= +Date: Sun, 15 Nov 2026 18:28:34 +0100 +Subject: [PATCH] drm/imagination: Don't free a job's command twice when its + stream is rejected + +After a rejected command stream on the iPad 5, the next exec in another +process oopses in free_bprm with a bad rss-counter. slub_debug reports +"Object already free" on kmalloc-512: the object was allocated and freed +in pvr_fw_cmd_init(), then freed again from pvr_job_put(). + +When stream parsing fails, pvr_job_process_stream() frees the command. +The caller then releases the job, whose release path frees it again. +Clear the command pointer and length after freeing the rejected command. + +Upstream has the same code. Affects every PowerVR device. + +Fixes: eaf01ee5ba28 ("drm/imagination: Implement job submission and scheduling") + +Assisted-by: LLM +--- + drivers/gpu/drm/imagination/pvr_job.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/drivers/gpu/drm/imagination/pvr_job.c b/drivers/gpu/drm/imagination/pvr_job.c +index 95c5d2e..48a1cbc 100644 +--- a/drivers/gpu/drm/imagination/pvr_job.c ++++ b/drivers/gpu/drm/imagination/pvr_job.c +@@ -79,8 +79,11 @@ pvr_job_process_stream(struct pvr_device *pvr_dev, const struct pvr_stream_cmd_d + job->cmd_len = cmd_defs->dest_size; + + err = pvr_stream_process(pvr_dev, cmd_defs, stream, stream_size, job->cmd); +- if (err) ++ if (err) { + kfree(job->cmd); ++ job->cmd = NULL; ++ job->cmd_len = 0; ++ } + + return err; + } + From 3002362ee59b257841bc40095194b4b99543a762 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Berkay=20K=C3=B6sebay?= Date: Sun, 15 Nov 2026 21:27:08 +0100 Subject: [PATCH 03/10] drm/imagination: apple: Require each chip's own register extension Every geometry and fragment job on the iPad 5 is refused with -EINVAL, without a log line. The stream parser requires the A10's type-1 register extension on every Apple chip, while the A9 supplies its registers in extension type 2. Put each chip's required extension type and mask beside its stream definitions and obtain them through an Apple accessor. Keep the A10's values and leave compute without an Apple must-have entry. Affects the Apple A9 (S8003). The A10's validation values are unchanged. Assisted-by: LLM --- ...apple-Require-each-chip-s-own-regist.patch | 181 ++++++++++++++++++ 1 file changed, 181 insertions(+) create mode 100644 kernel/patches/drivers/gpu/0028-drm-imagination-apple-Require-each-chip-s-own-regist.patch diff --git a/kernel/patches/drivers/gpu/0028-drm-imagination-apple-Require-each-chip-s-own-regist.patch b/kernel/patches/drivers/gpu/0028-drm-imagination-apple-Require-each-chip-s-own-regist.patch new file mode 100644 index 00000000..360aad59 --- /dev/null +++ b/kernel/patches/drivers/gpu/0028-drm-imagination-apple-Require-each-chip-s-own-regist.patch @@ -0,0 +1,181 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Berkay=20K=C3=B6sebay?= +Date: Sun, 15 Nov 2026 18:28:34 +0100 +Subject: [PATCH] drm/imagination: apple: Require each chip's own register + extension + +Every geometry and fragment job on the iPad 5 is refused with -EINVAL, +without a log line. The stream parser requires the A10's type-1 register +extension on every Apple chip, while the A9 supplies its registers in +extension type 2. + +Put each chip's required extension type and mask beside its stream +definitions and obtain them through an Apple accessor. Keep the A10's +values and leave compute without an Apple must-have entry. + +Affects the Apple A9 (S8003). The A10's validation values are unchanged. + +Assisted-by: LLM +--- + drivers/gpu/drm/imagination/pvr_apple.c | 26 +++++++++++++++++++ + drivers/gpu/drm/imagination/pvr_apple.h | 9 +++++++ + drivers/gpu/drm/imagination/pvr_apple_chip.h | 8 ++++++ + drivers/gpu/drm/imagination/pvr_apple_s8003.c | 4 +++ + drivers/gpu/drm/imagination/pvr_apple_t8010.c | 4 +++ + drivers/gpu/drm/imagination/pvr_stream.c | 11 +++++--- + 6 files changed, 58 insertions(+), 4 deletions(-) + +diff --git a/drivers/gpu/drm/imagination/pvr_apple.c b/drivers/gpu/drm/imagination/pvr_apple.c +index e147626..b0505a2 100644 +--- a/drivers/gpu/drm/imagination/pvr_apple.c ++++ b/drivers/gpu/drm/imagination/pvr_apple.c +@@ -1636,3 +1636,29 @@ const struct pvr_stream_cmd_defs *pvr_apple_cmd_stream(struct pvr_device *pvr_de + return chip->compute_stream ?: &pvr_cmd_compute_stream; + return type == DRM_PVR_JOB_TYPE_GEOMETRY ? chip->geom_stream : chip->frag_stream; + } ++ ++/** ++ * pvr_apple_stream_musthave() - Required register extension for a chip's stream ++ * @pvr_dev: Target device. ++ * @type: Geometry or fragment stream type. ++ * @ext_type: Extension header type to which the returned mask applies. ++ * ++ * Return: the chip's required register bits, or zero for other stream types. ++ */ ++u32 pvr_apple_stream_musthave(struct pvr_device *pvr_dev, enum pvr_stream_type type, ++ u32 *ext_type) ++{ ++ const struct pvr_apple_chip *chip = pvr_dev->device_data->apple_chip; ++ ++ if (type == PVR_STREAM_TYPE_GEOM) { ++ *ext_type = chip->geom_ext_type; ++ return chip->geom_ext_mask; ++ } ++ if (type == PVR_STREAM_TYPE_FRAG) { ++ *ext_type = chip->frag_ext_type; ++ return chip->frag_ext_mask; ++ } ++ ++ *ext_type = 0; ++ return 0; ++} +diff --git a/drivers/gpu/drm/imagination/pvr_apple.h b/drivers/gpu/drm/imagination/pvr_apple.h +index cdc8e96..d1de0ad 100644 +--- a/drivers/gpu/drm/imagination/pvr_apple.h ++++ b/drivers/gpu/drm/imagination/pvr_apple.h +@@ -10,6 +10,7 @@ + #include + + #include "pvr_rogue_fwif_client.h" ++#include "pvr_stream.h" + + struct dma_fence; + struct pvr_apple_chip; +@@ -167,6 +168,8 @@ int pvr_apple_resume(struct pvr_device *pvr_dev); + void pvr_apple_device_info_init(struct pvr_device *pvr_dev); + bool pvr_apple_takes_jobs(struct pvr_device *pvr_dev); + bool pvr_apple_free_list_has_pages(struct pvr_device *pvr_dev); ++u32 pvr_apple_stream_musthave(struct pvr_device *pvr_dev, enum pvr_stream_type type, ++ u32 *ext_type); + struct dma_fence *pvr_apple_submit_job(struct pvr_job *job); + struct dma_fence *pvr_apple_submit_compute_job(struct pvr_device *pvr_dev, + struct pvr_vm_context *vm_ctx, u64 stream, +@@ -200,6 +203,12 @@ static inline int pvr_apple_resume(struct pvr_device *pvr_dev) { return 0; } + static inline void pvr_apple_device_info_init(struct pvr_device *pvr_dev) {} + static inline bool pvr_apple_takes_jobs(struct pvr_device *pvr_dev) { return false; } + static inline bool pvr_apple_free_list_has_pages(struct pvr_device *pvr_dev) { return true; } ++static inline u32 pvr_apple_stream_musthave(struct pvr_device *pvr_dev, ++ enum pvr_stream_type type, u32 *ext_type) ++{ ++ *ext_type = 0; ++ return 0; ++} + static inline int pvr_apple_vm_init(struct pvr_device *pvr_dev, struct pvr_vm_context *vm_ctx) + { + return -ENODEV; +diff --git a/drivers/gpu/drm/imagination/pvr_apple_chip.h b/drivers/gpu/drm/imagination/pvr_apple_chip.h +index 201d72a..d524415 100644 +--- a/drivers/gpu/drm/imagination/pvr_apple_chip.h ++++ b/drivers/gpu/drm/imagination/pvr_apple_chip.h +@@ -164,6 +164,10 @@ struct pvr_apple { + * @render_job_size: Bytes @prepare_geom and @prepare_frag fill. + * @geom_stream: How a geometry job's command stream from userspace is decoded. + * @frag_stream: The same for a fragment job. ++ * @geom_ext_type: Required geometry register extension header type. ++ * @geom_ext_mask: Required bits within that geometry extension header. ++ * @frag_ext_type: Required fragment register extension header type. ++ * @frag_ext_mask: Required bits within that fragment extension header. + * @init: At probe, with Fender mapped: map and allocate what the chip needs, + * load the firmware (pvr_apple_fw_load()), set &pvr_apple.heap, + * &pvr_apple.layout and &pvr_apple.chip_data. Device-managed. +@@ -238,6 +242,10 @@ struct pvr_apple_chip { + size_t render_job_size; + const struct pvr_stream_cmd_defs *geom_stream; + const struct pvr_stream_cmd_defs *frag_stream; ++ u32 geom_ext_type; ++ u32 geom_ext_mask; ++ u32 frag_ext_type; ++ u32 frag_ext_mask; + const struct pvr_stream_cmd_defs *compute_stream; + unsigned int scenes; + bool own_pm_pages; +diff --git a/drivers/gpu/drm/imagination/pvr_apple_s8003.c b/drivers/gpu/drm/imagination/pvr_apple_s8003.c +index 468dd71..8115176 100644 +--- a/drivers/gpu/drm/imagination/pvr_apple_s8003.c ++++ b/drivers/gpu/drm/imagination/pvr_apple_s8003.c +@@ -2550,6 +2550,10 @@ const struct pvr_apple_chip pvr_apple_chip_s8003 = { + .perf_state_max = S8003_PERF_STATE_MAX, + .geom_stream = &pvr_apple_g5p_cmd_geom_stream, + .frag_stream = &pvr_apple_g5p_cmd_frag_stream, ++ .geom_ext_type = PVR_STREAM_EXTHDR_TYPE_GEOM_G5P, ++ .geom_ext_mask = PVR_STREAM_EXTHDR_GEOM_G5P_REGS, ++ .frag_ext_type = PVR_STREAM_EXTHDR_TYPE_FRAG_G5P, ++ .frag_ext_mask = PVR_STREAM_EXTHDR_FRAG_G5P_REGS, + .compute_stream = &pvr_apple_g5p_cmd_compute_stream, + .scenes = 2, + .own_pm_pages = true, +diff --git a/drivers/gpu/drm/imagination/pvr_apple_t8010.c b/drivers/gpu/drm/imagination/pvr_apple_t8010.c +index f3ee833..5c62c13 100644 +--- a/drivers/gpu/drm/imagination/pvr_apple_t8010.c ++++ b/drivers/gpu/drm/imagination/pvr_apple_t8010.c +@@ -461,6 +461,10 @@ const struct pvr_apple_chip pvr_apple_chip_t8010 = { + .render_job_size = sizeof(union pvr_apple_t8010_render_job), + .geom_stream = &pvr_apple_cmd_geom_stream, + .frag_stream = &pvr_apple_cmd_frag_stream, ++ .geom_ext_type = PVR_STREAM_EXTHDR_TYPE_GEOM_APPLE, ++ .geom_ext_mask = PVR_STREAM_EXTHDR_GEOM_APPLE_REGS, ++ .frag_ext_type = PVR_STREAM_EXTHDR_TYPE_FRAG_APPLE, ++ .frag_ext_mask = PVR_STREAM_EXTHDR_FRAG_APPLE_REGS, + .init = pvr_apple_t8010_init, + .boot = pvr_apple_t8010_boot, + .start = pvr_apple_t8010_start, +diff --git a/drivers/gpu/drm/imagination/pvr_stream.c b/drivers/gpu/drm/imagination/pvr_stream.c +index 7db6eb1..d83b7db 100644 +--- a/drivers/gpu/drm/imagination/pvr_stream.c ++++ b/drivers/gpu/drm/imagination/pvr_stream.c +@@ -1,6 +1,7 @@ + // SPDX-License-Identifier: GPL-2.0-only OR MIT + /* Copyright (c) 2023 Imagination Technologies Ltd. */ + ++#include "pvr_apple.h" + #include "pvr_device.h" + #include "pvr_rogue_fwif_stream.h" + #include "pvr_stream.h" +@@ -272,10 +273,12 @@ pvr_stream_create_musthave_masks(struct pvr_device *pvr_dev) + PVR_STREAM_EXTHDR_FRAG0_BRN47217; + + if (pvr_device_is_apple(pvr_dev)) { +- pvr_dev->stream_musthave_quirks[PVR_STREAM_TYPE_GEOM][PVR_STREAM_EXTHDR_TYPE_GEOM_APPLE] |= +- PVR_STREAM_EXTHDR_GEOM_APPLE_REGS; +- pvr_dev->stream_musthave_quirks[PVR_STREAM_TYPE_FRAG][PVR_STREAM_EXTHDR_TYPE_FRAG_APPLE] |= +- PVR_STREAM_EXTHDR_FRAG_APPLE_REGS; ++ u32 ext_type, mask; ++ ++ mask = pvr_apple_stream_musthave(pvr_dev, PVR_STREAM_TYPE_GEOM, &ext_type); ++ pvr_dev->stream_musthave_quirks[PVR_STREAM_TYPE_GEOM][ext_type] |= mask; ++ mask = pvr_apple_stream_musthave(pvr_dev, PVR_STREAM_TYPE_FRAG, &ext_type); ++ pvr_dev->stream_musthave_quirks[PVR_STREAM_TYPE_FRAG][ext_type] |= mask; + } + + if (pvr_device_has_uapi_quirk(pvr_dev, 49927)) { + From 14ff1676cfaf10dfb0ec3d71ade2400dc47fb26b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Berkay=20K=C3=B6sebay?= Date: Sun, 15 Nov 2026 21:27:08 +0100 Subject: [PATCH 04/10] drm/imagination: apple: Drop a fragment job's reference on its geometry job Once rendering works on the iPad 5, every fragment job warns at WARN_ON(job->paired_job) in pvr_job.c, thousands of times a minute. Geometry jobs are never freed, and clients hang when destroying a render target: glmark2 and vkcube run until killed. Apple queues receive jobs linked by pvr_jobs_link_geom_frag(), but their free path does not drop the fragment job's paired geometry reference. That reference also keeps the geometry job's HWRT and context alive. Follow pvr_queue_free_job(): drop the paired geometry reference and clear paired_job before dropping the scheduler's reference. Affects the shared Apple queue used by the A9 (S8003) and A10 (T8010). The A10 has been build-tested only. Assisted-by: LLM --- ...apple-Drop-a-fragment-job-s-referenc.patch | 43 +++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 kernel/patches/drivers/gpu/0029-drm-imagination-apple-Drop-a-fragment-job-s-referenc.patch diff --git a/kernel/patches/drivers/gpu/0029-drm-imagination-apple-Drop-a-fragment-job-s-referenc.patch b/kernel/patches/drivers/gpu/0029-drm-imagination-apple-Drop-a-fragment-job-s-referenc.patch new file mode 100644 index 00000000..51b02b97 --- /dev/null +++ b/kernel/patches/drivers/gpu/0029-drm-imagination-apple-Drop-a-fragment-job-s-referenc.patch @@ -0,0 +1,43 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Berkay=20K=C3=B6sebay?= +Date: Sun, 15 Nov 2026 19:08:29 +0100 +Subject: [PATCH] drm/imagination: apple: Drop a fragment job's reference on + its geometry job + +Once rendering works on the iPad 5, every fragment job warns at +WARN_ON(job->paired_job) in pvr_job.c, thousands of times a minute. +Geometry jobs are never freed, and clients hang when destroying a +render target: glmark2 and vkcube run until killed. + +Apple queues receive jobs linked by pvr_jobs_link_geom_frag(), but their +free path does not drop the fragment job's paired geometry reference. +That reference also keeps the geometry job's HWRT and context alive. + +Follow pvr_queue_free_job(): drop the paired geometry reference and +clear paired_job before dropping the scheduler's reference. + +Affects the shared Apple queue used by the A9 (S8003) and A10 (T8010). +The A10 has been build-tested only. + +Assisted-by: LLM +--- + drivers/gpu/drm/imagination/pvr_apple_queue.c | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/drivers/gpu/drm/imagination/pvr_apple_queue.c b/drivers/gpu/drm/imagination/pvr_apple_queue.c +index 80bc17b..d176fe6 100644 +--- a/drivers/gpu/drm/imagination/pvr_apple_queue.c ++++ b/drivers/gpu/drm/imagination/pvr_apple_queue.c +@@ -89,6 +89,11 @@ static void pvr_apple_free_job(struct drm_sched_job *sched_job) + struct pvr_job *job = container_of(sched_job, struct pvr_job, base); + + drm_sched_job_cleanup(sched_job); ++ ++ if (job->type == DRM_PVR_JOB_TYPE_FRAGMENT && job->paired_job) ++ pvr_job_put(job->paired_job); ++ ++ job->paired_job = NULL; + pvr_job_put(job); + } + + From 631f82d52507fab7749048014f911ac9576fa12b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Berkay=20K=C3=B6sebay?= Date: Sun, 15 Nov 2026 21:27:08 +0100 Subject: [PATCH 05/10] drm/imagination: apple: Let every geometry job take its VM's scene first A client's first render on the iPad 5 fails without a log line when another client rendered last. Its geometry job returns -EBUSY, then its fragment job is refused with "fragment job without a geometry job". The call that takes a VM's PM sets is inside the dependency choice for consecutive jobs of the same VM. A new VM can therefore reach submission without a PM set when the previous fragment belonged to another VM. Call vm_scenes for every geometry job before selecting its dependency. Keep the existing prev_frag/last_frag choice and locking context. Affects the Apple A9 (S8003). The A10 has no vm_scenes callback and is unchanged. Assisted-by: LLM --- ...apple-Let-every-geometry-job-take-it.patch | 50 +++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 kernel/patches/drivers/gpu/0030-drm-imagination-apple-Let-every-geometry-job-take-it.patch diff --git a/kernel/patches/drivers/gpu/0030-drm-imagination-apple-Let-every-geometry-job-take-it.patch b/kernel/patches/drivers/gpu/0030-drm-imagination-apple-Let-every-geometry-job-take-it.patch new file mode 100644 index 00000000..2f432c80 --- /dev/null +++ b/kernel/patches/drivers/gpu/0030-drm-imagination-apple-Let-every-geometry-job-take-it.patch @@ -0,0 +1,50 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Berkay=20K=C3=B6sebay?= +Date: Sun, 15 Nov 2026 19:32:10 +0100 +Subject: [PATCH] drm/imagination: apple: Let every geometry job take its VM's + scene first + +A client's first render on the iPad 5 fails without a log line when +another client rendered last. Its geometry job returns -EBUSY, then +its fragment job is refused with "fragment job without a geometry job". + +The call that takes a VM's PM sets is inside the dependency choice for +consecutive jobs of the same VM. A new VM can therefore reach submission +without a PM set when the previous fragment belonged to another VM. + +Call vm_scenes for every geometry job before selecting its dependency. +Keep the existing prev_frag/last_frag choice and locking context. + +Affects the Apple A9 (S8003). The A10 has no vm_scenes callback and is +unchanged. + +Assisted-by: LLM +--- + drivers/gpu/drm/imagination/pvr_apple.c | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/drivers/gpu/drm/imagination/pvr_apple.c b/drivers/gpu/drm/imagination/pvr_apple.c +index b0505a2..5a43e3f 100644 +--- a/drivers/gpu/drm/imagination/pvr_apple.c ++++ b/drivers/gpu/drm/imagination/pvr_apple.c +@@ -1229,14 +1229,18 @@ int pvr_apple_job_add_deps(struct pvr_job *job) + { + struct pvr_apple *apple = to_apple(job->pvr_dev); + struct dma_fence *last; ++ unsigned int scenes = 1; + + if (job->type != DRM_PVR_JOB_TYPE_GEOMETRY && job->type != DRM_PVR_JOB_TYPE_FRAGMENT) + return 0; + spin_lock_irq(&apple->fence_lock); ++ /* Take this VM's first scene even when another VM rendered last. */ ++ if (job->type == DRM_PVR_JOB_TYPE_GEOMETRY && apple->chip->vm_scenes) ++ scenes = apple->chip->vm_scenes(apple, job->ctx->vm_ctx); + if (job->type == DRM_PVR_JOB_TYPE_FRAGMENT) + last = apple->last_geom; + else if (apple->chip->scenes > 1 && apple->last_frag_vm == job->ctx->vm_ctx && +- apple->chip->vm_scenes(apple, job->ctx->vm_ctx) > 1) ++ scenes > 1) + last = apple->prev_frag; + else + last = apple->last_frag; + From dd9efa632f1578b90d8944060fc8e1ade934c049 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Berkay=20K=C3=B6sebay?= Date: Sun, 15 Nov 2026 21:27:08 +0100 Subject: [PATCH 06/10] drm/imagination: Say why a command stream is rejected The iPad 5's rejected geometry and fragment streams return -EINVAL without explaining which check failed. Applications fail to render, and the kernel gives no values with which to diagnose the rejection. Report malformed headers, invalid destination entries, short input, unsupported extensions and missing must-have bits at the rejecting check. Include the command type, entry or extension, and checked values. Use one rate-limited warning per rejected stream; callers log short reads so that propagated errors do not produce duplicate messages. Keep successful parsing and error returns unchanged. Affects every PowerVR device. Assisted-by: LLM --- ...Say-why-a-command-stream-is-rejected.patch | 251 ++++++++++++++++++ 1 file changed, 251 insertions(+) create mode 100644 kernel/patches/drivers/gpu/0031-drm-imagination-Say-why-a-command-stream-is-rejected.patch diff --git a/kernel/patches/drivers/gpu/0031-drm-imagination-Say-why-a-command-stream-is-rejected.patch b/kernel/patches/drivers/gpu/0031-drm-imagination-Say-why-a-command-stream-is-rejected.patch new file mode 100644 index 00000000..ed8c8522 --- /dev/null +++ b/kernel/patches/drivers/gpu/0031-drm-imagination-Say-why-a-command-stream-is-rejected.patch @@ -0,0 +1,251 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Berkay=20K=C3=B6sebay?= +Date: Sun, 15 Nov 2026 18:29:37 +0100 +Subject: [PATCH] drm/imagination: Say why a command stream is rejected + +The iPad 5's rejected geometry and fragment streams return -EINVAL +without explaining which check failed. Applications fail to render, +and the kernel gives no values with which to diagnose the rejection. + +Report malformed headers, invalid destination entries, short input, +unsupported extensions and missing must-have bits at the rejecting +check. Include the command type, entry or extension, and checked values. +Use one rate-limited warning per rejected stream; callers log short +reads so that propagated errors do not produce duplicate messages. + +Keep successful parsing and error returns unchanged. Affects every +PowerVR device. + +Assisted-by: LLM +--- + drivers/gpu/drm/imagination/pvr_stream.c | 101 +++++++++++++++++------ + 1 file changed, 77 insertions(+), 24 deletions(-) + +diff --git a/drivers/gpu/drm/imagination/pvr_stream.c b/drivers/gpu/drm/imagination/pvr_stream.c +index d83b7db..d0c5a1e 100644 +--- a/drivers/gpu/drm/imagination/pvr_stream.c ++++ b/drivers/gpu/drm/imagination/pvr_stream.c +@@ -7,6 +7,7 @@ + #include "pvr_stream.h" + + #include ++#include + #include + #include + #include +@@ -49,6 +50,8 @@ pvr_stream_get_data(u8 *stream, u32 *stream_offset, u32 stream_size, u32 data_si + /** + * pvr_stream_process_1() - Process a single stream and fill destination structure + * @pvr_dev: Device pointer. ++ * @type: Command stream type. ++ * @ext_type: Extension header type, or -1 for the main stream. + * @stream_def: Stream definition. + * @nr_entries: Number of entries in &stream_def. + * @stream: Pointer to stream. +@@ -63,14 +66,20 @@ pvr_stream_get_data(u8 *stream, u32 *stream_offset, u32 stream_size, u32 data_si + * * -%EINVAL on malformed stream. + */ + static int +-pvr_stream_process_1(struct pvr_device *pvr_dev, const struct pvr_stream_def *stream_def, +- u32 nr_entries, u8 *stream, u32 stream_offset, u32 stream_size, ++pvr_stream_process_1(struct pvr_device *pvr_dev, enum pvr_stream_type type, int ext_type, ++ const struct pvr_stream_def *stream_def, u32 nr_entries, u8 *stream, ++ u32 stream_offset, u32 stream_size, + u8 *dest, u32 dest_size, u32 *stream_offset_out) + { + int err = 0; + + for (u32 i = 0; i < nr_entries; i++) { ++ u32 data_size = 0; ++ + if (stream_def[i].offset >= dest_size) { ++ dev_warn_ratelimited(from_pvr_device(pvr_dev)->dev, ++ "stream rejected: destination type=%u ext_type=%d entry=%u offset=%u dest_size=%u\n", ++ type, ext_type, i, stream_def[i].offset, dest_size); + err = -EINVAL; + break; + } +@@ -80,41 +89,42 @@ pvr_stream_process_1(struct pvr_device *pvr_dev, const struct pvr_stream_def *st + + switch (stream_def[i].size) { + case PVR_STREAM_SIZE_8: ++ data_size = sizeof(u8); + err = pvr_stream_get_data(stream, &stream_offset, stream_size, sizeof(u8), + sizeof(u8), dest + stream_def[i].offset); +- if (err) +- return err; + break; + + case PVR_STREAM_SIZE_16: ++ data_size = sizeof(u16); + err = pvr_stream_get_data(stream, &stream_offset, stream_size, sizeof(u16), + sizeof(u16), dest + stream_def[i].offset); +- if (err) +- return err; + break; + + case PVR_STREAM_SIZE_32: ++ data_size = sizeof(u32); + err = pvr_stream_get_data(stream, &stream_offset, stream_size, sizeof(u32), + sizeof(u32), dest + stream_def[i].offset); +- if (err) +- return err; + break; + + case PVR_STREAM_SIZE_64: ++ data_size = sizeof(u64); + err = pvr_stream_get_data(stream, &stream_offset, stream_size, sizeof(u64), + sizeof(u64), dest + stream_def[i].offset); +- if (err) +- return err; + break; + + case PVR_STREAM_SIZE_ARRAY: ++ data_size = stream_def[i].array_size; + err = pvr_stream_get_data(stream, &stream_offset, stream_size, + stream_def[i].array_size, sizeof(u64), + dest + stream_def[i].offset); +- if (err) +- return err; + break; + } ++ if (err) { ++ dev_warn_ratelimited(from_pvr_device(pvr_dev)->dev, ++ "stream rejected: short data type=%u ext_type=%d entry=%u offset=%u size=%u stream_size=%u\n", ++ type, ext_type, i, stream_offset, data_size, stream_size); ++ return err; ++ } + } + + if (stream_offset_out) +@@ -143,18 +153,30 @@ pvr_stream_process_ext_stream(struct pvr_device *pvr_dev, + + err = pvr_stream_get_data(ext_stream, &stream_offset, ext_stream_size, sizeof(u32), + sizeof(ext_header), &ext_header); +- if (err) ++ if (err) { ++ dev_warn_ratelimited(from_pvr_device(pvr_dev)->dev, ++ "stream rejected: short extension header type=%u ext_type=-1 entry=-1 offset=%u size=%zu stream_size=%u\n", ++ cmd_defs->type, stream_offset, sizeof(ext_header), ext_stream_size); + return err; ++ } + + type = (ext_header & PVR_STREAM_EXTHDR_TYPE_MASK) >> PVR_STREAM_EXTHDR_TYPE_SHIFT; + data = ext_header & PVR_STREAM_EXTHDR_DATA_MASK; + +- if (type >= cmd_defs->ext_nr_headers) ++ if (type >= cmd_defs->ext_nr_headers) { ++ dev_warn_ratelimited(from_pvr_device(pvr_dev)->dev, ++ "stream rejected: extension type=%u ext_type=%u ext_nr_headers=%u\n", ++ cmd_defs->type, type, cmd_defs->ext_nr_headers); + return -EINVAL; ++ } + + header = &cmd_defs->ext_headers[type]; +- if (data & ~header->valid_mask) ++ if (data & ~header->valid_mask) { ++ dev_warn_ratelimited(from_pvr_device(pvr_dev)->dev, ++ "stream rejected: extension bits type=%u ext_type=%u data=0x%08x valid_mask=0x%08x\n", ++ cmd_defs->type, type, data, header->valid_mask); + return -EINVAL; ++ } + + musthave_masks[type] &= ~data; + +@@ -165,10 +187,15 @@ pvr_stream_process_ext_stream(struct pvr_device *pvr_dev, + continue; + + /* Quirk 0: the extension is not tied to a hardware quirk. */ +- if (ext_def->quirk && !pvr_device_has_uapi_quirk(pvr_dev, ext_def->quirk)) ++ if (ext_def->quirk && !pvr_device_has_uapi_quirk(pvr_dev, ext_def->quirk)) { ++ dev_warn_ratelimited(from_pvr_device(pvr_dev)->dev, ++ "stream rejected: unsupported quirk type=%u ext_type=%u entry=%u quirk=%u data=0x%08x mask=0x%08x\n", ++ cmd_defs->type, type, i, ext_def->quirk, data, ext_def->header_mask); + return -EINVAL; ++ } + +- err = pvr_stream_process_1(pvr_dev, ext_def->stream, ext_def->stream_len, ++ err = pvr_stream_process_1(pvr_dev, cmd_defs->type, type, ++ ext_def->stream, ext_def->stream_len, + ext_stream, stream_offset, + ext_stream_size, dest, + cmd_defs->dest_size, &stream_offset); +@@ -182,8 +209,12 @@ pvr_stream_process_ext_stream(struct pvr_device *pvr_dev, + * for this command was not present. + */ + for (u32 i = 0; i < cmd_defs->ext_nr_headers; i++) { +- if (musthave_masks[i]) ++ if (musthave_masks[i]) { ++ dev_warn_ratelimited(from_pvr_device(pvr_dev)->dev, ++ "stream rejected: missing must-have type=%u ext_type=%u leftover_mask=0x%08x\n", ++ cmd_defs->type, i, musthave_masks[i]); + return -EINVAL; ++ } + } + + return 0; +@@ -213,13 +244,21 @@ pvr_stream_process(struct pvr_device *pvr_dev, const struct pvr_stream_cmd_defs + u32 padding; + int err; + +- if (!stream || !stream_size) ++ if (!stream || !stream_size) { ++ dev_warn_ratelimited(from_pvr_device(pvr_dev)->dev, ++ "stream rejected: empty input type=%u stream_present=%u stream_size=%u\n", ++ cmd_defs->type, !!stream, stream_size); + return -EINVAL; ++ } + + err = pvr_stream_get_data(stream, &stream_offset, stream_size, sizeof(u32), + sizeof(u32), &main_stream_len); +- if (err) ++ if (err) { ++ dev_warn_ratelimited(from_pvr_device(pvr_dev)->dev, ++ "stream rejected: short main_stream_len type=%u ext_type=-1 entry=-1 offset=%u size=%zu stream_size=%u\n", ++ cmd_defs->type, stream_offset, sizeof(u32), stream_size); + return err; ++ } + + /* + * u32 after stream length is padding to ensure u64 alignment, but may be used for expansion +@@ -227,13 +266,22 @@ pvr_stream_process(struct pvr_device *pvr_dev, const struct pvr_stream_cmd_defs + */ + err = pvr_stream_get_data(stream, &stream_offset, stream_size, sizeof(u32), + sizeof(u32), &padding); +- if (err) ++ if (err) { ++ dev_warn_ratelimited(from_pvr_device(pvr_dev)->dev, ++ "stream rejected: short padding type=%u ext_type=-1 entry=-1 offset=%u size=%zu stream_size=%u\n", ++ cmd_defs->type, stream_offset, sizeof(u32), stream_size); + return err; ++ } + +- if (main_stream_len < stream_offset || main_stream_len > stream_size || padding) ++ if (main_stream_len < stream_offset || main_stream_len > stream_size || padding) { ++ dev_warn_ratelimited(from_pvr_device(pvr_dev)->dev, ++ "stream rejected: main header type=%u main_stream_len=%u stream_size=%u padding=0x%08x\n", ++ cmd_defs->type, main_stream_len, stream_size, padding); + return -EINVAL; ++ } + +- err = pvr_stream_process_1(pvr_dev, cmd_defs->main_stream, cmd_defs->main_stream_len, ++ err = pvr_stream_process_1(pvr_dev, cmd_defs->type, -1, ++ cmd_defs->main_stream, cmd_defs->main_stream_len, + stream, stream_offset, main_stream_len, dest_out, + cmd_defs->dest_size, &stream_offset); + if (err) +@@ -250,8 +298,13 @@ pvr_stream_process(struct pvr_device *pvr_dev, const struct pvr_stream_cmd_defs + * quirks for this command. + */ + for (u32 i = 0; i < cmd_defs->ext_nr_headers; i++) { +- if (pvr_dev->stream_musthave_quirks[cmd_defs->type][i]) ++ if (pvr_dev->stream_musthave_quirks[cmd_defs->type][i]) { ++ dev_warn_ratelimited(from_pvr_device(pvr_dev)->dev, ++ "stream rejected: no extension must-have type=%u ext_type=%u leftover_mask=0x%08x\n", ++ cmd_defs->type, i, ++ pvr_dev->stream_musthave_quirks[cmd_defs->type][i]); + return -EINVAL; ++ } + } + } + From 637a573d06ea01556d5a4a4a3ed283032c969928 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Berkay=20K=C3=B6sebay?= Date: Sun, 15 Nov 2026 21:27:08 +0100 Subject: [PATCH 07/10] drm/imagination: apple: Say why an S8003 job was not submitted Render failures on the iPad 5 can leave a fragment job without its geometry job. S8003 submission errors otherwise return silently, so the kernel does not say which engine or stage failed. Add one rate-limited warning at each failing submission stage with the engine, error, VM and reason. Separate the PM pool build and record slot wait checks so that their errors can be distinguished. Keep submission and recovery behaviour unchanged. A fragment without its geometry scene is still refused. Affects the Apple A9 (S8003). The A10 is unchanged. Assisted-by: LLM --- ...apple-Say-why-an-S8003-job-was-not-s.patch | 149 ++++++++++++++++++ 1 file changed, 149 insertions(+) create mode 100644 kernel/patches/drivers/gpu/0032-drm-imagination-apple-Say-why-an-S8003-job-was-not-s.patch diff --git a/kernel/patches/drivers/gpu/0032-drm-imagination-apple-Say-why-an-S8003-job-was-not-s.patch b/kernel/patches/drivers/gpu/0032-drm-imagination-apple-Say-why-an-S8003-job-was-not-s.patch new file mode 100644 index 00000000..82d05d7b --- /dev/null +++ b/kernel/patches/drivers/gpu/0032-drm-imagination-apple-Say-why-an-S8003-job-was-not-s.patch @@ -0,0 +1,149 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Berkay=20K=C3=B6sebay?= +Date: Sun, 15 Nov 2026 19:32:10 +0100 +Subject: [PATCH] drm/imagination: apple: Say why an S8003 job was not + submitted + +Render failures on the iPad 5 can leave a fragment job without its +geometry job. S8003 submission errors otherwise return silently, so +the kernel does not say which engine or stage failed. + +Add one rate-limited warning at each failing submission stage with the +engine, error, VM and reason. Separate the PM pool build and record +slot wait checks so that their errors can be distinguished. + +Keep submission and recovery behaviour unchanged. A fragment without +its geometry scene is still refused. + +Affects the Apple A9 (S8003). The A10 is unchanged. + +Assisted-by: LLM +--- + drivers/gpu/drm/imagination/pvr_apple_s8003.c | 49 +++++++++++++------ + 1 file changed, 33 insertions(+), 16 deletions(-) + +diff --git a/drivers/gpu/drm/imagination/pvr_apple_s8003.c b/drivers/gpu/drm/imagination/pvr_apple_s8003.c +index e4868b6..b31ec3e 100644 +--- a/drivers/gpu/drm/imagination/pvr_apple_s8003.c ++++ b/drivers/gpu/drm/imagination/pvr_apple_s8003.c +@@ -2262,6 +2262,15 @@ static bool s8003_pm_idle(struct pvr_apple *apple, const struct s8003_pm *pm) + return false; + } + ++static int s8003_submit_error(struct pvr_apple *apple, struct s8003_vm *vm, ++ const char *engine, int err, const char *reason) ++{ ++ dev_warn_ratelimited(apple_dev(apple), ++ "%s job not submitted: error=%d VM=%p: %s\n", ++ engine, err, vm->vm_ctx, reason); ++ return err; ++} ++ + static int s8003_submit_geom(struct pvr_apple *apple, struct s8003_vm *vm, struct pvr_job *job) + { + const struct pvr_hwrt_dataset *hwrt = job->hwrt->hwrt_dataset; +@@ -2275,7 +2284,7 @@ static int s8003_submit_geom(struct pvr_apple *apple, struct s8003_vm *vm, struc + + err = s8003_rt_derive(hwrt, &rt); + if (err) +- return err; ++ return s8003_submit_error(apple, vm, "geometry", err, "rt derive"); + /* The VM's sets were taken when the job was ordered (pvr_apple_s8003_vm_scenes()) */ + for (i = 0; i < 2 && !pm; i++) + if (vm->pm[i].set >= 0 && s8003_pm_idle(apple, &vm->pm[i])) +@@ -2289,7 +2298,7 @@ static int s8003_submit_geom(struct pvr_apple *apple, struct s8003_vm *vm, struc + !s8003_wait_done(apple, APPLE_ENGINE_GEOM, vm->pm[i].ta_seq)) + pm = &vm->pm[i]; + if (!pm) +- return -EBUSY; ++ return s8003_submit_error(apple, vm, "geometry", -EBUSY, "no PM set"); + + /* As many 128 KiB blocks as the free list has 4 KiB pages, and enough for the target */ + blocks = max(DIV_ROUND_UP(hwrt->free_lists[0]->initial_num_pages, 32), +@@ -2136,9 +2145,11 @@ static int s8003_submit_geom(struct pvr_apple *apple, struct s8003_vm *vm, struc + err = s8003_pm_build(apple, vm, pm, min(blocks, S8003_PM_BLOCKS_MAX)); ++ if (err) ++ return s8003_submit_error(apple, vm, "geometry", err, "PM pool build failed"); + /* The record slot of the job before the last one is free again */ +- if (!err && apple->ta_seq) ++ if (apple->ta_seq) + err = s8003_wait_done(apple, APPLE_ENGINE_GEOM, apple->ta_seq - 1); + if (err) +- return err; ++ return s8003_submit_error(apple, vm, "geometry", err, "record slot wait"); + + seq = apple->ta_seq + 1; + s8003_fill_ta(p + s8003_slot_of(seq, false).w, job->cmd, job->hwrt, &rt); +@@ -2320,7 +2331,9 @@ static int s8003_submit_geom(struct pvr_apple *apple, struct s8003_vm *vm, struc + pm->td_seq = 0; + apple->ta_seq = seq; + err = s8003_publish(apple, APPLE_ENGINE_GEOM, seq, (2 * seq) % S8003_CH_ENTRIES); +- return err ?: seq; ++ if (err) ++ return s8003_submit_error(apple, vm, "geometry", err, "publish"); ++ return seq; + } + + static int s8003_submit_frag(struct pvr_apple *apple, struct s8003_vm *vm, struct pvr_job *job) +@@ -2337,21 +2350,21 @@ static int s8003_submit_frag(struct pvr_apple *apple, struct s8003_vm *vm, struc + for (i = 0; i < 2; i++) + if (vm->pm[i].scene == s->gen && vm->pm[i].hwrt == job->hwrt && !vm->pm[i].td_seq) + pm = &vm->pm[i]; +- if (!pm) { +- dev_warn_ratelimited(apple_dev(apple), +- "fragment job without a geometry job: not run\n"); +- return -ECANCELED; +- } ++ if (!pm) ++ return s8003_submit_error(apple, vm, "fragment", -ECANCELED, ++ "its geometry job failed or was not submitted"); + err = s8003_rt_derive(job->hwrt->hwrt_dataset, &rt); +- if (!err && apple->frag_seq) ++ if (err) ++ return s8003_submit_error(apple, vm, "fragment", err, "rt derive"); ++ if (apple->frag_seq) + err = s8003_wait_done(apple, APPLE_ENGINE_FRAG, apple->frag_seq - 1); + if (err) +- return err; ++ return s8003_submit_error(apple, vm, "fragment", err, "record slot wait"); + + seq = apple->frag_seq + 1; + err = s8003_fill_3d(p + s8003_slot_of(seq, true).w, job->cmd, job->hwrt, &rt); + if (err) +- return err; ++ return s8003_submit_error(apple, vm, "fragment", err, "3D record fill"); + s8003_job_write(p, s8003_channel_addr(APPLE_ENGINE_FRAG), + s8003_object_addr(&s->layout, S8003_CHANNEL + 1), + s8003_meta_addr(s8003_pm_set_va(pm, 0)), pm->set + 1, vm->slot[1], true, seq, +@@ -2359,7 +2372,9 @@ static int s8003_submit_frag(struct pvr_apple *apple, struct s8003_vm *vm, struc + pm->td_seq = seq; + apple->frag_seq = seq; + err = s8003_publish(apple, APPLE_ENGINE_FRAG, seq, (2 * seq) % S8003_CH_ENTRIES); +- return err ?: seq; ++ if (err) ++ return s8003_submit_error(apple, vm, "fragment", err, "publish"); ++ return seq; + } + + /* +@@ -2382,7 +2397,7 @@ static int s8003_submit_compute(struct pvr_apple *apple, struct s8003_vm *vm, st + + err = s8003_wait_done(apple, APPLE_ENGINE_COMPUTE, apple->last_seq); + if (err) +- return err; ++ return s8003_submit_error(apple, vm, "compute", err, "record slot wait"); + seq = apple->last_seq + 1; + { + const u32 useq[] = { +@@ -2428,7 +2443,9 @@ static int s8003_submit_compute(struct pvr_apple *apple, struct s8003_vm *vm, st + put32(p + S8003_CH_RING + ((seq - 1) % S8003_CH_ENTRIES) * 4, w); + apple->last_seq = seq; + err = s8003_publish(apple, APPLE_ENGINE_COMPUTE, seq, seq % S8003_CH_ENTRIES); +- return err ?: seq; ++ if (err) ++ return s8003_submit_error(apple, vm, "compute", err, "publish"); ++ return seq; + } + + static int pvr_apple_s8003_submit(struct pvr_apple *apple, struct pvr_job *job) + From 3bec95f46f804148d9a9c2f7e2a2bb166040e92c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Berkay=20K=C3=B6sebay?= Date: Mon, 16 Nov 2026 11:03:58 +0100 Subject: [PATCH 08/10] drm/imagination: apple: Keep VM tag bumps off an S8003 slot pair while it loads The iPad 5 loses Firefox's WebGL context under multiple GPU clients. Firmware slot loads return -EIO, geometry jobs fail, and their fragment jobs are refused. Single-client runs do not hit the failure. VM map and unmap flushes take tag_lock but not submit_lock. They can bump a slot's host tag while DC_SLOT loads its root. With two or more bumps, firmware can copy an intermediate tag that matches neither the loaded tag nor the current host tag, falsely failing the load check. Mark each slot as loading under tag_lock while publishing its root and tag. Defer flushes on those slots, verify the exact loaded tag, then clear loading and apply any pending bump through the shared helper on both success and failure. submit_lock keeps the VM's job behind the pending bump, so firmware still invalidates stale translations before using the slot. Report the slot, loaded, firmware and current tags on a mismatch. Affects: Apple A9 (S8003). The A10 is unchanged. Assisted-by: LLM --- ...ff-an-S8003-slot-pair-while-it-loads.patch | 129 ++++++++++++++++++ 1 file changed, 129 insertions(+) create mode 100644 kernel/patches/drivers/gpu/0033-drm-imagination-apple-Keep-VM-tag-bumps-off-an-S8003-slot-pair-while-it-loads.patch diff --git a/kernel/patches/drivers/gpu/0033-drm-imagination-apple-Keep-VM-tag-bumps-off-an-S8003-slot-pair-while-it-loads.patch b/kernel/patches/drivers/gpu/0033-drm-imagination-apple-Keep-VM-tag-bumps-off-an-S8003-slot-pair-while-it-loads.patch new file mode 100644 index 00000000..e05d3253 --- /dev/null +++ b/kernel/patches/drivers/gpu/0033-drm-imagination-apple-Keep-VM-tag-bumps-off-an-S8003-slot-pair-while-it-loads.patch @@ -0,0 +1,129 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Berkay=20K=C3=B6sebay?= +Date: Mon, 16 Nov 2026 11:03:58 +0100 +Subject: [PATCH] drm/imagination: apple: Keep VM tag bumps off an S8003 slot + pair while it loads + +The iPad 5 loses Firefox's WebGL context under multiple GPU clients. +Firmware slot loads return -EIO, geometry jobs fail, and their fragment +jobs are refused. Single-client runs do not hit the failure. + +VM map and unmap flushes take tag_lock but not submit_lock. They can +bump a slot's host tag while DC_SLOT loads its root. With two or more +bumps, firmware can copy an intermediate tag that matches neither the +loaded tag nor the current host tag, falsely failing the load check. + +Mark each slot as loading under tag_lock while publishing its root and +tag. Defer flushes on those slots, verify the exact loaded tag, then +clear loading and apply any pending bump through the shared helper on +both success and failure. submit_lock keeps the VM's job behind the +pending bump, so firmware still invalidates stale translations before +using the slot. Report the slot, loaded, firmware and current tags on +a mismatch. + +Affects: Apple A9 (S8003). The A10 is unchanged. + +Assisted-by: LLM +--- + drivers/gpu/drm/imagination/pvr_apple_s8003.c | 55 ++++++++++++++----- + 1 file changed, 41 insertions(+), 14 deletions(-) + +diff --git a/drivers/gpu/drm/imagination/pvr_apple_s8003.c b/drivers/gpu/drm/imagination/pvr_apple_s8003.c +index bc6f300..40ca888 100644 +--- a/drivers/gpu/drm/imagination/pvr_apple_s8003.c ++++ b/drivers/gpu/drm/imagination/pvr_apple_s8003.c +@@ -276,6 +276,8 @@ struct pvr_apple_s8003 { + u32 gen; + spinlock_t tag_lock; /* @tag and the host's tags in the shared memory */ + u32 tag[S8003_SLOTS]; /* 0: slot not loaded */ ++ DECLARE_BITMAP(loading, S8003_SLOTS); /* tag held until DC_SLOT completes */ ++ DECLARE_BITMAP(bump_pending, S8003_SLOTS); /* flush deferred while loading */ + DECLARE_BITMAP(slots, S8003_SLOTS); + DECLARE_BITMAP(parked, S8003_SLOTS); /* left on @park_vm's tables */ + u32 next_slot; +@@ -1315,6 +1317,21 @@ static int s8003_device_control(struct pvr_apple *apple, const u32 (*cmd)[2], un + S8003_DC_TIMEOUT_US, false, apple, ctl); + } + ++/* Bump a loaded slot's tag with tag_lock held; leave empty slots at zero. */ ++static void s8003_slot_tag_bump(struct pvr_apple_s8003 *s, u32 slot) ++{ ++ u32 tag = s->tag[slot]; ++ ++ lockdep_assert_held(&s->tag_lock); ++ if (!tag) ++ return; ++ tag += S8003_TAG_CATALOGUE; ++ if (!tag) ++ tag = S8003_TAG_CATALOGUE; ++ s->tag[slot] = tag; ++ put32(s8003_object(s, S8003_TAG_HOST) + 4 * slot, tag); ++} ++ + /* Point a pair of slots at a page-table root (0: at none) under @tag */ + static int s8003_slots_load(struct pvr_apple *apple, const u32 *slot, u64 root, u32 tag) + { +@@ -1326,6 +1343,7 @@ static int s8003_slots_load(struct pvr_apple *apple, const u32 *slot, u64 root, + + spin_lock_irqsave(&s->tag_lock, flags); + for (e = 0; e < 2; e++) { ++ __set_bit(slot[e], s->loading); + put64(s8003_object(s, S8003_MMU_ROOT) + 8 * slot[e], root); + put32(s8003_object(s, S8003_TAG_HOST) + 4 * slot[e], tag); + s->tag[slot[e]] = tag; +@@ -1333,16 +1351,30 @@ static int s8003_slots_load(struct pvr_apple *apple, const u32 *slot, u64 root, + spin_unlock_irqrestore(&s->tag_lock, flags); + + err = s8003_device_control(apple, cmd, 2); +- /* The firmware copies the tag it loaded the root under */ ++ if (err) ++ dev_err(apple_dev(apple), "GFX firmware slot load failed: %d\n", err); ++ /* The firmware must copy the tag we held stable while loading the root. */ + for (e = 0; e < 2 && !err; e++) { + u32 seen = get32(s8003_object(s, S8003_TAG_SEEN) + 4 * slot[e]); + +- if (seen != tag && seen != READ_ONCE(s->tag[slot[e]])) ++ if (seen != tag) { ++ dev_err(apple_dev(apple), ++ "GFX firmware did not load slot %u: loaded tag %#x, firmware saw %#x, now %#x\n", ++ slot[e], tag, seen, READ_ONCE(s->tag[slot[e]])); + err = -EIO; ++ } + } +- if (err) +- dev_err(apple_dev(apple), "GFX firmware did not load slots %u and %u: %d\n", +- slot[0], slot[1], err); ++ /* The attach holds submit_lock: deferred flushes precede the VM's job. */ ++ spin_lock_irqsave(&s->tag_lock, flags); ++ for (e = 0; e < 2; e++) { ++ __clear_bit(slot[e], s->loading); ++ if (test_bit(slot[e], s->bump_pending)) { ++ s8003_slot_tag_bump(s, slot[e]); ++ __clear_bit(slot[e], s->bump_pending); ++ } ++ } ++ spin_unlock_irqrestore(&s->tag_lock, flags); ++ wmb(); + return err; + } + +@@ -1406,15 +1438,10 @@ static void pvr_apple_s8003_mmu_flush(struct pvr_apple *apple) + return; + spin_lock_irqsave(&s->tag_lock, flags); + for (slot = S8003_SLOT_FIRST; slot < S8003_SLOTS; slot++) { +- u32 tag = s->tag[slot]; +- +- if (!tag) +- continue; +- tag += S8003_TAG_CATALOGUE; +- if (!tag) +- tag = S8003_TAG_CATALOGUE; +- s->tag[slot] = tag; +- put32(s8003_object(s, S8003_TAG_HOST) + 4 * slot, tag); ++ if (test_bit(slot, s->loading)) ++ __set_bit(slot, s->bump_pending); ++ else ++ s8003_slot_tag_bump(s, slot); + } + spin_unlock_irqrestore(&s->tag_lock, flags); + wmb(); From 441dd2360b9a67e1c95df555966b1d333dcdb560 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Berkay=20K=C3=B6sebay?= Date: Mon, 16 Nov 2026 17:45:47 +0100 Subject: [PATCH 09/10] drm/imagination: apple: Signal completed jobs before touching S8003 PM memory The S8003 event callback reads firmware and PM cache lines before completed job fences are signalled. That host work delays the next scheduled job even though completion stamps are already visible through coherent mappings. Signal the fences and retire their runtime-PM references first, then run the chip event callback. Keep the A10 event acknowledgement before its retirement-watermark check, as before. No submission dependency changes. Affects: Apple A9 (S8003). The A10 acknowledgement order is unchanged. Assisted-by: LLM --- ...jobs-before-touching-S8003-PM-memory.patch | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 kernel/patches/drivers/gpu/0034-drm-imagination-apple-Signal-completed-jobs-before-touching-S8003-PM-memory.patch diff --git a/kernel/patches/drivers/gpu/0034-drm-imagination-apple-Signal-completed-jobs-before-touching-S8003-PM-memory.patch b/kernel/patches/drivers/gpu/0034-drm-imagination-apple-Signal-completed-jobs-before-touching-S8003-PM-memory.patch new file mode 100644 index 00000000..3b92d31e --- /dev/null +++ b/kernel/patches/drivers/gpu/0034-drm-imagination-apple-Signal-completed-jobs-before-touching-S8003-PM-memory.patch @@ -0,0 +1,48 @@ +From a6c0ea12f1712e9c17a642867025f7612fcef9cd Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Berkay=20K=C3=B6sebay?= +Date: Mon, 16 Nov 2026 17:45:06 +0100 +Subject: [PATCH] drm/imagination: apple: Signal completed jobs before touching + S8003 PM memory + +The S8003 event callback reads firmware and PM cache lines before completed +job fences are signalled. That host work delays the next scheduled job even +though completion stamps are already visible through coherent mappings. + +Signal the fences and retire their runtime-PM references first, then run +the chip event callback. Keep the A10 event acknowledgement before its +retirement-watermark check, as before. No submission dependency changes. + +Affects: Apple A9 (S8003). The A10 acknowledgement order is unchanged. + +Assisted-by: LLM +--- + drivers/gpu/drm/imagination/pvr_apple.c | 9 ++++++--- + 1 file changed, 6 insertions(+), 3 deletions(-) + +diff --git a/drivers/gpu/drm/imagination/pvr_apple.c b/drivers/gpu/drm/imagination/pvr_apple.c +index 5a43e3f..6c72c88 100644 +--- a/drivers/gpu/drm/imagination/pvr_apple.c ++++ b/drivers/gpu/drm/imagination/pvr_apple.c +@@ -759,9 +759,7 @@ static void pvr_apple_poll_work(struct work_struct *work) + bool pending = false; + int engine; + +- if (apple->chip->events) +- apple->chip->events(apple); +- else ++ if (!apple->chip->events) + pvr_apple_ack_events(apple); + spin_lock_irq(&apple->fence_lock); + for (engine = 0; engine < APPLE_ENGINES; engine++) { +@@ -795,6 +793,11 @@ static void pvr_apple_poll_work(struct work_struct *work) + } + spin_unlock_irq(&apple->fence_lock); + pvr_apple_jobs_retired(apple, retired); ++ /* Completion stamps need no touch. Signal first, then let S8003 ++ * touch and drain its rings. A10 acknowledgement above is unchanged. ++ */ ++ if (apple->chip->events) ++ apple->chip->events(apple); + + /* The firmware sends no completion message in this setup: poll. */ + if (pending) From 41bb9af6fa060417996b92a999bdb682843814e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Berkay=20K=C3=B6sebay?= Date: Mon, 16 Nov 2026 17:45:47 +0100 Subject: [PATCH 10/10] drm/imagination: apple: Allow opt-in per-VM S8003 scene overlap Composited S8003 workloads serialize one client's geometry behind another client's fragment, even though their PM sets are private to their VMs. Keep each VM's last two fragment fences and add apple_vm_overlap, default off. When enabled on a chip with per-VM scenes, geometry waits on its own VM's previous fragment (or last fragment for one scene). Keep the global scene dependencies with the option off and for chips without per-VM sets. Reference and release the per-VM history with the existing VM lifetime. Affects: Apple A9 (S8003). T8010 has no per-VM scene hook and keeps its global dependencies regardless of the parameter. Assisted-by: LLM --- ...ow-opt-in-per-VM-S8003-scene-overlap.patch | 194 ++++++++++++++++++ 1 file changed, 194 insertions(+) create mode 100644 kernel/patches/drivers/gpu/0035-drm-imagination-apple-Allow-opt-in-per-VM-S8003-scene-overlap.patch diff --git a/kernel/patches/drivers/gpu/0035-drm-imagination-apple-Allow-opt-in-per-VM-S8003-scene-overlap.patch b/kernel/patches/drivers/gpu/0035-drm-imagination-apple-Allow-opt-in-per-VM-S8003-scene-overlap.patch new file mode 100644 index 00000000..ebfe1d2d --- /dev/null +++ b/kernel/patches/drivers/gpu/0035-drm-imagination-apple-Allow-opt-in-per-VM-S8003-scene-overlap.patch @@ -0,0 +1,194 @@ +From bbd8003115717b35d347c9f40a8807ba71e9e8ba Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Berkay=20K=C3=B6sebay?= +Date: Mon, 16 Nov 2026 17:45:47 +0100 +Subject: [PATCH] drm/imagination: apple: Allow opt-in per-VM S8003 scene + overlap + +Composited S8003 workloads serialize one client's geometry behind another +client's fragment, even though their PM sets are private to their VMs. + +Keep each VM's last two fragment fences and add apple_vm_overlap, default +off. When enabled on a chip with per-VM scenes, geometry waits on its own +VM's previous fragment (or last fragment for one scene). Keep the global +scene dependencies with the option off and for chips without per-VM sets. +Reference and release the per-VM history with the existing VM lifetime. + +Affects: Apple A9 (S8003). T8010 has no per-VM scene hook and keeps its +global dependencies regardless of the parameter. + +Assisted-by: LLM +--- + drivers/gpu/drm/imagination/pvr_apple.c | 61 +++++++++++++++++++- + drivers/gpu/drm/imagination/pvr_apple_chip.h | 10 +++- + 2 files changed, 67 insertions(+), 4 deletions(-) + +diff --git a/drivers/gpu/drm/imagination/pvr_apple.c b/drivers/gpu/drm/imagination/pvr_apple.c +index 6c72c88..bcfc2e4 100644 +--- a/drivers/gpu/drm/imagination/pvr_apple.c ++++ b/drivers/gpu/drm/imagination/pvr_apple.c +@@ -64,6 +64,10 @@ MODULE_PARM_DESC(apple_poll_us, "Apple A10: microseconds between job completion + /* Idle time before runtime PM powers the GPU off; tunable in sysfs. */ + #define PVR_APPLE_AUTOSUSPEND_MS 1000 + ++static bool pvr_apple_vm_overlap; ++module_param_named(apple_vm_overlap, pvr_apple_vm_overlap, bool, 0644); ++MODULE_PARM_DESC(apple_vm_overlap, "Apple per-VM scene overlap (default 0)"); ++ + static unsigned int pvr_apple_perf_state; + module_param_named(apple_perf_state, pvr_apple_perf_state, uint, 0444); + MODULE_PARM_DESC(apple_perf_state, +@@ -325,6 +329,7 @@ static int pvr_apple_power_init(struct pvr_device *pvr_dev) + spin_lock_init(&apple->event_lock); + for (i = 0; i < APPLE_ENGINES; i++) + INIT_LIST_HEAD(&apple->pending[i]); ++ xa_init(&apple->vm_frags); + INIT_DELAYED_WORK(&apple->poll_work, pvr_apple_poll_work); + hrtimer_setup(&apple->poll_timer, pvr_apple_poll_timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL); + apple->fence_context = dma_fence_context_alloc(APPLE_ENGINES); +@@ -850,12 +855,23 @@ void pvr_apple_report_hang(struct pvr_device *pvr_dev, struct dma_fence *fence) + /* No job is ordered after the scenes submitted so far any more */ + static void pvr_apple_forget_scenes(struct pvr_apple *apple) + { ++ struct pvr_apple_vm_frags *frags; ++ unsigned long index; ++ ++ spin_lock_irq(&apple->fence_lock); ++ xa_for_each(&apple->vm_frags, index, frags) { ++ dma_fence_put(frags->last); ++ dma_fence_put(frags->prev); ++ frags->last = NULL; ++ frags->prev = NULL; ++ } + dma_fence_put(apple->last_frag); + apple->last_frag = NULL; + dma_fence_put(apple->prev_frag); + apple->prev_frag = NULL; + dma_fence_put(apple->last_geom); + apple->last_geom = NULL; ++ spin_unlock_irq(&apple->fence_lock); + } + + static unsigned int pvr_apple_cancel_fences(struct pvr_apple *apple, int error) +@@ -1038,6 +1054,18 @@ void pvr_apple_vm_fini(struct pvr_device *pvr_dev, struct pvr_vm_context *vm_ctx + + if (vm_ctx == pvr_dev->kernel_vm_ctx) + return; ++ { ++ struct pvr_apple_vm_frags *frags; ++ ++ spin_lock_irq(&apple->fence_lock); ++ frags = xa_erase(&apple->vm_frags, (unsigned long)vm_ctx); ++ spin_unlock_irq(&apple->fence_lock); ++ if (frags) { ++ dma_fence_put(frags->last); ++ dma_fence_put(frags->prev); ++ kfree(frags); ++ } ++ } + if (apple->chip->vm_fini) + apple->chip->vm_fini(apple, vm_ctx); + if (!apple->booted) +@@ -1224,7 +1252,9 @@ struct dma_fence *pvr_apple_submit_job(struct pvr_job *job) + * &pvr_apple_chip.vm_scenes): a geometry job then waits for the fragment job + * before the last one if the last one is its own VM's, and a fragment job + * for its geometry job to be submitted rather than finished +- * (pvr_apple_job_armed()). ++ * (pvr_apple_job_armed()). With apple_vm_overlap on, a chip with per-VM ++ * scenes takes only this VM's previous fragment (or last for one scene), ++ * as each VM owns its PM sets; the global timelines remain for A10/knob 0. + * + * Return: 0 or a negative error. + */ +@@ -1240,9 +1270,14 @@ int pvr_apple_job_add_deps(struct pvr_job *job) + /* Take this VM's first scene even when another VM rendered last. */ + if (job->type == DRM_PVR_JOB_TYPE_GEOMETRY && apple->chip->vm_scenes) + scenes = apple->chip->vm_scenes(apple, job->ctx->vm_ctx); +- if (job->type == DRM_PVR_JOB_TYPE_FRAGMENT) ++ if (job->type == DRM_PVR_JOB_TYPE_FRAGMENT) { + last = apple->last_geom; +- else if (apple->chip->scenes > 1 && apple->last_frag_vm == job->ctx->vm_ctx && ++ } else if (apple->chip->vm_scenes && READ_ONCE(pvr_apple_vm_overlap)) { ++ struct pvr_apple_vm_frags *frags = xa_load(&apple->vm_frags, ++ (unsigned long)job->ctx->vm_ctx); ++ ++ last = frags ? (scenes > 1 ? frags->prev : frags->last) : NULL; ++ } else if (apple->chip->scenes > 1 && apple->last_frag_vm == job->ctx->vm_ctx && + scenes > 1) + last = apple->prev_frag; + else +@@ -1276,6 +1311,14 @@ void pvr_apple_job_armed(struct pvr_job *job, struct dma_fence *finished) + old = *last; + *last = dma_fence_get(finished); + if (job->type == DRM_PVR_JOB_TYPE_FRAGMENT) { ++ struct pvr_apple_vm_frags *frags = xa_load(&apple->vm_frags, ++ (unsigned long)job->ctx->vm_ctx); ++ ++ if (frags) { ++ dma_fence_put(frags->prev); ++ frags->prev = frags->last; ++ frags->last = dma_fence_get(finished); ++ } + apple->last_frag_vm = job->ctx->vm_ctx; + if (joint) + swap(old, apple->prev_frag); +@@ -1300,6 +1343,18 @@ int pvr_apple_vm_init(struct pvr_device *pvr_dev, struct pvr_vm_context *vm_ctx) + struct pvr_apple *apple = to_apple(pvr_dev); + int err; + ++ if (apple->chip->vm_scenes) { ++ struct pvr_apple_vm_frags *frags = kzalloc(sizeof(*frags), GFP_KERNEL); ++ ++ if (!frags) ++ return -ENOMEM; ++ err = xa_err(xa_store(&apple->vm_frags, (unsigned long)vm_ctx, ++ frags, GFP_KERNEL)); ++ if (err) { ++ kfree(frags); ++ return err; ++ } ++ } + err = pvr_vm_map_reserved(vm_ctx, apple->data.obj, PVR_APPLE_GPU_DATA, + PVR_DEVICE_PAGE_SIZE); + if (!err) +diff --git a/drivers/gpu/drm/imagination/pvr_apple_chip.h b/drivers/gpu/drm/imagination/pvr_apple_chip.h +index d524415..2ef5208 100644 +--- a/drivers/gpu/drm/imagination/pvr_apple_chip.h ++++ b/drivers/gpu/drm/imagination/pvr_apple_chip.h +@@ -26,6 +26,7 @@ + #include + #include + #include ++#include + + struct devfreq; + struct pvr_gem_object; +@@ -74,6 +75,10 @@ struct pvr_apple_layout { + u32 event_size; + }; + ++struct pvr_apple_vm_frags { ++ struct dma_fence *last, *prev; ++}; ++ + struct pvr_apple { + struct pvr_device *pvr_dev; + const struct pvr_apple_chip *chip; +@@ -120,6 +125,7 @@ struct pvr_apple { + * Chips with &pvr_apple_chip.scenes of 2: the fragment job before + * @last_frag, and the VM @last_frag runs in. + */ ++ struct xarray vm_frags; /* per-VM last/previous fragment fences, fence_lock */ + struct dma_fence *prev_frag; + const struct pvr_vm_context *last_frag_vm; + +@@ -208,7 +214,9 @@ struct pvr_apple { + * @scenes: Scenes (a geometry job and its fragment job) one VM may have in the + * firmware at a time; 0 is 1. Above 1 a fragment job is submitted as soon + * as its geometry job was, not when that finished: the firmware orders +- * the two. Scenes of different VMs never overlap. ++ * the two. With @vm_scenes, scenes of different VMs may overlap: each ++ * VM owns its PM sets. AGXWorkQueue_initAndAttachPM has one PM per queue; ++ * AGXTACommandDescriptor_preparePMAndWork waits only on that PM's stamps. + * @own_pm_pages: The chip allocates the parameter manager's pages itself; a + * free list has none (pvr_apple_free_list_has_pages()). + * @gate_off_ms: How long the GPU's power domain stays off before the firmware