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 <am@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2548309
Reviewed-by: Amit Sharma (SW-TEGRA) <amisharma@nvidia.com>
Reviewed-by: Anup Mahindre <amahindre@nvidia.com>
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
This commit is contained in:
Arvind M
2021-06-22 17:19:44 +05:30
committed by Laxman Dewangan
parent 9bf2e99b45
commit c7692f6826
2 changed files with 15 additions and 7 deletions

View File

@@ -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;

View File

@@ -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,