]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
drm/amd/display: not skip hpd irq for bw alloc mode
authorPeichen Huang <PeiChen.Huang@amd.com>
Tue, 30 Sep 2025 05:39:02 +0000 (13:39 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 20 Oct 2025 22:21:45 +0000 (18:21 -0400)
[WHY]
Driver only process hpd irq when a branch device or when
the link is established. It would cause some irq for bw_alloc
mode of dp tunneling are ignored.

[HOW]
Driver should process hpd irq if bw_alloc and dp tunneling
are enabled.

Reviewed-by: Cruise Hung <cruise.hung@amd.com>
Signed-off-by: Peichen Huang <PeiChen.Huang@amd.com>
Signed-off-by: Aurabindo Pillai <aurabindo.pillai@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_dpia_bw.c
drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_irq_handler.c

index 8a3c18ae97a7b5ab8c6e46edde8d6807cc742e25..b16eb97ae11c92405a0a7d895ccf69735bd5d58e 100644 (file)
@@ -273,17 +273,28 @@ bool link_dpia_enable_usb4_dp_bw_alloc_mode(struct dc_link *link)
  */
 void link_dp_dpia_handle_bw_alloc_status(struct dc_link *link, uint8_t status)
 {
-       link->dpia_bw_alloc_config.estimated_bw = get_estimated_bw(link);
-
        if (status & DP_TUNNELING_BW_REQUEST_SUCCEEDED) {
                DC_LOG_DEBUG("%s: BW Allocation request succeeded on link(%d)",
                                __func__, link->link_index);
-       } else if (status & DP_TUNNELING_BW_REQUEST_FAILED) {
+       }
+
+       if (status & DP_TUNNELING_BW_REQUEST_FAILED) {
                DC_LOG_DEBUG("%s: BW Allocation request failed on link(%d)  allocated/estimated BW=%d",
                                __func__, link->link_index, link->dpia_bw_alloc_config.estimated_bw);
 
                link_dpia_send_bw_alloc_request(link, link->dpia_bw_alloc_config.estimated_bw);
-       } else if (status & DP_TUNNELING_ESTIMATED_BW_CHANGED) {
+       }
+
+       if (status & DP_TUNNELING_BW_ALLOC_CAP_CHANGED) {
+               link->dpia_bw_alloc_config.bw_granularity = get_bw_granularity(link);
+
+               DC_LOG_DEBUG("%s: Granularity changed on link(%d)  new granularity=%d",
+                               __func__, link->link_index, link->dpia_bw_alloc_config.bw_granularity);
+       }
+
+       if (status & DP_TUNNELING_ESTIMATED_BW_CHANGED) {
+               link->dpia_bw_alloc_config.estimated_bw = get_estimated_bw(link);
+
                DC_LOG_DEBUG("%s: Estimated BW changed on link(%d)  new estimated BW=%d",
                                __func__, link->link_index, link->dpia_bw_alloc_config.estimated_bw);
        }
index 6934774133471ff740891dc773e59b9dc853ff67..4b01ab0a5a7f0e1827d76d568b925968a28aa8b4 100644 (file)
@@ -398,10 +398,12 @@ bool dp_should_allow_hpd_rx_irq(const struct dc_link *link)
         * Don't handle RX IRQ unless one of following is met:
         * 1) The link is established (cur_link_settings != unknown)
         * 2) We know we're dealing with a branch device, SST or MST
+        * 3) The link is bw_alloc enabled.
         */
 
        if ((link->cur_link_settings.lane_count != LANE_COUNT_UNKNOWN) ||
-               is_dp_branch_device(link))
+               is_dp_branch_device(link) ||
+               link->dpia_bw_alloc_config.bw_alloc_enabled)
                return true;
 
        return false;