diff options
author | Terje Bergstrom <tbergstrom@nvidia.com> | 2011-12-19 15:12:06 +0200 |
---|---|---|
committer | Varun Wadekar <vwadekar@nvidia.com> | 2011-12-22 11:32:23 +0530 |
commit | d993b01464a87a76d0b859e570cb78caaf1996f9 (patch) | |
tree | 92b3af033ec92c282f196848d745ec34a9e23d4f /drivers/video/tegra/host/dev.c | |
parent | 204b15d959afb9d3d675c949262ce545c17e7c69 (diff) |
video: tegra: host: Move timeout to hwctx & job structs
Timeout struct contains fields which are accessed even after client has
quit. Move the fields to hwctx and nvhost_job so that they can be
accessed when submits complete.
Bug 917340
Change-Id: I322c38d32bc801aa9b061355a17be7f605692e18
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/71004
Reviewed-by: Automatic_Commit_Validation_User
Tested-by: Varun Wadekar <vwadekar@nvidia.com>
Reviewed-by: Yu-Huan Hsu <yhsu@nvidia.com>
Diffstat (limited to 'drivers/video/tegra/host/dev.c')
-rw-r--r-- | drivers/video/tegra/host/dev.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/drivers/video/tegra/host/dev.c b/drivers/video/tegra/host/dev.c index 47d6daa4a482..fe5fb22add92 100644 --- a/drivers/video/tegra/host/dev.c +++ b/drivers/video/tegra/host/dev.c @@ -61,8 +61,9 @@ struct nvhost_channel_userctx { int num_relocshifts; struct nvhost_job *job; struct nvmap_client *nvmap; - struct nvhost_userctx_timeout timeout; + u32 timeout; u32 priority; + int clientid; }; struct nvhost_ctrl_userctx { @@ -155,13 +156,12 @@ static int nvhost_channelopen(struct inode *inode, struct file *filp) priv->hwctx = ch->ctxhandler.alloc(ch); if (!priv->hwctx) goto fail; - priv->hwctx->timeout = &priv->timeout; - priv->timeout.hwctx = priv->hwctx; } priv->priority = NVHOST_PRIORITY_MEDIUM; + priv->clientid = atomic_add_return(1, &ch->dev->clientid); priv->job = nvhost_job_alloc(ch, priv->hwctx, &priv->hdr, - NULL, priv->priority, &priv->timeout); + NULL, priv->priority, priv->clientid); if (!priv->job) goto fail; @@ -187,9 +187,11 @@ static int set_submit(struct nvhost_channel_userctx *ctx) ctx->job = nvhost_job_realloc(ctx->job, &ctx->hdr, ctx->nvmap, - ctx->priority); + ctx->priority, + ctx->clientid); if (!ctx->job) return -ENOMEM; + ctx->job->timeout = ctx->timeout; if (ctx->hdr.submit_version >= NVHOST_SUBMIT_VERSION_V2) ctx->num_relocshifts = ctx->hdr.num_relocs; @@ -340,9 +342,8 @@ static int nvhost_ioctl_channel_flush( if ((nvhost_debug_force_timeout_pid == current->tgid) && (nvhost_debug_force_timeout_channel == ctx->ch->chid)) { - ctx->timeout.timeout = nvhost_debug_force_timeout_val; + ctx->timeout = nvhost_debug_force_timeout_val; } - ctx->timeout.syncpt_id = ctx->hdr.syncpt_id; trace_write_cmdbufs(ctx->job); @@ -361,7 +362,6 @@ static int nvhost_ioctl_channel_read_3d_reg( { BUG_ON(!channel_op(ctx->ch).read3dreg); return channel_op(ctx->ch).read3dreg(ctx->ch, ctx->hwctx, - &ctx->timeout, args->offset, &args->value); } @@ -480,15 +480,15 @@ static long nvhost_channelctl(struct file *filp, break; } case NVHOST_IOCTL_CHANNEL_SET_TIMEOUT: - priv->timeout.timeout = + priv->timeout = (u32)((struct nvhost_set_timeout_args *)buf)->timeout; dev_dbg(&priv->ch->dev->pdev->dev, "%s: setting buffer timeout (%d ms) for userctx 0x%p\n", - __func__, priv->timeout.timeout, priv); + __func__, priv->timeout, priv); break; case NVHOST_IOCTL_CHANNEL_GET_TIMEDOUT: ((struct nvhost_get_param_args *)buf)->value = - priv->timeout.has_timedout; + priv->hwctx->has_timedout; break; case NVHOST_IOCTL_CHANNEL_SET_PRIORITY: priv->priority = |