Skip to content

Commit

Permalink
drm/exynos: Clean up logs for DRM_ERROR / DRM_DEBUG_KMS
Browse files Browse the repository at this point in the history
This patch cleans up logs for DRM_ERROR / DRM_DEBUG_KMS to avoid
logging duplicated function name because the macros already contain
 __func__.

Signed-off-by: YoungJun Cho <yj44.cho@samsung.com>
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
  • Loading branch information
YoungJun Cho authored and Inki Dae committed Jun 28, 2013
1 parent bca34c9 commit cbc4c33
Show file tree
Hide file tree
Showing 6 changed files with 187 additions and 224 deletions.
113 changes: 53 additions & 60 deletions drivers/gpu/drm/exynos/exynos_drm_fimc.c
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ static void fimc_set_type_ctrl(struct fimc_context *ctx, enum fimc_wb wb)
{
u32 cfg;

DRM_DEBUG_KMS("%s:wb[%d]\n", __func__, wb);
DRM_DEBUG_KMS("wb[%d]\n", wb);

cfg = fimc_read(EXYNOS_CIGCTRL);
cfg &= ~(EXYNOS_CIGCTRL_TESTPATTERN_MASK |
Expand Down Expand Up @@ -253,10 +253,10 @@ static void fimc_set_polarity(struct fimc_context *ctx,
{
u32 cfg;

DRM_DEBUG_KMS("%s:inv_pclk[%d]inv_vsync[%d]\n",
__func__, pol->inv_pclk, pol->inv_vsync);
DRM_DEBUG_KMS("%s:inv_href[%d]inv_hsync[%d]\n",
__func__, pol->inv_href, pol->inv_hsync);
DRM_DEBUG_KMS("inv_pclk[%d]inv_vsync[%d]\n",
pol->inv_pclk, pol->inv_vsync);
DRM_DEBUG_KMS("inv_href[%d]inv_hsync[%d]\n",
pol->inv_href, pol->inv_hsync);

cfg = fimc_read(EXYNOS_CIGCTRL);
cfg &= ~(EXYNOS_CIGCTRL_INVPOLPCLK | EXYNOS_CIGCTRL_INVPOLVSYNC |
Expand All @@ -278,7 +278,7 @@ static void fimc_handle_jpeg(struct fimc_context *ctx, bool enable)
{
u32 cfg;

DRM_DEBUG_KMS("%s:enable[%d]\n", __func__, enable);
DRM_DEBUG_KMS("enable[%d]\n", enable);

cfg = fimc_read(EXYNOS_CIGCTRL);
if (enable)
Expand All @@ -294,7 +294,7 @@ static void fimc_handle_irq(struct fimc_context *ctx, bool enable,
{
u32 cfg;

DRM_DEBUG_KMS("%s:enable[%d]overflow[%d]level[%d]\n", __func__,
DRM_DEBUG_KMS("enable[%d]overflow[%d]level[%d]\n",
enable, overflow, level);

cfg = fimc_read(EXYNOS_CIGCTRL);
Expand Down Expand Up @@ -329,7 +329,7 @@ static bool fimc_check_ovf(struct fimc_context *ctx)
flag = EXYNOS_CISTATUS_OVFIY | EXYNOS_CISTATUS_OVFICB |
EXYNOS_CISTATUS_OVFICR;

DRM_DEBUG_KMS("%s:flag[0x%x]\n", __func__, flag);
DRM_DEBUG_KMS("flag[0x%x]\n", flag);

if (status & flag) {
cfg = fimc_read(EXYNOS_CIWDOFST);
Expand Down Expand Up @@ -358,7 +358,7 @@ static bool fimc_check_frame_end(struct fimc_context *ctx)

cfg = fimc_read(EXYNOS_CISTATUS);

DRM_DEBUG_KMS("%s:cfg[0x%x]\n", __func__, cfg);
DRM_DEBUG_KMS("cfg[0x%x]\n", cfg);

if (!(cfg & EXYNOS_CISTATUS_FRAMEEND))
return false;
Expand All @@ -380,7 +380,7 @@ static int fimc_get_buf_id(struct fimc_context *ctx)
if (frame_cnt == 0)
frame_cnt = EXYNOS_CISTATUS2_GET_FRAMECOUNT_PRESENT(cfg);

DRM_DEBUG_KMS("%s:present[%d]before[%d]\n", __func__,
DRM_DEBUG_KMS("present[%d]before[%d]\n",
EXYNOS_CISTATUS2_GET_FRAMECOUNT_PRESENT(cfg),
EXYNOS_CISTATUS2_GET_FRAMECOUNT_BEFORE(cfg));

Expand All @@ -390,7 +390,7 @@ static int fimc_get_buf_id(struct fimc_context *ctx)
}

buf_id = frame_cnt - 1;
DRM_DEBUG_KMS("%s:buf_id[%d]\n", __func__, buf_id);
DRM_DEBUG_KMS("buf_id[%d]\n", buf_id);

return buf_id;
}
Expand All @@ -399,7 +399,7 @@ static void fimc_handle_lastend(struct fimc_context *ctx, bool enable)
{
u32 cfg;

DRM_DEBUG_KMS("%s:enable[%d]\n", __func__, enable);
DRM_DEBUG_KMS("enable[%d]\n", enable);

cfg = fimc_read(EXYNOS_CIOCTRL);
if (enable)
Expand All @@ -416,7 +416,7 @@ static int fimc_src_set_fmt_order(struct fimc_context *ctx, u32 fmt)
struct exynos_drm_ippdrv *ippdrv = &ctx->ippdrv;
u32 cfg;

DRM_DEBUG_KMS("%s:fmt[0x%x]\n", __func__, fmt);
DRM_DEBUG_KMS("fmt[0x%x]\n", fmt);

/* RGB */
cfg = fimc_read(EXYNOS_CISCCTRL);
Expand Down Expand Up @@ -489,7 +489,7 @@ static int fimc_src_set_fmt(struct device *dev, u32 fmt)
struct exynos_drm_ippdrv *ippdrv = &ctx->ippdrv;
u32 cfg;

DRM_DEBUG_KMS("%s:fmt[0x%x]\n", __func__, fmt);
DRM_DEBUG_KMS("fmt[0x%x]\n", fmt);

cfg = fimc_read(EXYNOS_MSCTRL);
cfg &= ~EXYNOS_MSCTRL_INFORMAT_RGB;
Expand Down Expand Up @@ -549,8 +549,7 @@ static int fimc_src_set_transf(struct device *dev,
struct exynos_drm_ippdrv *ippdrv = &ctx->ippdrv;
u32 cfg1, cfg2;

DRM_DEBUG_KMS("%s:degree[%d]flip[0x%x]\n", __func__,
degree, flip);
DRM_DEBUG_KMS("degree[%d]flip[0x%x]\n", degree, flip);

cfg1 = fimc_read(EXYNOS_MSCTRL);
cfg1 &= ~(EXYNOS_MSCTRL_FLIP_X_MIRROR |
Expand Down Expand Up @@ -613,10 +612,9 @@ static int fimc_set_window(struct fimc_context *ctx,
v1 = pos->y;
v2 = sz->vsize - pos->h - pos->y;

DRM_DEBUG_KMS("%s:x[%d]y[%d]w[%d]h[%d]hsize[%d]vsize[%d]\n",
__func__, pos->x, pos->y, pos->w, pos->h, sz->hsize, sz->vsize);
DRM_DEBUG_KMS("%s:h1[%d]h2[%d]v1[%d]v2[%d]\n", __func__,
h1, h2, v1, v2);
DRM_DEBUG_KMS("x[%d]y[%d]w[%d]h[%d]hsize[%d]vsize[%d]\n",
pos->x, pos->y, pos->w, pos->h, sz->hsize, sz->vsize);
DRM_DEBUG_KMS("h1[%d]h2[%d]v1[%d]v2[%d]\n", h1, h2, v1, v2);

/*
* set window offset 1, 2 size
Expand Down Expand Up @@ -645,17 +643,16 @@ static int fimc_src_set_size(struct device *dev, int swap,
struct drm_exynos_sz img_sz = *sz;
u32 cfg;

DRM_DEBUG_KMS("%s:swap[%d]hsize[%d]vsize[%d]\n",
__func__, swap, sz->hsize, sz->vsize);
DRM_DEBUG_KMS("swap[%d]hsize[%d]vsize[%d]\n",
swap, sz->hsize, sz->vsize);

/* original size */
cfg = (EXYNOS_ORGISIZE_HORIZONTAL(img_sz.hsize) |
EXYNOS_ORGISIZE_VERTICAL(img_sz.vsize));

fimc_write(cfg, EXYNOS_ORGISIZE);

DRM_DEBUG_KMS("%s:x[%d]y[%d]w[%d]h[%d]\n", __func__,
pos->x, pos->y, pos->w, pos->h);
DRM_DEBUG_KMS("x[%d]y[%d]w[%d]h[%d]\n", pos->x, pos->y, pos->w, pos->h);

if (swap) {
img_pos.w = pos->h;
Expand Down Expand Up @@ -712,7 +709,7 @@ static int fimc_src_set_addr(struct device *dev,

property = &c_node->property;

DRM_DEBUG_KMS("%s:prop_id[%d]buf_id[%d]buf_type[%d]\n", __func__,
DRM_DEBUG_KMS("prop_id[%d]buf_id[%d]buf_type[%d]\n",
property->prop_id, buf_id, buf_type);

if (buf_id > FIMC_MAX_SRC) {
Expand Down Expand Up @@ -764,7 +761,7 @@ static int fimc_dst_set_fmt_order(struct fimc_context *ctx, u32 fmt)
struct exynos_drm_ippdrv *ippdrv = &ctx->ippdrv;
u32 cfg;

DRM_DEBUG_KMS("%s:fmt[0x%x]\n", __func__, fmt);
DRM_DEBUG_KMS("fmt[0x%x]\n", fmt);

/* RGB */
cfg = fimc_read(EXYNOS_CISCCTRL);
Expand Down Expand Up @@ -843,7 +840,7 @@ static int fimc_dst_set_fmt(struct device *dev, u32 fmt)
struct exynos_drm_ippdrv *ippdrv = &ctx->ippdrv;
u32 cfg;

DRM_DEBUG_KMS("%s:fmt[0x%x]\n", __func__, fmt);
DRM_DEBUG_KMS("fmt[0x%x]\n", fmt);

cfg = fimc_read(EXYNOS_CIEXTEN);

Expand Down Expand Up @@ -911,8 +908,7 @@ static int fimc_dst_set_transf(struct device *dev,
struct exynos_drm_ippdrv *ippdrv = &ctx->ippdrv;
u32 cfg;

DRM_DEBUG_KMS("%s:degree[%d]flip[0x%x]\n", __func__,
degree, flip);
DRM_DEBUG_KMS("degree[%d]flip[0x%x]\n", degree, flip);

cfg = fimc_read(EXYNOS_CITRGFMT);
cfg &= ~EXYNOS_CITRGFMT_FLIP_MASK;
Expand Down Expand Up @@ -962,7 +958,7 @@ static int fimc_dst_set_transf(struct device *dev,

static int fimc_get_ratio_shift(u32 src, u32 dst, u32 *ratio, u32 *shift)
{
DRM_DEBUG_KMS("%s:src[%d]dst[%d]\n", __func__, src, dst);
DRM_DEBUG_KMS("src[%d]dst[%d]\n", src, dst);

if (src >= dst * 64) {
DRM_ERROR("failed to make ratio and shift.\n");
Expand Down Expand Up @@ -1031,20 +1027,20 @@ static int fimc_set_prescaler(struct fimc_context *ctx, struct fimc_scaler *sc,

pre_dst_width = src_w / pre_hratio;
pre_dst_height = src_h / pre_vratio;
DRM_DEBUG_KMS("%s:pre_dst_width[%d]pre_dst_height[%d]\n", __func__,
DRM_DEBUG_KMS("pre_dst_width[%d]pre_dst_height[%d]\n",
pre_dst_width, pre_dst_height);
DRM_DEBUG_KMS("%s:pre_hratio[%d]hfactor[%d]pre_vratio[%d]vfactor[%d]\n",
__func__, pre_hratio, hfactor, pre_vratio, vfactor);
DRM_DEBUG_KMS("pre_hratio[%d]hfactor[%d]pre_vratio[%d]vfactor[%d]\n",
pre_hratio, hfactor, pre_vratio, vfactor);

sc->hratio = (src_w << 14) / (dst_w << hfactor);
sc->vratio = (src_h << 14) / (dst_h << vfactor);
sc->up_h = (dst_w >= src_w) ? true : false;
sc->up_v = (dst_h >= src_h) ? true : false;
DRM_DEBUG_KMS("%s:hratio[%d]vratio[%d]up_h[%d]up_v[%d]\n",
__func__, sc->hratio, sc->vratio, sc->up_h, sc->up_v);
DRM_DEBUG_KMS("hratio[%d]vratio[%d]up_h[%d]up_v[%d]\n",
sc->hratio, sc->vratio, sc->up_h, sc->up_v);

shfactor = FIMC_SHFACTOR - (hfactor + vfactor);
DRM_DEBUG_KMS("%s:shfactor[%d]\n", __func__, shfactor);
DRM_DEBUG_KMS("shfactor[%d]\n", shfactor);

cfg = (EXYNOS_CISCPRERATIO_SHFACTOR(shfactor) |
EXYNOS_CISCPRERATIO_PREHORRATIO(pre_hratio) |
Expand All @@ -1062,10 +1058,10 @@ static void fimc_set_scaler(struct fimc_context *ctx, struct fimc_scaler *sc)
{
u32 cfg, cfg_ext;

DRM_DEBUG_KMS("%s:range[%d]bypass[%d]up_h[%d]up_v[%d]\n",
__func__, sc->range, sc->bypass, sc->up_h, sc->up_v);
DRM_DEBUG_KMS("%s:hratio[%d]vratio[%d]\n",
__func__, sc->hratio, sc->vratio);
DRM_DEBUG_KMS("range[%d]bypass[%d]up_h[%d]up_v[%d]\n",
sc->range, sc->bypass, sc->up_h, sc->up_v);
DRM_DEBUG_KMS("hratio[%d]vratio[%d]\n",
sc->hratio, sc->vratio);

cfg = fimc_read(EXYNOS_CISCCTRL);
cfg &= ~(EXYNOS_CISCCTRL_SCALERBYPASS |
Expand Down Expand Up @@ -1105,17 +1101,16 @@ static int fimc_dst_set_size(struct device *dev, int swap,
struct drm_exynos_sz img_sz = *sz;
u32 cfg;

DRM_DEBUG_KMS("%s:swap[%d]hsize[%d]vsize[%d]\n",
__func__, swap, sz->hsize, sz->vsize);
DRM_DEBUG_KMS("swap[%d]hsize[%d]vsize[%d]\n",
swap, sz->hsize, sz->vsize);

/* original size */
cfg = (EXYNOS_ORGOSIZE_HORIZONTAL(img_sz.hsize) |
EXYNOS_ORGOSIZE_VERTICAL(img_sz.vsize));

fimc_write(cfg, EXYNOS_ORGOSIZE);

DRM_DEBUG_KMS("%s:x[%d]y[%d]w[%d]h[%d]\n",
__func__, pos->x, pos->y, pos->w, pos->h);
DRM_DEBUG_KMS("x[%d]y[%d]w[%d]h[%d]\n", pos->x, pos->y, pos->w, pos->h);

/* CSC ITU */
cfg = fimc_read(EXYNOS_CIGCTRL);
Expand Down Expand Up @@ -1172,7 +1167,7 @@ static int fimc_dst_get_buf_seq(struct fimc_context *ctx)
if (cfg & (mask << i))
buf_num++;

DRM_DEBUG_KMS("%s:buf_num[%d]\n", __func__, buf_num);
DRM_DEBUG_KMS("buf_num[%d]\n", buf_num);

return buf_num;
}
Expand All @@ -1186,8 +1181,7 @@ static int fimc_dst_set_buf_seq(struct fimc_context *ctx, u32 buf_id,
u32 mask = 0x00000001 << buf_id;
int ret = 0;

DRM_DEBUG_KMS("%s:buf_id[%d]buf_type[%d]\n", __func__,
buf_id, buf_type);
DRM_DEBUG_KMS("buf_id[%d]buf_type[%d]\n", buf_id, buf_type);

mutex_lock(&ctx->lock);

Expand Down Expand Up @@ -1244,7 +1238,7 @@ static int fimc_dst_set_addr(struct device *dev,

property = &c_node->property;

DRM_DEBUG_KMS("%s:prop_id[%d]buf_id[%d]buf_type[%d]\n", __func__,
DRM_DEBUG_KMS("prop_id[%d]buf_id[%d]buf_type[%d]\n",
property->prop_id, buf_id, buf_type);

if (buf_id > FIMC_MAX_DST) {
Expand Down Expand Up @@ -1294,7 +1288,7 @@ static struct exynos_drm_ipp_ops fimc_dst_ops = {

static int fimc_clk_ctrl(struct fimc_context *ctx, bool enable)
{
DRM_DEBUG_KMS("%s:enable[%d]\n", __func__, enable);
DRM_DEBUG_KMS("enable[%d]\n", enable);

if (enable) {
clk_prepare_enable(ctx->clocks[FIMC_CLK_GATE]);
Expand All @@ -1318,7 +1312,7 @@ static irqreturn_t fimc_irq_handler(int irq, void *dev_id)
c_node->event_work;
int buf_id;

DRM_DEBUG_KMS("%s:fimc id[%d]\n", __func__, ctx->id);
DRM_DEBUG_KMS("fimc id[%d]\n", ctx->id);

fimc_clear_irq(ctx);
if (fimc_check_ovf(ctx))
Expand All @@ -1331,7 +1325,7 @@ static irqreturn_t fimc_irq_handler(int irq, void *dev_id)
if (buf_id < 0)
return IRQ_HANDLED;

DRM_DEBUG_KMS("%s:buf_id[%d]\n", __func__, buf_id);
DRM_DEBUG_KMS("buf_id[%d]\n", buf_id);

if (fimc_dst_set_buf_seq(ctx, buf_id, IPP_BUF_DEQUEUE) < 0) {
DRM_ERROR("failed to dequeue.\n");
Expand Down Expand Up @@ -1392,7 +1386,7 @@ static inline bool fimc_check_drm_flip(enum drm_exynos_flip flip)
case EXYNOS_DRM_FLIP_BOTH:
return true;
default:
DRM_DEBUG_KMS("%s:invalid flip\n", __func__);
DRM_DEBUG_KMS("invalid flip\n");
return false;
}
}
Expand Down Expand Up @@ -1554,7 +1548,7 @@ static int fimc_ippdrv_start(struct device *dev, enum drm_exynos_ipp_cmd cmd)
int ret, i;
u32 cfg0, cfg1;

DRM_DEBUG_KMS("%s:cmd[%d]\n", __func__, cmd);
DRM_DEBUG_KMS("cmd[%d]\n", cmd);

if (!c_node) {
DRM_ERROR("failed to get c_node.\n");
Expand Down Expand Up @@ -1663,7 +1657,7 @@ static void fimc_ippdrv_stop(struct device *dev, enum drm_exynos_ipp_cmd cmd)
struct drm_exynos_ipp_set_wb set_wb = {0, 0};
u32 cfg;

DRM_DEBUG_KMS("%s:cmd[%d]\n", __func__, cmd);
DRM_DEBUG_KMS("cmd[%d]\n", cmd);

switch (cmd) {
case IPP_CMD_M2M:
Expand Down Expand Up @@ -1853,8 +1847,7 @@ static int fimc_probe(struct platform_device *pdev)
goto err_put_clk;
}

DRM_DEBUG_KMS("%s:id[%d]ippdrv[0x%x]\n", __func__, ctx->id,
(int)ippdrv);
DRM_DEBUG_KMS("id[%d]ippdrv[0x%x]\n", ctx->id, (int)ippdrv);

mutex_init(&ctx->lock);
platform_set_drvdata(pdev, ctx);
Expand Down Expand Up @@ -1901,7 +1894,7 @@ static int fimc_suspend(struct device *dev)
{
struct fimc_context *ctx = get_fimc_context(dev);

DRM_DEBUG_KMS("%s:id[%d]\n", __func__, ctx->id);
DRM_DEBUG_KMS("id[%d]\n", ctx->id);

if (pm_runtime_suspended(dev))
return 0;
Expand All @@ -1913,7 +1906,7 @@ static int fimc_resume(struct device *dev)
{
struct fimc_context *ctx = get_fimc_context(dev);

DRM_DEBUG_KMS("%s:id[%d]\n", __func__, ctx->id);
DRM_DEBUG_KMS("id[%d]\n", ctx->id);

if (!pm_runtime_suspended(dev))
return fimc_clk_ctrl(ctx, true);
Expand All @@ -1927,7 +1920,7 @@ static int fimc_runtime_suspend(struct device *dev)
{
struct fimc_context *ctx = get_fimc_context(dev);

DRM_DEBUG_KMS("%s:id[%d]\n", __func__, ctx->id);
DRM_DEBUG_KMS("id[%d]\n", ctx->id);

return fimc_clk_ctrl(ctx, false);
}
Expand All @@ -1936,7 +1929,7 @@ static int fimc_runtime_resume(struct device *dev)
{
struct fimc_context *ctx = get_fimc_context(dev);

DRM_DEBUG_KMS("%s:id[%d]\n", __func__, ctx->id);
DRM_DEBUG_KMS("id[%d]\n", ctx->id);

return fimc_clk_ctrl(ctx, true);
}
Expand Down
Loading

0 comments on commit cbc4c33

Please sign in to comment.