diff options
author | Terje Bergstrom <tbergstrom@nvidia.com> | 2012-05-31 15:04:53 +0300 |
---|---|---|
committer | Simone Willett <swillett@nvidia.com> | 2012-06-11 16:27:55 -0700 |
commit | b08927a712005ae3f6941e59f530b7896ac5f407 (patch) | |
tree | c6a974f266565dec2b7d619a67d2e9a61677e553 /drivers/video/tegra/host/nvhost_cdma.h | |
parent | 273ceab50c24ba53fcc7a90072dd02d1038d2a97 (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: I4e5e7de4271e0797d117ac8210af4732b6018973
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/105665
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Mayuresh Kulkarni <mkulkarni@nvidia.com>
Reviewed-by: Juha Tukkinen <jtukkinen@nvidia.com>
Diffstat (limited to 'drivers/video/tegra/host/nvhost_cdma.h')
-rw-r--r-- | drivers/video/tegra/host/nvhost_cdma.h | 27 |
1 files changed, 7 insertions, 20 deletions
diff --git a/drivers/video/tegra/host/nvhost_cdma.h b/drivers/video/tegra/host/nvhost_cdma.h index 2056774a7bc7..e4a19e6ab113 100644 --- a/drivers/video/tegra/host/nvhost_cdma.h +++ b/drivers/video/tegra/host/nvhost_cdma.h @@ -25,12 +25,13 @@ #include <linux/semaphore.h> #include <linux/nvhost.h> -#include <linux/nvmap.h> #include <linux/list.h> struct nvhost_syncpt; struct nvhost_userctx_timeout; struct nvhost_job; +struct mem_mgr; +struct mem_handle; /* * cdma @@ -46,27 +47,13 @@ struct nvhost_job; * update - call to update sync queue and push buffer, unpin memory */ -struct nvmap_client_handle { - struct nvmap_client *client; - struct nvmap_handle_ref *handle; -}; - struct push_buffer { - struct nvmap_handle_ref *mem; /* handle to pushbuffer memory */ + struct mem_handle *mem; /* handle to pushbuffer memory */ u32 *mapped; /* mapped pushbuffer memory */ u32 phys; /* physical address of pushbuffer */ u32 fence; /* index we've written */ u32 cur; /* index to write to */ - struct nvmap_client_handle *nvmap; - /* nvmap handle for each opcode pair */ -}; - -struct syncpt_buffer { - struct nvmap_handle_ref *mem; /* handle to pushbuffer memory */ - u32 *mapped; /* mapped gather buffer (at channel offset */ - u32 phys; /* physical address (at channel offset) */ - u32 incr_per_buffer; /* max # of incrs per GATHER */ - u32 words_per_incr; /* # of DWORDS in buffer to incr a syncpt */ + struct mem_mgr_handle *client_handle; /* handle for each opcode pair */ }; struct buffer_timeout { @@ -106,7 +93,7 @@ struct nvhost_cdma { #define cdma_to_channel(cdma) container_of(cdma, struct nvhost_channel, cdma) #define cdma_to_dev(cdma) nvhost_get_host(cdma_to_channel(cdma)->dev) -#define cdma_to_nvmap(cdma) ((cdma_to_dev(cdma))->nvmap) +#define cdma_to_memmgr(cdma) ((cdma_to_dev(cdma))->memmgr) #define pb_to_cdma(pb) container_of(pb, struct nvhost_cdma, push_buffer) int nvhost_cdma_init(struct nvhost_cdma *cdma); @@ -115,8 +102,8 @@ void nvhost_cdma_stop(struct nvhost_cdma *cdma); int nvhost_cdma_begin(struct nvhost_cdma *cdma, struct nvhost_job *job); void nvhost_cdma_push(struct nvhost_cdma *cdma, u32 op1, u32 op2); void nvhost_cdma_push_gather(struct nvhost_cdma *cdma, - struct nvmap_client *client, - struct nvmap_handle_ref *handle, u32 offset, u32 op1, u32 op2); + struct mem_mgr *client, + struct mem_handle *handle, u32 offset, u32 op1, u32 op2); void nvhost_cdma_end(struct nvhost_cdma *cdma, struct nvhost_job *job); void nvhost_cdma_update(struct nvhost_cdma *cdma); |