summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/amd/display/amdgpu_dm/tests
AgeCommit message (Collapse)Author
3 daysdrm/amd/display: Use FreeSync v3 infopacket for sinks above 255 HzCooper Morgan
Native DP, eDP, and HDMI sinks get the v1 FreeSync infopacket unless they are a whitelisted PCON or support Replay. v1 holds each refresh rate in one byte, so a sink whose range goes above 255 Hz cannot be told its real maximum. The v3 packet carries the high bits in PB11/PB12. The AMD VSDB version is already stored for every DP, eDP, and HDMI sink. Send v3 when the sink advertises AMD VSDB v3 and its maximum refresh rate is above 255 Hz. The choice follows the sink's maximum rather than the current mode, so such a sink gets v3 at every mode and the packet version stays fixed per sink. Sinks whose maximum is 255 Hz or less are unchanged. Tested with this series backported to v7.2.13 on an MSI MAG 271QPX32 (AMD VSDB v3, 48-320 Hz) over DP 1.4 on an RX 9070 XT: 320 Hz shows a correct picture, and with VRR active the refresh rate tracks frame caps of 300, 270, and 100 Hz. At 240 Hz, where the sink now gets v3 instead of v1, the picture is correct and VRR tracks a 100 Hz cap. Link: https://gitlab.freedesktop.org/drm/amd/-/issues/5988 Reviewed-by: Harry Wentland <harry.wentland@amd.com> Signed-off-by: Cooper Morgan <ext-github@cwooper.dev> Signed-off-by: Wayne Lin <Wayne.Lin@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> (cherry picked from commit e1c2682397f2f8f40eada17c817b5d3b300124b6) Cc: stable@vger.kernel.org
3 daysdrm/amd/display: Saturate refresh rates in v1/v2 FreeSync infopacketsCooper Morgan
The v1 and v2 FreeSync infopackets carry the minimum and maximum refresh rate in one byte each, and build_vrr_infopacket_data_v1() casts the rate in Hz to unsigned char. On a sink whose range goes above 255 Hz the value wraps: a 320 Hz mode is advertised as a 64 Hz maximum. Sinks that treat the field as authoritative misbehave once the wrapped value lands inside their range. An MSI MAG 271QPX32 (48-320 Hz) over native DP looks like a ~720p image upscaled to the full screen at 320 Hz and runs its self-test pattern at 305-315 Hz, while 300 Hz (wrapping to 44 Hz, below its minimum) is fine. Capping the EDID range at 255 Hz, so the packet says 255, gives a correct picture at 320 Hz. Saturate the fields at 255 Hz instead of wrapping. Capping v1 at 255 as a fallback was suggested by oystersuki in the linked issue. Fixes: 98e6436d3af5 ("drm/amd/display: Refactor FreeSync module") Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/5988 Reviewed-by: Harry Wentland <harry.wentland@amd.com> Signed-off-by: Cooper Morgan <ext-github@cwooper.dev> Signed-off-by: Wayne Lin <Wayne.Lin@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> (cherry picked from commit 8f91c13d9a14085216725f60b55546fce5c2dd19) Cc: stable@vger.kernel.org
3 daysdrm/amd/display: Hold the VRR vblank reference only on active CRTCsHugo Sales
amdgpu_dm_handle_vrr_transition() takes a vblank reference when a CRTC state turns VRR on and drops it when a later state turns it off. It only looks at freesync_config.state, and disabling a CRTC keeps that state, so a suspend or DPMS off with VRR active keeps the reference On resume, drm_atomic_helper_resume() first calls drm_mode_config_reset(), which swaps the CRTC state for a zeroed one. The restored state then goes from VRR_STATE_UNSUPPORTED to active and takes a second reference, and the first is never dropped. The vblank irq stays on for good, so the CRTC never idles and PSR is never entered A VRR change on a disabled CRTC can't take the reference at all, since vblank is off there and drm_crtc_vblank_get() fails with a WARN On a Cezanne laptop with VRR always on, each suspend added one to the eDP CRTC's vblank refcount, and it stayed at 1 rather than 0 after VRR was turned off again Treat VRR as active for the reference only while the CRTC is active too. Disabling the CRTC then drops it and enabling it takes it again, which balances suspend, resume and DPMS, and the get only happens once manage_dm_interrupts() has turned vblank on Fixes: 66b0c973d7f7 ("drm/amd/display: Prevent vblank irq disable while VRR is active. (v3)") Reviewed-by: Ivan Lipski <ivan.lipski@amd.com> Signed-off-by: Hugo Sales <hugo@hsal.es> Signed-off-by: Wayne Lin <Wayne.Lin@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> (cherry picked from commit 4232ec2333ab3ef16520b399b30d50f17ceb9c63) Cc: stable@vger.kernel.org
3 daysdrm/amd/display: Add the AUX backlight minimum once on the custom curveHugo Sales
On an AUX backlight, convert_brightness_from_user() maps the user level through the ATIF custom brightness curve with convert_custom_brightness(), which rescales the result to user_min..user_max. convert_brightness_from_user() then rescales it again, from 0..user_max to user_min..user_max, so the minimum goes in twice. On the 1..512 nits AUX fallback range, a request for 0 gives 1998 millinits instead of 1000 Rescale the curve's output to 0..user_max and leave the offset to the caller Fixes: 8dbd72cb7900 ("drm/amd/display: Export full brightness range to userspace") Reviewed-by: Ray Wu <ray.wu@amd.com> Signed-off-by: Hugo Sales <hugo@hsal.es> Signed-off-by: Wayne Lin <Wayne.Lin@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> (cherry picked from commit 5f95ef2cfd208ca7efe446abfc9e3144dc5ce4fa) Cc: stable@vger.kernel.org
3 daysdrm/amd/display: Apply the HDMI RGB range default only to HDMI signalsAdrian Betschart
Since d23f735d0eac, Broadcast RGB "Automatic" selects limited range on CTA modes when display_info.is_hdmi is set. That flag comes from an HDMI VSDB in the EDID and says nothing about the link, so a native DisplayPort monitor whose EDID carries an HDMI VSDB now gets limited range on CTA modes too. Monitors that ignore the DP range signal show grey blacks, where 7.2 sent full range. Require an HDMI signal as well, as the original commit intended. DP++ passive adapters drive an HDMI signal and keep the HDMI behaviour; native DP, DP MST and active DP-to-HDMI converters get full range again. Reported and analysed by Andrés Rodríguez in the issue below. Fixes: d23f735d0eac ("drm/amd/display: Default HDMI RGB output to limited range on CTA modes") Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/6052 Reviewed-by: Wayne Lin <Wayne.Lin@amd.com> Signed-off-by: Adrian Betschart <adrian.betschart@cinemaone.ch> Signed-off-by: Wayne Lin <Wayne.Lin@amd.com> Assisted-by: Claude Code:claude-opus-5-5 Signed-off-by: Alex Deucher <alexander.deucher@amd.com> (cherry picked from commit 39f37a2346410a33edf4af17a873ac96bb5244ce) Cc: stable@vger.kernel.org # 7.3
12 daysMerge tag 'devm_kmalloc_obj-v7.4-rc2' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux Pull devm_kmalloc_obj conversion from Kees Cook: - treewide refresh of kmalloc_obj() conversions - devm_kmalloc_obj conversion rules added to Coccinelle scripting - treewide conversion of devm_kmalloc() family to devm_kmalloc_obj() * tag 'devm_kmalloc_obj-v7.4-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux: treewide: Convert devm_kmalloc() family to the devm_kmalloc_obj() family coccinelle: kmalloc_obj: Include devm_kmalloc_obj conversion rules treewide: refresh kmalloc_obj() conversions
2026-11-05treewide: refresh kmalloc_obj() conversionsKees Cook
Refresh the tree with run of the existing Coccinelle rules in scripts/coccinelle/api/kmalloc_objs.cocci, now that they also convert arrays of multi-byte integers. The conversions break down as: 435 kzalloc_objs() 169 kmalloc_objs() 52 kvzalloc_objs() 47 kzalloc_obj() 42 kvmalloc_objs() 8 kmalloc_obj() 2 kzalloc_flex() 2 kvmalloc_flex() and 37 existing kmalloc_obj() family calls drop a redundant GFP_KERNEL. Build tested with allmodconfig on x86_64 with GCC 16.2.0, and, together with the devm_kmalloc_obj() conversion that follows, on x86_64, arm64, i386, arm, riscv, s390, m68k, mips, parisc, sparc, loongarch, arc, xtensa, and openrisc with GCC 16.2.0 with no new warnings. Signed-off-by: Kees Cook <kees+treewide@kernel.org>
2026-11-04drm/amd/display: Accept HDMI 2.2 FRL rates from the sink EDIDFangzhi Zuo
[Why] get_max_frl_rate() converts the DRM lane count / per-lane rate pair back into the FRL rate index used by DC, but it only knows the rates up to 12 Gbps. A sink advertising 16, 20 or 24 Gbps per lane therefore falls into the else branch and reports edid_caps.max_frl_rate = 0. [How] Map the remaining 4-lane rates to the matching hdmi_frl_link_rate values (16 Gbps -> 7, 20 Gbps -> 8, 24 Gbps -> 9) and extend the KUnit coverage alongside the existing per-rate cases. 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> (cherry picked from commit 175fcf337795cccc52242e20c5a88ac4a51ebc22)
2026-10-07drm/amd/display: Don't replace a sink mode that shares the native totalsAdrian Betschart
decide_crtc_timing_for_drm_display_mode() copies the native mode's CRTC timing into the requested mode when clock, htotal and vtotal match. That is meant for the modes amdgpu inserts itself: amdgpu_dm_create_common_mode() duplicates the native mode and changes only hdisplay and vdisplay, so those are sent with the native timing and scaled. A sink can also offer a real mode with the same clock and totals as its native mode. CTA-861 VIC 102 (4096x2160@60) and VIC 97 (3840x2160@60) both use 594 MHz and 4400x2250. With 3840x2160@60 as the preferred mode, a 4096x2160@60 request goes out with the 3840x2160 timing and the framebuffer scaled into it (dst 3840x2025 at y=67), while the AVI InfoFrame still carries VIC 102. A JVC projector then reports 3840x2160 and shows a corrupted right edge. 4096x2160@24, whose totals differ, is sent and displayed correctly. Inserted modes keep the native sync positions; a real mode with its own active width does not. Compare those too, so only inserted modes are patched. Fixes: 4562236b3bc0 ("drm/amd/dc: Add dc display driver (v2)") Signed-off-by: Adrian Betschart <adrian.betschart@cinemaone.ch> Assisted-by: Claude-Code:claude-opus-5-5 Tested-by: Dan Wheeler <daniel.wheeler@amd.com> Reviewed-by: Roman Li <roman.li@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-10-02Revert "drm/amd/display: replace EXPORT_IF_KUNIT with EXPORT_SYMBOL_IF_KUNIT"Alex Deucher
This reverts commit b6b813e046e475bb3fe209d74f1df70033b5b98e. This series breaks the build when CONFIG_KUNIT=y and CONFIG_DRM_AMD_DC_KUNIT_TEST=n. When CONFIG_KUNIT=y, the functions are not static, but when CONFIG_DRM_AMD_DC_KUNIT_TEST=n, they should be. Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-10-01drm/amd/display: Try RGB before YCbCr 4:4:4 in stream validationAdrian Betschart
amdgpu_dm_create_validate_stream_for_sink() walks encoding_order[] and uses the first encoding that validates. YCbCr 4:4:4 is listed before RGB, so an HDMI sink that advertises 4:4:4 gets YCbCr 4:4:4 whenever the "color format" property is left at AUTO, even though RGB fits the same link. That contradicts the documented AUTO behaviour for HDMI in enum drm_connector_color_format (RGB, falling back to YCbCr 4:2:0 only when the bandwidth is not available or the mode is 4:2:0-only), which the amdgpu implementation of the property also describes. It also leaves the "Broadcast RGB" property without effect on such sinks, since the quantization range it selects only applies to RGB output. Try RGB first. The mask still holds every encoding the sink supports, so a mode that cannot carry RGB falls back exactly as before. For reference, v7.2 picked RGB here unless YCbCr 4:4:4 was forced through debugfs, while earlier kernels picked YCbCr 4:4:4 for any HDMI sink that advertised it. Fixes: 0b0ff65d3ca1 ("drm/amd/display: Refactor stream validation") Suggested-by: Adolfo Rodrigues <adolfotregosa@gmail.com> Assisted-by: Claude Code:claude-fable-5-1 Signed-off-by: Adrian Betschart <adrian.betschart@cinemaone.ch> Reviewed-by: Fangzhi Zuo <jerry.zuo@amd.com> Tested-by: Adolfo Rodrigues <adolfotregosa@gmail.com> Tested-by: Daniel Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-10-01drm/amd/display: Skip HDMI FRL status polling while link is downFangzhi Zuo
[WHY] Hotplugging an HDMI FRL sink can wedge DMCUB when a poll-driven retrain lands on a link whose PHY has just been torn down. The status polling path can program PHY EQ on the disabled PHY, after which the sink SCDC reads back version 0 and the display fails to light up. [HOW] Skip FRL status polling unless the link is actively driving a stream. The check runs under dc_lock, so it is serialized with link detection and modesets while the PHY is being torn down. Signed-off-by: Fangzhi Zuo <jerry.zuo@amd.com> Reviewed-by: Harry Wentland <harry.wentland@amd.com> Tested-by: Dan Wheeler <daniel.wheeler@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: 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: 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-09-23drm/amd/display: Fix KUnit checkpatch warningsAlex Hung
[WHY] Clean up the AMDGPU DM KUnit tests after checkpatch reported an invalid sizeof(void) allocation, typed kzalloc patterns, and a repeated word in a kernel-doc summary. Clarify the test name that covers an active CRTC state transition. [HOW] - Use sizeof(cpu_ptr) for the fake CPU pointer allocation. - Replace typed kzalloc(sizeof(*object), ...) calls with kzalloc_obj(*object, ...) in the connector, IRQ, plane, and atomic-state tests. - Rename the CRTC active-state test and update its kernel-doc and suite registration. Assisted-by: Copilot:GPT-5.6-Luna Reviewed-by: Jerry Zuo <jerry.zuo@amd.com> Signed-off-by: Alex Hung <alex.hung@amd.com> Signed-off-by: George Zhang <george.zhang@amd.com> Tested-by: Dan Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-09-23drm/amd/display: Fix KUnit writeback warningsAlex Hung
[WHY] Writeback mode tests call drm_mode_probed_add without holding mode_config.mutex, producing a warning for every generated mode. [HOW] Hold the mutex around writeback mode enumeration and release it before checking the returned count or inspecting the generated modes. Assisted-by: Copilot:GPT-6-Astra Reviewed-by: Bhawanpreet Lakha <bhawanpreet.lakha@amd.com> Signed-off-by: Alex Hung <alex.hung@amd.com> Signed-off-by: George Zhang <george.zhang@amd.com> Tested-by: Dan Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-09-23drm/amd/display: Fix KUnit DM warningsAlex Hung
[WHY] Vblank and interrupt-management tests need discoverable CRTCs with complete vblank callbacks and balanced teardown. [HOW] Add the callbacks, link the fake CRTCs, and register cleanup actions to disable vblank before unlinking. Pass the CRTC directly so cleanup does not reinterpret two different fixture types through one layout. Assisted-by: Copilot:GPT-6-Astra Reviewed-by: Bhawanpreet Lakha <bhawanpreet.lakha@amd.com> Signed-off-by: Alex Hung <alex.hung@amd.com> Signed-off-by: George Zhang <george.zhang@amd.com> Tested-by: Dan Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-09-23drm/amd/display: Fix KUnit MST warningsAlex Hung
[WHY] The MST add-connector fixture registers an unmanaged master connector but does not clean it up before its KUnit-owned storage is released. [HOW] Register a KUnit action after successful connector initialization to run drm_connector_cleanup before freeing the master connector. Assisted-by: Copilot:GPT-6-Astra Reviewed-by: Bhawanpreet Lakha <bhawanpreet.lakha@amd.com> Signed-off-by: Alex Hung <alex.hung@amd.com> Signed-off-by: George Zhang <george.zhang@amd.com> Tested-by: Dan Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-09-23drm/amd/display: Fix KUnit IRQ warningsAlex Hung
[WHY] IRQ tests leave vblank active when removing their fake CRTCs, causing warnings during DRM device teardown. [HOW] Turn off initialized vblank before unlinking each test CRTC in the existing cleanup action. Assisted-by: Copilot:GPT-6-Astra Reviewed-by: Bhawanpreet Lakha <bhawanpreet.lakha@amd.com> Signed-off-by: Alex Hung <alex.hung@amd.com> Signed-off-by: George Zhang <george.zhang@amd.com> Tested-by: Dan Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-09-23drm/amd/display: Fix KUnit helper warningsAlex Hung
[WHY] The real connector fixture lacks atomic state callbacks required by DRM connector initialization. [HOW] Install the DRM atomic connector duplicate and destroy state helpers alongside the existing reset callback. Assisted-by: Copilot:GPT-6-Astra Reviewed-by: Bhawanpreet Lakha <bhawanpreet.lakha@amd.com> Signed-off-by: Alex Hung <alex.hung@amd.com> Signed-off-by: George Zhang <george.zhang@amd.com> Tested-by: Dan Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-09-23drm/amd/display: Fix KUnit VRR warningsAlex Hung
[WHY] The VRR transition test needs a discoverable CRTC and balanced vblank teardown. Assertion failures must not leave freed CRTCs linked. [HOW] Supply a vblank counter callback and link the test CRTC. Register a KUnit cleanup action to disable vblank and unlink it on every exit. Assisted-by: Copilot:GPT-6-Astra Reviewed-by: Bhawanpreet Lakha <bhawanpreet.lakha@amd.com> Signed-off-by: Alex Hung <alex.hung@amd.com> Signed-off-by: George Zhang <george.zhang@amd.com> Tested-by: Dan Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-09-23drm/amd/display: Fix KUnit cursor warningAlex Hung
[WHY] The cursor offset test binds a CRTC without a framebuffer, triggering a plane-state consistency warning before the intended offset check. [HOW] Provide a test framebuffer in the new plane state while retaining the invalid offset and its expected rejection. Assisted-by: Copilot:GPT-6-Astra Reviewed-by: Bhawanpreet Lakha <bhawanpreet.lakha@amd.com> Signed-off-by: Alex Hung <alex.hung@amd.com> Signed-off-by: George Zhang <george.zhang@amd.com> Tested-by: Dan Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-09-23drm/amd/display: Fix KUnit CRTC warningsAlex Hung
[WHY] Incomplete CRTC callbacks and vblank teardown cause DRM warnings in CRTC tests. [HOW] Provide the required CRTC callbacks, link fake CRTCs for vblank lookup, and register cleanup actions to disable vblank before unlinking them. Assisted-by: Copilot:GPT-6-Astra Reviewed-by: Bhawanpreet Lakha <bhawanpreet.lakha@amd.com> Signed-off-by: Alex Hung <alex.hung@amd.com> Signed-off-by: George Zhang <george.zhang@amd.com> Tested-by: Dan Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-09-23drm/amd/display: Fix KUnit connector warningsAlex Hung
[WHY] Connector mode population without mode_config.mutex produces warning stack traces. Legacy property reads also warn on atomic DRM devices. [HOW] Lock mode-population calls and release the mutex before assertions. Read stored property values with the atomic-compatible default getter. Assisted-by: Copilot:GPT-6-Astra Reviewed-by: Bhawanpreet Lakha <bhawanpreet.lakha@amd.com> Signed-off-by: Alex Hung <alex.hung@amd.com> Signed-off-by: George Zhang <george.zhang@amd.com> Tested-by: Dan Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-09-23drm/amd/display: Drop redundant amdgpu_dm_irq testsAlex Hung
[WHAT] Thirteen tests in the amdgpu_dm_irq suite only re-ran a path that another test already covered, and five more repeated setup that the fixtures added by the preceding patches now provide. [HOW] Delete the tests whose executed path is a strict subset of another's, and fold the remaining duplicated setup onto the shared fixtures. Assisted-by: Copilot:Claude-Opus-5 Reviewed-by: Bhawanpreet Lakha <bhawanpreet.lakha@amd.com> Signed-off-by: Alex Hung <alex.hung@amd.com> Signed-off-by: George Zhang <george.zhang@amd.com> Tested-by: Dan Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-09-23drm/amd/display: Test HPD RX downstream handlingAlex Hung
[WHAT] handle_hpd_rx_irq() left its whole post-detect block untested apart from a failing re-detect, and never dispatched a CP_IRQ. [HOW] Add four tests covering a failing connection-type probe, a connector forced on that is emulated instead of detected, a successful re-detect that notifies userspace, and a CP_IRQ that must be handed to the HDCP work queue for the connector that raised it. Assisted-by: Copilot:Claude-Opus-5 Reviewed-by: Bhawanpreet Lakha <bhawanpreet.lakha@amd.com> Signed-off-by: Alex Hung <alex.hung@amd.com> Signed-off-by: George Zhang <george.zhang@amd.com> Tested-by: Dan Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-09-23drm/amd/display: Test HPD handler HDCP and detectAlex Hung
[WHAT] handle_hpd_irq_helper() never ran its HDCP reset, its forced connector branch or its successful re-detect branch. [HOW] Add a minimal HDCP work queue fixture and three tests: an HPD on a driver that carries an HDCP work queue, which must reset the display and flag the connector state; a connector forced on that reports no connection and is emulated instead of detected; and a successful re-detect that notifies userspace. Assisted-by: Copilot:Claude-Opus-5 Reviewed-by: Bhawanpreet Lakha <bhawanpreet.lakha@amd.com> Signed-off-by: Alex Hung <alex.hung@amd.com> Signed-off-by: George Zhang <george.zhang@amd.com> Tested-by: Dan Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-09-23drm/amd/display: Test HDMI HPD debounce re-detectAlex Hung
[WHAT] amdgpu_dm_hdmi_hpd_debounce_work() only ran with detection failing, so neither outcome of the sink comparison that decides whether an HPD toggle was spurious was covered. [HOW] Add a fixture for the debounce work item and two tests: a re-detect finding the same sink, which re-enables internally without notifying userspace, and one finding a different sink, which sends the hotplug event. Assisted-by: Copilot:Claude-Opus-5 Reviewed-by: Bhawanpreet Lakha <bhawanpreet.lakha@amd.com> Signed-off-by: Alex Hung <alex.hung@amd.com> Signed-off-by: George Zhang <george.zhang@amd.com> Tested-by: Dan Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-09-23drm/amd/display: Test HPD RX offload work branchesAlex Hung
[WHAT] dm_handle_hpd_rx_offload_work() was covered only for its automated-test and link-loss branches. The connection-type failure, the GPU-reset drop, the MST message-ready drain and the forced reconnect were never entered. [HOW] Add a fixture that builds a queued offload work item on a DisplayPort link and four tests: a failing connection-type probe, a device already in reset, a deferred UP_REQ_MSG_RDY drained through an AUX that fails every transfer, and an automated test whose timing changed, which forces the connector off and back on. The last one registers the DRM device so the hotplug uevent helpers find a sysfs minor on the primary node. Assisted-by: Copilot:Claude-Opus-5 Reviewed-by: Bhawanpreet Lakha <bhawanpreet.lakha@amd.com> Signed-off-by: Alex Hung <alex.hung@amd.com> Signed-off-by: George Zhang <george.zhang@amd.com> Tested-by: Dan Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-09-23drm/amd/display: Test VRR pageflip completionAlex Hung
[WHAT] dm_pflip_high_irq() only ever ran with VRR inactive, so the scanout position query and the front-porch path that queues the pageflip event on the vblank event list were never reached. [HOW] Add a fake timing generator reporting a scanout position past the start of the front porch, plus a fixture that puts a submitted flip on an active-VRR stream. Assisted-by: Copilot:Claude-Opus-5 Reviewed-by: Bhawanpreet Lakha <bhawanpreet.lakha@amd.com> Signed-off-by: Alex Hung <alex.hung@amd.com> Signed-off-by: George Zhang <george.zhang@amd.com> Tested-by: Dan Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-09-23drm/amd/display: Test unassigned OTG CRTC lookupAlex Hung
[WHAT] amdgpu_dm_get_crtc_by_otg_inst() had no test for an OTG instance of -1, so its WARN_ON guard and the fallback to the first CRTC were never executed. [HOW] Add dm_test_get_crtc_by_otg_inst_unassigned_otg(), which installs a CRTC as mode_info.crtcs[0] and asserts the lookup returns it rather than walking the CRTC list. Assisted-by: Copilot:Claude-Opus-5 Reviewed-by: Bhawanpreet Lakha <bhawanpreet.lakha@amd.com> Signed-off-by: Alex Hung <alex.hung@amd.com> Signed-off-by: George Zhang <george.zhang@amd.com> Tested-by: Dan Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-09-23drm/amd/display: Test MST topology startAlex Hung
[WHAT] Add a KUnit test to cover dm_helpers_dp_mst_start_top_mgr() its success path. [HOW] Mark the topology manager as already in MST mode, so drm_dp_mst_topology_mgr_set_mst() returns success without touching the AUX channel or queueing the link probe work, and the helper reports that MST was started. Assisted-by: Copilot:Claude-Opus-5 Reviewed-by: Bhawanpreet Lakha <bhawanpreet.lakha@amd.com> Signed-off-by: Alex Hung <alex.hung@amd.com> Signed-off-by: George Zhang <george.zhang@amd.com> Tested-by: Dan Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-09-23drm/amd/display: Test AUX transfer pathsAlex Hung
[WHAT] Add KUnit tests for the AUX paths of dm_helper_dmub_aux_transfer_sync(), dm_helpers_read_mccs_caps() and dm_helpers_mccs_vcp_set(). Only their early returns and the plain I2C branch were covered before. [HOW] dm_helper_dmub_aux_transfer_sync() is called with HPD connected so it forwards the payload to the DMUB transfer. dc->link_count is zero, so the async transfer is rejected and the engine-acquire error is reported. Both MCCS helpers pick their DDC adapter from link->aux_mode. Add a fake AUX channel that ACKs every I2C-over-AUX transaction and counts the sized writes, then route the shared MCCS fixture through it. The VCP set completes on the first write. The VCP request gets an empty reply, so every attempt is retried and the request finally fails. Assisted-by: Copilot:Claude-Opus-5 Reviewed-by: Bhawanpreet Lakha <bhawanpreet.lakha@amd.com> Signed-off-by: Alex Hung <alex.hung@amd.com> Signed-off-by: George Zhang <george.zhang@amd.com> Tested-by: Dan Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-09-23drm/amd/display: Test EDID helper pathsAlex Hung
[WHAT] Add KUnit tests for three EDID paths in amdgpu_dm_helpers.c the SDC panel PSR PHY power-down quirk in apply_edid_quirks(), the HDMI compliance-auto branch of dm_helpers_parse_edid_caps(), and the VBIOS fallback and corrupt-EDID paths of dm_helpers_read_local_edid(). [HOW] apply_edid_quirks() is driven twice with the SDC panel ids, once on a DisplayPort signal and once on eDP, showing the quirk is embedded-only. dm_helpers_parse_edid_caps() runs against an HDMI connector whose hdmi_comp_auto flag is set, so the FRL and FRL DSC debug options are forced on and the quirk is recorded in the panel patch. dm_helpers_read_local_edid() is given an embedded link with no DDC line, so it falls back to the EDID hardcoded in the VBIOS embedded panel info that the existing fake dc_bios supplies. A second test corrupts the base block checksum served by the fake AUX DDC, so the read fails, the real checksum is written back and EDID_BAD_CHECKSUM is reported. Assisted-by: Copilot:Claude-Opus-5 Reviewed-by: Bhawanpreet Lakha <bhawanpreet.lakha@amd.com> Signed-off-by: Alex Hung <alex.hung@amd.com> Signed-off-by: George Zhang <george.zhang@amd.com> Tested-by: Dan Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-09-23drm/amd/display: Fold plane state check testsAlex Hung
[WHAT] Reduce the four viewport KUnit tests for amdgpu_dm_plane_helper_check_state() to one, and the three rejection tests for amdgpu_dm_plane_atomic_check() to one. [HOW] Drive the viewport cases from a table of CRTC rectangles and display sizes, and rebuild the atomic state between the helper-check, color pipeline conflict and scaling-info sub-cases of the atomic check test. Assisted-by: Copilot:Claude-Opus-5 Reviewed-by: Bhawanpreet Lakha <bhawanpreet.lakha@amd.com> Signed-off-by: Alex Hung <alex.hung@amd.com> Signed-off-by: George Zhang <george.zhang@amd.com> Tested-by: Dan Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-09-23drm/amd/display: Fold plane scaling and cursor testsAlex Hung
[WHAT] Reduce the two KUnit tests for amdgpu_dm_plane_get_min_max_dc_plane_scaling() to one, and the two for amdgpu_dm_plane_get_cursor_position() to one. [HOW] Populate the fp16 scaling caps alongside the NV12 and ARGB8888 ones and query all three formats from one device, and append the oversized cursor rejection to the existing clipping test. Assisted-by: Copilot:Claude-Opus-5 Reviewed-by: Bhawanpreet Lakha <bhawanpreet.lakha@amd.com> Signed-off-by: Alex Hung <alex.hung@amd.com> Signed-off-by: George Zhang <george.zhang@amd.com> Tested-by: Dan Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-09-23drm/amd/display: Fold DCC block mode testsAlex Hung
[WHAT] Reduce the five KUnit tests for the GFX9 DCC block modes of amdgpu_dm_plane_fill_gfx9_attrs_from_modifiers() to one, and the three for amdgpu_dm_plane_fill_gfx12_attrs_from_modifiers() to one. [HOW] Drive both from a table of modifier bits and the expected HUBP independent block mode, allocating the device, DC and framebuffer once and resetting the tiling, DCC and address outputs per row. Assisted-by: Copilot:Claude-Opus-5 Reviewed-by: Bhawanpreet Lakha <bhawanpreet.lakha@amd.com> Signed-off-by: Alex Hung <alex.hung@amd.com> Signed-off-by: George Zhang <george.zhang@amd.com> Tested-by: Dan Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-09-23drm/amd/display: Fold DCC validation testsAlex Hung
[WHAT] Reduce the seven KUnit tests for amdgpu_dm_plane_validate_dcc() to three. [HOW] Split them into a table-driven test for the checks that run before the DC capability query and a table-driven test for the rejections that come out of it, leaving the success and scan-mapping test unchanged. Assisted-by: Copilot:Claude-Opus-5 Reviewed-by: Bhawanpreet Lakha <bhawanpreet.lakha@amd.com> Signed-off-by: Alex Hung <alex.hung@amd.com> Signed-off-by: George Zhang <george.zhang@amd.com> Tested-by: Dan Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-09-23drm/amd/display: Fold GFX6-8 tiling and modifier testsAlex Hung
[WHAT] Reduce the four KUnit tests for amdgpu_dm_plane_fill_gfx6_tiling_info_from_modifier() to one, and the three for amdgpu_dm_plane_calc_gfx6_mod() to one. [HOW] Build the linear, rejected, 1D tiled and 2D tiled modifiers as locals and decode them in sequence, and drive the micro tiled, GFX7-8 and GFX6 modifier calculations from two devices inside a single test. Assisted-by: Copilot:Claude-Opus-5 Reviewed-by: Bhawanpreet Lakha <bhawanpreet.lakha@amd.com> Signed-off-by: Alex Hung <alex.hung@amd.com> Signed-off-by: George Zhang <george.zhang@amd.com> Tested-by: Dan Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-09-23drm/amd/display: Fold GFX9 tiling info testsAlex Hung
[WHAT] Reduce the two KUnit tests for amdgpu_dm_plane_fill_gfx9_tiling_info_from_device() to one, and the three for amdgpu_dm_plane_fill_gfx9_tiling_info_from_modifier() to one. [HOW] Reprogram the device configuration and re-run the helper in sequence inside a single test per function, so the pre-10.3, 10.3-and-later, linear, pre-NV and NV-and-later cases all stay covered. Assisted-by: Copilot:Claude-Opus-5 Reviewed-by: Bhawanpreet Lakha <bhawanpreet.lakha@amd.com> Signed-off-by: Alex Hung <alex.hung@amd.com> Signed-off-by: George Zhang <george.zhang@amd.com> Tested-by: Dan Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-09-23drm/amd/display: Fold modifier append testsAlex Hung
[WHAT] Reduce the four KUnit tests for amdgpu_dm_plane_add_modifier() to two, and the two tests for amdgpu_dm_plane_add_modifier_dedup() to one. [HOW] Group the append and capacity-growth cases into one test and the NULL-list and allocation-failure cases into another, and run the duplicate-skip and NULL-list dedup cases in sequence within a single test. Assisted-by: Copilot:Claude-Opus-5 Reviewed-by: Bhawanpreet Lakha <bhawanpreet.lakha@amd.com> Signed-off-by: Alex Hung <alex.hung@amd.com> Signed-off-by: George Zhang <george.zhang@amd.com> Tested-by: Dan Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-09-23drm/amd/display: Fold plane modifier list testsAlex Hung
[WHAT] Reduce the six KUnit tests for amdgpu_dm_plane_get_plane_modifiers() to three, keeping every family dispatch covered. [HOW] Merge the GFX10.1, GFX10.3 and GFX12 cases into one table-driven test over the family and GC IP version, and merge the two RV cases into a table over the external revision id that selects the constant-encode modifier variants. Assisted-by: Copilot:Claude-Opus-5 Reviewed-by: Bhawanpreet Lakha <bhawanpreet.lakha@amd.com> Signed-off-by: Alex Hung <alex.hung@amd.com> Signed-off-by: George Zhang <george.zhang@amd.com> Tested-by: Dan Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-09-23drm/amd/display: Fold universal overlay format testAlex Hung
[WHAT] Reduce the two KUnit tests for amdgpu_dm_plane_get_plane_formats() to one. [HOW] Allocate a second plane cap with the DCN universal type in the existing test and check the overlay format count against it, then drop the standalone test. Assisted-by: Copilot:Claude-Opus-5 Reviewed-by: Bhawanpreet Lakha <bhawanpreet.lakha@amd.com> Signed-off-by: Alex Hung <alex.hung@amd.com> Signed-off-by: George Zhang <george.zhang@amd.com> Tested-by: Dan Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-09-23drm/amd/display: Fold blending tests into two casesAlex Hung
[WHAT] Reduce the five KUnit tests for amdgpu_dm_plane_fill_blending_from_plane_state() to two, keeping every covered path. [HOW] Turn the opaque, premultiplied and coverage cases into one table-driven test over the pixel blend mode, and fold the DCN 4.2 case into the global alpha test as a second table row selecting the DCE IP version. Assisted-by: Copilot:Claude-Opus-5 Reviewed-by: Bhawanpreet Lakha <bhawanpreet.lakha@amd.com> Signed-off-by: Alex Hung <alex.hung@amd.com> Signed-off-by: George Zhang <george.zhang@amd.com> Tested-by: Dan Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-09-23drm/amd/display: Select KUnit helpersAlex Hung
[WHAT] DRM_KUNIT_TEST_HELPERS has no prompt, so it can only be turned on by a select. DRM_AMD_DC_KUNIT_TEST merely depended on it, which forced the amdgpu_dm KUnit config to enable CONFIG_DRM_KUNIT_TEST as well and drag in the entire core DRM test suite. [HOW] Select DRM_KUNIT_TEST_HELPERS from DRM_AMD_DC_KUNIT_TEST, matching what DRM_KUNIT_TEST and DRM_TTM_KUNIT_TEST already do, and drop CONFIG_DRM_KUNIT_TEST from the amdgpu_dm kunitconfig. The amdgpu_dm tests now build standalone and a run executes only the amdgpu_dm suites. Assisted-by: Copilot:Claude-Opus-5 Reviewed-by: Bhawanpreet Lakha <bhawanpreet.lakha@amd.com> Signed-off-by: Alex Hung <alex.hung@amd.com> Signed-off-by: George Zhang <george.zhang@amd.com> Tested-by: Dan Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-09-22Merge tag 'amd-drm-next-7.4-2026-09-17' of ↵Dave Airlie
https://gitlab.freedesktop.org/drm/amdgpu/kernel into drm-next [airlied: fix two merge conflicts] amd-drm-next-7.4-2026-09-17: amdgpu: - SMU 14.x fix - DC IRQ fix - Runtime PM fix for P2P - RAS fix - PCIe reporting fix - DCN 6 fix - Device removal fix - DC MALL fix - Display KUNIT test fixes - More display KUNIT tests - GC 12.1 cleanup - DC RMCM refactor - Display forces RGB fix - DP MST fixes - USB4 fixes - Plane update fixes - DMUB updates - ISM fixes - DCN 4.2 updates - HDMI FRL updates - Add new trace events - SDMA soft reset updates - Update git trees in MAINTAINERS - UALink fixes - UserQ fixes - SDMA clean ups - Misc spelling fixes - Documentation fixes - ATOM range checks amdkfd: - GC 12.x fixes - Boundary checks - Mapping clear fix - GC 10 CU occupancy support - GC 12.1 fixes - XNACK fix - Partition fix radeon: - eDP fix for DCE3.2 iMacs Signed-off-by: Dave Airlie <airlied@redhat.com> From: Alex Deucher <alexander.deucher@amd.com> Link: https://patch.msgid.link/20260917203841.3881294-1-alexander.deucher@amd.com
2026-09-18Merge tag 'drm-misc-next-2026-09-17' of ↵Dave Airlie
https://gitlab.freedesktop.org/drm/misc/kernel into drm-next drm-misc-next for v7.4: UAPI Changes: ivpu: - add DRM_IVPU_CAP_CMDQ_SET_PRIORITY Cross-subsystem Changes: dma-fence: - fix documentation vga_switcheroo: - disconnect from fbcon; update fbcon from within DRM fbdev emulation Core Changes: atomic: - replace state reset callback with create_state throughout DRM core and drivers panic: - split into core and helpers sched: - clean up interface sysfs: - drop drm_class_device_register() Driver Changes: amdxdna: - fix BO handling arcpgu: - replace simple-display pipeline with regular atomic helpers aspeed: - replace simple-display pipeline with regular atomic helpers gm12u320: - replace simple-display pipeline with regular atomic helpers imagination: - various improvement to firmware interaction ivpu: - support command-queue priority ioctl mcde: - replace simple-display pipeline with regular atomic helpers p111: - replace simple-display pipeline with regular atomic helpers - drop unsupported alpha formats from primary plane panel: - edp: Add support for BOE NV140FHM-T0A - samsung: Share test-key helpers rcar-du: - support Renesas R-Car V4H DSC - dsi: Support larger transfers with AXI memory repaper: - replace simple-display pipeline with regular atomic helpers rockchip: - dsi: improve PHY timings ssd130x: - support Solomon SSD1351 OLED plus DT bindings - ssd133x: upgrade color format to RGB565 tve200: - replace simple-display pipeline with regular atomic helpers xen: - replace simple-display pipeline with regular atomic helpers Signed-off-by: Dave Airlie <airlied@redhat.com> From: Thomas Zimmermann <tzimmermann@suse.de> Link: https://patch.msgid.link/20260917090534.GA420415@2a02-2455-9062-2500-ec39-e8a6-193-9c05.dyn6.pyur.net
2026-09-17drm/amd/display: Atomize IRQ register read/modify/write opsLeo Li
[Why] The OTG_GLOBAL_SYNC_STATUS register controls various HW IRQ sources for the output timing generator (OTG). VUPDATE_NO_LOCK is one of them. To enable the IRQ, driver sets the VUPDATE_NO_LOCK_EN bit in the GLOBAL_SYNC_STATUS register. To ack the IRQ after it fires, the driver sets the VUPDATE_NO_LOCK_CLEAR bit in the same GLOBAL_SYNC_STATUS register. The bit sets are done through read/modify/write operations, which are not atomic. Thus, the following race is possible: Thread A: IRQ handler: *HW IRQ fires* # IRQ disable val = read(GLOBAL_SYNC_STATUS) unset(val, VUPDATE_NO_LOCK_EN) write(val, GLOBAL_SYNC_STATUS) # ACK reads VUPDATE_NO_LOCK_EN unset val1 = read(GLOBAL_SYNC_STATUS) set(val1, VUPDATE_NO_LOCK_CLEAR) # IRQ enable val = read(GLOBAL_SYNC_STATUS) set(val, VUPDATE_NO_LOCK_EN) write(val, GLOBAL_SYNC_STATUS) # BAD! clears VUPDATE_NO_LOCK_EN write(val1, GLOBAL_SYNC_STATUS) Regarding the tagged Fixes: change, it appears the change made this race more likely to occur. Since VUPDATE_NO_LOCK is now the sole IRQ source for vblank handling, a single race on high refresh panels can lead to a time out. [How] The GLOBAL_SYNC_STATUS register is only one example, other IRQ control registers also share the same scheme. On top of GLOBAL_SYNC_STATUS, let's clean up those as well. To keep things simple, Let's atomize the IRQ rmw ops via a single driver-wide spinlock. Due to the small scope of this lock, it is unlikely to cause noticeable overhead on top of all the existing locking within the IRQ set/handle paths. Since DM is responsible for locking, wrap dc_interrupt_set/ack with the spinlock in the new amdgpu_dm_irq_set/ack functions. Migrate/drop all references in DM to dc_interrupt_set/ack to use amdgpu_dm_irq_set/ack instead. Closes: https://gitlab.freedesktop.org/drm/amd/-/work_items/5616 Fixes: c87e6635d2db ("drm/amd/display: consolidate DCN vblank/flip handling onto vupdate_no_lock") Reviewed-by: Mario Limonciello <mario.limonciello@amd.com> Signed-off-by: Leo Li <sunpeng.li@amd.com> Signed-off-by: Chenyu Chen <chen-yu.chen@amd.com> Tested-by: Daniel Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-09-17drm/amd/display: Flush ISM work before releasing the streamRay Wu
[Why] ISM timers are not tied to the atomic commit, so a timer armed before a DPMS off can still fire after the stream is released. The external display check in dcn35_apply_idle_power_optimizations() loops over the active streams, so with none left it never runs and idle is allowed on an external-only system. [How] Wait out pending and in-flight ISM work before dc_stream_release(); dc_lock is not held there, so the sync wait is safe. Rename amdgpu_dm_ism_fini() to amdgpu_dm_ism_flush() and assert dc_lock is not held. Assisted-by: Cursor:Claude-Opus-5 Reviewed-by: Leo Li <sunpeng.li@amd.com> Signed-off-by: Ray Wu <ray.wu@amd.com> Signed-off-by: Chenyu Chen <chen-yu.chen@amd.com> Tested-by: Daniel Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>