summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/tegra/hub.c
diff options
context:
space:
mode:
authorThierry Reding <treding@nvidia.com>2021-03-26 15:51:32 +0100
committerThierry Reding <treding@nvidia.com>2021-03-31 17:42:14 +0200
commit86044e749be77a3544990027244abb20ddb3caf0 (patch)
treeaf4f698643e7da641bb55b0d577d87bf663bf92a /drivers/gpu/drm/tegra/hub.c
parent933deb8c7b8e3f83e3dbd0b08e3cad51350d44c4 (diff)
drm/tegra: dc: Inherit DMA mask
Inherit the DMA mask from host1x (on Tegra210 and earlier) or the display hub (on Tegra186 and later). This is necessary in order to properly map buffers without SMMU support and use the maximum IOVA space available with SMMU support. Signed-off-by: Thierry Reding <treding@nvidia.com>
Diffstat (limited to 'drivers/gpu/drm/tegra/hub.c')
-rw-r--r--drivers/gpu/drm/tegra/hub.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/gpu/drm/tegra/hub.c b/drivers/gpu/drm/tegra/hub.c
index 8e6d329d062b..617240032c37 100644
--- a/drivers/gpu/drm/tegra/hub.c
+++ b/drivers/gpu/drm/tegra/hub.c
@@ -848,12 +848,19 @@ static const struct host1x_client_ops tegra_display_hub_ops = {
static int tegra_display_hub_probe(struct platform_device *pdev)
{
+ u64 dma_mask = dma_get_mask(pdev->dev.parent);
struct device_node *child = NULL;
struct tegra_display_hub *hub;
struct clk *clk;
unsigned int i;
int err;
+ err = dma_coerce_mask_and_coherent(&pdev->dev, dma_mask);
+ if (err < 0) {
+ dev_err(&pdev->dev, "failed to set DMA mask: %d\n", err);
+ return err;
+ }
+
hub = devm_kzalloc(&pdev->dev, sizeof(*hub), GFP_KERNEL);
if (!hub)
return -ENOMEM;