summaryrefslogtreecommitdiff
path: root/drivers/media/platform/tegra/nvavp/nvavp_dev.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/platform/tegra/nvavp/nvavp_dev.c')
-rw-r--r--drivers/media/platform/tegra/nvavp/nvavp_dev.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/media/platform/tegra/nvavp/nvavp_dev.c b/drivers/media/platform/tegra/nvavp/nvavp_dev.c
index 843ea338c949..05c5f997e12f 100644
--- a/drivers/media/platform/tegra/nvavp/nvavp_dev.c
+++ b/drivers/media/platform/tegra/nvavp/nvavp_dev.c
@@ -871,6 +871,7 @@ static int nvavp_pushbuffer_update(struct nvavp_info *nvavp, u32 phys_addr,
u32 wordcount = 0;
u32 index, value = -1;
int ret = 0;
+ u32 max_index = 0;
mutex_lock(&nvavp->open_lock);
nvavp_runtime_get(nvavp);
@@ -885,7 +886,9 @@ static int nvavp_pushbuffer_update(struct nvavp_info *nvavp, u32 phys_addr,
mutex_lock(&channel_info->pushbuffer_lock);
/* check for pushbuffer wrapping */
- if (channel_info->pushbuf_index >= channel_info->pushbuf_fence)
+ max_index = channel_info->pushbuf_fence;
+ max_index = ext_ucode_flag ? max_index : max_index - (sizeof(u32) * 4);
+ if (channel_info->pushbuf_index >= max_index)
channel_info->pushbuf_index = 0;
if (!ext_ucode_flag) {