Commit 904ce198 authored by Dave Airlie's avatar Dave Airlie
Browse files

Merge tag 'drm/tegra/for-5.5-rc1' of git://anongit.freedesktop.org/tegra/linux into drm-next



drm/tegra: Changes for v5.5-rc1

The bulk of these changes is the addition of DisplayPort support for
Tegra210, Tegra186 and Tegra194. I've been running versions of this for
about three years now, so I'd consider these changes to be pretty
mature. These changes also unify the existing eDP support with the DP
support since the programming is very similar, except for a few steps
that can be easily parameterized.

The rest are a couple of fixes all over the place for minor issues, as
well as some work to support the IOMMU-backed DMA API, which in the end
turned out to also clean up a number of cases where the DMA API was not
being used correctly.

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

From: Thierry Reding <thierry.reding@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20191102140116.3860545-1-thierry.reding@gmail.com
parents 633aa7e5 84db889e
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -9,7 +9,7 @@ config DRM_TEGRA
	select DRM_MIPI_DSI
	select DRM_PANEL
	select TEGRA_HOST1X
	select IOMMU_IOVA if IOMMU_SUPPORT
	select IOMMU_IOVA
	select CEC_CORE if CEC_NOTIFIER
	help
	  Choose this option if you have an NVIDIA Tegra SoC.
+20 −10
Original line number Diff line number Diff line
@@ -715,9 +715,7 @@ static void tegra_plane_atomic_update(struct drm_plane *plane,
	window.swap = state->swap;

	for (i = 0; i < fb->format->num_planes; i++) {
		struct tegra_bo *bo = tegra_fb_get_plane(fb, i);

		window.base[i] = bo->paddr + fb->offsets[i];
		window.base[i] = state->iova[i] + fb->offsets[i];

		/*
		 * Tegra uses a shared stride for UV planes. Framebuffers are
@@ -732,6 +730,8 @@ static void tegra_plane_atomic_update(struct drm_plane *plane,
}

static const struct drm_plane_helper_funcs tegra_plane_helper_funcs = {
	.prepare_fb = tegra_plane_prepare_fb,
	.cleanup_fb = tegra_plane_cleanup_fb,
	.atomic_check = tegra_plane_atomic_check,
	.atomic_disable = tegra_plane_atomic_disable,
	.atomic_update = tegra_plane_atomic_update,
@@ -869,11 +869,11 @@ static void tegra_cursor_atomic_update(struct drm_plane *plane,
		return;
	}

	value |= (bo->paddr >> 10) & 0x3fffff;
	value |= (bo->iova >> 10) & 0x3fffff;
	tegra_dc_writel(dc, value, DC_DISP_CURSOR_START_ADDR);

#ifdef CONFIG_ARCH_DMA_ADDR_T_64BIT
	value = (bo->paddr >> 32) & 0x3;
	value = (bo->iova >> 32) & 0x3;
	tegra_dc_writel(dc, value, DC_DISP_CURSOR_START_ADDR_HI);
#endif

@@ -914,6 +914,8 @@ static void tegra_cursor_atomic_disable(struct drm_plane *plane,
}

static const struct drm_plane_helper_funcs tegra_cursor_plane_helper_funcs = {
	.prepare_fb = tegra_plane_prepare_fb,
	.cleanup_fb = tegra_plane_cleanup_fb,
	.atomic_check = tegra_cursor_atomic_check,
	.atomic_update = tegra_cursor_atomic_update,
	.atomic_disable = tegra_cursor_atomic_disable,
@@ -2014,9 +2016,8 @@ static int tegra_dc_init(struct host1x_client *client)
	if (!dc->syncpt)
		dev_warn(dc->dev, "failed to allocate syncpoint\n");

	dc->group = host1x_client_iommu_attach(client, true);
	if (IS_ERR(dc->group)) {
		err = PTR_ERR(dc->group);
	err = host1x_client_iommu_attach(client);
	if (err < 0) {
		dev_err(client->dev, "failed to attach to domain: %d\n", err);
		return err;
	}
@@ -2074,6 +2075,12 @@ static int tegra_dc_init(struct host1x_client *client)
		goto cleanup;
	}

	/*
	 * Inherit the DMA parameters (such as maximum segment size) from the
	 * parent device.
	 */
	client->dev->dma_parms = client->parent->dma_parms;

	return 0;

cleanup:
@@ -2083,7 +2090,7 @@ cleanup:
	if (!IS_ERR(primary))
		drm_plane_cleanup(primary);

	host1x_client_iommu_detach(client, dc->group);
	host1x_client_iommu_detach(client);
	host1x_syncpt_free(dc->syncpt);

	return err;
@@ -2097,6 +2104,9 @@ static int tegra_dc_exit(struct host1x_client *client)
	if (!tegra_dc_has_window_groups(dc))
		return 0;

	/* avoid a dangling pointer just in case this disappears */
	client->dev->dma_parms = NULL;

	devm_free_irq(dc->dev, dc->irq, dc);

	err = tegra_dc_rgb_exit(dc);
@@ -2105,7 +2115,7 @@ static int tegra_dc_exit(struct host1x_client *client)
		return err;
	}

	host1x_client_iommu_detach(client, dc->group);
	host1x_client_iommu_detach(client);
	host1x_syncpt_free(dc->syncpt);

	return 0;
+0 −2
Original line number Diff line number Diff line
@@ -90,8 +90,6 @@ struct tegra_dc {
	struct drm_info_list *debugfs_files;

	const struct tegra_dc_soc_info *soc;

	struct iommu_group *group;
};

static inline struct tegra_dc *
+754 −11

File changed.

Preview size limit exceeded, changes collapsed.

+154 −3

File changed.

Preview size limit exceeded, changes collapsed.

Loading