summaryrefslogtreecommitdiff
path: root/drivers/video/tegra/host/mpe/mpe.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/video/tegra/host/mpe/mpe.c')
-rw-r--r--drivers/video/tegra/host/mpe/mpe.c39
1 files changed, 20 insertions, 19 deletions
diff --git a/drivers/video/tegra/host/mpe/mpe.c b/drivers/video/tegra/host/mpe/mpe.c
index 3fe2fcd8bb50..7468d4b9d753 100644
--- a/drivers/video/tegra/host/mpe/mpe.c
+++ b/drivers/video/tegra/host/mpe/mpe.c
@@ -26,6 +26,8 @@
#include "host1x/host1x_syncpt.h"
#include "host1x/host1x_hwctx.h"
#include "t20/t20.h"
+#include "chip_support.h"
+#include "nvhost_memmgr.h"
#include <linux/slab.h>
#include <linux/resource.h>
@@ -434,23 +436,23 @@ static u32 *save_ram(u32 *ptr, unsigned int *pending,
static struct nvhost_hwctx *ctxmpe_alloc(struct nvhost_hwctx_handler *h,
struct nvhost_channel *ch)
{
- struct nvmap_client *nvmap = nvhost_get_host(ch->dev)->nvmap;
+ struct mem_mgr *memmgr = nvhost_get_host(ch->dev)->memmgr;
struct host1x_hwctx_handler *p = to_host1x_hwctx_handler(h);
struct host1x_hwctx *ctx;
ctx = kzalloc(sizeof(*ctx), GFP_KERNEL);
if (!ctx)
return NULL;
- ctx->restore = nvmap_alloc(nvmap, restore_size * 4, 32,
- NVMAP_HANDLE_WRITE_COMBINE, 0);
+ ctx->restore = mem_op().alloc(memmgr, restore_size * 4, 32,
+ mem_mgr_flag_write_combine);
if (IS_ERR_OR_NULL(ctx->restore)) {
kfree(ctx);
return NULL;
}
- ctx->restore_virt = nvmap_mmap(ctx->restore);
+ ctx->restore_virt = mem_op().mmap(ctx->restore);
if (!ctx->restore_virt) {
- nvmap_free(nvmap, ctx->restore);
+ mem_op().put(memmgr, ctx->restore);
kfree(ctx);
return NULL;
}
@@ -462,7 +464,7 @@ static struct nvhost_hwctx *ctxmpe_alloc(struct nvhost_hwctx_handler *h,
ctx->save_incrs = 3;
ctx->save_thresh = 2;
ctx->save_slots = p->save_slots;
- ctx->restore_phys = nvmap_pin(nvmap, ctx->restore);
+ ctx->restore_phys = mem_op().pin(memmgr, ctx->restore);
ctx->restore_size = restore_size;
ctx->restore_incrs = 1;
@@ -480,13 +482,12 @@ static void ctxmpe_free(struct kref *ref)
{
struct nvhost_hwctx *nctx = container_of(ref, struct nvhost_hwctx, ref);
struct host1x_hwctx *ctx = to_host1x_hwctx(nctx);
- struct nvmap_client *nvmap =
- nvhost_get_host(nctx->channel->dev)->nvmap;
+ struct mem_mgr *memmgr = nvhost_get_host(nctx->channel->dev)->memmgr;
if (ctx->restore_virt)
- nvmap_munmap(ctx->restore, ctx->restore_virt);
- nvmap_unpin(nvmap, ctx->restore);
- nvmap_free(nvmap, ctx->restore);
+ mem_op().munmap(ctx->restore, ctx->restore_virt);
+ mem_op().unpin(memmgr, ctx->restore);
+ mem_op().put(memmgr, ctx->restore);
kfree(ctx);
}
@@ -501,7 +502,7 @@ static void ctxmpe_save_push(struct nvhost_hwctx *nctx,
struct host1x_hwctx *ctx = to_host1x_hwctx(nctx);
struct host1x_hwctx_handler *h = host1x_hwctx_handler(ctx);
nvhost_cdma_push_gather(cdma,
- nvhost_get_host(nctx->channel->dev)->nvmap,
+ nvhost_get_host(nctx->channel->dev)->memmgr,
h->save_buf,
0,
nvhost_opcode_gather(h->save_size),
@@ -537,7 +538,7 @@ static void ctxmpe_save_service(struct nvhost_hwctx *nctx)
struct nvhost_hwctx_handler *nvhost_mpe_ctxhandler_init(u32 syncpt,
u32 waitbase, struct nvhost_channel *ch)
{
- struct nvmap_client *nvmap;
+ struct mem_mgr *memmgr;
u32 *save_ptr;
struct host1x_hwctx_handler *p;
@@ -545,28 +546,28 @@ struct nvhost_hwctx_handler *nvhost_mpe_ctxhandler_init(u32 syncpt,
if (!p)
return NULL;
- nvmap = nvhost_get_host(ch->dev)->nvmap;
+ memmgr = nvhost_get_host(ch->dev)->memmgr;
p->syncpt = syncpt;
p->waitbase = waitbase;
setup_save(p, NULL);
- p->save_buf = nvmap_alloc(nvmap, p->save_size * 4, 32,
- NVMAP_HANDLE_WRITE_COMBINE, 0);
+ p->save_buf = mem_op().alloc(memmgr, p->save_size * 4, 32,
+ mem_mgr_flag_write_combine);
if (IS_ERR(p->save_buf)) {
p->save_buf = NULL;
return NULL;
}
- save_ptr = nvmap_mmap(p->save_buf);
+ save_ptr = mem_op().mmap(p->save_buf);
if (!save_ptr) {
- nvmap_free(nvmap, p->save_buf);
+ mem_op().put(memmgr, p->save_buf);
p->save_buf = NULL;
return NULL;
}
- p->save_phys = nvmap_pin(nvmap, p->save_buf);
+ p->save_phys = mem_op().pin(memmgr, p->save_buf);
p->save_slots = 1;
setup_save(p, save_ptr);