summaryrefslogtreecommitdiff
path: root/drivers/video/tegra/host/dev.c
diff options
context:
space:
mode:
authorTerje Bergstrom <tbergstrom@nvidia.com>2011-09-06 13:06:40 +0300
committerDan Willemsen <dwillemsen@nvidia.com>2011-11-30 21:49:33 -0800
commitb04d67acb91dc0f388675f85a28bfa955c25d978 (patch)
tree61c61fd1686a7b50f06960d91d68f348851a0c4c /drivers/video/tegra/host/dev.c
parentb77c1336fc29ac5a7066de146100551258a01746 (diff)
nvhost: Throttle low-priority tasks
Add interface for setting priority of a channel. When the priority is low, wait for channel to become empty before submitting it. Bug 864407 Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-on: http://git-master/r/57237 (cherry picked from commit 75228616ee2c3073e391c529aecb3f82be3fc5a4) Change-Id: I2f346918ae15427b826a2ec0c28bee6bc72dc859 Reviewed-on: http://git-master/r/59595 Reviewed-by: Varun Colbert <vcolbert@nvidia.com> Tested-by: Varun Colbert <vcolbert@nvidia.com> Rebase-Id: Rfb9ae7e88bec3a0c1e8f51f49f3e6f473d853b21
Diffstat (limited to 'drivers/video/tegra/host/dev.c')
-rw-r--r--drivers/video/tegra/host/dev.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/video/tegra/host/dev.c b/drivers/video/tegra/host/dev.c
index a3659fa296cd..df81566fac38 100644
--- a/drivers/video/tegra/host/dev.c
+++ b/drivers/video/tegra/host/dev.c
@@ -66,6 +66,7 @@ struct nvhost_channel_userctx {
struct nvhost_waitchk waitchks[NVHOST_MAX_WAIT_CHECKS];
struct nvhost_waitchk *cur_waitchk;
struct nvhost_userctx_timeout timeout;
+ u32 priority;
};
struct nvhost_ctrl_userctx {
@@ -130,6 +131,7 @@ static int nvhost_channelopen(struct inode *inode, struct file *filp)
goto fail;
priv->hwctx->timeout = &priv->timeout;
}
+ priv->priority = NVHOST_PRIORITY_MEDIUM;
priv->gathers = nvmap_mmap(priv->gather_mem);
if (!priv->gathers)
@@ -324,14 +326,14 @@ static int nvhost_ioctl_channel_flush(
ctx->timeout.syncpt_id = ctx->hdr.syncpt_id;
/* context switch if needed, and submit user's gathers to the channel */
- BUG_ON(!channel_op(ctx->ch).submit);
- err = channel_op(ctx->ch).submit(ctx->ch, ctx->hwctx, ctx->nvmap,
+ err = nvhost_channel_submit(ctx->ch, ctx->hwctx, ctx->nvmap,
ctx->gathers, ctx->cur_gather,
ctx->waitchks, ctx->cur_waitchk,
ctx->hdr.waitchk_mask,
ctx->unpinarray, num_unpin,
ctx->hdr.syncpt_id, ctx->hdr.syncpt_incrs,
&ctx->timeout,
+ ctx->priority,
&args->value,
null_kickoff);
if (err)
@@ -473,6 +475,10 @@ static long nvhost_channelctl(struct file *filp,
((struct nvhost_get_param_args *)buf)->value =
priv->timeout.has_timedout;
break;
+ case NVHOST_IOCTL_CHANNEL_SET_PRIORITY:
+ priv->timeout.timeout =
+ (u32)((struct nvhost_set_priority_args *)buf)->priority;
+ break;
default:
err = -ENOTTY;
break;