diff options
author | Terje Bergstrom <tbergstrom@nvidia.com> | 2012-05-31 15:04:53 +0300 |
---|---|---|
committer | Varun Wadekar <vwadekar@nvidia.com> | 2012-06-26 11:32:07 +0530 |
commit | c8d4da67ab904dca11cdbcb5903ed1cd516a527f (patch) | |
tree | 389cfce387cbda2d1a91788b43b0f05a23fa7e4e /drivers/video/tegra/host/nvhost_cdma.c | |
parent | 9f4df599245d267df6eeadc692562df94f8ef983 (diff) |
video: tegra: host: Abstract nvmap support
Abstract nvmap support to one file, and use it via function pointers
from other parts of nvhost.
Bug 965206
Change-Id: Icd98e5959045eccfb0d2ee1d48ee151102004279
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/105665
(cherry picked from commit b08927a712005ae3f6941e59f530b7896ac5f407)
Conflicts:
drivers/video/tegra/host/host1x/host1x_intr.c
Change-Id: I435b003698cd191fa6fe70cb666bf660e792a1ad
Reviewed-on: http://git-master/r/108519
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Tested-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-by: Juha Tukkinen <jtukkinen@nvidia.com>
Diffstat (limited to 'drivers/video/tegra/host/nvhost_cdma.c')
-rw-r--r-- | drivers/video/tegra/host/nvhost_cdma.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/video/tegra/host/nvhost_cdma.c b/drivers/video/tegra/host/nvhost_cdma.c index cd69ea20ae80..e172ea3ea249 100644 --- a/drivers/video/tegra/host/nvhost_cdma.c +++ b/drivers/video/tegra/host/nvhost_cdma.c @@ -24,6 +24,8 @@ #include "nvhost_hwctx.h" #include "dev.h" #include "debug.h" +#include "nvhost_memmgr.h" +#include "chip_support.h" #include <asm/cacheflush.h> #include <linux/slab.h> @@ -396,13 +398,13 @@ int nvhost_cdma_begin(struct nvhost_cdma *cdma, struct nvhost_job *job) } static void trace_write_gather(struct nvhost_cdma *cdma, - struct nvmap_handle_ref *ref, + struct mem_handle *ref, u32 offset, u32 words) { void *mem = NULL; if (nvhost_debug_trace_cmdbuf) { - mem = nvmap_mmap(ref); + mem = mem_op().mmap(ref); if (IS_ERR_OR_NULL(mem)) mem = NULL; }; @@ -416,12 +418,12 @@ static void trace_write_gather(struct nvhost_cdma *cdma, for (i = 0; i < words; i += TRACE_MAX_LENGTH) { trace_nvhost_cdma_push_gather( cdma_to_channel(cdma)->dev->name, - (u32)ref->handle, + (u32)ref, min(words - i, TRACE_MAX_LENGTH), offset + i * sizeof(u32), mem); } - nvmap_munmap(ref, mem); + mem_op().munmap(ref, mem); } } @@ -443,8 +445,7 @@ void nvhost_cdma_push(struct nvhost_cdma *cdma, u32 op1, u32 op2) * Blocks as necessary if the push buffer is full. */ void nvhost_cdma_push_gather(struct nvhost_cdma *cdma, - struct nvmap_client *client, - struct nvmap_handle_ref *handle, + struct mem_mgr *client, struct mem_handle *handle, u32 offset, u32 op1, u32 op2) { u32 slots_free = cdma->slots_free; |