diff options
author | Alexandre Courbot <acourbot@nvidia.com> | 2015-02-20 18:23:03 +0900 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2015-03-17 09:45:12 +1000 |
commit | 4a50f39203e1275327689b4da837b9df1c999909 (patch) | |
tree | ec817265309717acea00624db227a143f36be5a8 /lib | |
parent | 3bc5960645a5d152e74ee92582b0ce3ed0f8cf26 (diff) | |
download | nouveau-4a50f39203e1275327689b4da837b9df1c999909.tar.gz |
platform: probe IOMMU if present
Tegra SoCs have an IOMMU that can be used to present non-contiguous
physical memory as contiguous to the GPU and maximize the use of large
pages in the GPU MMU, leading to performance gains. This patch adds
support for probing such a IOMMU if present and make its properties
available in the nouveau_platform_gpu structure so subsystems can take
advantage of it.
Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/include/nvif/os.h | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/lib/include/nvif/os.h b/lib/include/nvif/os.h index b4d307e3a..275fa84ad 100644 --- a/lib/include/nvif/os.h +++ b/lib/include/nvif/os.h @@ -715,6 +715,29 @@ dma_free_attrs(struct device *dev, size_t sz, void *vaddr, dma_addr_t bus, /****************************************************************************** + * IOMMU + *****************************************************************************/ +struct iommu_domain; + +#define IOMMU_READ (1 << 0) +#define IOMMU_WRITE (1 << 1) +#define IOMMU_CACHE (1 << 2) /* DMA cache coherency */ +#define IOMMU_NOEXEC (1 << 3) + +static inline int +iommu_map(struct iommu_domain *domain, unsigned long iova, dma_addr_t paddr, + size_t size, int prot) +{ + return 0; +} + +static inline size_t +iommu_unmap(struct iommu_domain *domain, unsigned long iova, size_t size) +{ + return 0; +} + +/****************************************************************************** * PCI *****************************************************************************/ #include <pciaccess.h> @@ -1208,9 +1231,18 @@ regulator_get_voltage(struct regulator *regulator) * nouveau drm platform device *****************************************************************************/ +struct nvkm_mm; + struct nouveau_platform_gpu { struct clk *clk; struct regulator *vdd; + + struct { + struct mutex mutex; + struct nvkm_mm *mm; + struct iommu_domain *domain; + unsigned long pgshift; + } iommu; }; struct nouveau_platform_device { |