Skip to content

Commit

Permalink
drm/exynos: fimd: check error status for drm_iommu_attach_device
Browse files Browse the repository at this point in the history
check error status for drm_iommu_attach_device() and make sure
it propagates till the caller.

Signed-off-by: Ajay Kumar <[email protected]>
Signed-off-by: Inki Dae <[email protected]>
  • Loading branch information
AjayKumarRS authored and daeinki committed Jan 25, 2015
1 parent adf5691 commit efa75bc
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions drivers/gpu/drm/exynos/exynos_drm_fimd.c
Original file line number Diff line number Diff line change
Expand Up @@ -296,12 +296,19 @@ static int fimd_ctx_initialize(struct fimd_context *ctx,

/* attach this sub driver to iommu mapping if supported. */
if (is_drm_iommu_supported(ctx->drm_dev)) {
int ret;

/*
* If any channel is already active, iommu will throw
* a PAGE FAULT when enabled. So clear any channel if enabled.
*/
fimd_clear_channel(ctx->crtc);
drm_iommu_attach_device(ctx->drm_dev, ctx->dev);
ret = drm_iommu_attach_device(ctx->drm_dev, ctx->dev);
if (ret) {
DRM_ERROR("drm_iommu_attach failed.\n");
return ret;
}

}

return 0;
Expand Down Expand Up @@ -1056,14 +1063,20 @@ static int fimd_bind(struct device *dev, struct device *master, void *data)
{
struct fimd_context *ctx = dev_get_drvdata(dev);
struct drm_device *drm_dev = data;
int ret;

ctx->crtc = exynos_drm_crtc_create(drm_dev, ctx->pipe,
EXYNOS_DISPLAY_TYPE_LCD,
&fimd_crtc_ops, ctx);
if (IS_ERR(ctx->crtc))
return PTR_ERR(ctx->crtc);

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


if (ctx->display)
exynos_drm_create_enc_conn(drm_dev, ctx->display);
Expand Down

0 comments on commit efa75bc

Please sign in to comment.