Skip to content

Commit 842ec61

Browse files
committed
drm/sun4i: mixer: Call of_dma_configure if there's an IOMMU
The main DRM device is actually a virtual device so it doesn't have the iommus property, which is instead on the DMA masters, in this case the mixers. Add a call to of_dma_configure with the mixers DT node but on the DRM virtual device to configure it in the same way than the mixers. Reviewed-by: Paul Kocialkowski <[email protected]> Signed-off-by: Maxime Ripard <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/9a4daf438dd3f2fe07afb23688bfb793a0613d7d.1589378833.git-series.maxime@cerno.tech (cherry picked from commit b718102) [Maxime: Applied to -fixes since it missed the merge window and display is broken without it] Signed-off-by: Maxime Ripard <[email protected]>
1 parent a05caf9 commit 842ec61

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

drivers/gpu/drm/sun4i/sun8i_mixer.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -363,6 +363,19 @@ static int sun8i_mixer_bind(struct device *dev, struct device *master,
363363
mixer->engine.ops = &sun8i_engine_ops;
364364
mixer->engine.node = dev->of_node;
365365

366+
if (of_find_property(dev->of_node, "iommus", NULL)) {
367+
/*
368+
* This assume we have the same DMA constraints for
369+
* all our the mixers in our pipeline. This sounds
370+
* bad, but it has always been the case for us, and
371+
* DRM doesn't do per-device allocation either, so we
372+
* would need to fix DRM first...
373+
*/
374+
ret = of_dma_configure(drm->dev, dev->of_node, true);
375+
if (ret)
376+
return ret;
377+
}
378+
366379
/*
367380
* While this function can fail, we shouldn't do anything
368381
* if this happens. Some early DE2 DT entries don't provide

0 commit comments

Comments
 (0)