summaryrefslogtreecommitdiff
path: root/drivers/video/tegra/host/t20/3dctx_t20.c
diff options
context:
space:
mode:
authorChris Johnson <cwj@nvidia.com>2011-08-12 09:04:09 +0300
committerDan Willemsen <dwillemsen@nvidia.com>2011-11-30 21:48:21 -0800
commitb33dead2cc3e262000ba1915b19c27b6b0b87f41 (patch)
tree587b2f7261c8f1401e1aaa737d3f901eb8d3b49b /drivers/video/tegra/host/t20/3dctx_t20.c
parent14dcbce77792e27a94adb242650c50809435af30 (diff)
video: tegra: nvhost: add submit timeout support
In this change, nvhost_cdma starts a timer (if a timeout is specified in the userctx), for the buffer at the head of the sync_queue that has not reached its syncpt threshold. If the timeout fires, nvhost_cdma initiates a channel / module reset. It then detects up to where in the sync_queue it stopped execution (based on the current HW syncpt value). For any remaining uncompleted buffers in the context, nvhost_cdma NOPs the entry and CPU incrs the syncpt to where it should be had it completed. If one of the sync_queue entries belongs to another context, it still does the syncpt incrs for this context, but via the PB as a GATHER opcode, At the end, CDMA is restarted, so buffers are refetched (either with NOP slots, or GATHERs to incr syncpts). This appears as though the buffer has completed (and the associated resources released). For testing, debugfs entries have been added under /d/tegra_nvhost force_timeout_val - set the timeout value, in ms force_timeout_channel - channel ID, were timeouts checks occur force_timeout_pid - process ID to set the userctx The idea is to set the timeout_val, then the timeout_channel (e.g. for 3D, the channel ID is 1) and then the process ID, gotten from running adb shell ps. Bug 625545 Original-Change-Id: I659e9255f1105f3439ce23e9169a19739b83ea52 Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-on: http://git-master/r/42655 Reviewed-by: Scott Williams <scwilliams@nvidia.com> Reviewed-by: Varun Colbert <vcolbert@nvidia.com> Tested-by: Varun Colbert <vcolbert@nvidia.com> Rebase-Id: R89759c129e2db8f7dbf83a6066fc29947f95cc27
Diffstat (limited to 'drivers/video/tegra/host/t20/3dctx_t20.c')
-rw-r--r--drivers/video/tegra/host/t20/3dctx_t20.c21
1 files changed, 16 insertions, 5 deletions
diff --git a/drivers/video/tegra/host/t20/3dctx_t20.c b/drivers/video/tegra/host/t20/3dctx_t20.c
index dadfbed3434a..7ad7166b2d3a 100644
--- a/drivers/video/tegra/host/t20/3dctx_t20.c
+++ b/drivers/video/tegra/host/t20/3dctx_t20.c
@@ -216,11 +216,12 @@ static void setup_restore_v0(u32 *ptr)
/*** save ***/
/* the same context save command sequence is used for all contexts. */
-static struct nvmap_handle_ref *save_buf = NULL;
-static phys_addr_t save_phys = 0;
-static unsigned int save_size = 0;
-static unsigned int save_incrs = 0;
-static unsigned int save_thresh = 0;
+static struct nvmap_handle_ref *save_buf;
+static phys_addr_t save_phys;
+static unsigned int save_size;
+static unsigned int save_incrs;
+static unsigned int save_thresh;
+static unsigned int save_slots;
static void __init setup_save_regs(const struct ctx_saver *saver,
struct save_info *info,
@@ -648,6 +649,7 @@ static struct nvhost_hwctx *ctx3d_alloc_common(struct nvhost_channel *ch,
ctx->save = save_buf;
ctx->save_incrs = save_incrs;
ctx->save_thresh = save_thresh;
+ ctx->save_slots = save_slots;
ctx->restore_phys = nvmap_pin(nvmap, ctx->restore);
ctx->restore_size = restore_size;
ctx->restore_incrs = restore_incrs;
@@ -769,6 +771,15 @@ int __init t20_nvhost_3dctx_handler_init(struct nvhost_hwctx_handler *h)
return err;
}
+ save_slots = 1; /* save_push_v0() */
+ if (s_is_v1) {
+ save_slots = 6; /* save_push_v1() */
+ if (register_sets == 2)
+ save_slots += 2;
+ if (s_war_insert_syncpoints)
+ save_slots += 1;
+ }
+
save_ptr = nvmap_mmap(save_buf);
if (!save_ptr) {
nvmap_free(nvmap, save_buf);