]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
drm/tegra: vic: Inherit DMA mask from host1x
authorThierry Reding <treding@nvidia.com>
Fri, 8 Feb 2019 12:10:41 +0000 (13:10 +0100)
committerThierry Reding <treding@nvidia.com>
Mon, 28 Oct 2019 10:18:35 +0000 (11:18 +0100)
VIC, just like all other host1x clients, has the same addressing range
as its parent host1x device. Inherit the DMA mask to reflect that.

Signed-off-by: Thierry Reding <treding@nvidia.com>
drivers/gpu/drm/tegra/vic.c

index 748798f2cdc822ea2a95a275f7d690e23793ca09..d60e479cde92cf0e95d7cfd4cf4542d70976c824 100644 (file)
@@ -385,6 +385,13 @@ static int vic_probe(struct platform_device *pdev)
        struct vic *vic;
        int err;
 
+       /* inherit DMA mask from host1x parent */
+       err = dma_coerce_mask_and_coherent(dev, *dev->parent->dma_mask);
+       if (err < 0) {
+               dev_err(&pdev->dev, "failed to set DMA mask: %d\n", err);
+               return err;
+       }
+
        vic = devm_kzalloc(dev, sizeof(*vic), GFP_KERNEL);
        if (!vic)
                return -ENOMEM;