]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/commitdiff
video: tegra: host: Remove dmabuf memory manager
authorArto Merilainen <amerilainen@nvidia.com>
Wed, 26 Feb 2014 10:22:32 +0000 (12:22 +0200)
committerHiroshi Doyu <hdoyu@nvidia.com>
Mon, 3 Mar 2014 10:40:20 +0000 (02:40 -0800)
This patch removes dmabuf memmgr. It is dead code that has never
been used actively.

Change-Id: I273f305caca67ec9c5533370f331ed1518758952
Signed-off-by: Arto Merilainen <amerilainen@nvidia.com>
Reviewed-on: http://git-master/r/374797
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Hiroshi Doyu <hdoyu@nvidia.com>
Tested-by: Hiroshi Doyu <hdoyu@nvidia.com>
drivers/video/tegra/Kconfig
drivers/video/tegra/host/Makefile
drivers/video/tegra/host/dmabuf.c [deleted file]
drivers/video/tegra/host/dmabuf.h [deleted file]
drivers/video/tegra/host/nvhost_memmgr.c

index 2cb19a3542b6a3c2214cfc00fbf85d72a064cb11..25e03009b9d2c763917a6744b67fccd3a86fbc8b 100644 (file)
@@ -27,13 +27,6 @@ config TEGRA_GRHOST_FORCE_NVMAP
        help
          Force using nvmap instead of dma mapping API
 
-config TEGRA_GRHOST_USE_DMABUF
-       bool "Support dmabuf buffers"
-       default y
-       select DMA_SHARED_BUFFER
-       help
-         Support dmabuf buffers.
-
 config TEGRA_GRHOST_DEFAULT_TIMEOUT
        depends on TEGRA_GRHOST
        int "Default timeout for submits"
index d408c865a3297f7f1d83548178a828c09845a045..0647314671f1a6380ba0630e871cb1a89b864bc6 100644 (file)
@@ -54,6 +54,5 @@ obj-$(t12x_or_higher_config) += t124/
 obj-$(t12x_or_higher_config) += vic03/
 obj-$(t12x_or_higher_config) += nvhost_allocator.o
 obj-$(CONFIG_TEGRA_GRHOST_USE_NVMAP) += nvmap.o
-obj-$(CONFIG_TEGRA_GRHOST_USE_DMABUF) += dmabuf.o
 
 obj-$(CONFIG_TEGRA_GRHOST_SYNC) += nvhost_sync.o
diff --git a/drivers/video/tegra/host/dmabuf.c b/drivers/video/tegra/host/dmabuf.c
deleted file mode 100644 (file)
index 92eec66..0000000
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- * drivers/video/tegra/host/dmabuf.c
- *
- * Tegra Graphics Host DMA-BUF support
- *
- * Copyright (c) 2012-2014, NVIDIA CORPORATION.  All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms and conditions of the GNU General Public License,
- * version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include <linux/dma-buf.h>
-#include <linux/nvhost.h>
-#include "chip_support.h"
-#include "nvhost_memmgr.h"
-
-static inline struct dma_buf_attachment *to_dmabuf_att(struct mem_handle *h)
-{
-       return (struct dma_buf_attachment *)(((uintptr_t)h) & ~0x3);
-}
-
-static inline struct dma_buf *to_dmabuf(struct mem_handle *h)
-{
-       return to_dmabuf_att(h)->dmabuf;
-}
-
-static inline int to_dmabuf_fd(ulong id)
-{
-       return nvhost_memmgr_id(id) >> 2;
-}
-void nvhost_dmabuf_put(struct mem_handle *handle)
-{
-       struct dma_buf_attachment *attach = to_dmabuf_att(handle);
-       struct dma_buf *dmabuf = attach->dmabuf;
-       dma_buf_detach(dmabuf, attach);
-       dma_buf_put(dmabuf);
-}
-
-struct sg_table *nvhost_dmabuf_pin(struct mem_handle *handle)
-{
-       return dma_buf_map_attachment(to_dmabuf_att(handle),
-                               DMA_BIDIRECTIONAL);
-}
-
-void nvhost_dmabuf_unpin(struct mem_handle *handle, struct sg_table *sgt)
-{
-       dma_buf_unmap_attachment(to_dmabuf_att(handle), sgt, DMA_BIDIRECTIONAL);
-}
-
-
-void *nvhost_dmabuf_mmap(struct mem_handle *handle)
-{
-       return dma_buf_vmap(to_dmabuf(handle));
-}
-
-void nvhost_dmabuf_munmap(struct mem_handle *handle, void *addr)
-{
-       dma_buf_vunmap(to_dmabuf(handle), addr);
-}
-
-void *nvhost_dmabuf_kmap(struct mem_handle *handle, unsigned int pagenum)
-{
-       return dma_buf_kmap(to_dmabuf(handle), pagenum);
-}
-
-void nvhost_dmabuf_kunmap(struct mem_handle *handle, unsigned int pagenum,
-               void *addr)
-{
-       dma_buf_kunmap(to_dmabuf(handle), pagenum, addr);
-}
-
-size_t nvhost_dmabuf_size(struct mem_handle *handle)
-{
-       struct dma_buf_attachment *attach = to_dmabuf_att(handle);
-       struct dma_buf *dmabuf = attach->dmabuf;
-       return dmabuf->size;
-}
-
-struct mem_handle *nvhost_dmabuf_get(ulong id, struct platform_device *dev)
-{
-       struct mem_handle *h;
-       struct dma_buf *buf;
-
-       buf = dma_buf_get(to_dmabuf_fd(id));
-       if (IS_ERR(buf))
-               return (struct mem_handle *)buf;
-       else {
-               h = (struct mem_handle *)dma_buf_attach(buf, &dev->dev);
-               if (IS_ERR(h)) {
-                       dma_buf_put(buf);
-                       return (struct mem_handle *)h;
-               }
-       }
-
-       return (struct mem_handle *) ((uintptr_t)h | mem_mgr_type_dmabuf);
-}
diff --git a/drivers/video/tegra/host/dmabuf.h b/drivers/video/tegra/host/dmabuf.h
deleted file mode 100644 (file)
index 1d8ea38..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * drivers/video/tegra/host/dmabuf.h
- *
- * Tegra Graphics Host dmabuf memory manager
- *
- * Copyright (c) 2012-2014, NVIDIA CORPORATION.  All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms and conditions of the GNU General Public License,
- * version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef __NVHOST_DMABUF_H
-#define __NVHOST_DMABUF_H
-
-#include "nvhost_memmgr.h"
-
-struct nvhost_chip_support;
-struct platform_device;
-
-struct mem_mgr *nvhost_dmabuf_alloc_mgr(void);
-void nvhost_dmabuf_put_mgr(struct mem_mgr *mgr);
-struct mem_mgr *nvhost_dmabuf_get_mgr(struct mem_mgr *mgr);
-struct mem_mgr *nvhost_dmabuf_get_mgr_file(int fd);
-void nvhost_dmabuf_put(struct mem_handle *handle);
-struct sg_table *nvhost_dmabuf_pin(struct mem_handle *handle);
-void nvhost_dmabuf_unpin(struct mem_handle *handle, struct sg_table *sgt);
-void *nvhost_dmabuf_mmap(struct mem_handle *handle);
-void nvhost_dmabuf_munmap(struct mem_handle *handle, void *addr);
-void *nvhost_dmabuf_kmap(struct mem_handle *handle, unsigned int pagenum);
-void nvhost_dmabuf_kunmap(struct mem_handle *handle, unsigned int pagenum,
-               void *addr);
-struct mem_handle *nvhost_dmabuf_get(ulong id, struct platform_device *dev);
-int nvhost_dmabuf_get_param(struct mem_handle *handle,
-                          u32 param, u64 *result);
-#endif
index 177fd576debe54270e50e4e293514211dc001ea1..39f5f0bc9890c75e2ad7188eb787b469f4276ec1 100644 (file)
@@ -29,9 +29,6 @@
 #include "nvmap.h"
 #include <linux/nvmap.h>
 #endif
-#ifdef CONFIG_TEGRA_GRHOST_USE_DMABUF
-#include "dmabuf.h"
-#endif
 #include "chip_support.h"
 
 struct mem_mgr *nvhost_memmgr_alloc_mgr(void)
@@ -39,10 +36,6 @@ struct mem_mgr *nvhost_memmgr_alloc_mgr(void)
        struct mem_mgr *mgr = NULL;
 #ifdef CONFIG_TEGRA_GRHOST_USE_NVMAP
        mgr = nvhost_nvmap_alloc_mgr();
-#else
-#ifdef CONFIG_TEGRA_GRHOST_USE_DMABUF
-       mgr = (struct mem_mgr)1;
-#endif
 #endif
 
        return mgr;
@@ -52,10 +45,6 @@ void nvhost_memmgr_put_mgr(struct mem_mgr *mgr)
 {
 #ifdef CONFIG_TEGRA_GRHOST_USE_NVMAP
        nvhost_nvmap_put_mgr(mgr);
-#else
-#ifdef CONFIG_TEGRA_GRHOST_USE_DMABUF
-       mgr = (struct mem_mgr)1;
-#endif
 #endif
 }
 
@@ -64,10 +53,6 @@ struct mem_mgr *nvhost_memmgr_get_mgr(struct mem_mgr *_mgr)
        struct mem_mgr *mgr = NULL;
 #ifdef CONFIG_TEGRA_GRHOST_USE_NVMAP
        mgr = nvhost_nvmap_get_mgr(_mgr);
-#else
-#ifdef CONFIG_TEGRA_GRHOST_USE_DMABUF
-       mgr = (struct mem_mgr)1;
-#endif
 #endif
 
        return mgr;
@@ -78,10 +63,6 @@ struct mem_mgr *nvhost_memmgr_get_mgr_file(int fd)
        struct mem_mgr *mgr = NULL;
 #ifdef CONFIG_TEGRA_GRHOST_USE_NVMAP
        mgr = nvhost_nvmap_get_mgr_file(fd);
-#else
-#ifdef CONFIG_TEGRA_GRHOST_USE_DMABUF
-       mgr = (struct mem_mgr)1;
-#endif
 #endif
 
        return mgr;
@@ -97,11 +78,6 @@ struct mem_handle *nvhost_memmgr_get(struct mem_mgr *mgr,
        case mem_mgr_type_nvmap:
                h = (struct mem_handle *) nvhost_nvmap_get(mgr, id, dev);
                break;
-#endif
-#ifdef CONFIG_TEGRA_GRHOST_USE_DMABUF
-       case mem_mgr_type_dmabuf:
-               h = (struct mem_handle *) nvhost_dmabuf_get(id, dev);
-               break;
 #endif
        default:
                break;
@@ -117,11 +93,6 @@ void nvhost_memmgr_put(struct mem_mgr *mgr, struct mem_handle *handle)
        case mem_mgr_type_nvmap:
                nvhost_nvmap_put(mgr, handle);
                break;
-#endif
-#ifdef CONFIG_TEGRA_GRHOST_USE_DMABUF
-       case mem_mgr_type_dmabuf:
-               nvhost_dmabuf_put(handle);
-               break;
 #endif
        default:
                break;
@@ -136,11 +107,6 @@ struct sg_table *nvhost_memmgr_pin(struct mem_mgr *mgr,
        case mem_mgr_type_nvmap:
                return nvhost_nvmap_pin(mgr, handle, dev, rw_flag);
                break;
-#endif
-#ifdef CONFIG_TEGRA_GRHOST_USE_DMABUF
-       case mem_mgr_type_dmabuf:
-               return nvhost_dmabuf_pin(handle);
-               break;
 #endif
        default:
                return 0;
@@ -157,11 +123,6 @@ void nvhost_memmgr_unpin(struct mem_mgr *mgr,
        case mem_mgr_type_nvmap:
                nvhost_nvmap_unpin(mgr, handle, dev, sgt);
                break;
-#endif
-#ifdef CONFIG_TEGRA_GRHOST_USE_DMABUF
-       case mem_mgr_type_dmabuf:
-               nvhost_dmabuf_unpin(handle, sgt);
-               break;
 #endif
        default:
                break;
@@ -175,11 +136,6 @@ void *nvhost_memmgr_mmap(struct mem_handle *handle)
        case mem_mgr_type_nvmap:
                return nvhost_nvmap_mmap(handle);
                break;
-#endif
-#ifdef CONFIG_TEGRA_GRHOST_USE_DMABUF
-       case mem_mgr_type_dmabuf:
-               return nvhost_dmabuf_mmap(handle);
-               break;
 #endif
        default:
                return 0;
@@ -194,11 +150,6 @@ void nvhost_memmgr_munmap(struct mem_handle *handle, void *addr)
        case mem_mgr_type_nvmap:
                nvhost_nvmap_munmap(handle, addr);
                break;
-#endif
-#ifdef CONFIG_TEGRA_GRHOST_USE_DMABUF
-       case mem_mgr_type_dmabuf:
-               nvhost_dmabuf_munmap(handle, addr);
-               break;
 #endif
        default:
                break;
@@ -212,11 +163,6 @@ void *nvhost_memmgr_kmap(struct mem_handle *handle, unsigned int pagenum)
        case mem_mgr_type_nvmap:
                return nvhost_nvmap_kmap(handle, pagenum);
                break;
-#endif
-#ifdef CONFIG_TEGRA_GRHOST_USE_DMABUF
-       case mem_mgr_type_dmabuf:
-               return nvhost_dmabuf_kmap(handle, pagenum);
-               break;
 #endif
        default:
                return 0;
@@ -232,11 +178,6 @@ void nvhost_memmgr_kunmap(struct mem_handle *handle, unsigned int pagenum,
        case mem_mgr_type_nvmap:
                nvhost_nvmap_kunmap(handle, pagenum, addr);
                break;
-#endif
-#ifdef CONFIG_TEGRA_GRHOST_USE_DMABUF
-       case mem_mgr_type_dmabuf:
-               nvhost_dmabuf_kunmap(handle, pagenum, addr);
-               break;
 #endif
        default:
                break;