mirror of
git://nv-tegra.nvidia.com/linux-nv-oot.git
synced 2025-12-24 02:01:36 +03:00
video: tegra: host: dla: add semaphore support for prefences
- this adds semaphore/memsignal support in prefences - while updating task descriptor, does pinning of UMD semaphore handle and received dma_addr added as preaction Jira DLA-161 Change-Id: If3695b0cca29d485c04b93a83848d50ad81dd9fd Signed-off-by: Shridhar Rasal <srasal@nvidia.com> Reviewed-on: http://git-master/r/1274302 Reviewed-by: Prashant Gaikwad <pgaikwad@nvidia.com> GVS: Gerrit_Virtual_Submit
This commit is contained in:
committed by
Laxman Dewangan
parent
8e43147075
commit
0f0aa8f942
@@ -119,6 +119,7 @@ void nvdla_task_get(struct nvdla_task *task)
|
||||
|
||||
static void nvdla_task_free_locked(struct nvdla_task *task)
|
||||
{
|
||||
int i;
|
||||
struct nvhost_queue *queue = task->queue;
|
||||
struct platform_device *pdev = queue->pool->pdev;
|
||||
|
||||
@@ -134,6 +135,14 @@ static void nvdla_task_free_locked(struct nvdla_task *task)
|
||||
nvhost_buffer_submit_unpin(task->buffers,
|
||||
task->memory_handles, task->num_handles);
|
||||
|
||||
for (i = 0; i < task->num_prefences; i++) {
|
||||
if (task->prefences[i].type == NVDLA_FENCE_TYPE_SEMAPHORE &&
|
||||
task->prefences[i].sem_handle) {
|
||||
nvhost_buffer_submit_unpin(task->buffers,
|
||||
&task->prefences[i].sem_handle, 1);
|
||||
}
|
||||
}
|
||||
|
||||
/* update takslist */
|
||||
list_del(&task->list);
|
||||
|
||||
@@ -393,6 +402,7 @@ static int nvdla_fill_postactions(struct nvdla_task *task)
|
||||
static int nvdla_fill_preactions(struct nvdla_task *task)
|
||||
{
|
||||
struct dla_task_descriptor *task_desc = task->task_desc;
|
||||
struct nvhost_buffers *buffers = task->buffers;
|
||||
struct nvhost_queue *queue = task->queue;
|
||||
struct platform_device *pdev = queue->pool->pdev;
|
||||
struct nvhost_master *host = nvhost_get_host(pdev);
|
||||
@@ -489,6 +499,26 @@ static int nvdla_fill_preactions(struct nvdla_task *task)
|
||||
task->prefences[i].syncpoint_value);
|
||||
break;
|
||||
}
|
||||
case NVDLA_FENCE_TYPE_SEMAPHORE: {
|
||||
dma_addr_t dma_addr;
|
||||
size_t dma_size;
|
||||
|
||||
nvdla_dbg_info(pdev, "i[%d] semh[%u] semo[%u] val[%d]",
|
||||
i,
|
||||
task->prefences[i].sem_handle,
|
||||
task->prefences[i].sem_offset,
|
||||
task->prefences[i].sem_val);
|
||||
|
||||
if (nvhost_buffer_submit_pin(buffers,
|
||||
&task->prefences[i].sem_handle,
|
||||
1, &dma_addr, &dma_size))
|
||||
break;
|
||||
|
||||
UPDATE_PREACTION(pre_cnt++, PREACTION_SEM_GE,
|
||||
dma_addr + task->prefences[i].sem_offset,
|
||||
task->prefences[i].sem_val);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
nvdla_dbg_err(pdev, "Invalid sync_type[%d]",
|
||||
task->prefences[i].type);
|
||||
|
||||
Reference in New Issue
Block a user