]> www.infradead.org Git - users/hch/misc.git/commitdiff
drm/amd/display: Add debug option to control BW Allocation mode
authorCruise Hung <Cruise.Hung@amd.com>
Tue, 15 Jul 2025 08:36:44 +0000 (16:36 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 28 Jul 2025 20:40:31 +0000 (16:40 -0400)
[Why & How]
Add debug option to control BW Allocation mode.

Reviewed-by: Meenakshikumar Somasundaram <meenakshikumar.somasundaram@amd.com>
Reviewed-by: PeiChen (Pei-Chen) Huang <peichen.huang@amd.com>
Signed-off-by: Cruise Hung <Cruise.Hung@amd.com>
Signed-off-by: Ivan Lipski <ivan.lipski@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/dc.h
drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_dpia_bw.c

index fee54cc0f7d4867d02b6f961f431c59081194d14..57f4a9445b7edc3a697bb65fc76bfd31d422de40 100644 (file)
@@ -839,7 +839,8 @@ union dpia_debug_options {
                uint32_t enable_force_tbt3_work_around:1; /* bit 4 */
                uint32_t disable_usb4_pm_support:1; /* bit 5 */
                uint32_t enable_usb4_bw_zero_alloc_patch:1; /* bit 6 */
-               uint32_t reserved:25;
+               uint32_t enable_bw_allocation_mode:1; /* bit 7 */
+               uint32_t reserved:24;
        } bits;
        uint32_t raw;
 };
index 906d85ca89569c74e1772d6953b6e800d4f3911c..8a3c18ae97a7b5ab8c6e46edde8d6807cc742e25 100644 (file)
@@ -225,6 +225,11 @@ bool link_dpia_enable_usb4_dp_bw_alloc_mode(struct dc_link *link)
        bool ret = false;
        uint8_t val;
 
+       if (link->dc->debug.dpia_debug.bits.enable_bw_allocation_mode == false) {
+               DC_LOG_DEBUG("%s:  link[%d] DPTX BW allocation mode disabled", __func__, link->link_index);
+               return false;
+       }
+
        val = DPTX_BW_ALLOC_MODE_ENABLE | DPTX_BW_ALLOC_UNMASK_IRQ;
 
        if (core_link_write_dpcd(link, DPTX_BW_ALLOCATION_MODE_CONTROL, &val, sizeof(uint8_t)) == DC_OK) {