Skip to content

Commit

Permalink
drm/tegra: Delete host1x_bo_ops->k(un)map
Browse files Browse the repository at this point in the history
It doesn't have any callers anymore.

Aside: The ->mmap/munmap hooks have a bit a confusing name, they don't
do userspace mmaps, but a kernel vmap. I think most places use vmap
for this, except ttm, which uses kmap for vmap for added confusion.
mmap seems entirely for userspace mappings set up through mmap(2)
syscall.

Reviewed-by: Thierry Reding <[email protected]>
Tested-by: Thierry Reding <[email protected]>
Acked-by: Sumit Semwal <[email protected]>
Signed-off-by: Daniel Vetter <[email protected]>
Cc: Thierry Reding <[email protected]>
Cc: Jonathan Hunter <[email protected]>
Cc: [email protected]
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
  • Loading branch information
danvet committed Nov 25, 2019
1 parent 7a8139c commit 35bd71d
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 41 deletions.
28 changes: 0 additions & 28 deletions drivers/gpu/drm/tegra/gem.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,32 +65,6 @@ static void tegra_bo_munmap(struct host1x_bo *bo, void *addr)
vunmap(addr);
}

static void *tegra_bo_kmap(struct host1x_bo *bo, unsigned int page)
{
struct tegra_bo *obj = host1x_to_tegra_bo(bo);

if (obj->vaddr)
return obj->vaddr + page * PAGE_SIZE;
else if (obj->gem.import_attach)
return dma_buf_kmap(obj->gem.import_attach->dmabuf, page);
else
return vmap(obj->pages + page, 1, VM_MAP,
pgprot_writecombine(PAGE_KERNEL));
}

static void tegra_bo_kunmap(struct host1x_bo *bo, unsigned int page,
void *addr)
{
struct tegra_bo *obj = host1x_to_tegra_bo(bo);

if (obj->vaddr)
return;
else if (obj->gem.import_attach)
dma_buf_kunmap(obj->gem.import_attach->dmabuf, page, addr);
else
vunmap(addr);
}

static struct host1x_bo *tegra_bo_get(struct host1x_bo *bo)
{
struct tegra_bo *obj = host1x_to_tegra_bo(bo);
Expand All @@ -107,8 +81,6 @@ static const struct host1x_bo_ops tegra_bo_ops = {
.unpin = tegra_bo_unpin,
.mmap = tegra_bo_mmap,
.munmap = tegra_bo_munmap,
.kmap = tegra_bo_kmap,
.kunmap = tegra_bo_kunmap,
};

static int tegra_bo_iommu_map(struct tegra_drm *tegra, struct tegra_bo *bo)
Expand Down
13 changes: 0 additions & 13 deletions include/linux/host1x.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,6 @@ struct host1x_bo_ops {
void (*unpin)(struct host1x_bo *bo, struct sg_table *sgt);
void *(*mmap)(struct host1x_bo *bo);
void (*munmap)(struct host1x_bo *bo, void *addr);
void *(*kmap)(struct host1x_bo *bo, unsigned int pagenum);
void (*kunmap)(struct host1x_bo *bo, unsigned int pagenum, void *addr);
};

struct host1x_bo {
Expand Down Expand Up @@ -113,17 +111,6 @@ static inline void host1x_bo_munmap(struct host1x_bo *bo, void *addr)
bo->ops->munmap(bo, addr);
}

static inline void *host1x_bo_kmap(struct host1x_bo *bo, unsigned int pagenum)
{
return bo->ops->kmap(bo, pagenum);
}

static inline void host1x_bo_kunmap(struct host1x_bo *bo,
unsigned int pagenum, void *addr)
{
bo->ops->kunmap(bo, pagenum, addr);
}

/*
* host1x syncpoints
*/
Expand Down

0 comments on commit 35bd71d

Please sign in to comment.