diff options
author | Krishna Reddy <vdumpa@nvidia.com> | 2012-03-15 19:14:53 -0700 |
---|---|---|
committer | Simone Willett <swillett@nvidia.com> | 2012-03-20 14:02:25 -0700 |
commit | bda291df6347efb06cf15de0bbc09ce18ef757bb (patch) | |
tree | ae860081309806a48c5a3c933464b3dee040a9ba /drivers/video | |
parent | 419f21cd5826a38a1759fde2a4daba92a4f9a7bc (diff) |
arm: tegra: nvmap: Update nvmap_alloc api.
Update nvmap_alloc api to take heap_mask as arg.
This is to let clients specify the specific heap needed.
Change-Id: I9950b3e60e6dac0301b6dc66be3e9d0bab8e0fee
Signed-off-by: Krishna Reddy <vdumpa@nvidia.com>
Reviewed-on: http://git-master/r/90471
Reviewed-by: Scott Williams <scwilliams@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
Diffstat (limited to 'drivers/video')
-rw-r--r-- | drivers/video/tegra/host/gr3d/gr3d.c | 2 | ||||
-rw-r--r-- | drivers/video/tegra/host/gr3d/gr3d_t20.c | 2 | ||||
-rw-r--r-- | drivers/video/tegra/host/gr3d/gr3d_t30.c | 2 | ||||
-rw-r--r-- | drivers/video/tegra/host/host1x/host1x_cdma.c | 4 | ||||
-rw-r--r-- | drivers/video/tegra/host/mpe/mpe.c | 4 | ||||
-rw-r--r-- | drivers/video/tegra/host/nvhost_job.c | 2 | ||||
-rw-r--r-- | drivers/video/tegra/nvmap/nvmap.c | 8 |
7 files changed, 14 insertions, 10 deletions
diff --git a/drivers/video/tegra/host/gr3d/gr3d.c b/drivers/video/tegra/host/gr3d/gr3d.c index 6e7f87ea0cd6..2dca9ef0b254 100644 --- a/drivers/video/tegra/host/gr3d/gr3d.c +++ b/drivers/video/tegra/host/gr3d/gr3d.c @@ -76,7 +76,7 @@ struct host1x_hwctx *nvhost_3dctx_alloc_common(struct host1x_hwctx_handler *p, return NULL; ctx->restore = nvmap_alloc(nvmap, p->restore_size * 4, 32, map_restore ? NVMAP_HANDLE_WRITE_COMBINE - : NVMAP_HANDLE_UNCACHEABLE); + : NVMAP_HANDLE_UNCACHEABLE, 0); if (IS_ERR_OR_NULL(ctx->restore)) goto fail; diff --git a/drivers/video/tegra/host/gr3d/gr3d_t20.c b/drivers/video/tegra/host/gr3d/gr3d_t20.c index 90892aa1e7ee..3604142aaf20 100644 --- a/drivers/video/tegra/host/gr3d/gr3d_t20.c +++ b/drivers/video/tegra/host/gr3d/gr3d_t20.c @@ -366,7 +366,7 @@ struct nvhost_hwctx_handler * __init nvhost_gr3d_t20_ctxhandler_init( setup_save(p, NULL); p->save_buf = nvmap_alloc(nvmap, p->save_size * sizeof(u32), 32, - NVMAP_HANDLE_WRITE_COMBINE); + NVMAP_HANDLE_WRITE_COMBINE, 0); if (IS_ERR(p->save_buf)) { p->save_buf = NULL; return NULL; diff --git a/drivers/video/tegra/host/gr3d/gr3d_t30.c b/drivers/video/tegra/host/gr3d/gr3d_t30.c index 6a7c1470c199..e7329e50e3dd 100644 --- a/drivers/video/tegra/host/gr3d/gr3d_t30.c +++ b/drivers/video/tegra/host/gr3d/gr3d_t30.c @@ -404,7 +404,7 @@ struct nvhost_hwctx_handler *__init nvhost_gr3d_t30_ctxhandler_init( setup_save(p, NULL); p->save_buf = nvmap_alloc(nvmap, p->save_size * 4, 32, - NVMAP_HANDLE_WRITE_COMBINE); + NVMAP_HANDLE_WRITE_COMBINE, 0); if (IS_ERR(p->save_buf)) { p->save_buf = NULL; return NULL; diff --git a/drivers/video/tegra/host/host1x/host1x_cdma.c b/drivers/video/tegra/host/host1x/host1x_cdma.c index 09552753943e..064368ad4760 100644 --- a/drivers/video/tegra/host/host1x/host1x_cdma.c +++ b/drivers/video/tegra/host/host1x/host1x_cdma.c @@ -72,7 +72,7 @@ static int push_buffer_init(struct push_buffer *pb) /* allocate and map pushbuffer memory */ pb->mem = nvmap_alloc(nvmap, PUSH_BUFFER_SIZE + 4, 32, - NVMAP_HANDLE_WRITE_COMBINE); + NVMAP_HANDLE_WRITE_COMBINE, 0); if (IS_ERR_OR_NULL(pb->mem)) { pb->mem = NULL; goto fail; @@ -209,7 +209,7 @@ static int cdma_timeout_init(struct nvhost_cdma *cdma, /* allocate and map syncpt incr memory */ sb->mem = nvmap_alloc(nvmap, (SYNCPT_INCR_BUFFER_SIZE_WORDS * sizeof(u32)), 32, - NVMAP_HANDLE_WRITE_COMBINE); + NVMAP_HANDLE_WRITE_COMBINE, 0); if (IS_ERR_OR_NULL(sb->mem)) { sb->mem = NULL; goto fail; diff --git a/drivers/video/tegra/host/mpe/mpe.c b/drivers/video/tegra/host/mpe/mpe.c index a5459e885de4..e1fef69e0011 100644 --- a/drivers/video/tegra/host/mpe/mpe.c +++ b/drivers/video/tegra/host/mpe/mpe.c @@ -437,7 +437,7 @@ static struct nvhost_hwctx *ctxmpe_alloc(struct nvhost_hwctx_handler *h, if (!ctx) return NULL; ctx->restore = nvmap_alloc(nvmap, restore_size * 4, 32, - NVMAP_HANDLE_WRITE_COMBINE); + NVMAP_HANDLE_WRITE_COMBINE, 0); if (IS_ERR_OR_NULL(ctx->restore)) { kfree(ctx); return NULL; @@ -545,7 +545,7 @@ struct nvhost_hwctx_handler * __init nvhost_mpe_ctxhandler_init( setup_save(p, NULL); p->save_buf = nvmap_alloc(nvmap, p->save_size * 4, 32, - NVMAP_HANDLE_WRITE_COMBINE); + NVMAP_HANDLE_WRITE_COMBINE, 0); if (IS_ERR(p->save_buf)) { p->save_buf = NULL; return NULL; diff --git a/drivers/video/tegra/host/nvhost_job.c b/drivers/video/tegra/host/nvhost_job.c index 1f774edde98e..e0baea559b19 100644 --- a/drivers/video/tegra/host/nvhost_job.c +++ b/drivers/video/tegra/host/nvhost_job.c @@ -71,7 +71,7 @@ static int alloc_gathers(struct nvhost_job *job, /* Allocate memory */ job->gather_mem = nvmap_alloc(job->nvmap, gather_size(num_cmdbufs), - 32, NVMAP_HANDLE_CACHEABLE); + 32, NVMAP_HANDLE_CACHEABLE, 0); if (IS_ERR_OR_NULL(job->gather_mem)) { err = PTR_ERR(job->gather_mem); job->gather_mem = NULL; diff --git a/drivers/video/tegra/nvmap/nvmap.c b/drivers/video/tegra/nvmap/nvmap.c index 5fcdee61b71c..b4b6241618db 100644 --- a/drivers/video/tegra/nvmap/nvmap.c +++ b/drivers/video/tegra/nvmap/nvmap.c @@ -740,19 +740,23 @@ void nvmap_munmap(struct nvmap_handle_ref *ref, void *addr) } struct nvmap_handle_ref *nvmap_alloc(struct nvmap_client *client, size_t size, - size_t align, unsigned int flags) + size_t align, unsigned int flags, + unsigned int heap_mask) { const unsigned int default_heap = (NVMAP_HEAP_SYSMEM | NVMAP_HEAP_CARVEOUT_GENERIC); struct nvmap_handle_ref *r = NULL; int err; + if (heap_mask == 0) + heap_mask = default_heap; + r = nvmap_create_handle(client, size); if (IS_ERR(r)) return r; err = nvmap_alloc_handle_id(client, nvmap_ref_to_id(r), - default_heap, align, flags); + heap_mask, align, flags); if (err) { nvmap_free_handle_id(client, nvmap_ref_to_id(r)); |