Skip to content

Commit

Permalink
Merge tag 'exynos-drm-next-for-v5.2' of git://git.kernel.org/pub/scm/…
Browse files Browse the repository at this point in the history
…linux/kernel/git/daeinki/drm-exynos into drm-next

Log cleanups
- Correct the use of log macro in error case.
- Drop unnecessary messages.
- Replace DRM_ERROR/DEBUG with DRM_DEV_ERROR/DEBUG.
- Print out debug messages with correct device name in vidi and ipp drivers.

One trivial cleanup
- Just fix checkpatch error, "foo* bar" to "foo *bar" in g2d driver.

Signed-off-by: Dave Airlie <airlied@redhat.com>

From: Inki Dae <inki.dae@samsung.com>
Link: https://patchwork.freedesktop.org/patch/msgid/1556073313-9923-1-git-send-email-inki.dae@samsung.com
  • Loading branch information
Dave Airlie committed Apr 24, 2019
2 parents 70b5f09 + 8b95503 commit 331ca3a
Show file tree
Hide file tree
Showing 22 changed files with 400 additions and 300 deletions.
6 changes: 2 additions & 4 deletions drivers/gpu/drm/exynos/exynos5433_drm_decon.c
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ static void decon_setup_trigger(struct decon_context *ctx)

if (regmap_update_bits(ctx->sysreg, DSD_CFG_MUX,
DSD_CFG_MUX_TE_UNMASK_GLOBAL, ~0))
DRM_ERROR("Cannot update sysreg.\n");
DRM_DEV_ERROR(ctx->dev, "Cannot update sysreg.\n");
}

static void decon_commit(struct exynos_drm_crtc *crtc)
Expand Down 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 Expand Up @@ -561,8 +561,6 @@ static void decon_clear_channels(struct exynos_drm_crtc *crtc)
struct decon_context *ctx = crtc->ctx;
int win, i, ret;

DRM_DEBUG_KMS("%s\n", __FILE__);

for (i = 0; i < ARRAY_SIZE(decon_clks_name); i++) {
ret = clk_prepare_enable(ctx->clks[i]);
if (ret < 0)
Expand Down
26 changes: 14 additions & 12 deletions drivers/gpu/drm/exynos/exynos7_drm_decon.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,16 +99,14 @@ 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)
{
struct decon_context *ctx = crtc->ctx;
unsigned int win, ch_enabled = 0;

DRM_DEBUG_KMS("%s\n", __FILE__);

/* Check if any channel is enabled. */
for (win = 0; win < WINDOWS_NR; win++) {
u32 val = readl(ctx->regs + WINCON(win));
Expand Down Expand Up @@ -315,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 @@ -422,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 @@ -442,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 Expand Up @@ -622,7 +620,7 @@ static int decon_bind(struct device *dev, struct device *master, void *data)

ret = decon_ctx_initialize(ctx, drm_dev);
if (ret) {
DRM_ERROR("decon_ctx_initialize failed.\n");
DRM_DEV_ERROR(dev, "decon_ctx_initialize failed.\n");
return ret;
}

Expand Down Expand Up @@ -802,25 +800,29 @@ static int exynos7_decon_resume(struct device *dev)

ret = clk_prepare_enable(ctx->pclk);
if (ret < 0) {
DRM_ERROR("Failed to prepare_enable the pclk [%d]\n", ret);
DRM_DEV_ERROR(dev, "Failed to prepare_enable the pclk [%d]\n",
ret);
return ret;
}

ret = clk_prepare_enable(ctx->aclk);
if (ret < 0) {
DRM_ERROR("Failed to prepare_enable the aclk [%d]\n", ret);
DRM_DEV_ERROR(dev, "Failed to prepare_enable the aclk [%d]\n",
ret);
return ret;
}

ret = clk_prepare_enable(ctx->eclk);
if (ret < 0) {
DRM_ERROR("Failed to prepare_enable the eclk [%d]\n", ret);
DRM_DEV_ERROR(dev, "Failed to prepare_enable the eclk [%d]\n",
ret);
return ret;
}

ret = clk_prepare_enable(ctx->vclk);
if (ret < 0) {
DRM_ERROR("Failed to prepare_enable the vclk [%d]\n", ret);
DRM_DEV_ERROR(dev, "Failed to prepare_enable the vclk [%d]\n",
ret);
return ret;
}

Expand Down
9 changes: 6 additions & 3 deletions drivers/gpu/drm/exynos/exynos_dp.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ static int exynos_dp_get_modes(struct analogix_dp_plat_data *plat_data,

mode = drm_mode_create(connector->dev);
if (!mode) {
DRM_ERROR("failed to create a new display mode.\n");
DRM_DEV_ERROR(dp->dev,
"failed to create a new display mode.\n");
return num_modes;
}

Expand Down Expand Up @@ -111,7 +112,8 @@ static int exynos_dp_bridge_attach(struct analogix_dp_plat_data *plat_data,
if (dp->ptn_bridge) {
ret = drm_bridge_attach(&dp->encoder, dp->ptn_bridge, bridge);
if (ret) {
DRM_ERROR("Failed to attach bridge to drm\n");
DRM_DEV_ERROR(dp->dev,
"Failed to attach bridge to drm\n");
bridge->next = NULL;
return ret;
}
Expand Down Expand Up @@ -147,7 +149,8 @@ static int exynos_dp_dt_parse_panel(struct exynos_dp_device *dp)

ret = of_get_videomode(dp->dev->of_node, &dp->vm, OF_USE_NATIVE_MODE);
if (ret) {
DRM_ERROR("failed: of_get_videomode() : %d\n", ret);
DRM_DEV_ERROR(dp->dev,
"failed: of_get_videomode() : %d\n", ret);
return ret;
}
return 0;
Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/exynos/exynos_drm_dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ static int drm_iommu_attach_device(struct drm_device *drm_dev,
int ret;

if (get_dma_ops(priv->dma_dev) != get_dma_ops(subdrv_dev)) {
DRM_ERROR("Device %s lacks support for IOMMU\n",
DRM_DEV_ERROR(subdrv_dev, "Device %s lacks support for IOMMU\n",
dev_name(subdrv_dev));
return -EINVAL;
}
Expand Down
9 changes: 6 additions & 3 deletions drivers/gpu/drm/exynos/exynos_drm_dpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ static int exynos_dpi_get_modes(struct drm_connector *connector)

mode = drm_mode_create(connector->dev);
if (!mode) {
DRM_ERROR("failed to create a new display mode\n");
DRM_DEV_ERROR(ctx->dev,
"failed to create a new display mode\n");
return 0;
}
drm_display_mode_from_videomode(ctx->vm, mode);
Expand Down Expand Up @@ -108,7 +109,8 @@ static int exynos_dpi_create_connector(struct drm_encoder *encoder)
&exynos_dpi_connector_funcs,
DRM_MODE_CONNECTOR_VGA);
if (ret) {
DRM_ERROR("failed to initialize connector with drm\n");
DRM_DEV_ERROR(ctx->dev,
"failed to initialize connector with drm\n");
return ret;
}

Expand Down Expand Up @@ -213,7 +215,8 @@ int exynos_dpi_bind(struct drm_device *dev, struct drm_encoder *encoder)

ret = exynos_dpi_create_connector(encoder);
if (ret) {
DRM_ERROR("failed to create connector ret = %d\n", ret);
DRM_DEV_ERROR(encoder_to_dpi(encoder)->dev,
"failed to create connector ret = %d\n", ret);
drm_encoder_cleanup(encoder);
return ret;
}
Expand Down
7 changes: 5 additions & 2 deletions drivers/gpu/drm/exynos/exynos_drm_dsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -1483,7 +1483,8 @@ static int exynos_dsi_create_connector(struct drm_encoder *encoder)
ret = drm_connector_init(drm, connector, &exynos_dsi_connector_funcs,
DRM_MODE_CONNECTOR_DSI);
if (ret) {
DRM_ERROR("Failed to initialize connector with drm\n");
DRM_DEV_ERROR(dsi->dev,
"Failed to initialize connector with drm\n");
return ret;
}

Expand Down Expand Up @@ -1527,7 +1528,9 @@ static int exynos_dsi_host_attach(struct mipi_dsi_host *host,
int ret = exynos_dsi_create_connector(encoder);

if (ret) {
DRM_ERROR("failed to create connector ret = %d\n", ret);
DRM_DEV_ERROR(dsi->dev,
"failed to create connector ret = %d\n",
ret);
drm_encoder_cleanup(encoder);
return ret;
}
Expand Down
9 changes: 6 additions & 3 deletions drivers/gpu/drm/exynos/exynos_drm_fb.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ static int check_fb_gem_memory_type(struct drm_device *drm_dev,
* supported without IOMMU.
*/
if (IS_NONCONTIG_BUFFER(flags)) {
DRM_ERROR("Non-contiguous GEM memory is not supported.\n");
DRM_DEV_ERROR(drm_dev->dev,
"Non-contiguous GEM memory is not supported.\n");
return -EINVAL;
}

Expand Down Expand Up @@ -83,7 +84,8 @@ exynos_drm_framebuffer_init(struct drm_device *dev,

ret = drm_framebuffer_init(dev, fb, &exynos_drm_fb_funcs);
if (ret < 0) {
DRM_ERROR("failed to initialize framebuffer\n");
DRM_DEV_ERROR(dev->dev,
"failed to initialize framebuffer\n");
goto err;
}

Expand Down Expand Up @@ -113,7 +115,8 @@ exynos_user_fb_create(struct drm_device *dev, struct drm_file *file_priv,
exynos_gem[i] = exynos_drm_gem_get(file_priv,
mode_cmd->handles[i]);
if (!exynos_gem[i]) {
DRM_ERROR("failed to lookup gem object\n");
DRM_DEV_ERROR(dev->dev,
"failed to lookup gem object\n");
ret = -ENOENT;
goto err;
}
Expand Down
26 changes: 16 additions & 10 deletions drivers/gpu/drm/exynos/exynos_drm_fbdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ static int exynos_drm_fb_mmap(struct fb_info *info,
exynos_gem->dma_addr, exynos_gem->size,
exynos_gem->dma_attrs);
if (ret < 0) {
DRM_ERROR("failed to mmap.\n");
DRM_DEV_ERROR(to_dma_dev(helper->dev), "failed to mmap.\n");
return ret;
}

Expand Down Expand Up @@ -83,7 +83,8 @@ static int exynos_drm_fbdev_update(struct drm_fb_helper *helper,

fbi = drm_fb_helper_alloc_fbi(helper);
if (IS_ERR(fbi)) {
DRM_ERROR("failed to allocate fb info.\n");
DRM_DEV_ERROR(to_dma_dev(helper->dev),
"failed to allocate fb info.\n");
return PTR_ERR(fbi);
}

Expand All @@ -96,7 +97,8 @@ static int exynos_drm_fbdev_update(struct drm_fb_helper *helper,
exynos_gem->kvaddr = (void __iomem *) vmap(exynos_gem->pages, nr_pages,
VM_MAP, pgprot_writecombine(PAGE_KERNEL));
if (!exynos_gem->kvaddr) {
DRM_ERROR("failed to map pages to kernel space.\n");
DRM_DEV_ERROR(to_dma_dev(helper->dev),
"failed to map pages to kernel space.\n");
return -EIO;
}

Expand All @@ -120,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 Expand Up @@ -152,7 +155,7 @@ static int exynos_drm_fbdev_create(struct drm_fb_helper *helper,
helper->fb =
exynos_drm_framebuffer_init(dev, &mode_cmd, &exynos_gem, 1);
if (IS_ERR(helper->fb)) {
DRM_ERROR("failed to create drm framebuffer.\n");
DRM_DEV_ERROR(dev->dev, "failed to create drm framebuffer.\n");
ret = PTR_ERR(helper->fb);
goto err_destroy_gem;
}
Expand Down Expand Up @@ -201,20 +204,23 @@ int exynos_drm_fbdev_init(struct drm_device *dev)

ret = drm_fb_helper_init(dev, helper, MAX_CONNECTOR);
if (ret < 0) {
DRM_ERROR("failed to initialize drm fb helper.\n");
DRM_DEV_ERROR(dev->dev,
"failed to initialize drm fb helper.\n");
goto err_init;
}

ret = drm_fb_helper_single_add_all_connectors(helper);
if (ret < 0) {
DRM_ERROR("failed to register drm_fb_helper_connector.\n");
DRM_DEV_ERROR(dev->dev,
"failed to register drm_fb_helper_connector.\n");
goto err_setup;

}

ret = drm_fb_helper_initial_config(helper, PREFERRED_BPP);
if (ret < 0) {
DRM_ERROR("failed to set up hw configuration.\n");
DRM_DEV_ERROR(dev->dev,
"failed to set up hw configuration.\n");
goto err_setup;
}

Expand Down
Loading

0 comments on commit 331ca3a

Please sign in to comment.