From 5ba397e17e8a3d520bdd293d5d5d8d54dd325b34 Mon Sep 17 00:00:00 2001 From: Aravind Venkateswaran Date: Sun, 27 Sep 2020 22:11:47 -0700 Subject: [PATCH 1/2] disp: msm: dp: fix the check for link maintenance Current implementation checks for loss of channel equilization or clock recovery only if the sink sets the link status updated bit in the DPCD. However, it is possible that the sink can issue an IRQ HPD to notify a link loss without setting the link status updated field. Update the implementation to perform a link maintenance whenever clock recovery or channel equalization is not ok irrespective of whether the link status updated bit is set. Change-Id: I2d765236b1e8ddae3c410087406546d0422cdf07 Signed-off-by: Aravind Venkateswaran --- msm/dp/dp_link.c | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/msm/dp/dp_link.c b/msm/dp/dp_link.c index 20a09cf9bf..6ff3afef2d 100644 --- a/msm/dp/dp_link.c +++ b/msm/dp/dp_link.c @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0-only /* - * Copyright (c) 2012-2019, The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2020, The Linux Foundation. All rights reserved. */ #include "dp_link.h" @@ -1113,19 +1113,15 @@ static u8 get_link_status(const u8 link_status[DP_LINK_STATUS_SIZE], int r) */ static int dp_link_process_link_status_update(struct dp_link_private *link) { - if (!(get_link_status(link->link_status, DP_LANE_ALIGN_STATUS_UPDATED) & - DP_LINK_STATUS_UPDATED) || /* link status updated */ - (drm_dp_clock_recovery_ok(link->link_status, - link->dp_link.link_params.lane_count) && - drm_dp_channel_eq_ok(link->link_status, - link->dp_link.link_params.lane_count))) - return -EINVAL; - + bool channel_eq_done = drm_dp_channel_eq_ok(link->link_status, + link->dp_link.link_params.lane_count); + bool clock_recovery_done = drm_dp_clock_recovery_ok(link->link_status, + link->dp_link.link_params.lane_count); DP_DEBUG("channel_eq_done = %d, clock_recovery_done = %d\n", - drm_dp_channel_eq_ok(link->link_status, - link->dp_link.link_params.lane_count), - drm_dp_clock_recovery_ok(link->link_status, - link->dp_link.link_params.lane_count)); + channel_eq_done, clock_recovery_done); + + if (channel_eq_done && clock_recovery_done) + return -EINVAL; return 0; } From d1d2d5a809a86635cdd94230ba465ded9db780a2 Mon Sep 17 00:00:00 2001 From: Aravind Venkateswaran Date: Thu, 1 Oct 2020 22:46:03 -0700 Subject: [PATCH 2/2] disp: msm: dp: reduce log level for messages Decrease the log level for messages that are typically printed from a real time thread execution environment (such as the display commit thread). This can help with cases where a console lock held during the execution of these real time threads can result in RT throttling issues. Change-Id: I41e1e4f171b5eee9966d8a7d26d64430a81bc6fc Signed-off-by: Aravind Venkateswaran --- msm/dp/dp_catalog.c | 6 +++--- msm/dp/dp_debug.c | 2 +- msm/dp/dp_link.c | 4 ++-- msm/dp/dp_panel.c | 24 ++++++++++++------------ 4 files changed, 18 insertions(+), 18 deletions(-) diff --git a/msm/dp/dp_catalog.c b/msm/dp/dp_catalog.c index e62ba41a31..40086d43f2 100644 --- a/msm/dp/dp_catalog.c +++ b/msm/dp/dp_catalog.c @@ -634,7 +634,7 @@ static void dp_catalog_panel_setup_vsif_infoframe_sdp( memcpy(buf + off, &data, sizeof(data)); off += sizeof(data); - print_hex_dump(KERN_DEBUG, "[drm-dp] VSCEXT: ", + print_hex_dump_debug("[drm-dp] VSCEXT: ", DUMP_PREFIX_NONE, 16, 4, buf, off, false); } @@ -749,7 +749,7 @@ static void dp_catalog_panel_setup_hdr_infoframe_sdp( memcpy(buf + off, &data, sizeof(data)); off += sizeof(data); - print_hex_dump(KERN_DEBUG, "[drm-dp] HDR: ", + print_hex_dump_debug("[drm-dp] HDR: ", DUMP_PREFIX_NONE, 16, 4, buf, off, false); } @@ -841,7 +841,7 @@ static void dp_catalog_panel_setup_vsc_sdp(struct dp_catalog_panel *panel) memcpy(buf + off, &data, sizeof(data)); off += sizeof(data); - print_hex_dump(KERN_DEBUG, "[drm-dp] VSC: ", + print_hex_dump_debug("[drm-dp] VSC: ", DUMP_PREFIX_NONE, 16, 4, buf, off, false); } diff --git a/msm/dp/dp_debug.c b/msm/dp/dp_debug.c index f3cfb15d1b..e9b5266b6d 100644 --- a/msm/dp/dp_debug.c +++ b/msm/dp/dp_debug.c @@ -1751,7 +1751,7 @@ static ssize_t dp_debug_read_dump(struct file *file, goto end; snprintf(prefix, sizeof(prefix), "%s: ", debug->reg_dump); - print_hex_dump(KERN_DEBUG, prefix, DUMP_PREFIX_NONE, + print_hex_dump_debug(prefix, DUMP_PREFIX_NONE, 16, 4, buf, len, false); len = min_t(size_t, count, len); diff --git a/msm/dp/dp_link.c b/msm/dp/dp_link.c index 6ff3afef2d..57122e3431 100644 --- a/msm/dp/dp_link.c +++ b/msm/dp/dp_link.c @@ -1321,7 +1321,7 @@ exit: * and want source to redo some part of initialization which can * be helpful in debugging. */ - DP_INFO("test requested: %s\n", + DP_INFO("event: %s\n", dp_link_get_test_name(dp_link->sink_request)); return 0; } @@ -1404,7 +1404,7 @@ static int dp_link_adjust_levels(struct dp_link *dp_link, u8 *link_status) dp_link->phy_params.p_level = max; - print_hex_dump(KERN_DEBUG, "[drm-dp] Req (VxPx): ", + print_hex_dump_debug("[drm-dp] Req (VxPx): ", DUMP_PREFIX_NONE, 8, 2, buf, sizeof(buf), false); /** diff --git a/msm/dp/dp_panel.c b/msm/dp/dp_panel.c index c2847392cd..c2a1540a06 100644 --- a/msm/dp/dp_panel.c +++ b/msm/dp/dp_panel.c @@ -402,7 +402,7 @@ static void dp_panel_update_tu_timings(struct dp_tu_calc_input *in, tot_num_dummy_bytes = (nlanes - eoc_bytes) * dsc_num_slices; if (dsc_num_bytes == 0) - DP_INFO("incorrect no of bytes per slice=%d\n", dsc_num_bytes); + DP_DEBUG("incorrect no of bytes per slice=%d\n", dsc_num_bytes); dwidth_dsc_bytes = (tot_num_hor_bytes + tot_num_eoc_symbols + @@ -800,7 +800,7 @@ static void _dp_panel_calc_tu(struct dp_tu_calc_input *in, if (tu.dsc_en && compare_result_1 && compare_result_2) { HBLANK_MARGIN += 4; - DP_INFO("Info: increase HBLANK_MARGIN to %d\n", HBLANK_MARGIN); + DP_DEBUG("Info: increase HBLANK_MARGIN to %d\n", HBLANK_MARGIN); } tu_size_calc: @@ -834,7 +834,7 @@ tu_size_calc: tu.n_tus += 1; tu.even_distribution_legacy = tu.n_tus % tu.nlanes == 0 ? 1 : 0; - DP_INFO("Info: n_sym = %d, num_of_tus = %d\n", + DP_DEBUG("Info: n_sym = %d, num_of_tus = %d\n", tu.valid_boundary_link, tu.n_tus); _dp_calc_extra_bytes(&tu); @@ -964,17 +964,17 @@ tu_size_calc: tu_table->lower_boundary_count = tu.lower_boundary_count; tu_table->tu_size_minus1 = tu.tu_size_minus1; - DP_INFO("TU: valid_boundary_link: %d\n", tu_table->valid_boundary_link); - DP_INFO("TU: delay_start_link: %d\n", tu_table->delay_start_link); - DP_INFO("TU: boundary_moderation_en: %d\n", + DP_DEBUG("TU: valid_boundary_link: %d\n", tu_table->valid_boundary_link); + DP_DEBUG("TU: delay_start_link: %d\n", tu_table->delay_start_link); + DP_DEBUG("TU: boundary_moderation_en: %d\n", tu_table->boundary_moderation_en); - DP_INFO("TU: valid_lower_boundary_link: %d\n", + DP_DEBUG("TU: valid_lower_boundary_link: %d\n", tu_table->valid_lower_boundary_link); - DP_INFO("TU: upper_boundary_count: %d\n", + DP_DEBUG("TU: upper_boundary_count: %d\n", tu_table->upper_boundary_count); - DP_INFO("TU: lower_boundary_count: %d\n", + DP_DEBUG("TU: lower_boundary_count: %d\n", tu_table->lower_boundary_count); - DP_INFO("TU: tu_size_minus1: %d\n", tu_table->tu_size_minus1); + DP_DEBUG("TU: tu_size_minus1: %d\n", tu_table->tu_size_minus1); } static void dp_panel_calc_tu_parameters(struct dp_panel *dp_panel, @@ -1494,7 +1494,7 @@ static int dp_panel_read_dpcd(struct dp_panel *dp_panel, bool multi_func) goto end; } - print_hex_dump(KERN_DEBUG, "[drm-dp] SINK DPCD: ", + print_hex_dump_debug("[drm-dp] SINK DPCD: ", DUMP_PREFIX_NONE, 8, 1, dp_panel->dpcd, rlen, false); rlen = drm_dp_dpcd_read(panel->aux->drm_aux, @@ -1715,7 +1715,7 @@ static void dp_panel_read_sink_dsc_caps(struct dp_panel *dp_panel) return; } - print_hex_dump(KERN_DEBUG, "[drm-dp] SINK DSC DPCD: ", + print_hex_dump_debug("[drm-dp] SINK DSC DPCD: ", DUMP_PREFIX_NONE, 8, 1, dp_panel->dsc_dpcd, rlen, false);