summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/exynos/exynos_drm_iommu.h
Commit message (Collapse)AuthorAgeFilesLines
* iommu/dma: Avoid PCI host bridge windowsRobin Murphy2016-09-161-1/+1
| | | | | | | | | | | | | | With our DMA ops enabled for PCI devices, we should avoid allocating IOVAs which a host bridge might misinterpret as peer-to-peer DMA and lead to faults, corruption or other badness. To be safe, punch out holes for all of the relevant host bridge's windows when initialising a DMA domain for a PCI device. CC: Marek Szyprowski <m.szyprowski@samsung.com> CC: Inki Dae <inki.dae@samsung.com> Reported-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> Signed-off-by: Robin Murphy <robin.murphy@arm.com> Signed-off-by: Will Deacon <will.deacon@arm.com>
* drm/exynos: iommu: add support for ARM64 specific code for IOMMU glueMarek Szyprowski2016-07-131-0/+55
| | | | | | | | This patch adds support for ARM 64bit architecture with IOMMU-DMA glue code, so Exynos DRM can be now used on Exynos 5433 with IOMMU enabled. Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
* drm/exynos: iommu: move ARM specific code to exynos_drm_iommu.hMarek Szyprowski2016-07-131-0/+36
| | | | | | | | | | | This patch moves all ARM 32bit DMA-mapping/IOMMU dependant code from exynos_drm_iommu.c to .h, to let it compile conditionally and prepare for adding support for other architectures/IOMMU glue code (like ARM 64bit with IOMMU-DMA glue). Later, when ARM 32bit and 64bit will be unified, this code can be removed. Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
* drm/exynos: use real device for DMA-mapping operationsMarek Szyprowski2016-03-011-2/+2
| | | | | | | | | | | | | | This patch changes device pointer provided to all calls to DMA-mapping subsystem from the virtual exynos-drm 'device' to the real device pointer of one of the CRTC devices (decon, fimd or mixer). This way no more hacks will be needed to configure proper DMA-mapping address space on the common virtual exynos-drm device. This change also removes the need for some hacks in IOMMU related code. It also finally solves the problem of Exynos DRM driver not working on ARM64 architecture, which provides noop-based DMA-mapping operations for virtual platform devices. Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
* drm/exynos: remove drm_iommu_attach_device_if_possibleJoonyoung Shim2015-08-161-11/+0Star
| | | | | | | | | | | | Already drm_iommu_attach_device checks whether support iommu internally. It should clear channels always regardless iommu support. We didn't know because we can detect the problem when iommu is enabled, so we don't have to use drm_iommu_attach_device_if_possible and then we can remove drm_iommu_attach_device_if_possible and clear_channels function pointer. Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com> Tested-by: Marek Szyprowski <m.szyprowski@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
* drm/exynos: remove to use ifdef CONFIG_ARM_DMA_USE_IOMMUJoonyoung Shim2015-08-161-4/+0Star
| | | | | | | | | | | If CONFIG_ARM_DMA_USE_IOMMU is disable, CONFIG_DRM_EXYNOS_IOMMU also is disable. When CONFIG_DRM_EXYNOS_IOMMU is disable, is_drm_iommu_supported() returns always false, so we can remove to use ifdef CONFIG_ARM_DMA_USE_IOMMU in is_drm_iommu_supported(). Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com> Tested-by: Marek Szyprowski <m.szyprowski@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
* drm/exynos: add drm_iommu_attach_device_if_possible()Hyungwon Hwang2015-06-221-0/+11
| | | | | | | | | Every CRTC drivers in Exynos DRM implements the code which checks whether IOMMU is supported or not, and if supported enable it. Making new helper for it generalize each CRTC drivers. Signed-off-by: Hyungwon Hwang <human.hwang@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
* drm/exynos: remove uneeded declaration of struct dma_iommu_mappingGustavo Padovan2014-11-241-1/+0Star
| | | | | | | It is not even used in this header anymore. Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk> Signed-off-by: Inki Dae <inki.dae@samsung.com>
* arm: dma-mapping: remove order parameter from arm_iommu_create_mapping()Marek Szyprowski2014-02-281-1/+0Star
| | | | | | | | | | | | | | | | The 'order' parameter for IOMMU-aware dma-mapping implementation was introduced mainly as a hack to reduce size of the bitmap used for tracking IO virtual address space. Since now it is possible to dynamically resize the bitmap, this hack is not needed and can be removed without any impact on the client devices. This way the parameters for arm_iommu_create_mapping() becomes much easier to understand. 'size' parameter now means the maximum supported IO address space size. The code will allocate (resize) bitmap in chunks, ensuring that a single chunk is not larger than a single memory page to avoid unreliable allocations of size larger than PAGE_SIZE in atomic context. Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
* drm/exynos: fix iommu address allocation orderInki Dae2013-02-211-1/+1
| | | | | | | | | This patch modifies iommu address allocation order from 64k to 4k. 64k order causes waste of the io space and this was our mistakes. Signed-off-by: Inki Dae <inki.dae@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
* drm/exynos: change file license to GPLInki Dae2013-01-041-18/+4Star
| | | | | | | | | | | This patch changes file license to GPL Most of exynos files had been copied from some random file and not updated correctly. So this patch corrects the file license. Signed-off-by: Inki Dae <inki.dae@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
* drm/exynos: add iommu support for exynos drm frameworkInki Dae2012-11-291-0/+85
Changelog v4: - fix condition to drm_iommu_detach_device funtion. Changelog v3: - add dma_parms->max_segment_size setting of drm_device->dev. - use devm_kzalloc instead of kzalloc. Changelog v2: - fix iommu attach condition. . check archdata.dma_ops of drm device instead of subdrv device's one. - code clean to exynos_drm_iommu.c file. . remove '#ifdef CONFIG_ARM_DMA_USE_IOMMU' from exynos_drm_iommu.c and add it to driver/gpu/drm/exynos/Kconfig. Changelog v1: This patch adds iommu support for exynos drm framework with dma mapping api. In this patch, we used dma mapping api to allocate physical memory and maps it with iommu table and removed some existing codes and added new some codes for iommu support. GEM allocation requires one device object to use dma mapping api so this patch uses one iommu mapping for all sub drivers. In other words, all sub drivers have same iommu mapping. Signed-off-by: Inki Dae <inki.dae@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>