From db5d314a034ae81c499e76834a72a8f8a2e37c8b Mon Sep 17 00:00:00 2001 From: Dmitry Antipov Date: Fri, 28 Dec 2018 15:56:36 +0300 Subject: video: tegra: host: nvdla, pva: add task information to fences For NSys, we're interested in having detailed information on what task waits on a particular prefence or requests a particular postfence. This is implemented by adding two extra fields, 'task_syncpt_id' and 'task_syncpt_thresh' to 'struct nvhost_task_fence', to record the task this particular fence is associated with. To avoid race conditon in pva_submit (similar to what was fixed in 0c2065fd669926536f79fd9e8ec33f33cbdcae2e), PVA task memory management is changed to use simple kref-based scheme, much like it's done in DLA. Finally, this patch renames syncpoint fields of 'task_fence' to 'syncpt_id' and 'syncpt_thresh' to match the same field names in other events, which is intended to simplify Python scripting. JIRA DTSP-1662 JIRA DTSP-682 Bug 2568514 Signed-off-by: Dmitry Antipov Change-Id: I4c55efcae15eb80a0d950882d6ff6e5ac706ab20 Reviewed-on: https://git-master.nvidia.com/r/1978175 Reviewed-by: svc-mobile-coverity Reviewed-by: svc-mobile-misra Reviewed-by: Shridhar Rasal GVS: Gerrit_Virtual_Submit Reviewed-by: Prashant Gaikwad Reviewed-by: mobile promotions Tested-by: mobile promotions Reviewed-on: https://git-master.nvidia.com/r/2099982 Reviewed-by: Mitch Harwell Tested-by: Mitch Harwell --- include/uapi/linux/nvhost_events.h | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'include/uapi/linux') diff --git a/include/uapi/linux/nvhost_events.h b/include/uapi/linux/nvhost_events.h index 7399906eb..1c1fd7229 100644 --- a/include/uapi/linux/nvhost_events.h +++ b/include/uapi/linux/nvhost_events.h @@ -1,7 +1,7 @@ /* * Eventlib interface for PVA * - * Copyright (c) 2016-2018, NVIDIA Corporation. All rights reserved. + * Copyright (c) 2016-2019, NVIDIA Corporation. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License, @@ -98,12 +98,16 @@ struct nvhost_task_fence { /* Kind (prefence or postfence) */ u32 kind; - /* Type (see nvdev_fence.h) */ - u32 type; + /* Fence-specific type (see nvdev_fence.h) */ + u32 fence_type; /* Valid for NVDEV_FENCE_TYPE_SYNCPT only */ - u32 syncpoint_index; - u32 syncpoint_value; + u32 syncpt_id; + u32 syncpt_thresh; + + /* The task this fence is associated with */ + u32 task_syncpt_id; + u32 task_syncpt_thresh; /* Valid for NVDEV_FENCE_TYPE_SYNC_FD only */ u32 sync_fd; -- cgit v1.2.2