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/linux/nvhost.h | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) (limited to 'include/linux') diff --git a/include/linux/nvhost.h b/include/linux/nvhost.h index 78c95e5fc..2c01ffdcc 100644 --- a/include/linux/nvhost.h +++ b/include/linux/nvhost.h @@ -3,7 +3,7 @@ * * Tegra graphics host driver * - * Copyright (c) 2009-2018, NVIDIA Corporation. All rights reserved. + * Copyright (c) 2009-2019, NVIDIA Corporation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -49,6 +49,7 @@ struct nvhost_as_moduleops; struct nvhost_ctrl_sync_fence_info; struct nvhost_sync_timeline; struct nvhost_sync_pt; +enum nvdev_fence_kind; struct nvdev_fence; struct sync_pt; @@ -654,10 +655,14 @@ static inline void nvhost_eventlib_log_submit(struct platform_device *pdev, u64 timestamp) { } -static inline void nvhost_eventlib_log_fence(struct platform_device *pdev, - u32 kind, - struct nvdev_fence *fence, - u64 timestamp) + +static inline void nvhost_eventlib_log_fences(struct platform_device *pdev, + u32 task_syncpt_id, + u32 task_syncpt_thresh, + struct nvdev_fence *fences, + u8 num_fences, + enum nvdev_fence_kind kind, + u64 timestamp) { } #else @@ -772,10 +777,13 @@ void nvhost_eventlib_log_submit(struct platform_device *pdev, u32 syncpt_thresh, u64 timestamp); -void nvhost_eventlib_log_fence(struct platform_device *pdev, - u32 kind, - struct nvdev_fence *fence, - u64 timestamp); +void nvhost_eventlib_log_fences(struct platform_device *pdev, + u32 task_syncpt_id, + u32 task_syncpt_thresh, + struct nvdev_fence *fences, + u8 num_fences, + enum nvdev_fence_kind kind, + u64 timestamp); /* public host1x interrupt management APIs */ int nvhost_intr_register_notifier(struct platform_device *pdev, -- cgit v1.2.2