[08/14] drm/tegra: vic: Inherit DMA mask from host1x

Submitted by Thierry Reding on Oct. 14, 2019, 12:50 p.m.

Details

Message ID 20191014125049.425101-9-thierry.reding@gmail.com
State Accepted
Headers show
Series "drm/tegra: Miscellaneous cleanups" ( rev: 2 ) in DRI devel

Not browsing as part of any series.

Commit Message

Thierry Reding Oct. 14, 2019, 12:50 p.m.
From: Thierry Reding <treding@nvidia.com>

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 | 7 +++++++
 1 file changed, 7 insertions(+)

Patch hide | download patch | download mbox

diff --git a/drivers/gpu/drm/tegra/vic.c b/drivers/gpu/drm/tegra/vic.c
index 748798f2cdc8..d60e479cde92 100644
--- a/drivers/gpu/drm/tegra/vic.c
+++ b/drivers/gpu/drm/tegra/vic.c
@@ -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;