summaryrefslogtreecommitdiff
path: root/drivers/gpu
AgeCommit message (Collapse)Author
2026-10-01drm/amdgpu: Add gc_info_v1_4 table supportLikun Gao
Initialize amdgpu_gfx_config using values from gc_info_v1_4. Signed-off-by: Likun Gao <Likun.Gao@amd.com> Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-10-01drm/amdgpu: update FIRMWARE ID for soc24Frank Min
Update firmware ID for SOC24 to support more firmware. Signed-off-by: Frank Min <Frank.Min@amd.com> Signed-off-by: Likun Gao <Likun.Gao@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-10-01drm/amdgpu: add debug info for psp ip key mgr ucodeFrank Min
Add debug info for psp ip key mgr ucode. Signed-off-by: Frank Min <Frank.Min@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-10-01drm/amdgpu: add GDDR7 vram nameFrank Min
Add GDDR7 vram name. Signed-off-by: Frank Min <Frank.Min@amd.com> Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-10-01drm/amdgpu: use pm_runtime_resume_and_get amdgpu_gem_create_ioctlPierre-Eric Pelloux-Prayer
This ioctl might trigger GPU work through ttm so make sure the GPU is awake. Signed-off-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Co-developed-by: Shahyan Soltani <shahyan.soltani@amd.com> Signed-off-by: Shahyan Soltani <shahyan.soltani@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-10-01drm/amdgpu/gfx: add a shared gfx pipe reset helperJesse Zhang
Serialize GFX recovery with mec.reset_mutex and attempt MES suspend before locating a user HQD. Back up collateral kernel rings before reset, then resume MES before testing and replaying rebuilt rings. Allow reset to proceed if suspend fails. Always attempt resume, report reset or resume errors, and leave schedulers stopped on failure. Signed-off-by: Jesse Zhang <Jesse.Zhang@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-10-01drm/amdgpu: factor out the MES user queue reset bodyJesse Zhang
Extract mes_userq_reset_hw() for reuse by GFX recovery. Keep reset and MES queue removal together, marking the queue HUNG only after both operations succeed. The existing reset entry point uses the same helper. Signed-off-by: Jesse Zhang <Jesse.Zhang@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-10-01drm/amdgpu/gfx11: set KMD_QUEUE for kernel gfx queuesJesse Zhang
Set KMD_QUEUE in the GFX MQD and kernel ring control registers so CP preserves kernel IB VMIDs instead of replacing them with the queue VMID. Use prop->kernel_queue to distinguish kernel and user MQDs. Signed-off-by: Jesse Zhang <Jesse.Zhang@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-10-01drm/amdgpu/gfx12: set KMD_QUEUE for kernel gfx queuesJesse Zhang
Set KMD_QUEUE in the GFX MQD and kernel ring control registers so CP preserves kernel IB VMIDs instead of replacing them with the queue VMID. Use prop->kernel_queue to distinguish kernel and user MQDs. Signed-off-by: Jesse Zhang <Jesse.Zhang@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-10-01drm/amdgpu/mes12: read the gfx user queue VMID for MMIO resetJesse Zhang
Read the MES-assigned VMID from CP_GFX_HQD_VMID under srbm_mutex when resetting a GFX user queue over MMIO. Kernel queues keep the IB VMID supplied by the caller. Signed-off-by: Jesse Zhang <Jesse.Zhang@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-10-01drm/amdgpu/mes11: read the gfx user queue VMID for MMIO resetJesse Zhang
Read the MES-assigned VMID from CP_GFX_HQD_VMID under srbm_mutex when resetting a GFX user queue over MMIO. Kernel queues keep the IB VMID supplied by the caller. Signed-off-by: Jesse Zhang <Jesse.Zhang@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-10-01drm/amdgpu/mes11: restore collateral gfx queues after pipe resetJesse Zhang
A pipe reset restarts the shared PFP/ME, but CP firmware dequeues only the requested queue. Wait for its CP_VMID_RESET bit and HQD_ACTIVE to clear, and return -ETIMEDOUT if recovery does not complete. Preempt each collateral kernel queue and wait for its HQD to deactivate before rebuilding its MQD/ring and remapping it. Leave the guilty kernel queue to the outer reset helper. Signed-off-by: Jesse Zhang <Jesse.Zhang@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-10-01drm/amdgpu/mes12: restore collateral gfx queues after pipe resetJesse Zhang
A pipe reset restarts the shared PFP/ME, but CP firmware dequeues only the requested queue. Wait for its CP_VMID_RESET bit and HQD_ACTIVE to clear, and return -ETIMEDOUT if recovery does not complete. Preempt each collateral kernel queue and wait for its HQD to deactivate before rebuilding its MQD/ring and remapping it. Leave the guilty kernel queue to the outer reset helper. Signed-off-by: Jesse Zhang <Jesse.Zhang@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-10-01drm/amdgpu/gfx: export amdgpu_gfx_mqd_reset_restoreJesse Zhang
Expose amdgpu_gfx_mqd_reset_restore() so MES11/12 pipe reset can rebuild collateral kernel rings. Signed-off-by: Jesse Zhang <Jesse.Zhang@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-10-01drm/amdgpu/gfx11: implement detect_hung_queueJesse Zhang
Implement detect_hung_queue() by matching enabled HQD doorbells over MMIO, allowing GFX reset to locate the queue without a MES request. Signed-off-by: Jesse Zhang <Jesse.Zhang@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-10-01drm/amdgpu/gfx12: implement detect_hung_queueJesse Zhang
Implement detect_hung_queue() by matching enabled HQD doorbells over MMIO, allowing GFX reset to locate the queue without a MES request. Signed-off-by: Jesse Zhang <Jesse.Zhang@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-10-01drm/amdgpu/gfx: add a detect_hung_queue callbackJesse Zhang
Allow GFX recovery to resolve a doorbell to an HQD (ME, pipe, queue) without querying a stalled MES scheduler. Signed-off-by: Jesse Zhang <Jesse.Zhang@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-10-01drm/amdgpu: fix empty fence backup and replay intervalsJesse Zhang
amdgpu_ring_set_fence_errors_and_reemit() and amdgpu_ring_backup_unprocessed_commands() masked last_seq and sync_seq to fence-array indices before the loop, then walked a do/while until the two indices met. When hardware completed every command before the driver signalled the fences, last_seq == sync_seq, but the masked-index do/while could not tell that empty interval from a full table and walked the whole fence array, backing up and replaying already-completed commands. Read the raw sequence numbers, return early through amdgpu_fence_process() when they are equal, and mask only at the array index. Guard the force-completion against a NULL guilty_fence so a non-guilty backup does not dereference it. Signed-off-by: Jesse Zhang <Jesse.Zhang@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-10-01drm/amdgpu: support non-guilty job save on ring backupJesse Zhang
amdgpu_ring_backup_unprocessed_commands() is also used to preserve a ring that carries no guilty command - for example a collateral kernel gfx ring that shares the faulting pipe during a gfx user-queue pipe reset. Such a ring is backed up with a NULL guilty_fence and all of its unprocessed commands must be saved so they can be replayed after the reset rebuilds the ring's MQD. The early-return that skips an already-seen guilty fence compared "ring->guilty_fence == guilty_fence", which is also true when both are NULL. A non-guilty save therefore hit the early return and left ring_backup_entries_to_copy at 0, so the pending commands were dropped when the ring was rebuilt. Guard the early return with a non-NULL guilty_fence so a NULL fence never takes it and every unprocessed command is backed up. Signed-off-by: Jesse Zhang <Jesse.Zhang@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-10-01drm/amdgpu: Delete unimplemented IH soft_reset() codeTimur Kristóf
The soft_reset() function for IH (interrupt handler) blocks of Vega and newer have never been implemented, and there are no plans to implement them. Let's delete these functions, they don't do anything and also aren't called from anywhere. Acked-by: Christian König <christian.koenig@amd.com> Signed-off-by: Timur Kristóf <timur.kristof@gmail.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-10-01drm/amdgpu: Delete SI/CIK/VI IH soft_reset() codeTimur Kristóf
The code for SI/CIK/VI IH (interrupt handler) IP blocks has a soft_reset() function for each block. These functions are not called from anywhere and are dead code. It's unclear what the original intention was or why the IH block would ever need to be reset. All SI/CIK/VI GPUs have been working well for 10+ years without ever resetting the IH block so it's time to just delete the dead code. Signed-off-by: Timur Kristóf <timur.kristof@gmail.com> Acked-by: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-10-01drm/amdkfd: drop KFD_QUEUE_TYPE_DIQ noteLu Yao
Commit e1b73b64271d ("amdkfd: remove DIQ support") removed the KFD_QUEUE_TYPE_DIQ enumerator from enum kfd_queue_type but left its description behind in the note block. Fixes: e1b73b64271d ("amdkfd: remove DIQ support") Signed-off-by: Lu Yao <yaolu@kylinos.cn> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-10-01drm/amd/pm/si: Check AMD_IS_MOBILITY flag for PPSMC_SYSTEMFLAG_GPIO_DCTimur Kristóf
Unfortunately, some desktop boards eg. the FirePro D500 have the HARDWAREDC platform flag set and also have a battery power state configured in their VBIOS. This makes no sense for a desktop GPU and results in incorrect behaviour: the clocks are stuck at lowest. We observed that the kernel driver can work around the issue in two possible ways: 1. Set PPSMC_SWSTATE_FLAG_DC on all power states 2. Clear PPSMC_SYSTEMFLAG_GPIO_DC We think that the PPSMC_SYSTEMFLAG_GPIO_DC flag makes the SMC assume it's running on battery even though this is a desktop machine with no battery, and that's why it doesn't do DPM on power states without PPSMC_SYSTEMFLAG_GPIO_DC. Issue was uncovered by "Fix updating clock limits from power states" because previously the limits for the battery state were not tracked separately. However, battery power state has lower frequencies and voltages, so the kernel doesn't set the DC flag on the current power state anymore. That causes the SMC to be stuck on the lowest clocks. Let's clear PPSMC_SYSTEMFLAG_GPIO_DC on desktop GPUs. We can use the AMD_IS_MOBILITY flag to determine that. Fixes: e6c5d36756e7 ("drm/amd/pm/si: Fix updating clock limits from power states") Closes: https://gitlab.freedesktop.org/mesa/mesa/-/work_items/16352 Signed-off-by: Timur Kristóf <timur.kristof@gmail.com> Reviewed-by: Mario Limonciello <mario.limonciello@amd.com> Link: https://patch.msgid.link/20260923120354.1027996-1-timur.kristof@gmail.com Signed-off-by: Mario Limonciello <mario.limonciello@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-10-01 drm/amd/display: fix dml-wrapper file discovery for out-of-tree buildsPrike Liang
Anchor the object search to the DML wrapper top-level Makefile directory. This allows source files in subdirectories to be properly discovered and compiled with the required FPU CFLAGS, fixing SSE compilation errors. Signed-off-by: Prike Liang <Prike.Liang@amd.com> Reviewed-by: Leo Li <sunpeng.li@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-10-01drm/amdgpu: enlarge the waiting time for psp cmdShiwu Zhang
Just wait longer for psp command to complete. Signed-off-by: Shiwu Zhang <shiwu.zhang@amd.com> Signed-off-by: Mukul Joshi <mukul.joshi@amd.com> Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-10-01drm/amdgpu: disable XNACK replay for all VMIDs on GC 12.1.0 A0Alex Sierra
XNACK is not supported on A0. Updating RETRY_DISABLE only for the VMID in use gives unreliable control, so all VMIDs must be programmed identically. Set SH_MEM_CONFIG.RETRY_DISABLE = 1 on rev_id 0 for every VMID in both constants init and compute VMID init, so XNACK replay is off from device boot up. Signed-off-by: Alex Sierra <alex.sierra@amd.com> Reviewed-by: Mukul Joshi <mukul.joshi@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-10-01drm/amdgpu: Delete unimplemented DM soft_reset() codeTimur Kristóf
The soft_reset() function for the DCE / DCN blocks has never been implemented, and there are no plans to implement it. Let's delete this function, it doesn't do anything and also isn't called from anywhere. Acked-by: Christian König <christian.koenig@amd.com> Signed-off-by: Timur Kristóf <timur.kristof@gmail.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-10-01drm/amd/display: Mark DCE 6.4 as not APUTimur Kristóf
DCE 6.4 is found in Oland chips, which were advertised as low-end gaming GPUs in 2013~2015 and then have been sold as low-end workstation GPUs until 2017~2019. These are not APUs. Fixes: 7c15fd86aaec ("drm/amd/display: dc/dce: add initial DCE6 support (v10)") Signed-off-by: Timur Kristóf <timur.kristof@gmail.com> Reviewed-by: Mario Limonciello <mario.limonciello@amd.com> Link: https://patch.msgid.link/20260923122033.1046651-3-timur.kristof@gmail.com Signed-off-by: Mario Limonciello <mario.limonciello@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-10-01drm/amd/display: Fix fast updates on DCE 8.1Timur Kristóf
DCE8 should use legacy fast updates. This was already set for DCE 8.0 and 8.3, but it seems that DCE 8.1 (found in Kaveri chips) was forgotten. This fix should be backported to all kernel versions that have "Refactor fast update to use new HWSS build sequence", but this patch won't apply cleanly to older kernels due to another refactor in "Remove dc param from check_update". Fixes: 0baae6246307 ("drm/amd/display: Refactor fast update to use new HWSS build sequence") Fixes: 9ec11bb842b6 ("drm/amd/display: Remove dc param from check_update") Signed-off-by: Timur Kristóf <timur.kristof@gmail.com> Reviewed-by: Mario Limonciello <mario.limonciello@amd.com> Link: https://patch.msgid.link/20260923122033.1046651-2-timur.kristof@gmail.com Signed-off-by: Mario Limonciello <mario.limonciello@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-10-01drm/amd/display: Fix fast updates on DCE 6.xTimur Kristóf
DCE6 should use legacy fast updates, just like all DCE8 - DCN2. Set that flag for DCE 6.0, 6.1 and 6.4 (all DCE6 versions). Technically DCE6 should have been included when the fast update code was refactored, but it just happened to work until now. A recent commit "Attach only plane updates that actually changed" has exposed this issue because with that commit, DC accidentally took the new fast update code path for DCE6 as well, which caused it to boot into a black screen with a flip done timeout. This fix should be backported to all kernel versions that have "Refactor fast update to use new HWSS build sequence", but this patch won't apply cleanly to older kernels due to another refactor in "Remove dc param from check_update". Fixes: 0baae6246307 ("drm/amd/display: Refactor fast update to use new HWSS build sequence") Fixes: 9ec11bb842b6 ("drm/amd/display: Remove dc param from check_update") Signed-off-by: Timur Kristóf <timur.kristof@gmail.com> Reviewed-by: Mario Limonciello <mario.limonciello@amd.com> Link: https://patch.msgid.link/20260923122033.1046651-1-timur.kristof@gmail.com Signed-off-by: Mario Limonciello <mario.limonciello@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-10-01drm/amd/display: Preserve eDP mode on initial ASSR failureArthur Heymans
Commit 56d8ce9d8c17 ("drm/amd/display: Apply correct panel mode when reinitializing hardware") made ASSR failure fall back to the default panel mode unless eDP mode had previously been applied. However, dc_link is zero-initialized and DP_PANEL_MODE_DEFAULT is zero. Before the first call to dp_set_panel_mode(), panel_mode therefore looks like a previously applied default mode. If ASSR setup fails during the first link training attempt, the driver incorrectly trains the eDP link using the default scrambling mode. On a Google Vilboz Chromebook running self-built coreboot firmware and PSP verstage, this leaves the panel mostly black with corrupted output along the top edge. Track whether panel_mode has actually been initialized, and only consult the saved mode after it has been applied. This retains the recovery behavior while preserving eDP mode during initial link training. Fixes: 56d8ce9d8c17 ("drm/amd/display: Apply correct panel mode when reinitializing hardware") Assisted-by: Pi:gpt-5.6-sol Reviewed-by: George Zhang <george.zhang@amd.com> Reviewed-by: Alex Hung <alex.hung@amd.com> Signed-off-by: Arthur Heymans <arthur@aheymans.xyz> Tested-by: Dan Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-10-01drm/amd/display: Default HDMI RGB output to limited range on CTA modesAdrian Betschart
With the Broadcast RGB property at Automatic, amdgpu_dm_get_output_color_space() selects COLOR_SPACE_SRGB for RGB output, so DC neither compresses the pixels nor, without a QS-capable sink, signals full range in the AVI InfoFrame. A sink that follows CTA-861 treats the default quantization of a CTA video format as limited and expands 16-235 to 0-255: everything below 16 is crushed to black, everything above 235 clips. Follow the CTA-861 default for Automatic instead, as the DRM HDMI state helper (hdmi_is_limited_range()) and i915 do: limited range on an HDMI sink for CTA modes other than 640x480, full range elsewhere. Full and Limited keep their explicit meaning. The same rule applies to the BT.2020 RGB branch. With commit 892659399f64 ("drm/amd/display: Propagate HDMI RGB quantization selectability") the AVI InfoFrame then carries the matching Q value on sinks that support selection. Measured on a Radeon RX 7600 (DCN 3.2.1) driving a JVC DLA-RS4100 at 1920x1080p24 RGB 12 bpc: the sink reports the signal as limited range while the picture shows crushed shadows; rendering limited range in the client makes it match a reference source. The KUnit fixtures that reach amdgpu_dm_get_output_color_space() now carry a connector, since Automatic reads its display_info, and five cases cover the new rule. Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/5796 Reviewed-by: George Zhang <george.zhang@amd.com> Signed-off-by: Adrian Betschart <adrian.betschart@cinemaone.ch> Assisted-by: Claude Code:claude-fable-5-1 Tested-by: Dan Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-10-01drm/amd/display: drop INLINE_IFN_KUNITAlbert Esteve
This helper was originally static inline. INLINE_IFN_KUNIT only added inline for KUnit builds, which dropped that hint from production. There is no equivalent in kunit/visibility.h, and tests do not need one: they call the exported symbol from another translation unit. Use an unconditional inline with VISIBLE_IF_KUNIT instead so production stays static inline. kernel-doc already strips inline, so the dedicated xform can go too. Reviewed-by: George Zhang <george.zhang@amd.com> Signed-off-by: Albert Esteve <aesteve@redhat.com> Tested-by: Dan Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-10-01drm/amdgpu/gmc: Use amdgpu_gmc_handle_retry_fault() for GMC v12.1Timur Kristóf
Use the same helper for GMC v12.1 that is used by other GMC IP block versions. No functional changes intended. Just code cleanup. Signed-off-by: Timur Kristóf <timur.kristof@gmail.com> Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com> Acked-by: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-10-01drm/amd/display: replace EXPORT_IF_KUNIT with EXPORT_SYMBOL_IF_KUNITAlbert Esteve
Switch exports of KUnit-only helpers to EXPORT_SYMBOL_IF_KUNIT. Unlike EXPORT_IF_KUNIT, which used EXPORT_SYMBOL(), the standard macro places symbols in the EXPORTED_FOR_KUNIT_TESTING namespace. Add MODULE_IMPORT_NS() to the AMD DC test files so loadable tests can still resolve those helpers. Suggested-by: Maxime Ripard <mripard@kernel.org> Reviewed-by: George Zhang <george.zhang@amd.com> Signed-off-by: Albert Esteve <aesteve@redhat.com> Tested-by: Dan Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-10-01drm/xe: Include error-injection.h for ALLOW_ERROR_INJECTION()Petr Pavlu
Several drivers/gpu/drm/xe/*.c files use ALLOW_ERROR_INJECTION(), which is defined in asm-generic/error-injection.h. They currently rely on this header being included indirectly through linux/module.h -> linux/error-injection.h. Add the missing includes in preparation for removing the linux/error-injection.h include from linux/module.h. Remove also the linux/fault-injection.h include, which commit 91b2c42c214f ("drm/xe: Use fault injection infrastructure to find issues at probe time") mistakenly used to provide the definition of ALLOW_ERROR_INJECTION(). Reviewed-by: Francois Dugast <francois.dugast@intel.com> Signed-off-by: Petr Pavlu <petr.pavlu@suse.com>
2026-10-01drm/i915: Include error-injection.h for ALLOW_ERROR_INJECTION()Petr Pavlu
Several drivers/gpu/drm/i915/*.c files use ALLOW_ERROR_INJECTION(), which is defined in asm-generic/error-injection.h. They currently rely on this header being included indirectly through linux/module.h -> linux/error-injection.h. Add the missing includes in preparation for removing the linux/error-injection.h include from linux/module.h. Reviewed-by: Francois Dugast <francois.dugast@intel.com> Acked-by: Jani Nikula <jani.nikula@intel.com> Signed-off-by: Petr Pavlu <petr.pavlu@suse.com>
2026-10-01drm/vc4: Use kvmalloc_objs() for the BO cache size listMaíra Canal
The BO cache size list has one entry per BO page count, so its size scales with the largest BO ever freed. A 64 MiB BO already needs at least an order-6 allocation, which fails under fragmentation and triggers a warn_alloc() splat on BO close: page allocation failure: order:7, mode:0x40cc0(GFP_KERNEL|__GFP_COMP) Call trace: ... warn_alloc+0x118/0x190 __alloc_pages_slowpath+0x4a8/0x520 ... __kmalloc_noprof+0x3ac/0x5d8 vc4_free_object+0x128/0x370 [vc4] drm_gem_object_handle_put_unlocked+0xb8/0x158 [drm] drm_gem_object_release_handle+0x74/0xe8 [drm] drm_gem_handle_delete+0x6c/0xa8 [drm] drm_gem_close_ioctl+0x34/0x50 [drm] The list doesn't need physically contiguous memory. Use kvmalloc_objs() so large lists can fall back to vmalloc(), avoiding the allocation failure. Fixes: c826a6e10644 ("drm/vc4: Add a BO cache.") Reviewed-by: Thadeu Lima de Souza Cascardo <cascardo@igalia.com> Link: https://patch.msgid.link/20260930190721.1897264-2-mcanal@igalia.com Signed-off-by: Maíra Canal <mcanal@igalia.com>
2026-10-01drm/vc4: Free the BO cache size list on teardownMaíra Canal
vc4_bo_cache_destroy() purges the cached BOs but never frees the size list, leaking it on every unbind. Fixes: c826a6e10644 ("drm/vc4: Add a BO cache.") Assisted-by: LLM Reviewed-by: Thadeu Lima de Souza Cascardo <cascardo@igalia.com> Link: https://patch.msgid.link/20260930190721.1897264-1-mcanal@igalia.com Signed-off-by: Maíra Canal <mcanal@igalia.com>
2026-10-01drm/xe/mmio: Fix xe_mmio_wait32() to honor delay/sleep maximumsAlan Previn
Check for overflow in udelay use in __xe_mmio_wait32 and avoid growing delays becoming intollerably large by capping the in-loop wait time. v7: - Change assisted-by to "LLM" (Rodrigo). - Move the max-wait macro to outside the function (Rodrigo). v6: - Fix commit message to remove items dropped in v5. Fix the use of MAX_UDELAY_MS for microsecond unit. (Shasiko review). v5: - Simplify: don't introduce additional redesign and use min_t with a backoff to cap wait. (Rodrigo). v4: - Simplify using poll_timeout_us and poll_timeout_us_atomic and update all callers to never use a param for atomic (Jani) v3: - Use div64_s64 kernel API for 32-bit vs 64-bit division. v2: - Fixed checkpatch failure. - Added helper for 64-bit DIV_ROUND_UP on 32-bit CPU (Shasiko review). Fixed bug max range in usleep_range(Shasiko review) Fixes: 5c09bd6ccd41 ("drm/xe/mmio: Move xe_mmio_wait32() to xe_mmio.c") Signed-off-by: Alan Previn <alan.previn.teres.alexis@intel.com> Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com> Assisted-by: LLM Link: https://patch.msgid.link/20260929192037.2233429-2-alan.previn.teres.alexis@intel.com Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
2026-10-01drm/xe: Bump prefetch BO LRU for already-valid rangesHimal Prasad Ghimiray
A valid prefetch range skips migration and binding, so nothing refreshes its backing BOs on the LRU. Add xe_svm_range_prefetch_lru_bump(), which re-faults with no_dma_map and bumps each backing BO, and call it on the valid path. v2 - Make function failsafe (Matt/Sashiko AI comment) - Add stub for function Suggested-by: Matthew Brost <matthew.brost@intel.com> Reviewed-by: Matthew Brost <matthew.brost@intel.com> Link: https://patch.msgid.link/20261001033602.3166274-10-himal.prasad.ghimiray@intel.com Signed-off-by: Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com> Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
2026-10-01drm/xe: Bump prefetch BO LRU via GPUSVM devmem callbackHimal Prasad Ghimiray
Add xe_svm_devmem_lru_bump() and set it as drm_gpusvm_ctx.devmem_fn in the prefetch worker so each backing BO is moved to the LRU tail during get_pages. v2: - Guard xe_svm_devmem_lru_bump() against foreign device-memory allocations before casting to xe_bo: return early when devmem_allocation->ops != &dpagemap_devmem_ops. A shared device_private_page_owner can hand us another driver's allocation. (Matthew Brost / Sashiko AI review) - Add stub for function (CI) v3: - Guard xe_svm_devmem_lru_bump() body with CONFIG_DRM_XE_PAGEMAP; it references dpagemap_devmem_ops and to_xe_bo(), which only exist when PAGEMAP is enabled. Fixes the build with GPUSVM=y, PAGEMAP=n. (Sashiko AI review) v4: - Fix xe_svm_devmem_lru_bump() kernel-doc to explain the locking (Matt) Suggested-by: Matthew Brost <matthew.brost@intel.com> Reviewed-by: Matthew Brost <matthew.brost@intel.com> Link: https://patch.msgid.link/20261001033602.3166274-9-himal.prasad.ghimiray@intel.com Signed-off-by: Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com> Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
2026-10-01drm/gpusvm: Add devmem callback to get_pagesHimal Prasad Ghimiray
Add an optional drm_gpusvm_ctx.devmem_fn, invoked for each device-memory allocation backing the range's faulted pages. It runs under the notifier lock and independently of the DMA map, so it also fires with no_dma_map. Adjacent pages of one allocation are coalesced, so the callback must be idempotent. v2 Reset last to NULL for non-devmem pages(Sashiko/Matt) v3 Run drm_gpusvm_pages_valid_unlocked() on the map_dma path even when devmem_fn is set, so an invalidated range's stale inline mapping is reset. Suggested-by: Matthew Brost <matthew.brost@intel.com> Reviewed-by: Matthew Brost <matthew.brost@intel.com> Link: https://patch.msgid.link/20261001033602.3166274-8-himal.prasad.ghimiray@intel.com Signed-off-by: Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com> Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
2026-10-01drm/pagemap: Add helper to access backing devmem allocationHimal Prasad Ghimiray
drm_pagemap_zdd is private, so add drm_pagemap_page_to_devmem() to let callers get the drm_pagemap_devmem backing a device-private/coherent page. Add a NULL stub for !CONFIG_ZONE_DEVICE. Cc: Matthew Brost <matthew.brost@intel.com> Reviewed-by: Matthew Brost <matthew.brost@intel.com> Link: https://patch.msgid.link/20261001033602.3166274-7-himal.prasad.ghimiray@intel.com Signed-off-by: Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com> Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
2026-10-01drm/xe/guc: Rewind the LRC ring head when replaying a ULLS jobVarun Gupta
On GT reset replay, guc_exec_queue_start() rewinds the software ring tail to the first unsignalled job's head and sets the LRC tail to the LRC head. This assumes the saved head has not passed an unstarted job, which holds for ordinary submission as the CS cannot run past a job it has not executed. A ULLS job's slot is covered by a tail its predecessor published from within the ring, so the CS can consume the slot and idle without the job having run, leaving the saved head past it. On replay the job is re-emitted behind the head, the context restarts with head == tail and the job never starts. Rewind the LRC head to the job's head as well when the first pending job is a ULLS job, so the re-emitted job is ahead of it. Non-ULLS replay is unchanged. Fixes: 40c756bdbbee ("drm/xe: Add ULLS migration job support to GuC submission") Cc: Matthew Brost <matthew.brost@intel.com> Assisted-by: LLM Signed-off-by: Varun Gupta <varun.gupta@intel.com> Reviewed-by: Matthew Brost <matthew.brost@intel.com> Signed-off-by: Matthew Brost <matthew.brost@intel.com> Link: https://patch.msgid.link/20260930094031.3365707-8-varun.gupta@intel.com Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
2026-10-01drm/xe/guc: Publish the ring tail when replaying a chained ULLS jobVarun Gupta
A chained ULLS job skips the ring tail write in submit_exec_queue() since its predecessor's postamble has already published it from within the ring. After a GT reset the context is re-registered with scheduling disabled and that postamble is gone, so nothing publishes the replayed job's tail: the context is enabled with head == tail and the job never starts. On the kernel migration queue the second timeout wedges the device. Publish the tail for a chained job when the queue is not enabled. This is the state in which submit_exec_queue() already sends the scheduling enable H2G instead of relying on a resident context, and the tail write precedes that H2G. guc_exec_queue_stop() clears ENABLED on reset and register_exec_queue() does not set it, so the first replayed ULLS job always takes this path; its re-emitted postamble then publishes the next tail as usual. With the queue enabled nothing changes. job->restore_replay does not identify this case, it is only set on the SR-IOV VF pause/unpause path. Fixes: 40c756bdbbee ("drm/xe: Add ULLS migration job support to GuC submission") Cc: Matthew Brost <matthew.brost@intel.com> Assisted-by: LLM Signed-off-by: Varun Gupta <varun.gupta@intel.com> Reviewed-by: Matthew Brost <matthew.brost@intel.com> Signed-off-by: Matthew Brost <matthew.brost@intel.com> Link: https://patch.msgid.link/20260930094031.3365707-7-varun.gupta@intel.com Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
2026-10-01drm/xe: Park on the ULLS semaphore before publishing the next job's tailVarun Gupta
The ULLS postamble publishes the next job's ring tail and only then parks on that job's semaphore. The CS fetches ring contents up to the tail while parked, so it can fetch the next job's slot while it still holds padding NOOPs. When the CPU later writes the job and signals the semaphore, the CS executes the stale fetch, drains to the tail and idles. The job never runs and its fence never signals. This is hit whenever the CS parks before the next chained job is written, e.g. when there is a pause between entering ULLS and the next migration job. A lost ULLS_EXIT is silent as the next job's seqno write covers its fence, but a lost ULLS_ACTIVE hangs the migration queue and the subsequent kernel job timeout wedges the device. Park first and publish the tail after the wait. The CS never fetches beyond RING_TAIL, so the next slot cannot be fetched until the job is in place. This puts the non-posted tail write on the wake-up path, which the original order was chosen to avoid, but that order is not safe. Fixes: 6ec0b87160be ("drm/xe: Add ULLS migration job support to ring ops") Cc: Matthew Brost <matthew.brost@intel.com> Assisted-by: LLM Signed-off-by: Varun Gupta <varun.gupta@intel.com> Reviewed-by: Matthew Brost <matthew.brost@intel.com> Signed-off-by: Matthew Brost <matthew.brost@intel.com> Link: https://patch.msgid.link/20260930094031.3365707-6-varun.gupta@intel.com Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
2026-10-01drm/xe: Add focused VM teardown and page fault tracingDaniel Charles
Trace the start of VM teardown and ASID removal so late page faults can be correlated with the VM lifecycle. Emit one failure event for all page fault errors. Include the existing page fault reason alongside the errno. Keep the trace set focused by avoiding separate events for userptr pin attempts, individual close phases, ASID lookup rejection, and faults during shutdown. v2: Fix checkpatch warnings. v3: Pass xe to the page fault tracepoint and print VM mode as dma-fence/preempt-fence/fault (Matt) Assisted-by: GitHub Copilot using Claude Sonnet 5 Signed-off-by: Daniel Charles <daniel.charles@intel.com> Reviewed-by: Matthew Brost <matthew.brost@intel.com> Signed-off-by: Matthew Brost <matthew.brost@intel.com> Link: https://patch.msgid.link/20260930164645.1243801-1-daniel.charles@intel.com Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
2026-10-01drm/xe/vm: Do not dma_fence_put zero fences in err_out pathJonathan Cavitt
It is not necessary to iterate over and dma_fence_put current_fence fences in the err_out path of ops_execute because current_fences cannot be non-zero when jumping to that section of code. Caught by static analysis. Signed-off-by: Jonathan Cavitt <jonathan.cavitt@intel.com> Cc: Matthew Brost <matthew.brost@intel.com> Cc: Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com> Cc: Shuicheng Lin <shuicheng.lin@intel.com> Cc: Maarten Lankhorst <dev@lankhorst.se> Reviewed-by: Matthew Brost <matthew.brost@intel.com> Signed-off-by: Matthew Brost <matthew.brost@intel.com> Link: https://patch.msgid.link/20260929205606.1076177-1-jonathan.cavitt@intel.com Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
2026-10-01drm/xe: Implement print vfunc for page fault info loggingBrian Nguyen
Add a print vfunc to xe_pagefault_ops so different producer backends can log specific relevant debug info while keeping the consumer layer free of potential backend-specific formatting logic. Consumer-specific error prints are handled by passing as input into the vfunc. v2: - Decode producer specific fields for print message. (Matthew) - Combine consumer and producer prints to one print call. (Sashiko) v3: - Change assert to WARN_ON_ONCE. (Matthew) Suggested-by: Stuart Summers <stuart.summers@intel.com> Signed-off-by: Brian Nguyen <brian3.nguyen@intel.com> Reviewed-by: Matthew Brost <matthew.brost@intel.com> Cc: Matthew Brost <matthew.brost@intel.com> Signed-off-by: Matthew Brost <matthew.brost@intel.com> Link: https://patch.msgid.link/20260928222241.3815153-2-brian3.nguyen@intel.com Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>