コード例 #1
0
ファイル: user_hwctx.c プロジェクト: Lloir/nvidia-linux-3.10
static void user_hwctx_restore_push(struct nvhost_hwctx *nctx,
                                    struct nvhost_cdma *cdma)
{
    struct user_hwctx *ctx = to_user_hwctx(nctx);
    nvhost_cdma_push_gather(cdma,
                            nctx->memmgr,
                            ctx->restore,
                            ctx->restore_offset,
                            nvhost_opcode_gather(ctx->restore_size),
                            nvhost_memmgr_dma_addr(ctx->restore_sgt));
}
コード例 #2
0
static void user_hwctx_save_push(struct nvhost_hwctx *nctx,
		struct nvhost_cdma *cdma)
{
	struct user_hwctx *ctx = to_user_hwctx(nctx);
	nvhost_cdma_push_gather(cdma,
			nctx->memmgr,
			ctx->save_buf,
			ctx->save_offset,
			nvhost_opcode_gather(ctx->save_size),
			sg_dma_address(ctx->save_sgt->sgl));
}
コード例 #3
0
ファイル: user_hwctx.c プロジェクト: Lloir/nvidia-linux-3.10
static void user_hwctx_free(struct kref *ref)
{
    struct nvhost_hwctx *hwctx =
        container_of(ref, struct nvhost_hwctx, ref);
    struct user_hwctx *uhwctx = to_user_hwctx(hwctx);

    user_ctxhandler_free(hwctx->h);

    if (uhwctx->save_sgt)
        nvhost_memmgr_unpin(hwctx->memmgr, uhwctx->save_buf,
                            &hwctx->channel->dev->dev, uhwctx->save_sgt);
    if (uhwctx->restore_sgt)
        nvhost_memmgr_unpin(hwctx->memmgr, uhwctx->restore,
                            &hwctx->channel->dev->dev, uhwctx->restore_sgt);

    if (uhwctx->save_buf)
        nvhost_memmgr_put(hwctx->memmgr, uhwctx->save_buf);

    if (uhwctx->restore)
        nvhost_memmgr_put(hwctx->memmgr, uhwctx->restore);

    nvhost_memmgr_put_mgr(hwctx->memmgr);
    kfree(uhwctx);
}