Skip to content

Commit

Permalink
Merge tag 'drm/tegra/for-5.5-rc1' of git://anongit.freedesktop.org/te…
Browse files Browse the repository at this point in the history
…gra/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 <airlied@redhat.com>

From: Thierry Reding <thierry.reding@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20191102140116.3860545-1-thierry.reding@gmail.com
  • Loading branch information
Dave Airlie committed Nov 3, 2019
2 parents 633aa7e + 84db889 commit 904ce19
Show file tree
Hide file tree
Showing 33 changed files with 3,309 additions and 1,722 deletions.
2 changes: 1 addition & 1 deletion drivers/gpu/drm/tegra/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
30 changes: 20 additions & 10 deletions drivers/gpu/drm/tegra/dc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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,
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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:
Expand All @@ -2083,7 +2090,7 @@ static int tegra_dc_init(struct host1x_client *client)
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;
Expand All @@ -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);
Expand All @@ -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;
Expand Down
2 changes: 0 additions & 2 deletions drivers/gpu/drm/tegra/dc.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 *
Expand Down
Loading

0 comments on commit 904ce19

Please sign in to comment.