summaryrefslogtreecommitdiff
path: root/drivers/gpu
AgeCommit message (Collapse)Author
2026-09-02drm/amd/display: Move cursor SDR white level calculation out of hwss executorTomasz Siemek
[WHY] Cursor SDR white level calculation is common across DCN generations and does not require an ASIC-specific HWSS implementation. Keeping it in the DCN10 HWSS extension duplicated generic policy in generation-specific code and made block sequence execution depend on mutable pipe context. [HOW] Move cursor SDR white level calculation into dc_hw_sequencer. Store the calculated DPP cursor attributes in the block sequence so execution only invokes set_optional_cursor_attributes. Reviewed-by: Ilya Bakoulin <ilya.bakoulin@amd.com> Signed-off-by: Tomasz Siemek <tomasz.siemek@amd.com> Signed-off-by: Alex Hung <alex.hung@amd.com> Tested-by: Dan Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-09-02drm/amd/display: Fix DPP PRE_GAM register offset on DCN60Alvin Lee
[WHY] dcn60 uses dpp50_set_pregam_state, which reads PRE_GAM through the dcn50_dpp_registers layout. PRE_GAM sat at a different offset in dcn50 (based on DCN401) vs dcn60 (based on DCN42), so the cast landed on the wrong register which causes the wrong address to be used [HOW] Rebase the DPP macro inheritance so PRE_GAM shares a common offset: DCN50 lists now inherit from DCN42, and DCN60 lists inherit from DCN50. The dcn60 struct layout is unchanged, so PRE_GAM aligns between the two and dpp50_set_pregam_state programs the correct address. Reviewed-by: Taimur Hassan <syed.hassan@amd.com> Signed-off-by: Alvin Lee <Alvin.Lee2@amd.com> Signed-off-by: Alex Hung <alex.hung@amd.com> Tested-by: Dan Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-09-02drm/amd/display: Remove fixpt and custom float duplicated codeSamson Tam
[WHY/HOW] fixpt31_32 and custom_float code is duplicated in SPL Remove duplicated code and refer back to dc Cleaned up swap, div64_s64 Move namespace defines to spl_namespace.h Suggested-by: Dave Airlie <airlied@redhat.com> Reviewed-by: Alvin Lee <alvin.lee2@amd.com> Signed-off-by: Samson Tam <Samson.Tam@amd.com> Signed-off-by: Alex Hung <alex.hung@amd.com> Tested-by: Dan Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-09-02drm/amd/display: Avoid NULL hubp deref for remaining mpcc_id assignmentJames Lin
Previous fix converted most mpcc_id assignments in dc_hw_sequencer.c from pipe_ctx->plane_res.hubp->inst to plane_res.mpcc_inst, but missed the update_visual_confirm and power_on_mpc_mem_pwr paths in hwss_build_fast_sequence(). On DCE ASICs the pipe owns no HUBP, so those two remaining hubp->inst reads can NULL-deref. Use mpcc_inst for the remaining two assignments, matching the rest of the function and avoiding the NULL pointer dereference (same issue addressed upstream by "avoid NULL hubp deref when filling mpcc_id on DCE"). Fixes: 8e4670efd6dd ("drm/amd/display: Use mpcc_id instead of hubp instance") Reviewed-by: Tomasz Siemek <tomasz.siemek@amd.com> Signed-off-by: James Lin <PingLei.Lin@amd.com> Signed-off-by: Alex Hung <alex.hung@amd.com> Tested-by: Dan Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-09-02drm/amd/display: Move custom float structures from opp.h to custom_float.hSamson Tam
[WHY] Currently it needs to include opp.h to access custom_float structures, which pulls in additional include files that are not necessary. [HOW] Move custom_float structures to custom_float.h, and include this header in opp.h. Add only os_types.h and fixed31_32.h in custom_float.h Suggested-by: Dave Airlie <airlied@redhat.com> Reviewed-by: Alvin Lee <alvin.lee2@amd.com> Signed-off-by: Samson Tam <Samson.Tam@amd.com> Signed-off-by: Alex Hung <alex.hung@amd.com> Tested-by: Dan Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-09-02drm/amd/display: Set gpuvm min page size to 4K on dcn35/36Roman Li
[WHY] Splash screen corruption on some 8K monitors. [HOW] Set GPUVM min page size to 4K for DCN35/36 to use the correct DML2 calculations, avoiding the corruption path observed during splash. Fixes: 115009d11ccf ("drm/amd/display: Add DCN35 DML2 support") Cc: Mario Limonciello <mario.limonciello@amd.com> Cc: Alex Deucher <alexander.deucher@amd.com> Reviewed-by: Alex Hung <alex.hung@amd.com> Signed-off-by: Roman Li <Roman.Li@amd.com> Signed-off-by: Alex Hung <alex.hung@amd.com> Tested-by: Dan Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-09-02drm/amd/display: Fix DCN5/6 DML2 compilation warningsIvan Lipski
[WHY] A kernel compilation warning was reported caused by upstream of DCN5/6. [HOW] Using plain integer as NULL pointer. Assign NULL to the VActiveLatencyHidingMargin/VActiveLatencyHidingUs pointer members in dml2_core_dcn5_funcs_mode_programming.c, and pass NULL for the pointer arguments to calculate_first_second_splitting() in dml2_pmo_dcn6_stage_optimizers.c. Fixes: 7f7d7ea1fa51 ("drm/amd/display: Add new sources for DCN6") Reviewed-by: Dillon Varone <dillon.varone@amd.com> Signed-off-by: Ivan Lipski <ivan.lipski@amd.com> Signed-off-by: Alex Hung <alex.hung@amd.com> Tested-by: Dan Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-09-02drm/amd/display: Test colorop error pathsAlex Hung
[WHAT] Add KUnit tests for the failure paths of amdgpu_dm_build_default_pipeline(): a failed allocation and a failed initialization at each of the eight pipeline steps. [HOW] Add struct amdgpu_dm_colorop_kunit_ops, a KUnit-only indirection table for the colorop allocation and the five DRM colorop constructors. The constructors cannot be made to fail through their arguments, so tests install a fake allocator and spies that delegate to the real constructors and override the return value of one selected call. Non-KUnit builds call the same functions directly. Assisted-by: Copilot:Claude-Opus-5 Reviewed-by: Bhawanpreet Lakha <bhawanpreet.lakha@amd.com> Signed-off-by: Alex Hung <alex.hung@amd.com> Tested-by: Dan Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-09-02drm/amd/display: Test ISM delayed workersAlex Hung
[WHAT] Add KUnit tests for dm_ism_delayed_work_func() and dm_ism_sso_delayed_work_func(). [HOW] Arm each worker through the FSM, drop dc_lock, then run the handler with flush_delayed_work(). Assisted-by: Copilot:Claude-Opus-5 Reviewed-by: Bhawanpreet Lakha <bhawanpreet.lakha@amd.com> Signed-off-by: Alex Hung <alex.hung@amd.com> Tested-by: Dan Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-09-02drm/amd/display: Test ISM idle exit armsAlex Hung
[WHAT] Add KUnit tests for the OPTIMIZED_IDLE and OPTIMIZED_IDLE_SSO previous-state arms of dm_ism_dispatch_power_state(). [HOW] Cascade into each idle state, post EXIT_IDLE_REQUESTED, then check that idle is disallowed and the idle period recorded. These arms run on a state departure rather than on entry, so a single event cannot reach them; the FSM has to occupy the idle state first. Driving both steps through amdgpu_dm_ism_commit_event() keeps the test on the real path instead of calling the dispatcher directly. Both arms end in FULL_POWER_RUNNING and both disallow idle, so the state alone does not tell them apart. Asserting ism->next_record_idx pins the side effect that matters: the idle period is added to the hysteresis history on the way out. Assisted-by: Copilot:Claude-Opus-5 Reviewed-by: Bhawanpreet Lakha <bhawanpreet.lakha@amd.com> Signed-off-by: Alex Hung <alex.hung@amd.com> Tested-by: Dan Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-09-02drm/amd/display: Test ISM idle commitAlex Hung
[WHAT] Add KUnit tests for the three idle-optimization commit arms of the ISM FSM: OPTIMIZED_IDLE, OPTIMIZED_IDLE_SSO and TIMER_ABORTED. [HOW] Record idle changes with a stub on dc->hwss.apply_idle_power_optimizations() and read the outcome from dc->idle_optimizations_allowed. DC already owns that callback, so it is the natural injection point. dc_allow_idle_optimizations() returns early when the requested state already matches, so the stub runs only on a real transition and its call count is the number of idle changes the FSM asked for. That count is what separates the three arms, which otherwise all leave idle in the same state. The remaining two commit calls need no double: dc_post_update_surfaces_to_stream() returns on !dc->optimized_required and amdgpu_dm_crtc_set_static_screen_optimze() stops in the replay and PSR event helpers when the link has neither feature enabled. Both are already no-ops on a test dc, so a double would only add upkeep. Assisted-by: Copilot:Claude-Opus-5 Reviewed-by: Bhawanpreet Lakha <bhawanpreet.lakha@amd.com> Signed-off-by: Alex Hung <alex.hung@amd.com> Tested-by: Dan Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-09-02drm/amd/display: Add debug bit for force p2cpmHansen Dsouza
[WHY] To allow per panel control of PHY settings. [HOW] Extend panel workaround bits and fields. Reviewed-by: Leo Chen <leo.chen@amd.com> Signed-off-by: Hansen Dsouza <Hansen.Dsouza@amd.com> Signed-off-by: Alex Hung <alex.hung@amd.com> Tested-by: Dan Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-09-02drm/amd/display: fix misspelling of "overridden"Linlin Yang
Fix misspelling of "overridden" (missing a 'd') in comments. No functional change. Signed-off-by: Linlin Yang <yanglinlin@kylinos.cn> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-09-02drm/amdgpu/ih7.0: Enable retry CAM on Navi 4 dGPUsTimur Kristóf
The retry CAM can filter interrupts which occur repeatedly, such as page fault interrupts when retry faults are enabled. This makes processing those interrupts much more efficient, because the CPU won't have to deal with processing the same interrupt repeatedly. Also change the doorbell range to actually enable the doorbell for the retry CAM. Signed-off-by: Timur Kristóf <timur.kristof@gmail.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-09-02drm/amdgpu/ih6.0: Enable retry CAM on Navi 3 dGPUsTimur Kristóf
The retry CAM can filter interrupts which occur repeatedly, such as page fault interrupts when retry faults are enabled. This makes processing those interrupts much more efficient, because the CPU won't have to deal with processing the same interrupt repeatedly. Enable the doorbell for the retry CAM. Also change the doorbell range to actually enable the doorbell for the retry CAM. Signed-off-by: Timur Kristóf <timur.kristof@gmail.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-09-02drm/amdgpu/vm: Use init PTE flags in amdgpu_vm_handle_fault()Timur Kristóf
PTE_IS_PTE seems necessary for handling retry faults on GFX12. For reference see: amdgpu_vm_pte_update_flags() that explains the problem svm_range_get_pte_flags() that uses the flag on GFX12 Signed-off-by: Timur Kristóf <timur.kristof@gmail.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-09-02drm/amdgpu/gmc12: Use AMDGPU_PTE_IS_PTE flag for init_pte_flags on GFX12.0Timur Kristóf
This flag seems to work around a "fault priority problem" and is necessary for handling faults on GFX12. The kernel seems unable to mitigate retry faults on GFX12 without this flag. For reference see: amdgpu_vm_pte_update_flags() that explains the problem svm_range_get_pte_flags() that uses the flag on GFX12 Signed-off-by: Timur Kristóf <timur.kristof@gmail.com> Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-09-02drm/amdgpu/gmc12: Pass cam_index to retry fault handlerTimur Kristóf
This is necessary if we want to make use of the filter CAM. Signed-off-by: Timur Kristóf <timur.kristof@gmail.com> Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-09-02drm/amdgpu/gmc11: Pass cam_index to retry fault handlerTimur Kristóf
This is necessary if we want to make use of the filter CAM. Signed-off-by: Timur Kristóf <timur.kristof@gmail.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-09-02drm/amdgpu/ih7.0: Use IH_SW_RING_SIZE for soft IH ring instead of PAGE_SIZETimur Kristóf
When there are a lot of retry faults happening, the soft IH ring can fill up really quickly and possibly overflow. PAGE_SIZE was too small, use IH_SW_RING_SIZE to match what other GPU generations are doing. Signed-off-by: Timur Kristóf <timur.kristof@gmail.com> Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com> Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-09-02drm/amdgpu/ih6.1: Use IH_SW_RING_SIZE for soft IH ring instead of PAGE_SIZETimur Kristóf
When there are a lot of retry faults happening, the soft IH ring can fill up really quickly and possibly overflow. PAGE_SIZE was too small, use IH_SW_RING_SIZE to match what other GPU generations are doing. Signed-off-by: Timur Kristóf <timur.kristof@gmail.com> Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com> Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-09-02drm/amdgpu/ih: Don't perturb HW registers when accessing soft IH ringTimur Kristóf
The soft IH ring is implemented entirely in software. We shouldn't read (or write) any HW registers when accessing it. Signed-off-by: Timur Kristóf <timur.kristof@gmail.com> Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-09-02drm/amdgpu/gfxhub: Enable retry fault interrupts in L2_PROTECTION_FAULT_CNTL2Timur Kristóf
Enable retry fault interrupts when initializing the GFXHUB system aperture registers. Needs to be done for each GFXHUB version, because none of them actually enabled this interrupt. This bit gates all retry fault functionality on Navi GPUs. According to a mailing list conversation with AMD engineers, this register field should have been initialized to 1 according to hardware documentation. But it has been confirmed that it is in fact initialized to 0 by default. I have personally confirmed on both Navi 31 and Navi 48 that the GPU does NOT send any retry fault interrupts without enabling this bit. Initially I wanted to program this field according to the gmc.noretry flag in the previous versions of this patch, but I was asked to just program it always to 1 instead. Signed-off-by: Timur Kristóf <timur.kristof@gmail.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-09-02drm/amdgpu: Respect noretry flag for retry faults on GFX12.1Timur Kristóf
When retry faults are disabled (amdgpu.noretry=1), we should program the RETRY_PERMISSION_OR_INVALID_PAGE_FAULT bit to zero. Note that retry faults are enabled by default on GFX12.1 so this just fixes the case when they are explicitly disabled. Signed-off-by: Timur Kristóf <timur.kristof@gmail.com> Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-09-02drm/amdgpu: require a job to schedule an IBAlex Deucher
Remove the old direct submit path. This simplifies the code. v2: remove more local variables Reviewed-by: Jesse Zhang <jesse.zhang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-09-02drm/amdgpu: fix Idle BOs list in VM debugfs status infoSunil Khatri
amdgpu_debugfs_vm_bo_status_info() prints the "Idle BOs" section by iterating lists->needs_update, the same list already printed just above under "Moved BOs". struct amdgpu_vm_bo_status has a dedicated idle list, populated whenever a BO's state machine settles, but it was never read here, so genuinely idle BOs never show up in the debugfs output and the "Idle BOs" section duplicates "Moved BOs" instead. Iterate lists->idle for the "Idle BOs" section. Fixes: 4cdbba5a16aa ("drm/amdgpu: restructure VM state machine v4") Signed-off-by: Sunil Khatri <sunil.khatri@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-09-02drm/amdgpu: use AMDGPU_GPU_PAGE_SHIFT instead of PAGE_SHIFTSunil Khatri
For different address types the variable PAGE_SHIFT might not work well and it's better to use the GPU specific one Signed-off-by: Sunil Khatri <sunil.khatri@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-09-02drm/amdgpu/userq: update the kernel docs for amdgpu_userq_fence_read_wptrSunil Khatri
update the kernel docs for amdgpu_userq_fence_read_wptr. Signed-off-by: Sunil Khatri <sunil.khatri@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-09-02drm/amdgpu: make amdgpu_vm_bo_lookup_mapping() take a raw addressSunil Khatri
amdgpu_vm_bo_lookup_mapping() expected callers to pre-shift the address to a page frame number before calling in, unlike its sibling functions amdgpu_vm_bo_map() and amdgpu_vm_bo_replace_map(), which accept a raw address and shift internally. This inconsistency meant every caller had to duplicate the same shift to make it pfn and many place the shift is not AMDGPU_GPU_PAGE_SHIFT but normal PAGE_SHIFT too. Move the shift inside amdgpu_vm_bo_lookup_mapping() and update all callers to stop pre-shifting, so the function's calling convention matches its siblings. Signed-off-by: Sunil Khatri <sunil.khatri@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-09-02drm/amdgpu: fix oversubscription timer for sr-iovEric Huang
The KFD/userq software oversubscription-notify timers added to replace GFX11 MES firmware's oversubscription_timer call amdgpu_mes_notify_unmap_queue(), which takes mes->mutex_hidden, the same lock add/remove_hw_queue() use. Under SR-IOV this call can block up to 9s (vs 2.1s bare metal), so MES round-trip latency goes up (world-switch contention) it stalls re-mapping queues and times out KFDQMTest.AllCpQueues. Keep the firmware timer enabled for SR-IOV VFs and skip the software timers there; the issue this works around is bare-metal only. Fixes: 590e26626106 ("drm/amdkfd: workaround 100% gpu usage issue for gfx11") Signed-off-by: Eric Huang <jinhuieric.huang@amd.com> Reviewed-by: Mario Limonciello <mario.limonciello@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-09-02drm/amd/display: Enable HDMI FRL by defaultFangzhi Zuo
FRL (Fixed Rate Link) is required to drive HDMI 2.1 high-bandwidth modes and is broadly supported on capable sinks, but it was left disabled unless a user explicitly opted in via the amdgpu.dcfeaturemask module parameter. Enable it by default by adding DC_FRL_MASK to the default amdgpu_dc_feature_mask value, keeping the mask semantics unchanged. Signed-off-by: Fangzhi Zuo <jerry.zuo@amd.com> Reviewed-by: Harry Wentland <harry.wentland@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-09-02drm/amdgpu: switch all IPs to using job for IBsAlex Deucher
Switch remaining direct submissions to using a job structure for IBs. This converts GFX, compute, SDMA, and VPE to using jobs. VCE, UVD, JPEG, and VCN already did. v2: fix missing ib pointer setup spotted by the kernel test robot v3: rebase Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Acked-by: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-09-02drm/amdgpu: Update queue reset support versionAmber Lin
Update queue reset required MES version for MES 12.1 to 0x7b since we change the implementation from detect-and-reset method to per-queue-reset method. Signed-off-by: Amber Lin <amber.lin@amd.com> Reviewed-by: Michael Chen <michael.chen@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-09-02drm/amdgpu/gfx8: only apply compute quantums to KCQsAlex Deucher
Don't apply to KIQ. Seems to cause problems on KIQ on some ARM platforms. Closes: https://gitlab.freedesktop.org/drm/amd/-/work_items/5658 Fixes: 91cf34bc5a55 ("drm/amdgpu/gfx8: align mqd settings with KFD") Reviewed-by: Jesse Zhang <jesse.zhang@amd.com> Reviewed-by: Kent Russell <kent.russell@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-09-02drm/amdgpu: correct oversubscription timer interval for gfx11Eric Huang
oversubscription_timer in MES is in micro second, so change the timer's interval in KFD/useq to micro second. Signed-off-by: Eric Huang <jinhuieric.huang@amd.com> Suggested-by: Leo Lin <Leo.Lin@amd.com> Reviewed-by: Mario Limonciello <mario.limonciello@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-09-02drm/amd/display: Enable HDMI ALLM for Gaming-VRRFangzhi Zuo
why: HDMI 2.1 Auto Low-Latency Mode (ALLM) lets a Source request the Sink's low-latency mode through the HF-VSIF. HDMI 2.1 Section 7.6.6 requires that when Gaming-VRR is enabled (VRR_EN=1) and the Sink advertises ALLM in the SCDS, the Source shall transmit the HF-VSIF and set ALLM_Mode=1. amdgpu never set ALLM_Mode, so this requirement was not met. how: - In update_freesync_state_on_stream(), set ALLM_Mode=1 in the HF-VSIF when Gaming-VRR is active (vrr state ACTIVE_VARIABLE/ACTIVE_FIXED, i.e. VRR_EN=1) and the sink advertises ALLM, per HDMI 2.1 Section 7.6.6, and push the updated HF-VSIF (vsp_infopacket) as a stream update. - ALLM is driven by the mandatory Gaming-VRR case. Signed-off-by: Fangzhi Zuo <Jerry.Zuo@amd.com> Signed-off-by: Tomasz Pakuła <tomasz.pakula.oficjalny@gmail.com> Reviewed-by: Harry Wentland <harry.wentland@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-09-02drm/amd/display: Add HDMI 2.1 VRR support for HF-VSDBFangzhi Zuo
why: HDMI 2.1 sinks advertise their VRR range in the HDMI Forum VSDB (HF-VSDB), but amdgpu derived FreeSync capability only from the AMD VSDB. Sinks that expose just the HDMI Forum VRR capability (e.g. HDMI compliance EDIDs) were therefore reported as not VRR capable. how: - In amdgpu_dm_update_freesync_caps(), when the AMD VSDB does not provide a valid FreeSync range, fall back to the HDMI 2.1 VRR range parsed by DRM core from the HF-VSDB (connector->display_info.hdmi.vrr_cap). VRRMAX = 0 means "up to the Base Refresh Rate"; when the EDID provides no monitor range maximum either, fall back to the Base Refresh Rate (the highest refresh-rate mode of the preferred timing) so a valid VRR range is still reported to userspace. - Add VRR debug logging along the FreeSync capability and config paths. Signed-off-by: Fangzhi Zuo <Jerry.Zuo@amd.com> Signed-off-by: Tomasz Pakuła <tomasz.pakula.oficjalny@gmail.com> Reviewed-by: Harry Wentland <harry.wentland@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-09-02drm/edid: parse HDMI 2.1 gaming (ALLM/VRR) capabilities from HF-VSDBTomasz Pakuła
Parse the HDMI 2.1 gaming-related capabilities advertised in the HDMI Forum VSDB (HF-VSDB) and expose them through struct drm_hdmi_info so drivers can consume them. Add struct drm_hdmi_vrr_cap describing the sink's VRR capabilities: Fast VActive (Quick Frame Transport), Negative M VRR, Cinema VRR, MDelta, and the VRRmin/VRRmax range, together with a "supported" flag derived from that range. Add the fapa_start_location and allm (Auto Low Latency Mode) flags to struct drm_hdmi_info. drm_parse_hdmi_gaming_info() reads byte 8 of the HF-VSDB for the FAPA/ALLM/FVA/CNMVRR/CinemaVRR/MDelta flags and bytes 9-10 for VRRmin/VRRmax. Per HDMI 2.1, VRR is considered supported when VRRmin is within 1-48 and VRRmax is either 0 (maximum based on the video mode) or >= 100. It is invoked from drm_parse_hdmi_forum_scds(), and the parsed values are logged for debugging. Signed-off-by: Tomasz Pakuła <tomasz.pakula.oficjalny@gmail.com> Signed-off-by: Fangzhi Zuo <Jerry.Zuo@amd.com> Tested-by: Bernhard Berger <bernhard.berger@gmail.com> Reviewed-by: Harry Wentland <harry.wentland@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-09-02drm/amdgpu: restrict BAR0 fallback read to SR-IOV VFs onlyMario Limonciello
The BAR0 fallback read path was introduced as a workaround for SR-IOV VFs where the VRAM aperture is not available during early init. Restrict this workaround to only SR-IOV VFs where it's needed. Reported-by: gloveless@jqluv.com Fixes: cba4928cdffa ("drm/amdgpu: reduce early full GPU access during SR-IOV init") Acked-by: Alex Deucher <alexander.deucher@amd.com> Link: https://patch.msgid.link/20260826185102.2269511-1-mario.limonciello@amd.com Signed-off-by: Mario Limonciello <mario.limonciello@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-09-02drm/amdgpu: Set queue reset method for GC 12.1Amber Lin
Explicitely set use_mmio_for_reset = false in gfx_v12_1_sw_init for using MES to perform queue/pipe reset Signed-off-by: Amber Lin <amber.lin@amd.com> Reviewed-by: Jesse Zhang <Jesse.Zhang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-09-02drm/amd/display: Add HDMI 2.1 FreeSync support for AMD VSDBFangzhi Zuo
why: HDMI FRL sinks were not parsed for the AMD VSDB and no VTEM info packet was emitted for them, so 2.1 FreeSync over HDMI FRL did not work. It is backward-compatible with 2.0 FreeSync. how: - Accept SIGNAL_TYPE_HDMI_FRL alongside SIGNAL_TYPE_HDMI_TYPE_A when parsing the AMD VSDB in amdgpu_dm_update_freesync_caps(). - Build and send the VTEM info packet via mod_build_infopacket_vtem() when the stream signal is HDMI FRL during the freesync state update. - Set the VTEM Data_Set_Length to 0 when no VTEM feature is enabled. build_infopacket_header_vtem() hardcodes Data_Set_Length = 4, so a VTEM with Data_Set_Length = 4 would be transmitted even when no VTEM feature is enabled (VRR_EN = 0 and no FVA), e.g. when the sink advertises VRRMIN = 0 and vrr_capable is false. This fails HDMI GCTS HF1-58 step 6.2. The VTEM must keep being transmitted every MTW while VRR is enabled (HF1-58 steps 8.1 and 8.3), so it cannot simply be suppressed per frame. Instead, follow the MLDS option in HDMI 2.1 10.10.2.4: keep transmitting the VTEM but set Data_Set_Length = 0 when no feature is enabled. When VRR becomes active the full Data_Set_Length = 4 payload with VRR_EN = 1 is sent as before. Signed-off-by: Fangzhi Zuo <Jerry.Zuo@amd.com> Reviewed-by: Harry Wentland <harry.wentland@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-09-02drm/amdkfd: Add TLB flush after MES queue eviction/suspensionPriya Hosur
MES (Micro Engine Scheduler) does not perform heavy-weight TLB invalidation after unmapping queues, unlike HWS which does this automatically. This causes a race condition where in-flight DMA descriptors can access memory that has been unmapped, leading to page faults and GPU queue hangs during SVM page migration. The issue manifests as KFDSVMRangeTest.MultiThreadMigrationTest failures on gfx1151 (Strix Point) with XNACK mode 1 enabled - the GPU compute queue hangs with packets submitted but never consumed. Add kfd_flush_tlb() calls after MES queue removal in two locations: - evict_process_queues_cpsch(): after all queues removed during eviction - suspend_queues(): after debug/criu queue suspension (with mem_fence barrier) This ensures all in-flight memory accesses from unmapped queues are flushed before memory is freed or migrated. Signed-off-by: Priya Hosur <Priya.Hosur@amd.com> Reviewed-by: Felix Kuehling <felix.kuehling@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-09-02drm/amd/ras: take a log batch id only once there is something to logXiang Liu
The id is claimed before the banks are read, so a poll that ends up logging nothing still burns one and leaves a gap that every reader of the log then has to walk over. Claim it when the first record of the batch is about to go in. Signed-off-by: Xiang Liu <xiang.liu@amd.com> Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-09-02drm/amd/ras: report how far a CPER record query gotXiang Liu
The caller walks the log with cper_start_id and resumes at cper_start_id + real_cper_num, but the reply only counts the ids that held a record. A batch id that holds nothing therefore never moves the caller forward, and every such id makes it read the next populated batch one more time. Count the ids covered instead. The rewind to the last populated batch when the query starts at the end has the same effect once the caller has drained the log, and the latest id is already reported by the snapshot query, so drop it. Signed-off-by: Xiang Liu <xiang.liu@amd.com> Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-09-02drm/amdgpu/userq: use fence_val instead or rptrSunil Khatri
In function amdgpu_userq_fence_signaled rptr is a confusing variabile name as it is a fence value written by the cp in the fence address and no where related to the rptr. Signed-off-by: Sunil Khatri <sunil.khatri@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-09-02drm/amdgpu/userq: use fence_val instead or rptrSunil Khatri
In function amdgpu_userq_fence_driver_process rptr is a confusing variable name as it is a fence value written by the cp in the fence address and no where related to the rptr. Signed-off-by: Sunil Khatri <sunil.khatri@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-09-02drm/amd/ras: report the banks the scrubber loggedXiang Liu
A bank carrying the scrub bit was found by the background scrubber rather than by an access, which is worth telling apart from the rest when reading a log. Signed-off-by: Xiang Liu <xiang.liu@amd.com> Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-09-02drm/amd/ras: drop the ras_ prefix from the ACA v5 file namesXiang Liu
The prefix marks the files that back a hardware IP block. ACA is a bank format rather than an IP, and the rest of its files are named after it alone, so the v5 pair is the odd one out. Signed-off-by: Xiang Liu <xiang.liu@amd.com> Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-09-02drm/amdgpu: use underscores in TLB fence driver and timeline namesPrike Liang
Replace spaces with hyphens in amdgpu_tlb_fence_get_driver_name() and amdgpu_tlb_fence_get_timeline_name(). Returning string literals with spaces makes ftrace fence events and debugfs fence entries visually ambiguous and harder to parse using standard log analysis tools. Signed-off-by: Prike Liang <Prike.Liang@amd.com> Acked-by: Alex Deucher <alexander.deucher@amd.com> Acked-by: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-09-02drm/amd/ras: skip poison banks read through the UE channelXiang Liu
Outside of UMC a bank with the poison bit set describes the consumption of an error that was already reported, not a new uncorrectable one. Injecting an uncorrectable error while a workload is running therefore buries the real bank under a dump of GFX poison banks collected from every other device of the hive. Signed-off-by: Xiang Liu <xiang.liu@amd.com> Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>