Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit eb7a3fc7 authored by Joonyoung Shim's avatar Joonyoung Shim Committed by Inki Dae
Browse files

drm/exynos: remove drm_iommu_attach_device_if_possible



Already drm_iommu_attach_device checks whether support iommu internally.
It should clear channels always regardless iommu support. We didn't know
because we can detect the problem when iommu is enabled, so we don't
have to use drm_iommu_attach_device_if_possible and then we can remove
drm_iommu_attach_device_if_possible and clear_channels function pointer.

Signed-off-by: default avatarJoonyoung Shim <jy0922.shim@samsung.com>
Tested-by: default avatarMarek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: default avatarInki Dae <inki.dae@samsung.com>
parent 735c21c3
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -463,7 +463,6 @@ static struct exynos_drm_crtc_ops decon_crtc_ops = {
	.win_commit		= decon_win_commit,
	.win_disable		= decon_win_disable,
	.te_handler		= decon_te_irq_handler,
	.clear_channels		= decon_clear_channels,
};

static int decon_bind(struct device *dev, struct device *master, void *data)
@@ -497,7 +496,9 @@ static int decon_bind(struct device *dev, struct device *master, void *data)
		goto err;
	}

	ret = drm_iommu_attach_device_if_possible(ctx->crtc, drm_dev, dev);
	decon_clear_channels(ctx->crtc);

	ret = drm_iommu_attach_device(drm_dev, dev);
	if (ret)
		goto err;

+3 −2
Original line number Diff line number Diff line
@@ -126,7 +126,9 @@ static int decon_ctx_initialize(struct decon_context *ctx,
	ctx->drm_dev = drm_dev;
	ctx->pipe = priv->pipe++;

	ret = drm_iommu_attach_device_if_possible(ctx->crtc, drm_dev, ctx->dev);
	decon_clear_channels(ctx->crtc);

	ret = drm_iommu_attach_device(drm_dev, ctx->dev);
	if (ret)
		priv->pipe--;

@@ -622,7 +624,6 @@ static const struct exynos_drm_crtc_ops decon_crtc_ops = {
	.wait_for_vblank = decon_wait_for_vblank,
	.win_commit = decon_win_commit,
	.win_disable = decon_win_disable,
	.clear_channels = decon_clear_channels,
};


+0 −1
Original line number Diff line number Diff line
@@ -177,7 +177,6 @@ struct exynos_drm_crtc_ops {
	void (*win_disable)(struct exynos_drm_crtc *crtc, unsigned int zpos);
	void (*te_handler)(struct exynos_drm_crtc *crtc);
	void (*clock_enable)(struct exynos_drm_crtc *crtc, bool enable);
	void (*clear_channels)(struct exynos_drm_crtc *crtc);
};

/*
+3 −2
Original line number Diff line number Diff line
@@ -887,7 +887,6 @@ static const struct exynos_drm_crtc_ops fimd_crtc_ops = {
	.win_disable = fimd_win_disable,
	.te_handler = fimd_te_handler,
	.clock_enable = fimd_dp_clock_enable,
	.clear_channels = fimd_clear_channels,
};

static irqreturn_t fimd_irq_handler(int irq, void *dev_id)
@@ -957,7 +956,9 @@ static int fimd_bind(struct device *dev, struct device *master, void *data)
	if (ctx->display)
		exynos_drm_create_enc_conn(drm_dev, ctx->display);

	ret = drm_iommu_attach_device_if_possible(ctx->crtc, drm_dev, dev);
	fimd_clear_channels(ctx->crtc);

	ret = drm_iommu_attach_device(drm_dev, dev);
	if (ret)
		priv->pipe--;

+0 −11
Original line number Diff line number Diff line
@@ -142,14 +142,3 @@ void drm_iommu_detach_device(struct drm_device *drm_dev,
	iommu_detach_device(mapping->domain, subdrv_dev);
	drm_release_iommu_mapping(drm_dev);
}

int drm_iommu_attach_device_if_possible(struct exynos_drm_crtc *exynos_crtc,
			struct drm_device *drm_dev, struct device *subdrv_dev)
{
	if (is_drm_iommu_supported(drm_dev)) {
		if (exynos_crtc->ops->clear_channels)
			exynos_crtc->ops->clear_channels(exynos_crtc);
	}

	return drm_iommu_attach_device(drm_dev, subdrv_dev);
}
Loading