diff options
author | Terje Bergstrom <tbergstrom@nvidia.com> | 2011-09-06 13:06:40 +0300 |
---|---|---|
committer | Dan Willemsen <dwillemsen@nvidia.com> | 2011-11-30 21:49:33 -0800 |
commit | b04d67acb91dc0f388675f85a28bfa955c25d978 (patch) | |
tree | 61c61fd1686a7b50f06960d91d68f348851a0c4c /drivers/video/tegra/host/nvhost_channel.c | |
parent | b77c1336fc29ac5a7066de146100551258a01746 (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/nvhost_channel.c')
-rw-r--r-- | drivers/video/tegra/host/nvhost_channel.c | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/drivers/video/tegra/host/nvhost_channel.c b/drivers/video/tegra/host/nvhost_channel.c index e17aa4c72472..c8f529223745 100644 --- a/drivers/video/tegra/host/nvhost_channel.c +++ b/drivers/video/tegra/host/nvhost_channel.c @@ -24,9 +24,46 @@ #include "dev.h" #include "nvhost_hwctx.h" #include <trace/events/nvhost.h> +#include <linux/nvhost_ioctl.h> #include <linux/platform_device.h> +int nvhost_channel_submit( + struct nvhost_channel *channel, + struct nvhost_hwctx *hwctx, + struct nvmap_client *user_nvmap, + u32 *gather, + u32 *gather_end, + struct nvhost_waitchk *waitchk, + struct nvhost_waitchk *waitchk_end, + u32 waitchk_mask, + struct nvmap_handle **unpins, + int nr_unpins, + u32 syncpt_id, + u32 syncpt_incrs, + struct nvhost_userctx_timeout *timeout_ctx, + u32 priority, + u32 *syncpt_value, + bool null_kickoff) +{ + BUG_ON(!channel_op(channel).submit); + + /* Low priority submits wait until sync queue is empty */ + if (priority < NVHOST_PRIORITY_MEDIUM) + nvhost_cdma_wait(&channel->cdma, CDMA_EVENT_SYNC_QUEUE_EMPTY); + + return channel_op(channel).submit(channel, + hwctx, + user_nvmap, + gather, gather_end, + waitchk, waitchk_end, waitchk_mask, + unpins, nr_unpins, + syncpt_id, syncpt_incrs, + timeout_ctx, + syncpt_value, + null_kickoff); +} + struct nvhost_channel *nvhost_getchannel(struct nvhost_channel *ch) { int err = 0; |