summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
10 daysdrm/amd/display: Reduce DML reinitialization when params don't changeClara Wong
[WHY] Reinitializing DML causes an extra ~8s delay in gaming mode preset switches on some systems [HOW] Don't reinitialize DML unless params/caps have changed Reviewed-by: Austin Zheng <austin.zheng@amd.com> Reviewed-by: Taimur Hassan <syed.hassan@amd.com> Signed-off-by: Clara Wong <Clara.Wong@amd.com> Signed-off-by: Wayne Lin <wayne.lin@amd.com> Tested-by: Dan Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 daysdrm/amd/display: hide Apple Studio Display secondary tileJerry Zuo
The Apple Studio Display exposes a 2x1 tiled panel over two SST DP links. The primary tile advertises the full 5120x2880 mode (with DSC on the bandwidth-sufficient link) while the secondary carries a per-tile 2560x2880 timing on a link without sufficient bandwidth. Report the non-primary tile connector as disconnected during detect so compositors only see the primary DP link and configure a single 5K mode instead of driving both tiled streams independently. Drive the behaviour from an EDID quirk: add a disable_second_tile panel patch that apply_edid_quirks() sets for the affected Apple Studio Display panel IDs (0xAE3A, 0xAE42, 0xAE46), and have detect() hide the secondary tile when the sink carries that quirk. Reviewed-by: Mario Limonciello <mario.limonciello@amd.com> Reviewed-by: Sun peng Li <sunpeng.li@amd.com> Signed-off-by: Jerry Zuo <jerry.zuo@amd.com> Signed-off-by: Wayne Lin <wayne.lin@amd.com> Tested-by: Dan Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 daysdrm/amd/display: Register DCN as a PMFW DF C-state client on DCN42Leo Chen
[Why] DCN must not gate DF C-state locally via the DCHUBBUB ALLOW_SELF_REFRESH controls: forcing a local "disallow" during MM-stutter re-entry can wedge the fabric and hang boot. When DCN is disallowing c-state or has invalid watermarks we should be explicit about it rather than using the watermark force selector. [How] Register DCN as a client of PMFW's DF C-state arbiter and signal over DALSMC whether DCN permits DF C-state; PMFW allows DF C-state only once every client (including DCN) has voted "allow". - dc_clocks.cstate_allow: last DCN vote acked by PMFW - clk_mgr_funcs::notify_cstate_disable(clk_mgr, disable) prepare_bandwidth and headless dc_power_down_on_boot vote Allow; hardware_release votes Disallow; init_clocks (D0 entry) only clears the cache (cstate_allow) so the next allow re-syncs with PMFW. Reviewed-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com> Signed-off-by: Leo Chen <leo.chen@amd.com> Signed-off-by: Wayne Lin <wayne.lin@amd.com> Tested-by: Dan Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 daysdrm/amd/display: Make dc_state_update const in commit pathWenjing Liu
[Why] The state-update commit path only reads the caller's update descriptor, it never mutates the dc_state_update root. Making the pointer const documents that contract. [How] Add const to the updates parameter of dc_update_state and dc_check_state_update. Mark the single-assignment locals in dc_update_state_init const and replace the memset plus field-by-field assignment with a compound literal initializer. Reviewed-by: Dominik Kaszewski <dominik.kaszewski@amd.com> Signed-off-by: Wenjing Liu <wenjing.liu@amd.com> Signed-off-by: Wayne Lin <wayne.lin@amd.com> Tested-by: Dan Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 daysdrm/amd/display: Wire probe commit path into dc_update_stateWenjing Liu
[Why] The dc_update_state commit interface and the dc_probe object model existed but were not connected: there was no path to validate, commit, and program a probe through the update pipeline, nor to read the result back. The measurement waits on OTG frame edges and must not block fast updates. [How] - Move the per-commit scratch off dc_stream_state onto a dc-owned pool; acquire at init, release on cleanup or prepare failure, serialized by the DM global lock every commit path already holds. - dc_update_state drives stream commits, probe-only commits, or both through one staged init/prepare/execute/cleanup loop with a null-arg guard. prepare releases the scratch slot on failure; cleanup releases it on success. - Probe prepare installs the absolute probe set in place; execute calls the perfmon programming hook in the unlocked window and latches results. - Add resource_validate_probe_set, a context-free achievability check shared by dc_validate_global_state (full update) and probe prepare (probe-only). - dc_state_get_status gains a probe status class with a probe filter and a by-type mapping; dc_validation_set gains probes/probe_count. Drop the dead actual_* fields from struct dc_qos_info. Reviewed-by: Dominik Kaszewski <dominik.kaszewski@amd.com> Signed-off-by: Wenjing Liu <wenjing.liu@amd.com> Signed-off-by: Wayne Lin <wayne.lin@amd.com> Tested-by: Dan Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 daysdrm/amd/display: Introduce program_perfmon hwss hook and BLS perfmon sequenceWenjing Liu
[Why] The hubbub perfmon peak-bandwidth path used a monolithic function combining counter configuration and enable in one call, and wrote results into a caller-supplied struct outside the dc_state model. A BLS-driven approach builds the measurement from stateless primitives, gates it to OTG frame boundaries, and stores results in dc_state. [How] - Rename the peak-BW vtable members from "unbounded_bandwidth" to "out_of_order_bandwidth" and split them into arm and start operations. - Add the full set of perfmon BLS primitives - param structs, union members, enum entries, executors, and hwss_add_* builders - for reset, arm, every start_measuring_* and every get_* operation. - Add dc_probe_status (valid, type, result union) plus probe_status[] to dc_state. - Replace the measure_memory_qos hook with program_perfmon(dc, context), which writes results into probe_status[]. - dc_get_qos_info no longer calls the removed hook. Reviewed-by: Dominik Kaszewski <dominik.kaszewski@amd.com> Signed-off-by: Wenjing Liu <wenjing.liu@amd.com> Signed-off-by: Wayne Lin <wayne.lin@amd.com> Tested-by: Dan Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 daysdrm/amd/display: Introduce dc_state_get_status unified status accessorWenjing Liu
[Why] dc_state_get_stream_status() is typed against streams only, leaving no extensible slot for future status classes. The public status accessor signature needs to stay stable as new status classes are added. [How] Add a dc_get_status_type bitmask and the dc_get_status_options / dc_state_status structs. Implement dc_state_get_status() to populate the output object per the options bitmask, and make dc_state_get_stream_status() a shim over it. Reviewed-by: Dominik Kaszewski <dominik.kaszewski@amd.com> Signed-off-by: Wenjing Liu <wenjing.liu@amd.com> Signed-off-by: Wayne Lin <wayne.lin@amd.com> Tested-by: Dan Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 daysdrm/amd/display: Refactor dc_validation_set array into single root structWenjing Liu
[Why] dc_validate_with_context() took a C array of per-stream elements plus a separate count. This flat array cannot be extended to carry global objects without widening the signature further. [How] Rename the per-stream element to dc_validation_stream, and make dc_validation_set a root struct holding streams[MAX_STREAMS] and stream_count. Update dc_validate_with_context() to take a single const dc_validation_set * and propagate the new shape through all DC-layer callers and helpers. Remove the never-implemented dce112_validate_with_context declaration and the orphaned dce100 forward-declare. No behavior change. Reviewed-by: Dominik Kaszewski <dominik.kaszewski@amd.com> Signed-off-by: Wenjing Liu <wenjing.liu@amd.com> Signed-off-by: Wayne Lin <wayne.lin@amd.com> Tested-by: Dan Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 daysdrm/amd/display: Introduce dc_update_state unified commit interfaceWenjing Liu
[Why] dc_update_planes_and_stream() is typed against surface/stream arrays only, leaving no extensible slot for future object classes. The public entry point names and signatures need to stay stable as new object classes are added. [How] Introduce dc_update_state() and dc_check_state_update(), both taking a dc_state_update root object. dc_update_state() routes stream and plane updates through the existing pipeline. Keep dc_update_planes_and_stream() and dc_check_update_surfaces_for_stream() as shims that delegate. Change dc_update_state_init() to take a const dc_state_update* and rename dc_update_planes_and_stream_{init,prepare,execute,cleanup} -> dc_update_state_{init,prepare,execute,cleanup}. Rename surface_update_type -> dc_update_type and surface_update_descriptor -> dc_update_descriptor. Reviewed-by: Dominik Kaszewski <dominik.kaszewski@amd.com> Signed-off-by: Wenjing Liu <wenjing.liu@amd.com> Signed-off-by: Wayne Lin <wayne.lin@amd.com> Tested-by: Dan Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 daysdrm/amd/display: Introduce dc_probe public object modelWenjing Liu
[Why] Performance measurement needs to commit through the same update entry point as planes and streams, with DM working against an abstraction of what to measure rather than the hardware block that performs it. [How] Add dc_probe.h defining dc_probe_type (the measurable quantity), dc_probe_target_state (not measuring / measuring / measured), dc_probe_scope (global only, per-stream/plane deferred), and dc_probe_state (an inline descriptor with copy semantics, no refcount). dc_state carries the committed set as probes[MAX_PROBES] plus probe_count. dc_state_update carries dc_probe_updates as the desired absolute set that DC diffs against the committed set. Reviewed-by: Dominik Kaszewski <dominik.kaszewski@amd.com> Signed-off-by: Wenjing Liu <wenjing.liu@amd.com> Signed-off-by: Wayne Lin <wayne.lin@amd.com> Tested-by: Dan Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 daysdrm/amd/display: Revert Fix DMSS not triggering for HDR to SDR transitionJustin Chen
Reverting this commit as it causes a regression lighting up eDP panels: This reverts commit 1f07e9fddc4a ("drm/amd/display: Fix DMSS not triggering for HDR to SDR transition") Fixes: 1f07e9fddc4a ("drm/amd/display: Fix DMSS not triggering for HDR to SDR transition") Reviewed-by: Joshua Aberback <joshua.aberback@amd.com> Reviewed-by: Yihan Zhu <yihan.zhu@amd.com> Signed-off-by: Justin Chen <Justin.Chen5@amd.com> Signed-off-by: Wayne Lin <wayne.lin@amd.com> Tested-by: Dan Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 daysdrm/amd/display: Adjust structure dml2_display_dlg_regsAurabindo Pillai
Adjust structure dml2_display_dlg_regs for future use Reviewed-by: Dillon Varone <dillon.varone@amd.com> Signed-off-by: Aurabindo Pillai <aurabindo.pillai@amd.com> Signed-off-by: Wayne Lin <wayne.lin@amd.com> Tested-by: Dan Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 daysdrm/amd/display: Add stream validation tests for connectorBhawanpreet Lakha
Add KUnit coverage for amdgpu_dm_create_validate_stream_for_sink() and amdgpu_dm_connector_funcs_update_after_detect(): null dm_state, MST no-op, and unchanged sink handling. Assisted-by: Copilot:Claude-Opus-4.8 Reviewed-by: Alex Hung <alex.hung@amd.com> Signed-off-by: Bhawanpreet Lakha <bhawanpreet.lakha@amd.com> Signed-off-by: Wayne Lin <wayne.lin@amd.com> Tested-by: Dan Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 daysdrm/amd/display: Add mode validation and CEC tests for connectorBhawanpreet Lakha
Add KUnit coverage for connector mode validation and HDMI CEC: mode_valid rejects interlaced and doublescan modes, set_edid with no notifier, and the S3 suspend/resume CEC handlers. Assisted-by: Copilot:Claude-Opus-4.8 Reviewed-by: Alex Hung <alex.hung@amd.com> Signed-off-by: Bhawanpreet Lakha <bhawanpreet.lakha@amd.com> Signed-off-by: Wayne Lin <wayne.lin@amd.com> Tested-by: Dan Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 daysdrm/amd/display: Add i2c and EDID parsing tests for connectorBhawanpreet Lakha
Add KUnit coverage for the i2c and EDID parsing helpers: amdgpu_dm_i2c_func(), amdgpu_dm_i2c_xfer(), get_amd_vsdb(), parse_hdmi_amd_vsdb() and parse_edid_displayid_vrr(). Assisted-by: Copilot:Claude-Opus-4.8 Reviewed-by: Alex Hung <alex.hung@amd.com> Signed-off-by: Bhawanpreet Lakha <bhawanpreet.lakha@amd.com> Signed-off-by: Wayne Lin <wayne.lin@amd.com> Tested-by: Dan Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 daysdrm/amd/display: Add mode helper tests for connectorBhawanpreet Lakha
Add KUnit coverage for the connector mode helpers: amdgpu_dm_connector_funcs_force(), dm_validate_stream_and_context(), amdgpu_dm_connector_to_encoder(), amdgpu_dm_get_native_mode(), amdgpu_dm_create_common_mode(), amdgpu_dm_connector_add_common_modes(), amdgpu_dm_connector_ddc_get_modes(), add_fs_modes() and amdgpu_dm_connector_add_freesync_modes(). Assisted-by: Copilot:Claude-Opus-4.8 Reviewed-by: Alex Hung <alex.hung@amd.com> Signed-off-by: Bhawanpreet Lakha <bhawanpreet.lakha@amd.com> Signed-off-by: Wayne Lin <wayne.lin@amd.com> Tested-by: Dan Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 daysdrm/amd/display: Adjust the structure dml2_dchub_watermark_regsAurabindo Pillai
Adjust the structure dml2_dchub_watermark_regs for future usage Reviewed-by: Austin Zheng <austin.zheng@amd.com> Signed-off-by: Aurabindo Pillai <aurabindo.pillai@amd.com> Signed-off-by: Wayne Lin <wayne.lin@amd.com> Tested-by: Dan Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 daysdrm/amd/display: add CRC IRQ handler KUnit coverageAlex Hung
[WHAT] Expose amdgpu_dm_crtc_handle_crc_irq() for KUnit and add tests for the incomplete-CRTC early returns, the disabled-source exit, the initial two-frame skip window, the DPRX post-skip exit, and the failed dc_stream_get_crc() path that stops before delivering a DRM CRC entry. These tests reuse the fake DC fixture introduced with the CRC configure coverage. Assisted-by: Copilot:Claude-Opus-4.8 GPT-5.5 Reviewed-by: Bhawanpreet Lakha <bhawanpreet.lakha@amd.com> Signed-off-by: Alex Hung <alex.hung@amd.com> Signed-off-by: Wayne Lin <wayne.lin@amd.com> Tested-by: Dan Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 daysdrm/amd/display: add CRC set-source KUnit coverageAlex Hung
[WHAT] Expose amdgpu_dm_crtc_set_crc_source() for KUnit and add tests for the invalid-source guard, the valid NONE no-stream exit, the pending-commit wait/put path, and the DPRX connector-walk that returns -EINVAL when no matching DP connector is attached. Add connector test helpers (drm_connector_funcs plus a cleanup action) to back the DPRX connector-walk test. Assisted-by: Copilot:Claude-Opus-4.8 GPT-5.5 Reviewed-by: Bhawanpreet Lakha <bhawanpreet.lakha@amd.com> Signed-off-by: Alex Hung <alex.hung@amd.com> Signed-off-by: Wayne Lin <wayne.lin@amd.com> Tested-by: Dan Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 daysdrm/amd/display: add CRC configure KUnit coverageAlex Hung
[WHAT] Expose amdgpu_dm_crtc_configure_crc_source() for KUnit and add tests for the CRTC-enable, disable (NONE), DPRX, DPRX-dither, DCN3.6 polynomial select, and DC-configure-failure paths. Introduce a small fake DC fixture (timing-generator and OPP callbacks over an empty resource context) so the configure path can be exercised without real hardware. The fixture is shared with the CRC IRQ tests. Assisted-by: Copilot:Claude-Opus-4.8 GPT-5.5 Reviewed-by: Bhawanpreet Lakha <bhawanpreet.lakha@amd.com> Signed-off-by: Alex Hung <alex.hung@amd.com> Signed-off-by: Wayne Lin <wayne.lin@amd.com> Tested-by: Dan Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 daysdrm/amd/display: add CRC source verify KUnit coverageAlex Hung
[WHAT] Expose amdgpu_dm_crtc_verify_crc_source() for KUnit and add tests for the valid and invalid source-name paths. Introduce the shared CRTC test scaffolding (dm_test_alloc_crc_crtc() plus the DM device test includes) used by the remaining CRTC CRC tests. Assisted-by: Copilot:Claude-Opus-4.8 GPT-5.5 Reviewed-by: Bhawanpreet Lakha <bhawanpreet.lakha@amd.com> Signed-off-by: Alex Hung <alex.hung@amd.com> Signed-off-by: Wayne Lin <wayne.lin@amd.com> Tested-by: Dan Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 daysdrm/amd/display: add CRC source list KUnit coverageAlex Hung
[WHAT] Expose amdgpu_dm_crtc_get_crc_sources() for KUnit and add a test that verifies the returned static source-name list and its count. This is the accessor used by the debugfs CRC control interface. Assisted-by: Copilot:Claude-Opus-4.8 GPT-5.5 Reviewed-by: Bhawanpreet Lakha <bhawanpreet.lakha@amd.com> Signed-off-by: Alex Hung <alex.hung@amd.com> Signed-off-by: Wayne Lin <wayne.lin@amd.com> Tested-by: Dan Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 daysdrm/amd/display: add KUnit tests for DPCD poweroff delayAlex Hung
[WHAT] Add KUnit tests for amdgpu_dm_apply_delay_after_dpcd_poweroff covering the NULL-sink early return, the zero-wait skip path, and the non-zero wait interval. Assisted-by: Copilot:Claude-Opus-4.8 Reviewed-by: Bhawanpreet Lakha <bhawanpreet.lakha@amd.com> Signed-off-by: Alex Hung <alex.hung@amd.com> Signed-off-by: Wayne Lin <wayne.lin@amd.com> Tested-by: Dan Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 daysdrm/amd/display: add KUnit tests for stutter quirkAlex Hung
[WHAT] Add KUnit tests for dm_should_disable_stutter covering a full quirk match, a non-matching device, and a partial match that differs only in the PCI revision. Assisted-by: Copilot:Claude-Opus-4.8 Reviewed-by: Bhawanpreet Lakha <bhawanpreet.lakha@amd.com> Signed-off-by: Alex Hung <alex.hung@amd.com> Signed-off-by: Wayne Lin <wayne.lin@amd.com> Tested-by: Dan Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 daysdrm/amd/display: add KUnit tests for per-frame master syncAlex Hung
[WHAT] Add KUnit tests for dm_enable_per_frame_crtc_master_sync covering the single-stream no-op, the two-stream master selection with trigger parameters, and the NULL-stream skip path. Assisted-by: Copilot:Claude-Opus-4.8 Reviewed-by: Bhawanpreet Lakha <bhawanpreet.lakha@amd.com> Signed-off-by: Alex Hung <alex.hung@amd.com> Signed-off-by: Wayne Lin <wayne.lin@amd.com> Tested-by: Dan Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 daysdrm/amd/display: add KUnit tests for freesync configAlex Hung
[WHAT] Add KUnit tests for get_freesync_config_for_crtc and reset_freesync_config_for_crtc using a shared connector/crtc/stream fixture. Cover the writeback early return, the not-capable and out-of-range unsupported paths, the active-variable, inactive and active-fixed states, and the config reset. Assisted-by: Copilot:Claude-Opus-4.8 Reviewed-by: Bhawanpreet Lakha <bhawanpreet.lakha@amd.com> Signed-off-by: Alex Hung <alex.hung@amd.com> Signed-off-by: Wayne Lin <wayne.lin@amd.com> Tested-by: Dan Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 daysdrm/amd/display: add KUnit tests for HDCP state diffingAlex Hung
[WHAT] Add KUnit tests for is_content_protection_different using a shared connector/crtc fixture. Cover the content-type change, ENABLED->DESIRED re-enable (with and without modeset), UNDESIRED and DESIRED steady states, the update_hdcp hot-plug and stream re-enable paths, and the S3/DESIRED/UNDESIRED enable transitions. Assisted-by: Copilot:Claude-Opus-4.8 Reviewed-by: Bhawanpreet Lakha <bhawanpreet.lakha@amd.com> Signed-off-by: Alex Hung <alex.hung@amd.com> Signed-off-by: Wayne Lin <wayne.lin@amd.com> Tested-by: Dan Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 daysdrm/amd/display: add KUnit tests for DM stream scalingAlex Hung
[WHAT] Add KUnit tests for the stream scaling path: a disable-underscan case for is_scaling_state_different, and coverage of amdgpu_dm_update_stream_scaling_settings across the full-screen default, RMX_FULL, RMX_ASPECT pillarbox/letterbox, RMX_CENTER and underscan paths. Assisted-by: Copilot:Claude-Opus-4.8 Reviewed-by: Bhawanpreet Lakha <bhawanpreet.lakha@amd.com> Signed-off-by: Alex Hung <alex.hung@amd.com> Signed-off-by: Wayne Lin <wayne.lin@amd.com> Tested-by: Dan Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 daysdrm/amd/display: add KUnit tests for DM atomic state helpersAlex Hung
[WHAT] Add KUnit tests for the DM atomic private-state accessors (dm_atomic_get_new_state, dm_atomic_destroy_state), the native cursor-mode selector (dm_should_update_native_cursor) and amdgpu_dm_smu_write_watermarks_table. Cover the empty and matching private-object lookups, the NULL-context destroy path, the NULL, native and overlay cursor-mode paths, and the non-Navi1x watermark table early return. Assisted-by: Copilot:Claude-Opus-4.8 Reviewed-by: Bhawanpreet Lakha <bhawanpreet.lakha@amd.com> Signed-off-by: Alex Hung <alex.hung@amd.com> Signed-off-by: Wayne Lin <wayne.lin@amd.com> Tested-by: Dan Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 daysdrm/amd/display: add KUnit tests for DM CRTC vblank/scanoutAlex Hung
[WHAT] Add KUnit tests for the DM CRTC helpers: the no-writeback and non-pending writeback paths of amdgpu_dm_crtc_complete_writeback, the out-of-range and no-stream paths of dm_vblank_get_counter, and the invalid-CRTC and no-stream paths of dm_crtc_get_scanoutpos. Assisted-by: Copilot:Claude-Opus-4.8 Reviewed-by: Bhawanpreet Lakha <bhawanpreet.lakha@amd.com> Signed-off-by: Alex Hung <alex.hung@amd.com> Signed-off-by: Wayne Lin <wayne.lin@amd.com> Tested-by: Dan Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 daysdrm/amd/display: add KUnit tests for DM IP-block callbacksAlex Hung
[WHAT] Add KUnit coverage for the simple amdgpu_dm IP-block callbacks (is_idle, wait_for_idle, soft_reset, set_clockgating_state, set_powergating_state and the bandwidth_update display hook) by asserting their placeholder return values. Also add the shared test include block used by the amdgpu_dm test suite. Assisted-by: Copilot:Claude-Opus-4.8 Reviewed-by: Bhawanpreet Lakha <bhawanpreet.lakha@amd.com> Signed-off-by: Alex Hung <alex.hung@amd.com> Signed-off-by: Wayne Lin <wayne.lin@amd.com> Tested-by: Dan Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 daysdrm/amd/display: Test plane colorop pipeline updateAlex Hung
[WHAT] Add KUnit coverage for the colorop-pipeline path of amdgpu_dm_update_plane_color_mgmt(). Test-local helpers fabricate a linked colorop pipeline so the update path can be exercised end to end: a fully bypassed pipeline succeeds, a pipeline missing the multiplier or the 3x4 op falls back to defaults, and a pipeline with no 3D LUT hardware skips the 3D ops. Assisted-by: Copilot:Claude-Opus-4.8 GPT-5.5 Reviewed-by: Bhawanpreet Lakha <bhawanpreet.lakha@amd.com> Signed-off-by: Alex Hung <alex.hung@amd.com> Signed-off-by: Wayne Lin <wayne.lin@amd.com> Tested-by: Dan Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 daysdrm/amd/display: Test plane color management updateAlex Hung
[WHAT] Add KUnit coverage for the legacy paths of amdgpu_dm_update_plane_color_mgmt(). Using the shared color-update fixture, the tests cover the bad 3D LUT size early failure, the default fallback path, implicit CRTC degamma mapping, color caps taken from the DC context, and a plane CTM mapping to the DPP gamut remap matrix. Assisted-by: Copilot:Claude-Opus-4.8 GPT-5.5 Reviewed-by: Bhawanpreet Lakha <bhawanpreet.lakha@amd.com> Signed-off-by: Alex Hung <alex.hung@amd.com> Signed-off-by: Wayne Lin <wayne.lin@amd.com> Tested-by: Dan Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 daysdrm/amd/display: Test CRTC color management updateAlex Hung
[WHAT] Add KUnit coverage for amdgpu_dm_check_crtc_color_mgmt() and amdgpu_dm_update_crtc_color_mgmt(). A shared color-update fixture (adev/DC, atomic state, CRTC/stream and plane state) backs the tests: the check path succeeds with no CRTC LUTs, and the update path leaves the stream gamut remap bypassed without a CTM and enables it when a CRTC CTM is present. Assisted-by: Copilot:Claude-Opus-4.8 GPT-5.5 Reviewed-by: Bhawanpreet Lakha <bhawanpreet.lakha@amd.com> Signed-off-by: Alex Hung <alex.hung@amd.com> Signed-off-by: Wayne Lin <wayne.lin@amd.com> Tested-by: Dan Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 daysdrm/amd/display: Test plane colorop helper walkersAlex Hung
[WHAT] Add KUnit coverage for the per-colorop plane helpers __set_dm_plane_colorop_multiplier(), __set_dm_plane_colorop_3x4_matrix() and __set_dm_plane_colorop_degamma(). A single-colorop atomic-state fixture drives each helper: the multiplier programs hdr_mult, the 3x4 matrix enables gamut remap (and rejects a wrong blob length), and the degamma 1D curve maps to a predefined transfer function (and rejects an unsupported curve). Assisted-by: Copilot:Claude-Opus-4.8 GPT-5.5 Reviewed-by: Bhawanpreet Lakha <bhawanpreet.lakha@amd.com> Signed-off-by: Alex Hung <alex.hung@amd.com> Signed-off-by: Wayne Lin <wayne.lin@amd.com> Tested-by: Dan Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 daysdrm/amd/display: Test color mod init and 3D LUT sizeAlex Hung
[WHAT] Add KUnit coverage for amdgpu_dm_init_color_mod() and amdgpu_dm_verify_lut3d_size(). init_color_mod is a smoke test that the x-points distribution is set up without crashing. The verify_lut3d_size tests build adev/DC fixtures with and without the 3D LUT capability and confirm that correct shaper and 3D LUT blob sizes succeed while mismatched sizes return -EINVAL. Assisted-by: Copilot:Claude-Opus-4.8 GPT-5.5 Reviewed-by: Bhawanpreet Lakha <bhawanpreet.lakha@amd.com> Signed-off-by: Alex Hung <alex.hung@amd.com> Signed-off-by: Wayne Lin <wayne.lin@amd.com> Tested-by: Dan Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 daysdrm/amd/display: Split DPMS ON into partsDominik Kaszewski
[Why] Ongoing optimization efforts require splitting DPMS ON around enable_link, in order to enable running multiple sequences in parallel. [How] * Split link_set_dpms_on across enable_link * Add return value indicating whether the programming sequence succeeded and/or run to the end. Reviewed-by: Alvin Lee <alvin.lee2@amd.com> Signed-off-by: Dominik Kaszewski <dominik.kaszewski@amd.com> Signed-off-by: Wayne Lin <wayne.lin@amd.com> Tested-by: Dan Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 daysdrm/amd/display: Add DWB validation support to DML2.1 wrapperDillon Varone
[WHY&HOW] DML2.1 wrapper was lacking translation for DWB. This change adds the necessary translation for DWB validation and programming support. Reviewed-by: Austin Zheng <austin.zheng@amd.com> Signed-off-by: Dillon Varone <Dillon.Varone@amd.com> Signed-off-by: Wayne Lin <wayne.lin@amd.com> Tested-by: Dan Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 daysdrm/amd/display: fix debug flags assignment in dmub_replay.cRobin Chen
[WHY] Fix incorrect casting of debug flags to uint16_t, which could truncate the value. Reviewed-by: ChunTao Tso <chuntao.tso@amd.com> Signed-off-by: Robin Chen <robin.chen@amd.com> Signed-off-by: Wayne Lin <wayne.lin@amd.com> Tested-by: Dan Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 daysdrm/amd/display: Add EDID management tests for connectorBhawanpreet Lakha
Add KUnit coverage for hdmi_cec_unset_edid(), create_eml_sink() and handle_edid_mgmt(): unset edid with no notifier, eml sink with no edid, and DP vs non-DP edid management link caps handling. Assisted-by: Copilot:Claude-Opus-4.8 Reviewed-by: Alex Hung <alex.hung@amd.com> Signed-off-by: Bhawanpreet Lakha <bhawanpreet.lakha@amd.com> Signed-off-by: Wayne Lin <wayne.lin@amd.com> Tested-by: Dan Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 daysdrm/amd/display: Add encoder helper tests for connectorBhawanpreet Lakha
Add KUnit coverage for the encoder helpers dm_encoder_helper_disable() and dm_encoder_helper_atomic_check(): disable no-op, eDP native keeps scaling, LVDS non-native enables scaling, and the non-MST zero return. Assisted-by: Copilot:Claude-Opus-4.8 Reviewed-by: Alex Hung <alex.hung@amd.com> Signed-off-by: Bhawanpreet Lakha <bhawanpreet.lakha@amd.com> Signed-off-by: Wayne Lin <wayne.lin@amd.com> Tested-by: Dan Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 daysdrm/amd/display: Add destroy tests for connectorBhawanpreet Lakha
Add KUnit coverage for amdgpu_dm_connector_destroy(): minimal teardown plus releasing the dc_sink and dc_em_sink references. Assisted-by: Copilot:Claude-Opus-4.8 Reviewed-by: Alex Hung <alex.hung@amd.com> Signed-off-by: Bhawanpreet Lakha <bhawanpreet.lakha@amd.com> Signed-off-by: Wayne Lin <wayne.lin@amd.com> Tested-by: Dan Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 daysdrm/amd/display: Add register and unregister tests for connectorBhawanpreet Lakha
Add KUnit coverage for amdgpu_dm_connector_late_register() and amdgpu_dm_connector_unregister(): non-DP late register succeeds and non-DP unregister is a no-op. Assisted-by: Copilot:Claude-Opus-4.8 Reviewed-by: Alex Hung <alex.hung@amd.com> Signed-off-by: Bhawanpreet Lakha <bhawanpreet.lakha@amd.com> Signed-off-by: Wayne Lin <wayne.lin@amd.com> Tested-by: Dan Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 daysdrm/amd/display: Add detect and poll tests for connectorBhawanpreet Lakha
Add KUnit coverage for amdgpu_dm_connector_detect() and amdgpu_dm_connector_poll(): force on (analog/digital), force off, sink present/absent, and the DAC-load cached status path. Assisted-by: Copilot:Claude-Opus-4.8 Reviewed-by: Alex Hung <alex.hung@amd.com> Signed-off-by: Bhawanpreet Lakha <bhawanpreet.lakha@amd.com> Signed-off-by: Wayne Lin <wayne.lin@amd.com> Tested-by: Dan Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 daysdrm/amd/display: Add stream creation tests for connectorBhawanpreet Lakha
Add KUnit coverage for create_stream_for_sink(): fake sink success, dm context setup, virtual signal handling, scaling source, and reuse of an existing sink. Assisted-by: Copilot:Claude-Opus-4.8 Reviewed-by: Alex Hung <alex.hung@amd.com> Signed-off-by: Bhawanpreet Lakha <bhawanpreet.lakha@amd.com> Signed-off-by: Wayne Lin <wayne.lin@amd.com> Tested-by: Dan Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 daysdrm/amd/display: Replace amdgpu_dm_kunit_helpers.h with dm_helpers.hBhawanpreet Lakha
Drop the amdgpu_dm_kunit_helpers.h include across the amdgpu_dm source files and use dm_helpers.h instead Assisted-by: Copilot:Claude-Opus-4.8 Reviewed-by: Alex Hung <alex.hung@amd.com> Signed-off-by: Bhawanpreet Lakha <bhawanpreet.lakha@amd.com> Signed-off-by: Wayne Lin <wayne.lin@amd.com> Tested-by: Dan Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 daysdrm/amd/display: Add updated MCIF ARB register definitionsDillon Varone
[WHY&HOW] DCN4+ use a new structure for MCIF arbiter registers. Reviewed-by: Austin Zheng <austin.zheng@amd.com> Signed-off-by: Dillon Varone <Dillon.Varone@amd.com> Signed-off-by: Wayne Lin <wayne.lin@amd.com> Tested-by: Dan Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 daysdrm/amd/display: Fix DP LT failure loggingIlya Bakoulin
[Why/How] The final DP LT failure meant to be logged as DC warning is skipped due to a break statement above. Move logging up to make sure we don't miss LT fail events. Reviewed-by: George Shen <george.shen@amd.com> Signed-off-by: Ilya Bakoulin <Ilya.Bakoulin@amd.com> Signed-off-by: Wayne Lin <wayne.lin@amd.com> Tested-by: Dan Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 daysdrm/amd/display: Refactor DPP_SET_OUTPUT_TRANSFER_FUNC to drop pipe_ctxTomasz Siemek
[why] Pipe_ctx shouldn't be passed as block sequence block parameter. [how] Adjust arguments for set_output_transfer_func and implementations. Reviewed-by: Alvin Lee <alvin.lee2@amd.com> Signed-off-by: Tomasz Siemek <tomasz.siemek@amd.com> Signed-off-by: Wayne Lin <wayne.lin@amd.com> Tested-by: Dan Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 daysdrm/amd/display: Refactor DPP_PROGRAM_GAMUT_REMAP to drop pipe_ctx paramTomasz Siemek
[why] Pipe_ctx shouldn't be passed as block sequence block parameter. [how] - Adjust program_gamut_remap_params struct. - Adjust program_gamut_remap interface and implementations. - Adjust program_gamut_remap callsites to match new signature. Reviewed-by: Alvin Lee <alvin.lee2@amd.com> Signed-off-by: Tomasz Siemek <tomasz.siemek@amd.com> Signed-off-by: Wayne Lin <wayne.lin@amd.com> Tested-by: Dan Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>