diff options
Diffstat (limited to 'drivers/video/tegra/host/bus_client.c')
-rw-r--r-- | drivers/video/tegra/host/bus_client.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/drivers/video/tegra/host/bus_client.c b/drivers/video/tegra/host/bus_client.c index fd632a6ea9c5..822f8f3a456d 100644 --- a/drivers/video/tegra/host/bus_client.c +++ b/drivers/video/tegra/host/bus_client.c @@ -166,7 +166,7 @@ static int set_submit(struct nvhost_channel_userctx *ctx) return -EFAULT; } - ctx->job = nvhost_job_realloc(ctx->job, + ctx->job = nvhost_job_alloc(ctx->ch, ctx->hwctx, &ctx->hdr, ctx->nvmap, @@ -241,13 +241,17 @@ static ssize_t nvhost_channelwrite(struct file *filp, const char __user *buf, consumed = sizeof(struct nvhost_reloc); if (remaining < consumed) break; - if (copy_from_user(&job->pinarray[job->num_pins], + if (copy_from_user(&job->pinarray[job->num_relocs], buf, consumed)) { err = -EFAULT; break; } - trace_nvhost_channel_write_reloc(chname); - job->num_pins++; + trace_nvhost_channel_write_reloc(chname, + job->pinarray[job->num_relocs].patch_mem, + job->pinarray[job->num_relocs].patch_offset, + job->pinarray[job->num_relocs].pin_mem, + job->pinarray[job->num_relocs].pin_offset); + job->num_relocs++; hdr->num_relocs--; } else if (hdr->num_waitchks) { int numwaitchks = @@ -269,7 +273,7 @@ static ssize_t nvhost_channelwrite(struct file *filp, const char __user *buf, hdr->num_waitchks -= numwaitchks; } else if (priv->num_relocshifts) { int next_shift = - job->num_pins - priv->num_relocshifts; + job->num_relocs - priv->num_relocshifts; consumed = sizeof(struct nvhost_reloc_shift); if (remaining < consumed) break; @@ -337,6 +341,9 @@ static int nvhost_ioctl_channel_flush( if (err) nvhost_job_unpin(ctx->job); + nvhost_job_put(ctx->job); + ctx->job = NULL; + return err; } |