diff options
Diffstat (limited to 'drivers/video/tegra/host/host1x/host1x_channel.c')
-rw-r--r-- | drivers/video/tegra/host/host1x/host1x_channel.c | 46 |
1 files changed, 25 insertions, 21 deletions
diff --git a/drivers/video/tegra/host/host1x/host1x_channel.c b/drivers/video/tegra/host/host1x/host1x_channel.c index 18aa2da5151f..7d34f5da263e 100644 --- a/drivers/video/tegra/host/host1x/host1x_channel.c +++ b/drivers/video/tegra/host/host1x/host1x_channel.c @@ -52,7 +52,7 @@ int host1x_channel_submit(struct nvhost_job *job) { struct nvhost_hwctx *hwctx_to_save = NULL; struct nvhost_channel *channel = job->ch; - struct nvhost_syncpt *sp = &job->ch->dev->host->syncpt; + struct nvhost_syncpt *sp = &nvhost_get_host(job->ch->dev)->syncpt; u32 user_syncpt_incrs = job->syncpt_incrs; bool need_restore = false; u32 syncval; @@ -162,7 +162,7 @@ int host1x_channel_submit(struct nvhost_job *job) /* gather restore buffer */ if (need_restore) { nvhost_cdma_push_gather(&channel->cdma, - channel->dev->host->nvmap, + nvhost_get_host(channel->dev)->nvmap, nvmap_ref_to_handle(channel->cur_ctx->restore), nvhost_opcode_gather(channel->cur_ctx->restore_size), channel->cur_ctx->restore_phys); @@ -222,7 +222,8 @@ int host1x_channel_submit(struct nvhost_job *job) * if necessary, and to release the restore buffer) */ if (hwctx_to_save) { - err = nvhost_intr_add_action(&channel->dev->host->intr, + err = nvhost_intr_add_action( + &nvhost_get_host(channel->dev)->intr, job->syncpt_id, syncval - job->syncpt_incrs + hwctx_to_save->save_thresh, @@ -235,7 +236,8 @@ int host1x_channel_submit(struct nvhost_job *job) if (need_restore) { BUG_ON(!ctxrestore_waiter); - err = nvhost_intr_add_action(&channel->dev->host->intr, + err = nvhost_intr_add_action( + &nvhost_get_host(channel->dev)->intr, job->syncpt_id, syncval - user_syncpt_incrs, NVHOST_INTR_ACTION_CTXRESTORE, channel->cur_ctx, @@ -246,8 +248,8 @@ int host1x_channel_submit(struct nvhost_job *job) } /* schedule a submit complete interrupt */ - err = nvhost_intr_add_action(&channel->dev->host->intr, job->syncpt_id, - syncval, + err = nvhost_intr_add_action(&nvhost_get_host(channel->dev)->intr, + job->syncpt_id, syncval, NVHOST_INTR_ACTION_SUBMIT_COMPLETE, channel, completed_waiter, NULL); @@ -293,7 +295,7 @@ int host1x_channel_read_3d_reg( job = nvhost_job_alloc(channel, hwctx, NULL, - channel->dev->host->nvmap, 0, 0); + nvhost_get_host(channel->dev)->nvmap, 0, 0); if (!job) { err = -ENOMEM; goto done; @@ -324,7 +326,7 @@ int host1x_channel_read_3d_reg( } } - syncval = nvhost_syncpt_incr_max(&channel->dev->host->syncpt, + syncval = nvhost_syncpt_incr_max(&nvhost_get_host(channel->dev)->syncpt, NVSYNCPT_3D, syncpt_incrs); job->syncpt_id = NVSYNCPT_3D; @@ -390,7 +392,8 @@ int host1x_channel_read_3d_reg( * if necessary, and to release the restore buffer) */ if (hwctx_to_save) { - err = nvhost_intr_add_action(&channel->dev->host->intr, + err = nvhost_intr_add_action( + &nvhost_get_host(channel->dev)->intr, NVSYNCPT_3D, syncval - syncpt_incrs + hwctx_to_save->save_incrs - 1, NVHOST_INTR_ACTION_CTXSAVE, hwctx_to_save, @@ -401,27 +404,28 @@ int host1x_channel_read_3d_reg( } /* Wait for FIFO to be ready */ - err = nvhost_intr_add_action(&channel->dev->host->intr, NVSYNCPT_3D, - syncval - 2, + err = nvhost_intr_add_action(&nvhost_get_host(channel->dev)->intr, + NVSYNCPT_3D, syncval - 2, NVHOST_INTR_ACTION_WAKEUP, &wq, read_waiter, &ref); read_waiter = NULL; WARN(err, "Failed to set wakeup interrupt"); wait_event(wq, - nvhost_syncpt_min_cmp(&channel->dev->host->syncpt, + nvhost_syncpt_min_cmp(&nvhost_get_host(channel->dev)->syncpt, NVSYNCPT_3D, syncval - 2)); - nvhost_intr_put_ref(&channel->dev->host->intr, ref); + nvhost_intr_put_ref(&nvhost_get_host(channel->dev)->intr, ref); /* Read the register value from FIFO */ err = host1x_drain_read_fifo(channel->aperture, value, 1, &pending); /* Indicate we've read the value */ - nvhost_syncpt_cpu_incr(&channel->dev->host->syncpt, NVSYNCPT_3D); + nvhost_syncpt_cpu_incr(&nvhost_get_host(channel->dev)->syncpt, + NVSYNCPT_3D); /* Schedule a submit complete interrupt */ - err = nvhost_intr_add_action(&channel->dev->host->intr, + err = nvhost_intr_add_action(&nvhost_get_host(channel->dev)->intr, NVSYNCPT_3D, syncval, NVHOST_INTR_ACTION_SUBMIT_COMPLETE, channel, completed_waiter, NULL); @@ -510,7 +514,7 @@ int host1x_save_context(struct nvhost_device *dev, u32 syncpt_id) job = nvhost_job_alloc(ch, hwctx_to_save, NULL, - ch->dev->host->nvmap, 0, 0); + nvhost_get_host(ch->dev)->nvmap, 0, 0); if (IS_ERR_OR_NULL(job)) { err = PTR_ERR(job); mutex_unlock(&ch->submitlock); @@ -522,7 +526,7 @@ int host1x_save_context(struct nvhost_device *dev, u32 syncpt_id) ch->cur_ctx = NULL; syncpt_incrs = hwctx_to_save->save_incrs; - syncpt_val = nvhost_syncpt_incr_max(&ch->dev->host->syncpt, + syncpt_val = nvhost_syncpt_incr_max(&nvhost_get_host(ch->dev)->syncpt, syncpt_id, syncpt_incrs); job->syncpt_id = syncpt_id; @@ -540,7 +544,7 @@ int host1x_save_context(struct nvhost_device *dev, u32 syncpt_id) nvhost_job_put(job); job = NULL; - err = nvhost_intr_add_action(&ch->dev->host->intr, syncpt_id, + err = nvhost_intr_add_action(&nvhost_get_host(ch->dev)->intr, syncpt_id, syncpt_val - syncpt_incrs + hwctx_to_save->save_thresh, NVHOST_INTR_ACTION_CTXSAVE, hwctx_to_save, ctx_waiter, @@ -548,7 +552,7 @@ int host1x_save_context(struct nvhost_device *dev, u32 syncpt_id) ctx_waiter = NULL; WARN(err, "Failed to set context save interrupt"); - err = nvhost_intr_add_action(&ch->dev->host->intr, + err = nvhost_intr_add_action(&nvhost_get_host(ch->dev)->intr, syncpt_id, syncpt_val, NVHOST_INTR_ACTION_WAKEUP, &wq, wakeup_waiter, @@ -556,10 +560,10 @@ int host1x_save_context(struct nvhost_device *dev, u32 syncpt_id) wakeup_waiter = NULL; WARN(err, "Failed to set wakeup interrupt"); wait_event(wq, - nvhost_syncpt_min_cmp(&ch->dev->host->syncpt, + nvhost_syncpt_min_cmp(&nvhost_get_host(ch->dev)->syncpt, syncpt_id, syncpt_val)); - nvhost_intr_put_ref(&ch->dev->host->intr, ref); + nvhost_intr_put_ref(&nvhost_get_host(ch->dev)->intr, ref); nvhost_cdma_update(&ch->cdma); |