disp: msm: dp: adding prefix for logs

Adding prefixes for error, debug and info
messages in dp files. To enable debug logs
run "echo 0x100 > /sys/module/drm/parameters/debug"

CRs-Fixed: 2493739
Change-Id: Ibf509e837f527be6bff6b7a1c34b0cde2921b388
Signed-off-by: Satya Rama Aditya Pinapala <psraditya30@codeaurora.org>
此提交包含在:
Satya Rama Aditya Pinapala
2019-07-15 19:28:57 -07:00
父節點 a6bfb7fc1e
當前提交 aacd9e9585
共有 20 個檔案被更改,包括 961 行新增971 行删除

查看文件

@@ -3,8 +3,6 @@
* Copyright (c) 2017-2019, The Linux Foundation. All rights reserved.
*/
#define pr_fmt(fmt) "[drm-dp] %s: " fmt, __func__
#include <linux/debugfs.h>
#include <linux/slab.h>
@@ -115,7 +113,7 @@ static ssize_t dp_debug_write_edid(struct file *file,
goto bail;
if (edid_size != debug->edid_size) {
pr_debug("realloc debug edid\n");
DP_DEBUG("realloc debug edid\n");
if (debug->edid) {
devm_kfree(debug->dev, debug->edid);
@@ -143,7 +141,7 @@ static ssize_t dp_debug_write_edid(struct file *file,
t[char_to_nib] = '\0';
if (kstrtoint(t, 16, &d)) {
pr_err("kstrtoint error\n");
DP_ERR("kstrtoint error\n");
goto bail;
}
@@ -163,7 +161,7 @@ bail:
* only while running in debug mode which is manually
* triggered by a tester or a script.
*/
pr_info("[%s]\n", edid ? "SET" : "CLEAR");
DP_INFO("[%s]\n", edid ? "SET" : "CLEAR");
mutex_unlock(&debug->lock);
return rc;
@@ -208,7 +206,7 @@ static ssize_t dp_debug_write_dpcd(struct file *file,
offset_ch[4] = '\0';
if (kstrtoint(offset_ch, 16, &offset)) {
pr_err("offset kstrtoint error\n");
DP_ERR("offset kstrtoint error\n");
goto bail;
}
@@ -216,7 +214,7 @@ static ssize_t dp_debug_write_dpcd(struct file *file,
goto bail;
if (offset == 0xFFFF) {
pr_err("clearing dpcd\n");
DP_ERR("clearing dpcd\n");
memset(debug->dpcd, 0, debug->dpcd_size);
goto bail;
}
@@ -237,7 +235,7 @@ static ssize_t dp_debug_write_dpcd(struct file *file,
t[char_to_nib] = '\0';
if (kstrtoint(t, 16, &d)) {
pr_err("kstrtoint error\n");
DP_ERR("kstrtoint error\n");
goto bail;
}
@@ -263,7 +261,7 @@ bail:
* only while running in debug mode which is manually
* triggered by a tester or a script.
*/
pr_info("[%s]\n", dpcd ? "SET" : "CLEAR");
DP_INFO("[%s]\n", dpcd ? "SET" : "CLEAR");
} else
debug->aux->dpcd_updated(debug->aux);
@@ -348,7 +346,7 @@ static ssize_t dp_debug_write_hpd(struct file *file,
* only while running in debug mode which is manually
* triggered by a tester or a script.
*/
pr_info("%s\n", debug->hotplug ? "[CONNECT]" : "[DISCONNECT]");
DP_INFO("%s\n", debug->hotplug ? "[CONNECT]" : "[DISCONNECT]");
debug->hpd->simulate_connect(debug->hpd, debug->hotplug);
end:
@@ -390,7 +388,7 @@ static ssize_t dp_debug_write_edid_modes(struct file *file,
debug->dp_debug.aspect_ratio = aspect_ratio;
goto end;
clear:
pr_debug("clearing debug modes\n");
DP_DEBUG("clearing debug modes\n");
debug->dp_debug.debug_en = false;
end:
return len;
@@ -440,7 +438,7 @@ static ssize_t dp_debug_write_edid_modes_mst(struct file *file,
}
if (!in_list)
pr_debug("dp connector id %d is invalid\n", con_id);
DP_DEBUG("dp connector id %d is invalid\n", con_id);
in_list = false;
read_buf += offset;
@@ -497,7 +495,7 @@ static ssize_t dp_debug_write_mst_con_id(struct file *file,
mutex_unlock(&debug->dp_debug.dp_mst_connector_list.lock);
if (!in_list)
pr_err("invalid connector id %u\n", con_id);
DP_ERR("invalid connector id %u\n", con_id);
else if (status != connector_status_unknown) {
debug->dp_debug.mst_hpd_sim = true;
debug->hpd->simulate_attention(debug->hpd, vdo);
@@ -505,7 +503,7 @@ static ssize_t dp_debug_write_mst_con_id(struct file *file,
goto end;
clear:
pr_debug("clearing mst_con_id\n");
DP_DEBUG("clearing mst_con_id\n");
debug->mst_con_id = 0;
end:
return len;
@@ -620,11 +618,11 @@ static ssize_t dp_debug_bw_code_write(struct file *file,
return 0;
if (!is_link_rate_valid(max_bw_code)) {
pr_err("Unsupported bw code %d\n", max_bw_code);
DP_ERR("Unsupported bw code %d\n", max_bw_code);
return len;
}
debug->panel->max_bw_code = max_bw_code;
pr_debug("max_bw_code: %d\n", max_bw_code);
DP_DEBUG("max_bw_code: %d\n", max_bw_code);
return len;
}
@@ -668,7 +666,7 @@ static ssize_t dp_debug_mst_mode_write(struct file *file,
return 0;
debug->parser->has_mst = mst_mode ? true : false;
pr_debug("mst_enable: %d\n", mst_mode);
DP_DEBUG("mst_enable: %d\n", mst_mode);
return len;
}
@@ -697,12 +695,12 @@ static ssize_t dp_debug_max_pclk_khz_write(struct file *file,
return 0;
if (max_pclk > debug->parser->max_pclk_khz)
pr_err("requested: %d, max_pclk_khz:%d\n", max_pclk,
DP_ERR("requested: %d, max_pclk_khz:%d\n", max_pclk,
debug->parser->max_pclk_khz);
else
debug->dp_debug.max_pclk_khz = max_pclk;
pr_debug("max_pclk_khz: %d\n", max_pclk);
DP_DEBUG("max_pclk_khz: %d\n", max_pclk);
return len;
}
@@ -759,19 +757,19 @@ static ssize_t dp_debug_mst_sideband_mode_write(struct file *file,
buf[len] = '\0';
if (sscanf(buf, "%d %u", &mst_sideband_mode, &mst_port_cnt) != 2) {
pr_err("invalid input\n");
DP_ERR("invalid input\n");
return -EINVAL;
}
if (mst_port_cnt > DP_MST_SIM_MAX_PORTS) {
pr_err("port cnt:%d exceeding max:%d\n", mst_port_cnt,
DP_ERR("port cnt:%d exceeding max:%d\n", mst_port_cnt,
DP_MST_SIM_MAX_PORTS);
return -EINVAL;
}
debug->parser->has_mst_sideband = mst_sideband_mode ? true : false;
debug->dp_debug.mst_port_cnt = mst_port_cnt;
pr_debug("mst_sideband_mode: %d port_cnt:%d\n",
DP_DEBUG("mst_sideband_mode: %d port_cnt:%d\n",
mst_sideband_mode, mst_port_cnt);
return count;
}
@@ -800,7 +798,7 @@ static ssize_t dp_debug_widebus_mode_write(struct file *file,
return -EINVAL;
debug->parser->has_widebus = widebus_mode ? true : false;
pr_debug("widebus_enable: %d\n", widebus_mode);
DP_DEBUG("widebus_enable: %d\n", widebus_mode);
return len;
}
@@ -830,7 +828,7 @@ static ssize_t dp_debug_tpg_write(struct file *file,
goto bail;
tpg_state &= 0x1;
pr_debug("tpg_state: %d\n", tpg_state);
DP_DEBUG("tpg_state: %d\n", tpg_state);
if (tpg_state == debug->dp_debug.tpg_state)
goto bail;
@@ -950,7 +948,7 @@ static ssize_t dp_debug_read_hdcp(struct file *file,
static int dp_debug_check_buffer_overflow(int rc, int *max_size, int *len)
{
if (rc >= *max_size) {
pr_err("buffer overflow\n");
DP_ERR("buffer overflow\n");
return -EINVAL;
}
*len += rc;
@@ -970,7 +968,7 @@ static ssize_t dp_debug_read_edid_modes(struct file *file,
struct drm_display_mode *mode;
if (!debug) {
pr_err("invalid data\n");
DP_ERR("invalid data\n");
rc = -ENODEV;
goto error;
}
@@ -978,7 +976,7 @@ static ssize_t dp_debug_read_edid_modes(struct file *file,
connector = *debug->connector;
if (!connector) {
pr_err("connector is NULL\n");
DP_ERR("connector is NULL\n");
rc = -EINVAL;
goto error;
}
@@ -1030,7 +1028,7 @@ static ssize_t dp_debug_read_edid_modes_mst(struct file *file,
bool in_list = false;
if (!debug) {
pr_err("invalid data\n");
DP_ERR("invalid data\n");
rc = -ENODEV;
goto error;
}
@@ -1046,13 +1044,13 @@ static ssize_t dp_debug_read_edid_modes_mst(struct file *file,
mutex_unlock(&debug->dp_debug.dp_mst_connector_list.lock);
if (!in_list) {
pr_err("connector %u not in mst list\n", debug->mst_con_id);
DP_ERR("connector %u not in mst list\n", debug->mst_con_id);
rc = -EINVAL;
goto error;
}
if (!connector) {
pr_err("connector is NULL\n");
DP_ERR("connector is NULL\n");
rc = -EINVAL;
goto error;
}
@@ -1101,7 +1099,7 @@ static ssize_t dp_debug_read_mst_con_id(struct file *file,
int rc = 0;
if (!debug) {
pr_err("invalid data\n");
DP_ERR("invalid data\n");
rc = -ENODEV;
goto error;
}
@@ -1143,7 +1141,7 @@ static ssize_t dp_debug_read_mst_conn_info(struct file *file,
struct drm_connector *connector;
if (!debug) {
pr_err("invalid data\n");
DP_ERR("invalid data\n");
rc = -ENODEV;
goto error;
}
@@ -1167,7 +1165,7 @@ static ssize_t dp_debug_read_mst_conn_info(struct file *file,
connector = mst_connector->conn;
if (!connector) {
pr_err("connector for id %d is NULL\n",
DP_ERR("connector for id %d is NULL\n",
mst_connector->con_id);
continue;
}
@@ -1488,14 +1486,14 @@ static ssize_t dp_debug_read_hdr(struct file *file,
struct drm_connector *connector;
if (!debug) {
pr_err("invalid data\n");
DP_ERR("invalid data\n");
return -ENODEV;
}
connector = *debug->connector;
if (!connector) {
pr_err("connector is NULL\n");
DP_ERR("connector is NULL\n");
return -EINVAL;
}
@@ -1533,7 +1531,7 @@ static ssize_t dp_debug_read_hdr_mst(struct file *file,
bool in_list = false;
if (!debug) {
pr_err("invalid data\n");
DP_ERR("invalid data\n");
return -ENODEV;
}
@@ -1548,12 +1546,12 @@ static ssize_t dp_debug_read_hdr_mst(struct file *file,
mutex_unlock(&debug->dp_debug.dp_mst_connector_list.lock);
if (!in_list) {
pr_err("connector %u not in mst list\n", debug->mst_con_id);
DP_ERR("connector %u not in mst list\n", debug->mst_con_id);
return -EINVAL;
}
if (!connector) {
pr_err("connector is NULL\n");
DP_ERR("connector is NULL\n");
return -EINVAL;
}
@@ -1598,7 +1596,7 @@ static void dp_debug_set_sim_mode(struct dp_debug_private *debug, bool sim)
debug->edid, debug->dpcd);
} else {
if (debug->hotplug) {
pr_warn("sim mode off before hotplug disconnect\n");
DP_WARN("sim mode off before hotplug disconnect\n");
debug->hpd->simulate_connect(debug->hpd, false);
debug->hotplug = false;
}
@@ -1626,7 +1624,7 @@ static void dp_debug_set_sim_mode(struct dp_debug_private *debug, bool sim)
* only while running in debug mode which is manually
* triggered by a tester or a script.
*/
pr_info("%s\n", sim ? "[ON]" : "[OFF]");
DP_INFO("%s\n", sim ? "[ON]" : "[OFF]");
}
static ssize_t dp_debug_write_sim(struct file *file,
@@ -1897,7 +1895,7 @@ static int dp_debug_init(struct dp_debug *dp_debug)
rc = -EINVAL;
else
rc = PTR_ERR(dir);
pr_err("[%s] debugfs create dir failed, rc = %d\n",
DP_ERR("[%s] debugfs create dir failed, rc = %d\n",
DEBUG_NAME, rc);
goto error;
}
@@ -1908,7 +1906,7 @@ static int dp_debug_init(struct dp_debug *dp_debug)
debug, &dp_debug_fops);
if (IS_ERR_OR_NULL(file)) {
rc = PTR_ERR(file);
pr_err("[%s] debugfs create file failed, rc=%d\n",
DP_ERR("[%s] debugfs create file failed, rc=%d\n",
DEBUG_NAME, rc);
goto error_remove_dir;
}
@@ -1917,7 +1915,7 @@ static int dp_debug_init(struct dp_debug *dp_debug)
debug, &edid_modes_fops);
if (IS_ERR_OR_NULL(file)) {
rc = PTR_ERR(file);
pr_err("[%s] debugfs create edid_modes failed, rc=%d\n",
DP_ERR("[%s] debugfs create edid_modes failed, rc=%d\n",
DEBUG_NAME, rc);
goto error_remove_dir;
}
@@ -1926,7 +1924,7 @@ static int dp_debug_init(struct dp_debug *dp_debug)
debug, &edid_modes_mst_fops);
if (IS_ERR_OR_NULL(file)) {
rc = PTR_ERR(file);
pr_err("[%s] debugfs create edid_modes_mst failed, rc=%d\n",
DP_ERR("[%s] debugfs create edid_modes_mst failed, rc=%d\n",
DEBUG_NAME, rc);
goto error_remove_dir;
}
@@ -1935,7 +1933,7 @@ static int dp_debug_init(struct dp_debug *dp_debug)
debug, &mst_con_id_fops);
if (IS_ERR_OR_NULL(file)) {
rc = PTR_ERR(file);
pr_err("[%s] debugfs create mst_con_id failed, rc=%d\n",
DP_ERR("[%s] debugfs create mst_con_id failed, rc=%d\n",
DEBUG_NAME, rc);
goto error_remove_dir;
}
@@ -1944,7 +1942,7 @@ static int dp_debug_init(struct dp_debug *dp_debug)
debug, &mst_conn_info_fops);
if (IS_ERR_OR_NULL(file)) {
rc = PTR_ERR(file);
pr_err("[%s] debugfs create mst_conn_info failed, rc=%d\n",
DP_ERR("[%s] debugfs create mst_conn_info failed, rc=%d\n",
DEBUG_NAME, rc);
goto error_remove_dir;
}
@@ -1971,7 +1969,7 @@ static int dp_debug_init(struct dp_debug *dp_debug)
debug, &hpd_fops);
if (IS_ERR_OR_NULL(file)) {
rc = PTR_ERR(file);
pr_err("[%s] debugfs hpd failed, rc=%d\n",
DP_ERR("[%s] debugfs hpd failed, rc=%d\n",
DEBUG_NAME, rc);
goto error_remove_dir;
}
@@ -1980,7 +1978,7 @@ static int dp_debug_init(struct dp_debug *dp_debug)
debug, &connected_fops);
if (IS_ERR_OR_NULL(file)) {
rc = PTR_ERR(file);
pr_err("[%s] debugfs connected failed, rc=%d\n",
DP_ERR("[%s] debugfs connected failed, rc=%d\n",
DEBUG_NAME, rc);
goto error_remove_dir;
}
@@ -1989,7 +1987,7 @@ static int dp_debug_init(struct dp_debug *dp_debug)
debug, &bw_code_fops);
if (IS_ERR_OR_NULL(file)) {
rc = PTR_ERR(file);
pr_err("[%s] debugfs max_bw_code failed, rc=%d\n",
DP_ERR("[%s] debugfs max_bw_code failed, rc=%d\n",
DEBUG_NAME, rc);
}
@@ -1997,7 +1995,7 @@ static int dp_debug_init(struct dp_debug *dp_debug)
debug, &exe_mode_fops);
if (IS_ERR_OR_NULL(file)) {
rc = PTR_ERR(file);
pr_err("[%s] debugfs register failed, rc=%d\n",
DP_ERR("[%s] debugfs register failed, rc=%d\n",
DEBUG_NAME, rc);
}
@@ -2005,7 +2003,7 @@ static int dp_debug_init(struct dp_debug *dp_debug)
debug, &edid_fops);
if (IS_ERR_OR_NULL(file)) {
rc = PTR_ERR(file);
pr_err("[%s] debugfs edid failed, rc=%d\n",
DP_ERR("[%s] debugfs edid failed, rc=%d\n",
DEBUG_NAME, rc);
goto error_remove_dir;
}
@@ -2014,7 +2012,7 @@ static int dp_debug_init(struct dp_debug *dp_debug)
debug, &dpcd_fops);
if (IS_ERR_OR_NULL(file)) {
rc = PTR_ERR(file);
pr_err("[%s] debugfs dpcd failed, rc=%d\n",
DP_ERR("[%s] debugfs dpcd failed, rc=%d\n",
DEBUG_NAME, rc);
goto error_remove_dir;
}
@@ -2023,7 +2021,7 @@ static int dp_debug_init(struct dp_debug *dp_debug)
debug, &tpg_fops);
if (IS_ERR_OR_NULL(file)) {
rc = PTR_ERR(file);
pr_err("[%s] debugfs tpg failed, rc=%d\n",
DP_ERR("[%s] debugfs tpg failed, rc=%d\n",
DEBUG_NAME, rc);
goto error_remove_dir;
}
@@ -2033,7 +2031,7 @@ static int dp_debug_init(struct dp_debug *dp_debug)
if (IS_ERR_OR_NULL(file)) {
rc = PTR_ERR(file);
pr_err("[%s] debugfs hdr failed, rc=%d\n",
DP_ERR("[%s] debugfs hdr failed, rc=%d\n",
DEBUG_NAME, rc);
goto error_remove_dir;
}
@@ -2043,7 +2041,7 @@ static int dp_debug_init(struct dp_debug *dp_debug)
if (IS_ERR_OR_NULL(file)) {
rc = PTR_ERR(file);
pr_err("[%s] debugfs hdr_mst failed, rc=%d\n",
DP_ERR("[%s] debugfs hdr_mst failed, rc=%d\n",
DEBUG_NAME, rc);
goto error_remove_dir;
}
@@ -2053,7 +2051,7 @@ static int dp_debug_init(struct dp_debug *dp_debug)
if (IS_ERR_OR_NULL(file)) {
rc = PTR_ERR(file);
pr_err("[%s] debugfs sim failed, rc=%d\n",
DP_ERR("[%s] debugfs sim failed, rc=%d\n",
DEBUG_NAME, rc);
goto error_remove_dir;
}
@@ -2063,7 +2061,7 @@ static int dp_debug_init(struct dp_debug *dp_debug)
if (IS_ERR_OR_NULL(file)) {
rc = PTR_ERR(file);
pr_err("[%s] debugfs attention failed, rc=%d\n",
DP_ERR("[%s] debugfs attention failed, rc=%d\n",
DEBUG_NAME, rc);
goto error_remove_dir;
}
@@ -2073,7 +2071,7 @@ static int dp_debug_init(struct dp_debug *dp_debug)
if (IS_ERR_OR_NULL(file)) {
rc = PTR_ERR(file);
pr_err("[%s] debugfs dump failed, rc=%d\n",
DP_ERR("[%s] debugfs dump failed, rc=%d\n",
DEBUG_NAME, rc);
goto error_remove_dir;
}
@@ -2082,7 +2080,7 @@ static int dp_debug_init(struct dp_debug *dp_debug)
debug, &mst_mode_fops);
if (IS_ERR_OR_NULL(file)) {
rc = PTR_ERR(file);
pr_err("[%s] debugfs max_bw_code failed, rc=%d\n",
DP_ERR("[%s] debugfs max_bw_code failed, rc=%d\n",
DEBUG_NAME, rc);
goto error_remove_dir;
}
@@ -2091,7 +2089,7 @@ static int dp_debug_init(struct dp_debug *dp_debug)
debug, &mst_sideband_mode_fops);
if (IS_ERR_OR_NULL(file)) {
rc = PTR_ERR(file);
pr_err("[%s] debugfs max_bw_code failed, rc=%d\n",
DP_ERR("[%s] debugfs max_bw_code failed, rc=%d\n",
DEBUG_NAME, rc);
goto error_remove_dir;
}
@@ -2100,7 +2098,7 @@ static int dp_debug_init(struct dp_debug *dp_debug)
debug, &max_pclk_khz_fops);
if (IS_ERR_OR_NULL(file)) {
rc = PTR_ERR(file);
pr_err("[%s] debugfs max_pclk_khz failed, rc=%d\n",
DP_ERR("[%s] debugfs max_pclk_khz failed, rc=%d\n",
DEBUG_NAME, rc);
goto error_remove_dir;
}
@@ -2109,7 +2107,7 @@ static int dp_debug_init(struct dp_debug *dp_debug)
&debug->dp_debug.force_encryption);
if (IS_ERR_OR_NULL(file)) {
rc = PTR_ERR(file);
pr_err("[%s] debugfs force_encryption failed, rc=%d\n",
DP_ERR("[%s] debugfs force_encryption failed, rc=%d\n",
DEBUG_NAME, rc);
goto error_remove_dir;
}
@@ -2118,7 +2116,7 @@ static int dp_debug_init(struct dp_debug *dp_debug)
debug, &hdcp_fops);
if (IS_ERR_OR_NULL(file)) {
rc = PTR_ERR(file);
pr_err("[%s] debugfs hdcp failed, rc=%d\n",
DP_ERR("[%s] debugfs hdcp failed, rc=%d\n",
DEBUG_NAME, rc);
goto error_remove_dir;
}
@@ -2128,7 +2126,7 @@ static int dp_debug_init(struct dp_debug *dp_debug)
if (IS_ERR_OR_NULL(file)) {
rc = PTR_ERR(file);
pr_err("[%s] debugfs hdcp_wait_sink_sync failed, rc=%d\n",
DP_ERR("[%s] debugfs hdcp_wait_sink_sync failed, rc=%d\n",
DEBUG_NAME, rc);
goto error_remove_dir;
}
@@ -2137,7 +2135,7 @@ static int dp_debug_init(struct dp_debug *dp_debug)
&debug->parser->dsc_feature_enable);
if (IS_ERR_OR_NULL(file)) {
rc = PTR_ERR(file);
pr_err("[%s] debugfs dsc_feature failed, rc=%d\n",
DP_ERR("[%s] debugfs dsc_feature failed, rc=%d\n",
DEBUG_NAME, rc);
}
@@ -2145,7 +2143,7 @@ static int dp_debug_init(struct dp_debug *dp_debug)
&debug->parser->fec_feature_enable);
if (IS_ERR_OR_NULL(file)) {
rc = PTR_ERR(file);
pr_err("[%s] debugfs fec_feature_enable failed, rc=%d\n",
DP_ERR("[%s] debugfs fec_feature_enable failed, rc=%d\n",
DEBUG_NAME, rc);
}
@@ -2153,7 +2151,7 @@ static int dp_debug_init(struct dp_debug *dp_debug)
debug, &widebus_mode_fops);
if (IS_ERR_OR_NULL(file)) {
rc = PTR_ERR(file);
pr_err("[%s] debugfs widebus failed, rc=%d\n",
DP_ERR("[%s] debugfs widebus failed, rc=%d\n",
DEBUG_NAME, rc);
}
@@ -2161,7 +2159,7 @@ static int dp_debug_init(struct dp_debug *dp_debug)
&debug->parser->max_lclk_khz);
if (IS_ERR_OR_NULL(file)) {
rc = PTR_ERR(file);
pr_err("[%s] debugfs max_lclk_khz failed, rc=%d\n",
DP_ERR("[%s] debugfs max_lclk_khz failed, rc=%d\n",
DEBUG_NAME, rc);
}
@@ -2209,7 +2207,7 @@ struct dp_debug *dp_debug_get(struct dp_debug_in *in)
if (!in->dev || !in->panel || !in->hpd || !in->link ||
!in->catalog || !in->ctrl) {
pr_err("invalid input\n");
DP_ERR("invalid input\n");
rc = -EINVAL;
goto error;
}