From: jsg Date: Sat, 15 Jun 2024 03:51:28 +0000 (+0000) Subject: drm/amd/display: Allocate zero bw after bw alloc enable X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=6b49712e6fdc10340da05998e89a2c68924ac4e2;p=openbsd drm/amd/display: Allocate zero bw after bw alloc enable From Meenakshikumar Somasundaram 53a7d15331b084378ca7255695d2987a3fdf7ad6 in linux-6.6.y/6.6.33 46fe9cb1a9e62f4e6229f48ae303ef8e6c1fdc64 in mainline linux --- diff --git a/sys/dev/pci/drm/amd/display/dc/link/protocols/link_dp_dpia_bw.c b/sys/dev/pci/drm/amd/display/dc/link/protocols/link_dp_dpia_bw.c index 3db9489c08f..4c6a6d6c1ba 100644 --- a/sys/dev/pci/drm/amd/display/dc/link/protocols/link_dp_dpia_bw.c +++ b/sys/dev/pci/drm/amd/display/dc/link/protocols/link_dp_dpia_bw.c @@ -270,7 +270,7 @@ static void set_usb4_req_bw_req(struct dc_link *link, int req_bw) /* Error check whether requested and allocated are equal */ req_bw = requested_bw * (Kbps_TO_Gbps / link->dpia_bw_alloc_config.bw_granularity); - if (req_bw == link->dpia_bw_alloc_config.allocated_bw) { + if (req_bw && (req_bw == link->dpia_bw_alloc_config.allocated_bw)) { DC_LOG_ERROR("%s: Request bw equals to allocated bw for link(%d)\n", __func__, link->link_index); } @@ -341,6 +341,14 @@ bool link_dp_dpia_set_dptx_usb4_bw_alloc_support(struct dc_link *link) ret = true; init_usb4_bw_struct(link); link->dpia_bw_alloc_config.bw_alloc_enabled = true; + + /* + * During DP tunnel creation, CM preallocates BW and reduces estimated BW of other + * DPIA. CM release preallocation only when allocation is complete. Do zero alloc + * to make the CM to release preallocation and update estimated BW correctly for + * all DPIAs per host router + */ + link_dp_dpia_allocate_usb4_bandwidth_for_stream(link, 0); } }