diff --git a/drivers/video/tegra/host/nvdla/dla_os_interface.h b/drivers/video/tegra/host/nvdla/dla_os_interface.h index 817fc7cf..9c0bdb69 100644 --- a/drivers/video/tegra/host/nvdla/dla_os_interface.h +++ b/drivers/video/tegra/host/nvdla/dla_os_interface.h @@ -86,6 +86,7 @@ /* write actions */ #define ACTION_WRITE_SEM 0x80U +#define ACTION_INCREMENT_SEM 0x82U #define ACTION_WRITE_TS_SEM 0x83U #define ACTION_WRITE_TIMESTAMP 0x87U #define ACTION_WRITE_GOS 0xA0U @@ -211,10 +212,10 @@ struct dla_action_opcode { /** * Semaphore action structure * - * OPCODE = 0x90/0x80/0x92/0x83 + * OPCODE = 0x90/0x80/0x92/0x83/0x82 * - * @address: Address to read or write value - * @value: Value to compare + * @address: Address to read/write/increment value + * @value: Value to compare/write/increment */ struct dla_action_semaphore { uint64_t address; diff --git a/drivers/video/tegra/host/nvdla/nvdla_queue.c b/drivers/video/tegra/host/nvdla/nvdla_queue.c index ec40fed1..138b11da 100644 --- a/drivers/video/tegra/host/nvdla/nvdla_queue.c +++ b/drivers/video/tegra/host/nvdla/nvdla_queue.c @@ -857,9 +857,15 @@ static int nvdla_fill_signal_fence_action(struct nvdla_task *task, break; } - next = add_fence_action(next, ACTION_WRITE_SEM, - dma_addr + fence->semaphore_offset, - fence->semaphore_value); + if (fence->action == NVDEV_FENCE_SIGNAL_STRIDE) { + next = add_fence_action(next, ACTION_INCREMENT_SEM, + dma_addr + fence->semaphore_offset, + fence->semaphore_value); + } else { + next = add_fence_action(next, ACTION_WRITE_SEM, + dma_addr + fence->semaphore_offset, + fence->semaphore_value); + } break; } case NVDEV_FENCE_TYPE_SEMAPHORE_TS: { @@ -1194,7 +1200,8 @@ static int nvdla_fill_preactions(struct nvdla_task *task) /* fill all preactions signals */ for (i = 0; i < task->num_prefences; i++) { /* update action */ - if (task->prefences[i].action != NVDEV_FENCE_SIGNAL) + if ((task->prefences[i].action != NVDEV_FENCE_SIGNAL) && + (task->prefences[i].action != NVDEV_FENCE_SIGNAL_STRIDE)) continue; err = nvdla_fill_signal_fence_action(task,