disp: msm: display error log signature alignment

Ensure SDE_ERROR error log print function name and line number.
Add a macro DISP_DEV_ERR as a wrapper of dev_err to ensure origin dev_err
will print function name and line number.
This would help with analysis of errors reported with automated testing.

Expected display error log format:
  [FUNCTION_NAME:line] ERROR_MESSAGE

Change-Id: I354f45b492059d5ba2bb110d56443fd338add7ad
Signed-off-by: GG Hou <quic_renjhou@quicinc.com>
This commit is contained in:
GG Hou
2021-12-06 19:42:34 +08:00
parent 5c51cd9cfd
commit dbf99b46c9
24 changed files with 69 additions and 39 deletions

View File

@@ -297,7 +297,7 @@ void __iomem *msm_ioremap(struct platform_device *pdev, const char *name,
ptr = devm_ioremap(&pdev->dev, res->start, size);
if (!ptr) {
dev_err(&pdev->dev, "failed to ioremap: %s\n", name);
DISP_DEV_ERR(&pdev->dev, "failed to ioremap: %s\n", name);
return ERR_PTR(-ENOMEM);
}
@@ -331,13 +331,13 @@ unsigned long msm_get_phys_addr(struct platform_device *pdev, const char *name)
struct resource *res;
if (!name) {
dev_err(&pdev->dev, "invalid block name\n");
DISP_DEV_ERR(&pdev->dev, "invalid block name\n");
return 0;
}
res = platform_get_resource_byname(pdev, IORESOURCE_MEM, name);
if (!res) {
dev_err(&pdev->dev, "failed to get memory resource: %s\n", name);
DISP_DEV_ERR(&pdev->dev, "failed to get memory resource: %s\n", name);
return 0;
}
@@ -651,7 +651,7 @@ static int msm_init_vram(struct drm_device *dev)
p = dma_alloc_attrs(dev->dev, size,
&priv->vram.paddr, GFP_KERNEL, attrs);
if (!p) {
dev_err(dev->dev, "failed to allocate VRAM\n");
DISP_DEV_ERR(dev->dev, "failed to allocate VRAM\n");
priv->vram.paddr = 0;
return -ENOMEM;
}
@@ -704,7 +704,7 @@ static int msm_drm_display_thread_create(struct msm_drm_private *priv, struct dr
kthread_flush_work(&priv->thread_priority_work);
if (IS_ERR(priv->disp_thread[i].thread)) {
dev_err(dev, "failed to create crtc_commit kthread\n");
DISP_DEV_ERR(dev, "failed to create crtc_commit kthread\n");
priv->disp_thread[i].thread = NULL;
}
@@ -729,7 +729,7 @@ static int msm_drm_display_thread_create(struct msm_drm_private *priv, struct dr
kthread_flush_work(&priv->thread_priority_work);
if (IS_ERR(priv->event_thread[i].thread)) {
dev_err(dev, "failed to create crtc_event kthread\n");
DISP_DEV_ERR(dev, "failed to create crtc_event kthread\n");
priv->event_thread[i].thread = NULL;
}
@@ -766,7 +766,7 @@ static int msm_drm_display_thread_create(struct msm_drm_private *priv, struct dr
kthread_flush_work(&priv->thread_priority_work);
if (IS_ERR(priv->pp_event_thread)) {
dev_err(dev, "failed to create pp_event kthread\n");
DISP_DEV_ERR(dev, "failed to create pp_event kthread\n");
ret = PTR_ERR(priv->pp_event_thread);
priv->pp_event_thread = NULL;
return ret;
@@ -805,7 +805,7 @@ static struct msm_kms *_msm_drm_component_init_helper(
* and (for example) use dmabuf/prime to share buffers with
* imx drm driver on iMX5
*/
dev_err(dev, "failed to load kms\n");
DISP_DEV_ERR(dev, "failed to load kms\n");
return kms;
}
priv->kms = kms;
@@ -821,7 +821,7 @@ static struct msm_kms *_msm_drm_component_init_helper(
ret = (kms)->funcs->hw_init(kms);
if (ret) {
dev_err(dev, "kms hw init failed: %d\n", ret);
DISP_DEV_ERR(dev, "kms hw init failed: %d\n", ret);
return ERR_PTR(ret);
}
@@ -838,7 +838,7 @@ static int msm_drm_device_init(struct platform_device *pdev,
ddev = drm_dev_alloc(drv, dev);
if (IS_ERR(ddev)) {
dev_err(dev, "failed to allocate drm_device\n");
DISP_DEV_ERR(dev, "failed to allocate drm_device\n");
return PTR_ERR(ddev);
}
@@ -862,7 +862,7 @@ static int msm_drm_device_init(struct platform_device *pdev,
ret = sde_dbg_init(&pdev->dev);
if (ret) {
dev_err(dev, "failed to init sde dbg: %d\n", ret);
DISP_DEV_ERR(dev, "failed to init sde dbg: %d\n", ret);
goto dbg_init_fail;
}
@@ -870,7 +870,7 @@ static int msm_drm_device_init(struct platform_device *pdev,
ret = pm_runtime_resume_and_get(dev);
if (ret < 0) {
dev_err(dev, "failed to enable power resource %d\n", ret);
DISP_DEV_ERR(dev, "failed to enable power resource %d\n", ret);
goto pm_runtime_error;
}
@@ -933,7 +933,7 @@ static int msm_drm_component_init(struct device *dev)
kms = _msm_drm_component_init_helper(priv, ddev, dev, pdev);
if (IS_ERR_OR_NULL(kms)) {
dev_err(dev, "msm_drm_component_init_helper failed\n");
DISP_DEV_ERR(dev, "msm_drm_component_init_helper failed\n");
goto fail;
}
@@ -943,13 +943,13 @@ static int msm_drm_component_init(struct device *dev)
ret = msm_drm_display_thread_create(priv, ddev, dev);
if (ret) {
dev_err(dev, "msm_drm_display_thread_create failed\n");
DISP_DEV_ERR(dev, "msm_drm_display_thread_create failed\n");
goto fail;
}
ret = drm_vblank_init(ddev, priv->num_crtcs);
if (ret < 0) {
dev_err(dev, "failed to initialize vblank\n");
DISP_DEV_ERR(dev, "failed to initialize vblank\n");
goto fail;
}
@@ -959,7 +959,7 @@ static int msm_drm_component_init(struct device *dev)
if (kms) {
ret = pm_runtime_resume_and_get(dev);
if (ret < 0) {
dev_err(dev, "failed to enable power resource %d\n", ret);
DISP_DEV_ERR(dev, "failed to enable power resource %d\n", ret);
goto fail;
}
@@ -970,7 +970,7 @@ static int msm_drm_component_init(struct device *dev)
#endif
pm_runtime_put_sync(dev);
if (ret < 0) {
dev_err(dev, "failed to install IRQ handler\n");
DISP_DEV_ERR(dev, "failed to install IRQ handler\n");
goto fail;
}
}
@@ -985,7 +985,7 @@ static int msm_drm_component_init(struct device *dev)
if (kms && kms->funcs && kms->funcs->cont_splash_config) {
ret = kms->funcs->cont_splash_config(kms, NULL);
if (ret) {
dev_err(dev, "kms cont_splash config failed.\n");
DISP_DEV_ERR(dev, "kms cont_splash config failed.\n");
goto fail;
}
}
@@ -1009,7 +1009,7 @@ static int msm_drm_component_init(struct device *dev)
ret = sde_dbg_debugfs_register(dev);
if (ret) {
dev_err(dev, "failed to reg sde dbg debugfs: %d\n", ret);
DISP_DEV_ERR(dev, "failed to reg sde dbg debugfs: %d\n", ret);
goto fail;
}
@@ -1950,7 +1950,7 @@ static int add_components_mdp(struct device *mdp_dev,
ret = of_graph_parse_endpoint(ep_node, &ep);
if (ret) {
dev_err(mdp_dev, "unable to parse port endpoint\n");
DISP_DEV_ERR(mdp_dev, "unable to parse port endpoint\n");
of_node_put(ep_node);
return ret;
}
@@ -2017,13 +2017,13 @@ static int add_display_components(struct device *dev,
if (of_device_is_compatible(dev->of_node, "qcom,mdss")) {
ret = of_platform_populate(dev->of_node, NULL, NULL, dev);
if (ret) {
dev_err(dev, "failed to populate children devices\n");
DISP_DEV_ERR(dev, "failed to populate children devices\n");
return ret;
}
mdp_dev = device_find_child(dev, NULL, compare_name_mdp);
if (!mdp_dev) {
dev_err(dev, "failed to find MDSS MDP node\n");
DISP_DEV_ERR(dev, "failed to find MDSS MDP node\n");
of_platform_depopulate(dev);
return -ENODEV;
}
@@ -2162,7 +2162,7 @@ static int msm_drm_component_dependency_check(struct device *dev)
struct platform_device *pdev =
of_find_device_by_node(node);
if (!platform_get_drvdata(pdev)) {
dev_err(dev,
DISP_DEV_ERR(dev,
"qcom,sde_rscc not probed yet\n");
return -EPROBE_DEFER;
} else {

View File

@@ -85,6 +85,8 @@ struct msm_gem_vma;
#define TEARDOWN_DEADLOCK_RETRY_MAX 5
#define DISP_DEV_ERR(dev, fmt, ...) dev_err(dev, "[%s:%d] " fmt, __func__, __LINE__, ##__VA_ARGS__)
struct msm_file_private {
rwlock_t queuelock;
struct list_head submitqueues;

View File

@@ -1,4 +1,5 @@
/*
* Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
* Copyright (c) 2018-2021, The Linux Foundation. All rights reserved.
* Copyright (C) 2013 Red Hat
* Author: Rob Clark <robdclark@gmail.com>
@@ -194,7 +195,7 @@ struct drm_framebuffer *msm_framebuffer_init(struct drm_device *dev,
format = kms->funcs->get_format(kms, mode_cmd->pixel_format,
mode_cmd->modifier[0]);
if (!format) {
dev_err(dev->dev, "unsupported pixel format: %4.4s\n",
DISP_DEV_ERR(dev->dev, "unsupported pixel format: %4.4s\n",
(char *)&mode_cmd->pixel_format);
ret = -EINVAL;
goto fail;
@@ -226,7 +227,7 @@ struct drm_framebuffer *msm_framebuffer_init(struct drm_device *dev,
if (is_modified) {
if (!kms->funcs->check_modified_format) {
dev_err(dev->dev, "can't check modified fb format\n");
DISP_DEV_ERR(dev->dev, "can't check modified fb format\n");
ret = -EINVAL;
goto fail;
} else {
@@ -269,7 +270,7 @@ struct drm_framebuffer *msm_framebuffer_init(struct drm_device *dev,
ret = drm_framebuffer_init(dev, fb, &msm_framebuffer_funcs);
if (ret) {
dev_err(dev->dev, "framebuffer init failed: %d\n", ret);
DISP_DEV_ERR(dev->dev, "framebuffer init failed: %d\n", ret);
goto fail;
}

View File

@@ -101,7 +101,7 @@ static struct page **get_pages(struct drm_gem_object *obj)
p = get_pages_vram(obj, npages);
if (IS_ERR(p)) {
dev_err(dev->dev, "could not get pages: %ld\n",
DISP_DEV_ERR(dev->dev, "could not get pages: %ld\n",
PTR_ERR(p));
return p;
}
@@ -112,7 +112,7 @@ static struct page **get_pages(struct drm_gem_object *obj)
if (IS_ERR(msm_obj->sgt)) {
void *ptr = ERR_CAST(msm_obj->sgt);
dev_err(dev->dev, "failed to allocate sgt\n");
DISP_DEV_ERR(dev->dev, "failed to allocate sgt\n");
msm_obj->sgt = NULL;
return ptr;
}
@@ -325,7 +325,7 @@ static uint64_t mmap_offset(struct drm_gem_object *obj)
ret = drm_gem_create_mmap_offset(obj);
if (ret) {
dev_err(dev->dev, "could not allocate mmap offset\n");
DISP_DEV_ERR(dev->dev, "could not allocate mmap offset\n");
return 0;
}
@@ -700,7 +700,7 @@ static void *get_vaddr(struct drm_gem_object *obj, unsigned madv)
mutex_lock(&msm_obj->lock);
if (WARN_ON(msm_obj->madv > madv)) {
dev_err(obj->dev->dev, "Invalid madv state: %u vs %u\n",
DISP_DEV_ERR(obj->dev->dev, "Invalid madv state: %u vs %u\n",
msm_obj->madv, madv);
mutex_unlock(&msm_obj->lock);
return ERR_PTR(-EBUSY);
@@ -980,7 +980,7 @@ static int msm_gem_new_impl(struct drm_device *dev,
case MSM_BO_WC:
break;
default:
dev_err(dev->dev, "invalid cache flag: %x\n",
DISP_DEV_ERR(dev->dev, "invalid cache flag: %x\n",
(flags & MSM_BO_CACHE_MASK));
return -EINVAL;
}

View File

@@ -1,4 +1,5 @@
/*
* Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
* Copyright (c) 2015-2021, The Linux Foundation. All rights reserved.
* Copyright (C) 2013 Red Hat
* Author: Rob Clark <robdclark@gmail.com>
@@ -85,7 +86,7 @@ static int msm_smmu_attach(struct msm_mmu *mmu, const char * const *names,
rc = qcom_iommu_sid_switch(client->dev, SID_ACQUIRE);
if (rc) {
dev_err(client->dev, "iommu sid switch failed (%d)\n", rc);
DISP_DEV_ERR(client->dev, "iommu sid switch failed (%d)\n", rc);
return rc;
}
@@ -517,13 +518,13 @@ static int msm_smmu_probe(struct platform_device *pdev)
match = of_match_device(msm_smmu_dt_match, &pdev->dev);
if (!match || !match->data) {
dev_err(&pdev->dev, "probe failed as match data is invalid\n");
DISP_DEV_ERR(&pdev->dev, "probe failed as match data is invalid\n");
return -EINVAL;
}
domain = match->data;
if (!domain) {
dev_err(&pdev->dev, "no matching device found\n");
DISP_DEV_ERR(&pdev->dev, "no matching device found\n");
return -EINVAL;
}
@@ -536,7 +537,7 @@ static int msm_smmu_probe(struct platform_device *pdev)
client->dev = &pdev->dev;
client->domain = iommu_get_domain_for_dev(client->dev);
if (!client->domain) {
dev_err(&pdev->dev, "iommu get domain for dev failed\n");
DISP_DEV_ERR(&pdev->dev, "iommu get domain for dev failed\n");
return -EINVAL;
}
client->compat = match->compatible;

View File

@@ -4,7 +4,7 @@
* Copyright (c) 2016-2021, The Linux Foundation. All rights reserved.
*/
#define pr_fmt(fmt) "%s: " fmt, __func__
#define pr_fmt(fmt) "[drm:%s:%d] " fmt, __func__, __LINE__
#include <linux/dma-buf.h>
#include <linux/string.h>

View File

@@ -1,8 +1,10 @@
// SPDX-License-Identifier: GPL-2.0-only
/*
* Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
* Copyright (c) 2016-2021 The Linux Foundation. All rights reserved.
*/
#define pr_fmt(fmt) "[drm:%s:%d] " fmt, __func__, __LINE__
#include <linux/kthread.h>
#include <linux/debugfs.h>
#include <linux/seq_file.h>

View File

@@ -4,6 +4,7 @@
* Copyright (c) 2015-2021, The Linux Foundation. All rights reserved.
*/
#define pr_fmt(fmt) "[drm:%s:%d] " fmt, __func__, __LINE__
#include <linux/delay.h>
#include "sde_hwio.h"
#include "sde_hw_ctl.h"

View File

@@ -4,6 +4,7 @@
* Copyright (c) 2017-2021, The Linux Foundation. All rights reserved.
*/
#define pr_fmt(fmt) "[drm:%s:%d] " fmt, __func__, __LINE__
#include "sde_hw_ds.h"
#include "sde_formats.h"
#include "sde_dbg.h"

View File

@@ -1,8 +1,10 @@
// SPDX-License-Identifier: GPL-2.0-only
/*
* Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
* Copyright (c) 2017-2021, The Linux Foundation. All rights reserved.
*/
#define pr_fmt(fmt) "[drm:%s:%d] " fmt, __func__, __LINE__
#include "sde_hw_mdss.h"
#include "sde_hwio.h"
#include "sde_hw_catalog.h"

View File

@@ -4,6 +4,7 @@
* Copyright (c) 2015-2021, The Linux Foundation. All rights reserved.
*/
#define pr_fmt(fmt) "[drm:%s:%d] " fmt, __func__, __LINE__
#include <drm/msm_drm_pp.h>
#include "sde_hw_mdss.h"
#include "sde_hwio.h"

View File

@@ -3,6 +3,8 @@
* Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved.
* Copyright (c) 2015-2021, The Linux Foundation. All rights reserved.
*/
#define pr_fmt(fmt) "[drm:%s:%d] " fmt, __func__, __LINE__
#include <linux/iopoll.h>
#include "sde_hwio.h"

View File

@@ -1,8 +1,10 @@
// SPDX-License-Identifier: GPL-2.0-only
/*
* Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
* Copyright (c) 2015-2021, The Linux Foundation. All rights reserved.
*/
#define pr_fmt(fmt) "[drm:%s:%d] " fmt, __func__, __LINE__
#include <linux/iopoll.h>
#include "sde_kms.h"

View File

@@ -1,8 +1,10 @@
// SPDX-License-Identifier: GPL-2.0-only
/*
* Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
* Copyright (c) 2015-2021, The Linux Foundation. All rights reserved.
*/
#define pr_fmt(fmt) "[drm:%s:%d] " fmt, __func__, __LINE__
#include <linux/iopoll.h>
#include "sde_hw_mdss.h"

View File

@@ -4,6 +4,7 @@
* Copyright (c) 2015-2021, The Linux Foundation. All rights reserved.
*/
#define pr_fmt(fmt) "[drm:%s:%d] " fmt, __func__, __LINE__
#include "sde_hwio.h"
#include "sde_hw_catalog.h"
#include "sde_hw_lm.h"

View File

@@ -4,6 +4,7 @@
* Copyright (c) 2015-2021, The Linux Foundation. All rights reserved.
*/
#define pr_fmt(fmt) "[drm:%s:%d] " fmt, __func__, __LINE__
#include "sde_hwio.h"
#include "sde_hw_catalog.h"
#include "sde_hw_top.h"

View File

@@ -5,6 +5,7 @@
*
*/
#define pr_fmt(fmt) "[drm:%s:%d] " fmt, __func__, __LINE__
#include "sde_hwio.h"
#include "sde_hw_catalog.h"
#include "sde_hw_top.h"

View File

@@ -1,8 +1,10 @@
// SPDX-License-Identifier: GPL-2.0-only
/*
* Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
* Copyright (c) 2020-2021, The Linux Foundation. All rights reserved.
*/
#define pr_fmt(fmt) "[drm:%s:%d] " fmt, __func__, __LINE__
#include "sde_hw_mdss.h"
#include "sde_hwio.h"
#include "sde_hw_catalog.h"

View File

@@ -1,9 +1,10 @@
// SPDX-License-Identifier: GPL-2.0-only
/*
* Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved.
* Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
* Copyright (c) 2015-2021, The Linux Foundation. All rights reserved.
*/
#define pr_fmt(fmt) "[drm:%s:%d] " fmt, __func__, __LINE__
#include "sde_hw_mdss.h"
#include "sde_hwio.h"
#include "sde_hw_catalog.h"

View File

@@ -1,9 +1,10 @@
// SPDX-License-Identifier: GPL-2.0-only
/*
* Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
* Copyright (c) 2015-2021, The Linux Foundation. All rights reserved.
*/
#define pr_fmt(fmt) "sde-kms_utils:[%s] " fmt, __func__
#define pr_fmt(fmt) "[sde-kms_utils:%s:%d] " fmt, __func__, __LINE__
#include "sde_kms.h"

View File

@@ -4,7 +4,7 @@
* Copyright (c) 2016-2021, The Linux Foundation. All rights reserved.
*/
#define pr_fmt(fmt) "[drm:%s] " fmt, __func__
#define pr_fmt(fmt) "[drm:%s:%d] " fmt, __func__, __LINE__
#include "sde_kms.h"
#include "sde_hw_lm.h"
#include "sde_hw_ctl.h"

View File

@@ -1,8 +1,10 @@
// SPDX-License-Identifier: GPL-2.0-only
/*
* Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
* Copyright (c) 2020-2021, The Linux Foundation. All rights reserved.
*/
#define pr_fmt(fmt) "[drm:%s:%d] " fmt, __func__, __LINE__
#include <linux/gunyah/gh_msgq.h>
#include <linux/kthread.h>
#include "sde_kms.h"

View File

@@ -1,8 +1,10 @@
// SPDX-License-Identifier: GPL-2.0-only
/*
* Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
* Copyright (c) 2012-2021 The Linux Foundation. All rights reserved.
*/
#define pr_fmt(fmt) "[drm:%s:%d] " fmt, __func__, __LINE__
#include "msm_drv.h"
#include "sde_dsc_helper.h"
#include "sde_kms.h"

View File

@@ -1,8 +1,10 @@
// SPDX-License-Identifier: GPL-2.0-only
/*
* Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
* Copyright (c) 2017-2021, The Linux Foundation. All rights reserved.
*/
#define pr_fmt(fmt) "[drm:%s:%d] " fmt, __func__, __LINE__
#include <drm/drm_edid.h>
#include <linux/hdmi.h>