diff options
author | Terje Bergstrom <tbergstrom@nvidia.com> | 2012-06-27 09:37:05 +0300 |
---|---|---|
committer | Simone Willett <swillett@nvidia.com> | 2012-07-01 08:59:42 -0700 |
commit | 8484091b29b9f4a7f0e305fa4e1085a66753393e (patch) | |
tree | 21927a91944afbd211b9ce2f2a006047b28fb254 | |
parent | 74d5c98c9ad0cf5c474e8a71310778a97913b2fd (diff) |
video: tegra: host: Serialize 2D jobs
Force serialization of 2D jobs by inserting a host wait for previous
maximum at the beginning of the job.
Bug 1002293
Change-Id: I667ad4565cc32186ea7ccf16845c68d1b1bbdf78
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/111475
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Donghan Ryu <dryu@nvidia.com>
Reviewed-by: Arto Merilainen <amerilainen@nvidia.com>
Reviewed-by: Daniel Parker <dparker@nvidia.com>
Reviewed-by: Mayuresh Kulkarni <mkulkarni@nvidia.com>
Reviewed-by: Juha Tukkinen <jtukkinen@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Francis Hart <fhart@nvidia.com>
-rw-r--r-- | drivers/video/tegra/host/host1x/host1x_channel.c | 12 | ||||
-rw-r--r-- | drivers/video/tegra/host/t20/t20.c | 1 | ||||
-rw-r--r-- | drivers/video/tegra/host/t30/t30.c | 1 | ||||
-rw-r--r-- | include/linux/nvhost.h | 1 |
4 files changed, 15 insertions, 0 deletions
diff --git a/drivers/video/tegra/host/host1x/host1x_channel.c b/drivers/video/tegra/host/host1x/host1x_channel.c index 98af5758df56..9e9fc25dc966 100644 --- a/drivers/video/tegra/host/host1x/host1x_channel.c +++ b/drivers/video/tegra/host/host1x/host1x_channel.c @@ -251,6 +251,18 @@ static int host1x_channel_submit(struct nvhost_job *job) goto error; } + if (ch->dev->serialize) { + /* Force serialization by inserting a host wait for the + * previous job to finish before this one can commence. */ + nvhost_cdma_push(&ch->cdma, + nvhost_opcode_setclass(NV_HOST1X_CLASS_ID, + host1x_uclass_wait_syncpt_r(), + 1), + nvhost_class_host_wait_syncpt(job->syncpt_id, + nvhost_syncpt_read_max(sp, + job->syncpt_id))); + } + submit_ctxsave(job, ctxsave_waiter, ch->cur_ctx); submit_ctxrestore(job); ch->cur_ctx = job->hwctx; diff --git a/drivers/video/tegra/host/t20/t20.c b/drivers/video/tegra/host/t20/t20.c index 00c1e2825920..71ed7334e714 100644 --- a/drivers/video/tegra/host/t20/t20.c +++ b/drivers/video/tegra/host/t20/t20.c @@ -140,6 +140,7 @@ static struct nvhost_device tegra_gr2d01_device = { NVHOST_MODULE_NO_POWERGATE_IDS, .clockgate_delay = 0, .moduleid = NVHOST_MODULE_NONE, + .serialize = true, }; static struct resource isp_resources_t20[] = { diff --git a/drivers/video/tegra/host/t30/t30.c b/drivers/video/tegra/host/t30/t30.c index 88a489244b48..4d042a985fe1 100644 --- a/drivers/video/tegra/host/t30/t30.c +++ b/drivers/video/tegra/host/t30/t30.c @@ -148,6 +148,7 @@ static struct nvhost_device tegra_gr2d02_device = { NVHOST_MODULE_NO_POWERGATE_IDS, .clockgate_delay = 0, .moduleid = NVHOST_MODULE_NONE, + .serialize = true, }; static struct resource isp_resources_t20[] = { diff --git a/include/linux/nvhost.h b/include/linux/nvhost.h index f84749a75df9..cde63fa6abb7 100644 --- a/include/linux/nvhost.h +++ b/include/linux/nvhost.h @@ -100,6 +100,7 @@ struct nvhost_device { bool keepalive; /* Do not power gate when opened */ bool waitbasesync; /* Force sync of wait bases */ bool powerup_reset; /* Do a reset after power un-gating */ + bool serialize; /* Serialize submits in the channel */ int powergate_ids[NVHOST_MODULE_MAX_POWERGATE_IDS]; bool can_powergate; /* True if module can be power gated */ |