From c7692f68261200f65857d0ddb702f327fcfc6c7e Mon Sep 17 00:00:00 2001 From: Arvind M Date: Tue, 22 Jun 2021 17:19:44 +0530 Subject: [PATCH] nvdla: kmd: add support for stride signal action NVDEV_FENCE_SIGNAL_STRIDE fence action translates to ACTION_INCREMENT_SEM firmware action. Jira DLA-4445 Change-Id: Idb537ea784614d031f66c570359dbc7dd74374af Signed-off-by: Arvind M Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2548309 Reviewed-by: Amit Sharma (SW-TEGRA) Reviewed-by: Anup Mahindre Reviewed-by: svc_kernel_abi Reviewed-by: Bharat Nihalani Reviewed-by: mobile promotions Tested-by: mobile promotions GVS: Gerrit_Virtual_Submit --- drivers/video/tegra/host/nvdla/dla_os_interface.h | 7 ++++--- drivers/video/tegra/host/nvdla/nvdla_queue.c | 15 +++++++++++---- 2 files changed, 15 insertions(+), 7 deletions(-) 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,