Skip to content

Commit 904ce19

Browse files
committed
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: Dave Airlie <[email protected]> From: Thierry Reding <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2 parents 633aa7e + 84db889 commit 904ce19

File tree

33 files changed

+3309
-1722
lines changed

33 files changed

+3309
-1722
lines changed

drivers/gpu/drm/tegra/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ config DRM_TEGRA
99
select DRM_MIPI_DSI
1010
select DRM_PANEL
1111
select TEGRA_HOST1X
12-
select IOMMU_IOVA if IOMMU_SUPPORT
12+
select IOMMU_IOVA
1313
select CEC_CORE if CEC_NOTIFIER
1414
help
1515
Choose this option if you have an NVIDIA Tegra SoC.

drivers/gpu/drm/tegra/dc.c

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -715,9 +715,7 @@ static void tegra_plane_atomic_update(struct drm_plane *plane,
715715
window.swap = state->swap;
716716

717717
for (i = 0; i < fb->format->num_planes; i++) {
718-
struct tegra_bo *bo = tegra_fb_get_plane(fb, i);
719-
720-
window.base[i] = bo->paddr + fb->offsets[i];
718+
window.base[i] = state->iova[i] + fb->offsets[i];
721719

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

734732
static const struct drm_plane_helper_funcs tegra_plane_helper_funcs = {
733+
.prepare_fb = tegra_plane_prepare_fb,
734+
.cleanup_fb = tegra_plane_cleanup_fb,
735735
.atomic_check = tegra_plane_atomic_check,
736736
.atomic_disable = tegra_plane_atomic_disable,
737737
.atomic_update = tegra_plane_atomic_update,
@@ -869,11 +869,11 @@ static void tegra_cursor_atomic_update(struct drm_plane *plane,
869869
return;
870870
}
871871

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

875875
#ifdef CONFIG_ARCH_DMA_ADDR_T_64BIT
876-
value = (bo->paddr >> 32) & 0x3;
876+
value = (bo->iova >> 32) & 0x3;
877877
tegra_dc_writel(dc, value, DC_DISP_CURSOR_START_ADDR_HI);
878878
#endif
879879

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

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

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

2078+
/*
2079+
* Inherit the DMA parameters (such as maximum segment size) from the
2080+
* parent device.
2081+
*/
2082+
client->dev->dma_parms = client->parent->dma_parms;
2083+
20772084
return 0;
20782085

20792086
cleanup:
@@ -2083,7 +2090,7 @@ static int tegra_dc_init(struct host1x_client *client)
20832090
if (!IS_ERR(primary))
20842091
drm_plane_cleanup(primary);
20852092

2086-
host1x_client_iommu_detach(client, dc->group);
2093+
host1x_client_iommu_detach(client);
20872094
host1x_syncpt_free(dc->syncpt);
20882095

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

2107+
/* avoid a dangling pointer just in case this disappears */
2108+
client->dev->dma_parms = NULL;
2109+
21002110
devm_free_irq(dc->dev, dc->irq, dc);
21012111

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

2108-
host1x_client_iommu_detach(client, dc->group);
2118+
host1x_client_iommu_detach(client);
21092119
host1x_syncpt_free(dc->syncpt);
21102120

21112121
return 0;

drivers/gpu/drm/tegra/dc.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,6 @@ struct tegra_dc {
9090
struct drm_info_list *debugfs_files;
9191

9292
const struct tegra_dc_soc_info *soc;
93-
94-
struct iommu_group *group;
9593
};
9694

9795
static inline struct tegra_dc *

0 commit comments

Comments
 (0)