Commit 3715112c authored by Fangzhi Zuo's avatar Fangzhi Zuo Committed by Alex Deucher

drm/amd/display: Add DSC Debug Log

Add DSC log in each critical routines to facilitate debugging.
Reviewed-by: default avatarRodrigo Siqueira <rodrigo.siqueira@amd.com>
Signed-off-by: default avatarFangzhi Zuo <Jerry.Zuo@amd.com>
Signed-off-by: default avatarZaeem Mohamed <zaeem.mohamed@amd.com>
Tested-by: default avatarDaniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 38d6f7e2
...@@ -6452,7 +6452,8 @@ static void apply_dsc_policy_for_stream(struct amdgpu_dm_connector *aconnector, ...@@ -6452,7 +6452,8 @@ static void apply_dsc_policy_for_stream(struct amdgpu_dm_connector *aconnector,
dc_link_get_highest_encoding_format(aconnector->dc_link), dc_link_get_highest_encoding_format(aconnector->dc_link),
&stream->timing.dsc_cfg)) { &stream->timing.dsc_cfg)) {
stream->timing.flags.DSC = 1; stream->timing.flags.DSC = 1;
DRM_DEBUG_DRIVER("%s: [%s] DSC is selected from SST RX\n", __func__, drm_connector->name); DRM_DEBUG_DRIVER("%s: SST_DSC [%s] DSC is selected from SST RX\n",
__func__, drm_connector->name);
} }
} else if (sink->link->dpcd_caps.dongle_type == DISPLAY_DONGLE_DP_HDMI_CONVERTER) { } else if (sink->link->dpcd_caps.dongle_type == DISPLAY_DONGLE_DP_HDMI_CONVERTER) {
timing_bw_in_kbps = dc_bandwidth_in_kbps_from_timing(&stream->timing, timing_bw_in_kbps = dc_bandwidth_in_kbps_from_timing(&stream->timing,
...@@ -6471,7 +6472,7 @@ static void apply_dsc_policy_for_stream(struct amdgpu_dm_connector *aconnector, ...@@ -6471,7 +6472,7 @@ static void apply_dsc_policy_for_stream(struct amdgpu_dm_connector *aconnector,
dc_link_get_highest_encoding_format(aconnector->dc_link), dc_link_get_highest_encoding_format(aconnector->dc_link),
&stream->timing.dsc_cfg)) { &stream->timing.dsc_cfg)) {
stream->timing.flags.DSC = 1; stream->timing.flags.DSC = 1;
DRM_DEBUG_DRIVER("%s: [%s] DSC is selected from DP-HDMI PCON\n", DRM_DEBUG_DRIVER("%s: SST_DSC [%s] DSC is selected from DP-HDMI PCON\n",
__func__, drm_connector->name); __func__, drm_connector->name);
} }
} }
...@@ -11594,7 +11595,7 @@ static int amdgpu_dm_atomic_check(struct drm_device *dev, ...@@ -11594,7 +11595,7 @@ static int amdgpu_dm_atomic_check(struct drm_device *dev,
if (dc_resource_is_dsc_encoding_supported(dc)) { if (dc_resource_is_dsc_encoding_supported(dc)) {
ret = compute_mst_dsc_configs_for_state(state, dm_state->context, vars); ret = compute_mst_dsc_configs_for_state(state, dm_state->context, vars);
if (ret) { if (ret) {
drm_dbg_atomic(dev, "compute_mst_dsc_configs_for_state() failed\n"); drm_dbg_atomic(dev, "MST_DSC compute_mst_dsc_configs_for_state() failed\n");
ret = -EINVAL; ret = -EINVAL;
goto fail; goto fail;
} }
...@@ -11615,7 +11616,7 @@ static int amdgpu_dm_atomic_check(struct drm_device *dev, ...@@ -11615,7 +11616,7 @@ static int amdgpu_dm_atomic_check(struct drm_device *dev,
*/ */
ret = drm_dp_mst_atomic_check(state); ret = drm_dp_mst_atomic_check(state);
if (ret) { if (ret) {
drm_dbg_atomic(dev, "drm_dp_mst_atomic_check() failed\n"); drm_dbg_atomic(dev, "MST drm_dp_mst_atomic_check() failed\n");
goto fail; goto fail;
} }
status = dc_validate_global_state(dc, dm_state->context, true); status = dc_validate_global_state(dc, dm_state->context, true);
......
...@@ -759,7 +759,7 @@ static uint8_t write_dsc_enable_synaptics_non_virtual_dpcd_mst( ...@@ -759,7 +759,7 @@ static uint8_t write_dsc_enable_synaptics_non_virtual_dpcd_mst(
uint8_t ret = 0; uint8_t ret = 0;
drm_dbg_dp(aux->drm_dev, drm_dbg_dp(aux->drm_dev,
"Configure DSC to non-virtual dpcd synaptics\n"); "MST_DSC Configure DSC to non-virtual dpcd synaptics\n");
if (enable) { if (enable) {
/* When DSC is enabled on previous boot and reboot with the hub, /* When DSC is enabled on previous boot and reboot with the hub,
...@@ -772,7 +772,7 @@ static uint8_t write_dsc_enable_synaptics_non_virtual_dpcd_mst( ...@@ -772,7 +772,7 @@ static uint8_t write_dsc_enable_synaptics_non_virtual_dpcd_mst(
apply_synaptics_fifo_reset_wa(aux); apply_synaptics_fifo_reset_wa(aux);
ret = drm_dp_dpcd_write(aux, DP_DSC_ENABLE, &enable, 1); ret = drm_dp_dpcd_write(aux, DP_DSC_ENABLE, &enable, 1);
DRM_INFO("Send DSC enable to synaptics\n"); DRM_INFO("MST_DSC Send DSC enable to synaptics\n");
} else { } else {
/* Synaptics hub not support virtual dpcd, /* Synaptics hub not support virtual dpcd,
...@@ -781,7 +781,7 @@ static uint8_t write_dsc_enable_synaptics_non_virtual_dpcd_mst( ...@@ -781,7 +781,7 @@ static uint8_t write_dsc_enable_synaptics_non_virtual_dpcd_mst(
*/ */
if (!stream->link->link_status.link_active) { if (!stream->link->link_status.link_active) {
ret = drm_dp_dpcd_write(aux, DP_DSC_ENABLE, &enable, 1); ret = drm_dp_dpcd_write(aux, DP_DSC_ENABLE, &enable, 1);
DRM_INFO("Send DSC disable to synaptics\n"); DRM_INFO("MST_DSC Send DSC disable to synaptics\n");
} }
} }
...@@ -823,14 +823,14 @@ bool dm_helpers_dp_write_dsc_enable( ...@@ -823,14 +823,14 @@ bool dm_helpers_dp_write_dsc_enable(
DP_DSC_ENABLE, DP_DSC_ENABLE,
&enable_passthrough, 1); &enable_passthrough, 1);
drm_dbg_dp(dev, drm_dbg_dp(dev,
"Sent DSC pass-through enable to virtual dpcd port, ret = %u\n", "MST_DSC Sent DSC pass-through enable to virtual dpcd port, ret = %u\n",
ret); ret);
} }
ret = drm_dp_dpcd_write(aconnector->dsc_aux, ret = drm_dp_dpcd_write(aconnector->dsc_aux,
DP_DSC_ENABLE, &enable_dsc, 1); DP_DSC_ENABLE, &enable_dsc, 1);
drm_dbg_dp(dev, drm_dbg_dp(dev,
"Sent DSC decoding enable to %s port, ret = %u\n", "MST_DSC Sent DSC decoding enable to %s port, ret = %u\n",
(port->passthrough_aux) ? "remote RX" : (port->passthrough_aux) ? "remote RX" :
"virtual dpcd", "virtual dpcd",
ret); ret);
...@@ -838,7 +838,7 @@ bool dm_helpers_dp_write_dsc_enable( ...@@ -838,7 +838,7 @@ bool dm_helpers_dp_write_dsc_enable(
ret = drm_dp_dpcd_write(aconnector->dsc_aux, ret = drm_dp_dpcd_write(aconnector->dsc_aux,
DP_DSC_ENABLE, &enable_dsc, 1); DP_DSC_ENABLE, &enable_dsc, 1);
drm_dbg_dp(dev, drm_dbg_dp(dev,
"Sent DSC decoding disable to %s port, ret = %u\n", "MST_DSC Sent DSC decoding disable to %s port, ret = %u\n",
(port->passthrough_aux) ? "remote RX" : (port->passthrough_aux) ? "remote RX" :
"virtual dpcd", "virtual dpcd",
ret); ret);
...@@ -848,7 +848,7 @@ bool dm_helpers_dp_write_dsc_enable( ...@@ -848,7 +848,7 @@ bool dm_helpers_dp_write_dsc_enable(
DP_DSC_ENABLE, DP_DSC_ENABLE,
&enable_passthrough, 1); &enable_passthrough, 1);
drm_dbg_dp(dev, drm_dbg_dp(dev,
"Sent DSC pass-through disable to virtual dpcd port, ret = %u\n", "MST_DSC Sent DSC pass-through disable to virtual dpcd port, ret = %u\n",
ret); ret);
} }
} }
...@@ -858,12 +858,12 @@ bool dm_helpers_dp_write_dsc_enable( ...@@ -858,12 +858,12 @@ bool dm_helpers_dp_write_dsc_enable(
if (stream->sink->link->dpcd_caps.dongle_type == DISPLAY_DONGLE_NONE) { if (stream->sink->link->dpcd_caps.dongle_type == DISPLAY_DONGLE_NONE) {
ret = dm_helpers_dp_write_dpcd(ctx, stream->link, DP_DSC_ENABLE, &enable_dsc, 1); ret = dm_helpers_dp_write_dpcd(ctx, stream->link, DP_DSC_ENABLE, &enable_dsc, 1);
drm_dbg_dp(dev, drm_dbg_dp(dev,
"Send DSC %s to SST RX\n", "SST_DSC Send DSC %s to SST RX\n",
enable_dsc ? "enable" : "disable"); enable_dsc ? "enable" : "disable");
} else if (stream->sink->link->dpcd_caps.dongle_type == DISPLAY_DONGLE_DP_HDMI_CONVERTER) { } else if (stream->sink->link->dpcd_caps.dongle_type == DISPLAY_DONGLE_DP_HDMI_CONVERTER) {
ret = dm_helpers_dp_write_dpcd(ctx, stream->link, DP_DSC_ENABLE, &enable_dsc, 1); ret = dm_helpers_dp_write_dpcd(ctx, stream->link, DP_DSC_ENABLE, &enable_dsc, 1);
drm_dbg_dp(dev, drm_dbg_dp(dev,
"Send DSC %s to DP-HDMI PCON\n", "SST_DSC Send DSC %s to DP-HDMI PCON\n",
enable_dsc ? "enable" : "disable"); enable_dsc ? "enable" : "disable");
} }
} }
......
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