drm/tegra: prime: Add vmap support
authorThierry Reding <treding@nvidia.com>
Wed, 29 Jan 2014 19:32:33 +0000 (20:32 +0100)
committerThierry Reding <treding@nvidia.com>
Fri, 4 Apr 2014 07:12:49 +0000 (09:12 +0200)
This is trivial to support since all GEM objects are mapped into kernel
space anyway.

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

index ef853e558036d55ce31c7cb4acfdf2479beefb80..29913eb9b25de0ab58aec19b785450a4ab11a824 100644 (file)
@@ -394,6 +394,18 @@ static int tegra_gem_prime_mmap(struct dma_buf *buf, struct vm_area_struct *vma)
        return -EINVAL;
 }
 
+static void *tegra_gem_prime_vmap(struct dma_buf *buf)
+{
+       struct drm_gem_object *gem = buf->priv;
+       struct tegra_bo *bo = to_tegra_bo(gem);
+
+       return bo->vaddr;
+}
+
+static void tegra_gem_prime_vunmap(struct dma_buf *buf, void *vaddr)
+{
+}
+
 static const struct dma_buf_ops tegra_gem_prime_dmabuf_ops = {
        .map_dma_buf = tegra_gem_prime_map_dma_buf,
        .unmap_dma_buf = tegra_gem_prime_unmap_dma_buf,
@@ -403,6 +415,8 @@ static const struct dma_buf_ops tegra_gem_prime_dmabuf_ops = {
        .kmap = tegra_gem_prime_kmap,
        .kunmap = tegra_gem_prime_kunmap,
        .mmap = tegra_gem_prime_mmap,
+       .vmap = tegra_gem_prime_vmap,
+       .vunmap = tegra_gem_prime_vunmap,
 };
 
 struct dma_buf *tegra_gem_prime_export(struct drm_device *drm,