Commit aee0c07a authored by Mustapha Ghaddar's avatar Mustapha Ghaddar Committed by Alex Deucher

drm/amd/display: Unify DC logging for BW Alloc

[WHY]
To keep all logging within DC unified

[HOW]
Use the standard DC Logging functions
Reviewed-by: default avatarWenjing Liu <Wenjing.Liu@amd.com>
Reviewed-by: default avatarMeenakshikumar Somasundaram <Meenakshikumar.Somasundaram@amd.com>
Acked-by: default avatarQingqing Zhuo <qingqing.zhuo@amd.com>
Signed-off-by: default avatarMustapha Ghaddar <mghaddar@amd.com>
Tested-by: default avatarDaniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent de534c1c
...@@ -31,6 +31,9 @@ ...@@ -31,6 +31,9 @@
#include "drm_dp_helper_dc.h" #include "drm_dp_helper_dc.h"
#include "link_dpcd.h" #include "link_dpcd.h"
#define DC_LOGGER \
link->ctx->logger
#define Kbps_TO_Gbps (1000 * 1000) #define Kbps_TO_Gbps (1000 * 1000)
// ------------------------------------------------------------------ // ------------------------------------------------------------------
...@@ -83,12 +86,11 @@ static int get_estimated_bw(struct dc_link *link) ...@@ -83,12 +86,11 @@ static int get_estimated_bw(struct dc_link *link)
{ {
uint8_t bw_estimated_bw = 0; uint8_t bw_estimated_bw = 0;
if (core_link_read_dpcd( core_link_read_dpcd(
link, link,
ESTIMATED_BW, ESTIMATED_BW,
&bw_estimated_bw, &bw_estimated_bw,
sizeof(uint8_t)) != DC_OK) sizeof(uint8_t));
dm_output_to_console("%s: AUX W/R ERROR @ 0x%x\n", __func__, ESTIMATED_BW);
return bw_estimated_bw * (Kbps_TO_Gbps / link->dpia_bw_alloc_config.bw_granularity); return bw_estimated_bw * (Kbps_TO_Gbps / link->dpia_bw_alloc_config.bw_granularity);
} }
...@@ -226,9 +228,7 @@ static void dc_link_set_usb4_req_bw_req(struct dc_link *link, int req_bw) ...@@ -226,9 +228,7 @@ static void dc_link_set_usb4_req_bw_req(struct dc_link *link, int req_bw)
link, link,
REQUESTED_BW, REQUESTED_BW,
&requested_bw, &requested_bw,
sizeof(uint8_t)) != DC_OK) sizeof(uint8_t)) == DC_OK)
dm_output_to_console("%s: AUX W/R ERROR @ 0x%x\n", __func__, REQUESTED_BW);
else
link->dpia_bw_alloc_config.response_ready = false; // Reset flag link->dpia_bw_alloc_config.response_ready = false; // Reset flag
} }
/* /*
...@@ -256,22 +256,18 @@ bool link_dp_dpia_set_dptx_usb4_bw_alloc_support(struct dc_link *link) ...@@ -256,22 +256,18 @@ bool link_dp_dpia_set_dptx_usb4_bw_alloc_support(struct dc_link *link)
goto out; goto out;
if (core_link_read_dpcd( if (core_link_read_dpcd(
link, link,
DP_TUNNELING_CAPABILITIES, DP_TUNNELING_CAPABILITIES,
&response, &response,
sizeof(uint8_t)) != DC_OK) sizeof(uint8_t)) == DC_OK)
dm_output_to_console("%s: AUX W/R ERROR @ 0x%x\n", __func__, DP_TUNNELING_CAPABILITIES); bw_support_dpia = (response >> 7) & 1;
bw_support_dpia = (response >> 7) & 1;
if (core_link_read_dpcd( if (core_link_read_dpcd(
link, link,
USB4_DRIVER_BW_CAPABILITY, USB4_DRIVER_BW_CAPABILITY,
&response, &response,
sizeof(uint8_t)) != DC_OK) sizeof(uint8_t)) == DC_OK)
dm_output_to_console("%s: AUX W/R ERROR @ 0x%x\n", __func__, DP_TUNNELING_CAPABILITIES); bw_support_cm = (response >> 7) & 1;
bw_support_cm = (response >> 7) & 1;
/* Send request acknowledgment to Turn ON DPTX support */ /* Send request acknowledgment to Turn ON DPTX support */
if (bw_support_cm && bw_support_dpia) { if (bw_support_cm && bw_support_dpia) {
...@@ -281,15 +277,15 @@ bool link_dp_dpia_set_dptx_usb4_bw_alloc_support(struct dc_link *link) ...@@ -281,15 +277,15 @@ bool link_dp_dpia_set_dptx_usb4_bw_alloc_support(struct dc_link *link)
link, link,
DPTX_BW_ALLOCATION_MODE_CONTROL, DPTX_BW_ALLOCATION_MODE_CONTROL,
&response, &response,
sizeof(uint8_t)) != DC_OK) sizeof(uint8_t)) != DC_OK) {
dm_output_to_console("%s: AUX W/R ERROR @ 0x%x\n", DC_LOG_DEBUG("%s: **** FAILURE Enabling DPtx BW Allocation Mode Support ***\n",
"**** FAILURE Enabling DPtx BW Allocation Mode Support ***\n", __func__);
__func__, DP_TUNNELING_CAPABILITIES); } else {
else {
// SUCCESS Enabled DPtx BW Allocation Mode Support // SUCCESS Enabled DPtx BW Allocation Mode Support
link->dpia_bw_alloc_config.bw_alloc_enabled = true; link->dpia_bw_alloc_config.bw_alloc_enabled = true;
dm_output_to_console("**** SUCCESS Enabling DPtx BW Allocation Mode Support ***\n"); DC_LOG_DEBUG("%s: **** SUCCESS Enabling DPtx BW Allocation Mode Support ***\n",
__func__);
ret = true; ret = true;
init_usb4_bw_struct(link); init_usb4_bw_struct(link);
...@@ -308,7 +304,7 @@ void dc_link_handle_usb4_bw_alloc_response(struct dc_link *link, uint8_t bw, uin ...@@ -308,7 +304,7 @@ void dc_link_handle_usb4_bw_alloc_response(struct dc_link *link, uint8_t bw, uin
case DPIA_BW_REQ_FAILED: case DPIA_BW_REQ_FAILED:
dm_output_to_console("%s: *** *** BW REQ FAILURE for DP-TX Request *** ***\n", __func__); DC_LOG_DEBUG("%s: *** *** BW REQ FAILURE for DP-TX Request *** ***\n", __func__);
// Update the new Estimated BW value updated by CM // Update the new Estimated BW value updated by CM
link->dpia_bw_alloc_config.estimated_bw = link->dpia_bw_alloc_config.estimated_bw =
...@@ -328,7 +324,7 @@ void dc_link_handle_usb4_bw_alloc_response(struct dc_link *link, uint8_t bw, uin ...@@ -328,7 +324,7 @@ void dc_link_handle_usb4_bw_alloc_response(struct dc_link *link, uint8_t bw, uin
case DPIA_BW_REQ_SUCCESS: case DPIA_BW_REQ_SUCCESS:
dm_output_to_console("%s: *** BW REQ SUCCESS for DP-TX Request ***\n", __func__); DC_LOG_DEBUG("%s: *** BW REQ SUCCESS for DP-TX Request ***\n", __func__);
// 1. SUCCESS 1st time before any Pruning is done // 1. SUCCESS 1st time before any Pruning is done
// 2. SUCCESS after prev. FAIL before any Pruning is done // 2. SUCCESS after prev. FAIL before any Pruning is done
...@@ -369,7 +365,7 @@ void dc_link_handle_usb4_bw_alloc_response(struct dc_link *link, uint8_t bw, uin ...@@ -369,7 +365,7 @@ void dc_link_handle_usb4_bw_alloc_response(struct dc_link *link, uint8_t bw, uin
case DPIA_EST_BW_CHANGED: case DPIA_EST_BW_CHANGED:
dm_output_to_console("%s: *** ESTIMATED BW CHANGED for DP-TX Request ***\n", __func__); DC_LOG_DEBUG("%s: *** ESTIMATED BW CHANGED for DP-TX Request ***\n", __func__);
int available = 0, estimated = bw * (Kbps_TO_Gbps / link->dpia_bw_alloc_config.bw_granularity); int available = 0, estimated = bw * (Kbps_TO_Gbps / link->dpia_bw_alloc_config.bw_granularity);
int host_router_total_estimated_bw = get_host_router_total_bw(link, HOST_ROUTER_BW_ESTIMATED); int host_router_total_estimated_bw = get_host_router_total_bw(link, HOST_ROUTER_BW_ESTIMATED);
...@@ -397,7 +393,7 @@ void dc_link_handle_usb4_bw_alloc_response(struct dc_link *link, uint8_t bw, uin ...@@ -397,7 +393,7 @@ void dc_link_handle_usb4_bw_alloc_response(struct dc_link *link, uint8_t bw, uin
case DPIA_BW_ALLOC_CAPS_CHANGED: case DPIA_BW_ALLOC_CAPS_CHANGED:
dm_output_to_console("%s: *** BW ALLOC CAPABILITY CHANGED for DP-TX Request ***\n", __func__); DC_LOG_DEBUG("%s: *** BW ALLOC CAPABILITY CHANGED for DP-TX Request ***\n", __func__);
link->dpia_bw_alloc_config.bw_alloc_enabled = false; link->dpia_bw_alloc_config.bw_alloc_enabled = false;
break; break;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment