Skip to content

Commit

Permalink
drm/exynos: use DRM_DEV_DEBUG* instead of DRM_DEBUG macro
Browse files Browse the repository at this point in the history
Use DRM_DEV_DEBUG* instead of DRM_DEBUG macro to print out
debug messages.

This patch just cleans up the use of debug log macro, which changes
the log macro to DRM_DEV_DEBUG*.

Signed-off-by: Inki Dae <[email protected]>
  • Loading branch information
daeinki committed Apr 24, 2019
1 parent 6f83d20 commit 6be9005
Show file tree
Hide file tree
Showing 13 changed files with 191 additions and 148 deletions.
2 changes: 1 addition & 1 deletion drivers/gpu/drm/exynos/exynos5433_drm_decon.c
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ static void decon_win_set_pixfmt(struct decon_context *ctx, unsigned int win,
break;
}

DRM_DEBUG_KMS("cpp = %u\n", fb->format->cpp[0]);
DRM_DEV_DEBUG_KMS(ctx->dev, "cpp = %u\n", fb->format->cpp[0]);

/*
* In case of exynos, setting dma-burst to 16Word causes permanent
Expand Down
10 changes: 5 additions & 5 deletions drivers/gpu/drm/exynos/exynos7_drm_decon.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ static void decon_wait_for_vblank(struct exynos_drm_crtc *crtc)
if (!wait_event_timeout(ctx->wait_vsync_queue,
!atomic_read(&ctx->wait_vsync_event),
HZ/20))
DRM_DEBUG_KMS("vblank wait timed out.\n");
DRM_DEV_DEBUG_KMS(ctx->dev, "vblank wait timed out.\n");
}

static void decon_clear_channels(struct exynos_drm_crtc *crtc)
Expand Down Expand Up @@ -313,7 +313,7 @@ static void decon_win_set_pixfmt(struct decon_context *ctx, unsigned int win,
break;
}

DRM_DEBUG_KMS("cpp = %d\n", fb->format->cpp[0]);
DRM_DEV_DEBUG_KMS(ctx->dev, "cpp = %d\n", fb->format->cpp[0]);

/*
* In case of exynos, setting dma-burst to 16Word causes permanent
Expand Down Expand Up @@ -420,9 +420,9 @@ static void decon_update_plane(struct exynos_drm_crtc *crtc,
writel(state->src.x, ctx->regs + VIDW_OFFSET_X(win));
writel(state->src.y, ctx->regs + VIDW_OFFSET_Y(win));

DRM_DEBUG_KMS("start addr = 0x%lx\n",
DRM_DEV_DEBUG_KMS(ctx->dev, "start addr = 0x%lx\n",
(unsigned long)val);
DRM_DEBUG_KMS("ovl_width = %d, ovl_height = %d\n",
DRM_DEV_DEBUG_KMS(ctx->dev, "ovl_width = %d, ovl_height = %d\n",
state->crtc.w, state->crtc.h);

val = VIDOSDxA_TOPLEFT_X(state->crtc.x) |
Expand All @@ -440,7 +440,7 @@ static void decon_update_plane(struct exynos_drm_crtc *crtc,

writel(val, ctx->regs + VIDOSD_B(win));

DRM_DEBUG_KMS("osd pos: tx = %d, ty = %d, bx = %d, by = %d\n",
DRM_DEV_DEBUG_KMS(ctx->dev, "osd pos: tx = %d, ty = %d, bx = %d, by = %d\n",
state->crtc.x, state->crtc.y, last_x, last_y);

/* OSD alpha */
Expand Down
7 changes: 4 additions & 3 deletions drivers/gpu/drm/exynos/exynos_drm_fbdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,10 @@ static int exynos_drm_fbdev_create(struct drm_fb_helper *helper,
unsigned long size;
int ret;

DRM_DEBUG_KMS("surface width(%d), height(%d) and bpp(%d\n",
sizes->surface_width, sizes->surface_height,
sizes->surface_bpp);
DRM_DEV_DEBUG_KMS(dev->dev,
"surface width(%d), height(%d) and bpp(%d\n",
sizes->surface_width, sizes->surface_height,
sizes->surface_bpp);

mode_cmd.width = sizes->surface_width;
mode_cmd.height = sizes->surface_height;
Expand Down
85 changes: 45 additions & 40 deletions drivers/gpu/drm/exynos/exynos_drm_fimc.c
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ static void fimc_handle_jpeg(struct fimc_context *ctx, bool enable)
{
u32 cfg;

DRM_DEBUG_KMS("enable[%d]\n", enable);
DRM_DEV_DEBUG_KMS(ctx->dev, "enable[%d]\n", enable);

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

DRM_DEBUG_KMS("enable[%d]\n", enable);
DRM_DEV_DEBUG_KMS(ctx->dev, "enable[%d]\n", enable);

cfg = fimc_read(ctx, EXYNOS_CIGCTRL);
if (enable) {
Expand All @@ -225,7 +225,7 @@ static bool fimc_check_ovf(struct fimc_context *ctx)
flag = EXYNOS_CISTATUS_OVFIY | EXYNOS_CISTATUS_OVFICB |
EXYNOS_CISTATUS_OVFICR;

DRM_DEBUG_KMS("flag[0x%x]\n", flag);
DRM_DEV_DEBUG_KMS(ctx->dev, "flag[0x%x]\n", flag);

if (status & flag) {
fimc_set_bits(ctx, EXYNOS_CIWDOFST,
Expand All @@ -247,7 +247,7 @@ static bool fimc_check_frame_end(struct fimc_context *ctx)

cfg = fimc_read(ctx, EXYNOS_CISTATUS);

DRM_DEBUG_KMS("cfg[0x%x]\n", cfg);
DRM_DEV_DEBUG_KMS(ctx->dev, "cfg[0x%x]\n", cfg);

if (!(cfg & EXYNOS_CISTATUS_FRAMEEND))
return false;
Expand All @@ -269,17 +269,17 @@ 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("present[%d]before[%d]\n",
EXYNOS_CISTATUS2_GET_FRAMECOUNT_PRESENT(cfg),
EXYNOS_CISTATUS2_GET_FRAMECOUNT_BEFORE(cfg));
DRM_DEV_DEBUG_KMS(ctx->dev, "present[%d]before[%d]\n",
EXYNOS_CISTATUS2_GET_FRAMECOUNT_PRESENT(cfg),
EXYNOS_CISTATUS2_GET_FRAMECOUNT_BEFORE(cfg));

if (frame_cnt == 0) {
DRM_DEV_ERROR(ctx->dev, "failed to get frame count.\n");
return -EIO;
}

buf_id = frame_cnt - 1;
DRM_DEBUG_KMS("buf_id[%d]\n", buf_id);
DRM_DEV_DEBUG_KMS(ctx->dev, "buf_id[%d]\n", buf_id);

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

DRM_DEBUG_KMS("enable[%d]\n", enable);
DRM_DEV_DEBUG_KMS(ctx->dev, "enable[%d]\n", enable);

cfg = fimc_read(ctx, EXYNOS_CIOCTRL);
if (enable)
Expand All @@ -303,7 +303,7 @@ static void fimc_src_set_fmt_order(struct fimc_context *ctx, u32 fmt)
{
u32 cfg;

DRM_DEBUG_KMS("fmt[0x%x]\n", fmt);
DRM_DEV_DEBUG_KMS(ctx->dev, "fmt[0x%x]\n", fmt);

/* RGB */
cfg = fimc_read(ctx, EXYNOS_CISCCTRL);
Expand Down Expand Up @@ -368,7 +368,7 @@ static void fimc_src_set_fmt(struct fimc_context *ctx, u32 fmt, bool tiled)
{
u32 cfg;

DRM_DEBUG_KMS("fmt[0x%x]\n", fmt);
DRM_DEV_DEBUG_KMS(ctx->dev, "fmt[0x%x]\n", fmt);

cfg = fimc_read(ctx, EXYNOS_MSCTRL);
cfg &= ~EXYNOS_MSCTRL_INFORMAT_RGB;
Expand Down Expand Up @@ -421,7 +421,7 @@ static void fimc_src_set_transf(struct fimc_context *ctx, unsigned int rotation)
unsigned int degree = rotation & DRM_MODE_ROTATE_MASK;
u32 cfg1, cfg2;

DRM_DEBUG_KMS("rotation[%x]\n", rotation);
DRM_DEV_DEBUG_KMS(ctx->dev, "rotation[%x]\n", rotation);

cfg1 = fimc_read(ctx, EXYNOS_MSCTRL);
cfg1 &= ~(EXYNOS_MSCTRL_FLIP_X_MIRROR |
Expand Down Expand Up @@ -479,10 +479,11 @@ static void fimc_set_window(struct fimc_context *ctx,
v1 = buf->rect.y;
v2 = buf->buf.height - buf->rect.h - buf->rect.y;

DRM_DEBUG_KMS("x[%d]y[%d]w[%d]h[%d]hsize[%d]vsize[%d]\n",
buf->rect.x, buf->rect.y, buf->rect.w, buf->rect.h,
real_width, buf->buf.height);
DRM_DEBUG_KMS("h1[%d]h2[%d]v1[%d]v2[%d]\n", h1, h2, v1, v2);
DRM_DEV_DEBUG_KMS(ctx->dev, "x[%d]y[%d]w[%d]h[%d]hsize[%d]vsize[%d]\n",
buf->rect.x, buf->rect.y, buf->rect.w, buf->rect.h,
real_width, buf->buf.height);
DRM_DEV_DEBUG_KMS(ctx->dev, "h1[%d]h2[%d]v1[%d]v2[%d]\n", h1, h2, v1,
v2);

/*
* set window offset 1, 2 size
Expand All @@ -507,16 +508,17 @@ static void fimc_src_set_size(struct fimc_context *ctx,
unsigned int real_width = buf->buf.pitch[0] / buf->format->cpp[0];
u32 cfg;

DRM_DEBUG_KMS("hsize[%d]vsize[%d]\n", real_width, buf->buf.height);
DRM_DEV_DEBUG_KMS(ctx->dev, "hsize[%d]vsize[%d]\n", real_width,
buf->buf.height);

/* original size */
cfg = (EXYNOS_ORGISIZE_HORIZONTAL(real_width) |
EXYNOS_ORGISIZE_VERTICAL(buf->buf.height));

fimc_write(ctx, cfg, EXYNOS_ORGISIZE);

DRM_DEBUG_KMS("x[%d]y[%d]w[%d]h[%d]\n", buf->rect.x, buf->rect.y,
buf->rect.w, buf->rect.h);
DRM_DEV_DEBUG_KMS(ctx->dev, "x[%d]y[%d]w[%d]h[%d]\n", buf->rect.x,
buf->rect.y, buf->rect.w, buf->rect.h);

/* set input DMA image size */
cfg = fimc_read(ctx, EXYNOS_CIREAL_ISIZE);
Expand Down Expand Up @@ -561,7 +563,7 @@ static void fimc_dst_set_fmt_order(struct fimc_context *ctx, u32 fmt)
{
u32 cfg;

DRM_DEBUG_KMS("fmt[0x%x]\n", fmt);
DRM_DEV_DEBUG_KMS(ctx->dev, "fmt[0x%x]\n", fmt);

/* RGB */
cfg = fimc_read(ctx, EXYNOS_CISCCTRL);
Expand Down Expand Up @@ -632,7 +634,7 @@ static void fimc_dst_set_fmt(struct fimc_context *ctx, u32 fmt, bool tiled)
{
u32 cfg;

DRM_DEBUG_KMS("fmt[0x%x]\n", fmt);
DRM_DEV_DEBUG_KMS(ctx->dev, "fmt[0x%x]\n", fmt);

cfg = fimc_read(ctx, EXYNOS_CIEXTEN);

Expand Down Expand Up @@ -692,7 +694,7 @@ static void fimc_dst_set_transf(struct fimc_context *ctx, unsigned int rotation)
unsigned int degree = rotation & DRM_MODE_ROTATE_MASK;
u32 cfg;

DRM_DEBUG_KMS("rotation[0x%x]\n", rotation);
DRM_DEV_DEBUG_KMS(ctx->dev, "rotation[0x%x]\n", rotation);

cfg = fimc_read(ctx, EXYNOS_CITRGFMT);
cfg &= ~EXYNOS_CITRGFMT_FLIP_MASK;
Expand Down Expand Up @@ -776,19 +778,20 @@ static int fimc_set_prescaler(struct fimc_context *ctx, struct fimc_scaler *sc,

pre_dst_width = src_w >> hfactor;
pre_dst_height = src_h >> vfactor;
DRM_DEBUG_KMS("pre_dst_width[%d]pre_dst_height[%d]\n",
pre_dst_width, pre_dst_height);
DRM_DEBUG_KMS("hfactor[%d]vfactor[%d]\n", hfactor, vfactor);
DRM_DEV_DEBUG_KMS(ctx->dev, "pre_dst_width[%d]pre_dst_height[%d]\n",
pre_dst_width, pre_dst_height);
DRM_DEV_DEBUG_KMS(ctx->dev, "hfactor[%d]vfactor[%d]\n", hfactor,
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("hratio[%d]vratio[%d]up_h[%d]up_v[%d]\n",
sc->hratio, sc->vratio, sc->up_h, sc->up_v);
DRM_DEV_DEBUG_KMS(ctx->dev, "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("shfactor[%d]\n", shfactor);
DRM_DEV_DEBUG_KMS(ctx->dev, "shfactor[%d]\n", shfactor);

cfg = (EXYNOS_CISCPRERATIO_SHFACTOR(shfactor) |
EXYNOS_CISCPRERATIO_PREHORRATIO(1 << hfactor) |
Expand All @@ -806,10 +809,10 @@ static void fimc_set_scaler(struct fimc_context *ctx, struct fimc_scaler *sc)
{
u32 cfg, cfg_ext;

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);
DRM_DEV_DEBUG_KMS(ctx->dev, "range[%d]bypass[%d]up_h[%d]up_v[%d]\n",
sc->range, sc->bypass, sc->up_h, sc->up_v);
DRM_DEV_DEBUG_KMS(ctx->dev, "hratio[%d]vratio[%d]\n",
sc->hratio, sc->vratio);

cfg = fimc_read(ctx, EXYNOS_CISCCTRL);
cfg &= ~(EXYNOS_CISCCTRL_SCALERBYPASS |
Expand Down Expand Up @@ -847,16 +850,18 @@ static void fimc_dst_set_size(struct fimc_context *ctx,
unsigned int real_width = buf->buf.pitch[0] / buf->format->cpp[0];
u32 cfg, cfg_ext;

DRM_DEBUG_KMS("hsize[%d]vsize[%d]\n", real_width, buf->buf.height);
DRM_DEV_DEBUG_KMS(ctx->dev, "hsize[%d]vsize[%d]\n", real_width,
buf->buf.height);

/* original size */
cfg = (EXYNOS_ORGOSIZE_HORIZONTAL(real_width) |
EXYNOS_ORGOSIZE_VERTICAL(buf->buf.height));

fimc_write(ctx, cfg, EXYNOS_ORGOSIZE);

DRM_DEBUG_KMS("x[%d]y[%d]w[%d]h[%d]\n", buf->rect.x, buf->rect.y,
buf->rect.w, buf->rect.h);
DRM_DEV_DEBUG_KMS(ctx->dev, "x[%d]y[%d]w[%d]h[%d]\n", buf->rect.x,
buf->rect.y,
buf->rect.w, buf->rect.h);

/* CSC ITU */
cfg = fimc_read(ctx, EXYNOS_CIGCTRL);
Expand Down Expand Up @@ -906,7 +911,7 @@ static void fimc_dst_set_buf_seq(struct fimc_context *ctx, u32 buf_id,
u32 buf_num;
u32 cfg;

DRM_DEBUG_KMS("buf_id[%d]enqueu[%d]\n", buf_id, enqueue);
DRM_DEV_DEBUG_KMS(ctx->dev, "buf_id[%d]enqueu[%d]\n", buf_id, enqueue);

spin_lock_irqsave(&ctx->lock, flags);

Expand Down Expand Up @@ -946,7 +951,7 @@ static irqreturn_t fimc_irq_handler(int irq, void *dev_id)
struct fimc_context *ctx = dev_id;
int buf_id;

DRM_DEBUG_KMS("fimc id[%d]\n", ctx->id);
DRM_DEV_DEBUG_KMS(ctx->dev, "fimc id[%d]\n", ctx->id);

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

DRM_DEBUG_KMS("buf_id[%d]\n", buf_id);
DRM_DEV_DEBUG_KMS(ctx->dev, "buf_id[%d]\n", buf_id);

if (ctx->task) {
struct exynos_drm_ipp_task *task = ctx->task;
Expand Down Expand Up @@ -1381,7 +1386,7 @@ static int fimc_runtime_suspend(struct device *dev)
{
struct fimc_context *ctx = get_fimc_context(dev);

DRM_DEBUG_KMS("id[%d]\n", ctx->id);
DRM_DEV_DEBUG_KMS(dev, "id[%d]\n", ctx->id);
clk_disable_unprepare(ctx->clocks[FIMC_CLK_GATE]);
return 0;
}
Expand All @@ -1390,7 +1395,7 @@ static int fimc_runtime_resume(struct device *dev)
{
struct fimc_context *ctx = get_fimc_context(dev);

DRM_DEBUG_KMS("id[%d]\n", ctx->id);
DRM_DEV_DEBUG_KMS(dev, "id[%d]\n", ctx->id);
return clk_prepare_enable(ctx->clocks[FIMC_CLK_GATE]);
}
#endif
Expand Down
19 changes: 11 additions & 8 deletions drivers/gpu/drm/exynos/exynos_drm_fimd.c
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ static void fimd_wait_for_vblank(struct exynos_drm_crtc *crtc)
if (!wait_event_timeout(ctx->wait_vsync_queue,
!atomic_read(&ctx->wait_vsync_event),
HZ/20))
DRM_DEBUG_KMS("vblank wait timed out.\n");
DRM_DEV_DEBUG_KMS(ctx->dev, "vblank wait timed out.\n");
}

static void fimd_enable_video_output(struct fimd_context *ctx, unsigned int win,
Expand Down Expand Up @@ -817,10 +817,11 @@ static void fimd_update_plane(struct exynos_drm_crtc *crtc,
val = (unsigned long)(dma_addr + size);
writel(val, ctx->regs + VIDWx_BUF_END(win, 0));

DRM_DEBUG_KMS("start addr = 0x%lx, end addr = 0x%lx, size = 0x%lx\n",
(unsigned long)dma_addr, val, size);
DRM_DEBUG_KMS("ovl_width = %d, ovl_height = %d\n",
state->crtc.w, state->crtc.h);
DRM_DEV_DEBUG_KMS(ctx->dev,
"start addr = 0x%lx, end addr = 0x%lx, size = 0x%lx\n",
(unsigned long)dma_addr, val, size);
DRM_DEV_DEBUG_KMS(ctx->dev, "ovl_width = %d, ovl_height = %d\n",
state->crtc.w, state->crtc.h);

/* buffer size */
buf_offsize = pitch - (state->crtc.w * cpp);
Expand Down Expand Up @@ -850,8 +851,9 @@ static void fimd_update_plane(struct exynos_drm_crtc *crtc,

writel(val, ctx->regs + VIDOSD_B(win));

DRM_DEBUG_KMS("osd pos: tx = %d, ty = %d, bx = %d, by = %d\n",
state->crtc.x, state->crtc.y, last_x, last_y);
DRM_DEV_DEBUG_KMS(ctx->dev,
"osd pos: tx = %d, ty = %d, bx = %d, by = %d\n",
state->crtc.x, state->crtc.y, last_x, last_y);

/* OSD size */
if (win != 3 && win != 4) {
Expand All @@ -861,7 +863,8 @@ static void fimd_update_plane(struct exynos_drm_crtc *crtc,
val = state->crtc.w * state->crtc.h;
writel(val, ctx->regs + offset);

DRM_DEBUG_KMS("osd size = 0x%x\n", (unsigned int)val);
DRM_DEV_DEBUG_KMS(ctx->dev, "osd size = 0x%x\n",
(unsigned int)val);
}

fimd_win_set_pixfmt(ctx, win, fb, state->src.w);
Expand Down
Loading

0 comments on commit 6be9005

Please sign in to comment.