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

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

drm/exynos: remove unnecessary checking to support iommu



Already drm_iommu_attach_device and drm_iommu_detach_device check
whether support iommu internally, so we don't have to call
is_drm_iommu_supported before call them.

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 b2491957
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -514,7 +514,6 @@ static void decon_unbind(struct device *dev, struct device *master, void *data)
	decon_disable(ctx->crtc);

	/* detach this sub driver from iommu mapping if supported. */
	if (is_drm_iommu_supported(ctx->drm_dev))
	drm_iommu_detach_device(ctx->drm_dev, ctx->dev);
}

+1 −2
Original line number Diff line number Diff line
@@ -136,7 +136,6 @@ static int decon_ctx_initialize(struct decon_context *ctx,
static void decon_ctx_remove(struct decon_context *ctx)
{
	/* detach this sub driver from iommu mapping if supported. */
	if (is_drm_iommu_supported(ctx->drm_dev))
	drm_iommu_detach_device(ctx->drm_dev, ctx->dev);
}

+1 −8
Original line number Diff line number Diff line
@@ -348,13 +348,6 @@ static void fimd_clear_channels(struct exynos_drm_crtc *crtc)
	pm_runtime_put(ctx->dev);
}

static void fimd_iommu_detach_devices(struct fimd_context *ctx)
{
	/* detach this sub driver from iommu mapping if supported. */
	if (is_drm_iommu_supported(ctx->drm_dev))
		drm_iommu_detach_device(ctx->drm_dev, ctx->dev);
}

static u32 fimd_calc_clkdiv(struct fimd_context *ctx,
		const struct drm_display_mode *mode)
{
@@ -978,7 +971,7 @@ static void fimd_unbind(struct device *dev, struct device *master,

	fimd_disable(ctx->crtc);

	fimd_iommu_detach_devices(ctx);
	drm_iommu_detach_device(ctx->drm_dev, ctx->dev);

	if (ctx->display)
		exynos_dpi_remove(ctx->display);
+0 −6
Original line number Diff line number Diff line
@@ -1319,9 +1319,6 @@ static int g2d_subdrv_probe(struct drm_device *drm_dev, struct device *dev)
		return ret;
	}

	if (!is_drm_iommu_supported(drm_dev))
		return 0;

	ret = drm_iommu_attach_device(drm_dev, dev);
	if (ret < 0) {
		dev_err(dev, "failed to enable iommu.\n");
@@ -1334,9 +1331,6 @@ static int g2d_subdrv_probe(struct drm_device *drm_dev, struct device *dev)

static void g2d_subdrv_remove(struct drm_device *drm_dev, struct device *dev)
{
	if (!is_drm_iommu_supported(drm_dev))
		return;

	drm_iommu_detach_device(drm_dev, dev);
}

+3 −8
Original line number Diff line number Diff line
@@ -87,10 +87,8 @@ int drm_iommu_attach_device(struct drm_device *drm_dev,
	struct device *dev = drm_dev->dev;
	int ret;

	if (!dev->archdata.mapping) {
		DRM_ERROR("iommu_mapping is null.\n");
		return -EFAULT;
	}
	if (!dev->archdata.mapping)
		return 0;

	subdrv_dev->dma_parms = devm_kzalloc(subdrv_dev,
					sizeof(*subdrv_dev->dma_parms),
@@ -148,13 +146,10 @@ void drm_iommu_detach_device(struct drm_device *drm_dev,
int drm_iommu_attach_device_if_possible(struct exynos_drm_crtc *exynos_crtc,
			struct drm_device *drm_dev, struct device *subdrv_dev)
{
	int ret = 0;

	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);
	}

	return ret;
	return drm_iommu_attach_device(drm_dev, subdrv_dev);
}
Loading