summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArto Merilainen <amerilainen@nvidia.com>2017-12-01 08:26:57 -0500
committerAdeel Raza <araza@nvidia.com>2017-12-05 12:13:16 -0500
commitbdeb2f1104b1e5ee954530305703ce1c6f63d277 (patch)
tree038b4e2f09bf1b8a7dc1815e76998f5223911bf1
parent90afc4fd287cca5887e800dfbfb437a002828ee9 (diff)
video: tegra: host: Rework eventlib events
This change updates eventlib events to follow the requested format: - An event is generated as part of submission - Rather than using "START" in the event identifier, the code uses "BEGIN" Bug 1996639 Change-Id: I5afc31332b0121a2287eda07f77d86304a0ba6ac Signed-off-by: Arto Merilainen <amerilainen@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1610037 GVS: Gerrit_Virtual_Submit Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
-rw-r--r--drivers/video/tegra/host/bus_client.c41
-rw-r--r--drivers/video/tegra/host/pva/pva_queue.c2
-rw-r--r--include/linux/nvhost.h10
-rw-r--r--include/uapi/linux/nvhost_events.h34
4 files changed, 77 insertions, 10 deletions
diff --git a/drivers/video/tegra/host/bus_client.c b/drivers/video/tegra/host/bus_client.c
index d9f94bde9..1312f63ce 100644
--- a/drivers/video/tegra/host/bus_client.c
+++ b/drivers/video/tegra/host/bus_client.c
@@ -1825,14 +1825,14 @@ void nvhost_eventlib_log_task(struct platform_device *pdev,
1825 /* 1825 /*
1826 * Write task start event 1826 * Write task start event
1827 */ 1827 */
1828 event.task_start.syncpt_id = syncpt_id; 1828 event.task_begin.syncpt_id = syncpt_id;
1829 event.task_start.syncpt_thresh = syncpt_thresh; 1829 event.task_begin.syncpt_thresh = syncpt_thresh;
1830 event.task_start.class_id = pdata->class; 1830 event.task_begin.class_id = pdata->class;
1831 1831
1832 keventlib_write(pdata->eventlib_id, 1832 keventlib_write(pdata->eventlib_id,
1833 &event, 1833 &event,
1834 sizeof(event), 1834 sizeof(event),
1835 NVHOST_TASK_START, 1835 NVHOST_TASK_BEGIN,
1836 timestamp_start); 1836 timestamp_start);
1837 1837
1838 /* 1838 /*
@@ -1848,6 +1848,32 @@ void nvhost_eventlib_log_task(struct platform_device *pdev,
1848 NVHOST_TASK_END, 1848 NVHOST_TASK_END,
1849 timestamp_end); 1849 timestamp_end);
1850} 1850}
1851
1852void nvhost_eventlib_log_submit(struct platform_device *pdev,
1853 u32 syncpt_id,
1854 u32 syncpt_thresh)
1855{
1856 struct nvhost_device_data *pdata = platform_get_drvdata(pdev);
1857 union nvhost_event_union event;
1858
1859 if (!pdata->eventlib_id)
1860 return;
1861
1862 /*
1863 * Write task start event
1864 */
1865 event.task_submit.syncpt_id = syncpt_id;
1866 event.task_submit.syncpt_thresh = syncpt_thresh;
1867 event.task_submit.class_id = pdata->class;
1868 event.task_submit.pid = current->tgid;
1869 event.task_submit.tid = current->pid;
1870
1871 keventlib_write(pdata->eventlib_id,
1872 &event,
1873 sizeof(event),
1874 NVHOST_TASK_SUBMIT,
1875 0);
1876}
1851#else 1877#else
1852void nvhost_eventlib_log_task(struct platform_device *pdev, 1878void nvhost_eventlib_log_task(struct platform_device *pdev,
1853 u32 syncpt_id, 1879 u32 syncpt_id,
@@ -1856,5 +1882,12 @@ void nvhost_eventlib_log_task(struct platform_device *pdev,
1856 u64 timestamp_end) 1882 u64 timestamp_end)
1857{ 1883{
1858} 1884}
1885
1886void nvhost_eventlib_log_submit(struct platform_device *pdev,
1887 u32 syncpt_id,
1888 u32 syncpt_thresh)
1889{
1890}
1859#endif 1891#endif
1892EXPORT_SYMBOL(nvhost_eventlib_log_submit);
1860EXPORT_SYMBOL(nvhost_eventlib_log_task); 1893EXPORT_SYMBOL(nvhost_eventlib_log_task);
diff --git a/drivers/video/tegra/host/pva/pva_queue.c b/drivers/video/tegra/host/pva/pva_queue.c
index 32a57721c..a9b713659 100644
--- a/drivers/video/tegra/host/pva/pva_queue.c
+++ b/drivers/video/tegra/host/pva/pva_queue.c
@@ -1182,6 +1182,8 @@ static int pva_task_submit(struct pva_submit_task *task)
1182 list_add_tail(&task->node, &queue->tasklist); 1182 list_add_tail(&task->node, &queue->tasklist);
1183 mutex_unlock(&queue->list_lock); 1183 mutex_unlock(&queue->list_lock);
1184 1184
1185 nvhost_eventlib_log_submit(task->pva->pdev, queue->syncpt_id, thresh);
1186
1185 nvhost_dbg_info("Postfence id=%u, value=%u", 1187 nvhost_dbg_info("Postfence id=%u, value=%u",
1186 queue->syncpt_id, thresh); 1188 queue->syncpt_id, thresh);
1187 1189
diff --git a/include/linux/nvhost.h b/include/linux/nvhost.h
index 1496aa13a..63bc56fca 100644
--- a/include/linux/nvhost.h
+++ b/include/linux/nvhost.h
@@ -648,6 +648,12 @@ static inline void nvhost_eventlib_log_task(struct platform_device *pdev,
648 u64 timestamp_end) 648 u64 timestamp_end)
649{ 649{
650} 650}
651
652static inline void nvhost_eventlib_log_submit(struct platform_device *pdev,
653 u32 syncpt_id,
654 u32 syncpt_thresh)
655{
656}
651#else 657#else
652 658
653#ifdef CONFIG_DEBUG_FS 659#ifdef CONFIG_DEBUG_FS
@@ -756,6 +762,10 @@ void nvhost_eventlib_log_task(struct platform_device *pdev,
756 u64 timestamp_start, 762 u64 timestamp_start,
757 u64 timestamp_end); 763 u64 timestamp_end);
758 764
765void nvhost_eventlib_log_submit(struct platform_device *pdev,
766 u32 syncpt_id,
767 u32 syncpt_thresh);
768
759/* public host1x interrupt management APIs */ 769/* public host1x interrupt management APIs */
760int nvhost_intr_register_notifier(struct platform_device *pdev, 770int nvhost_intr_register_notifier(struct platform_device *pdev,
761 u32 id, u32 thresh, 771 u32 id, u32 thresh,
diff --git a/include/uapi/linux/nvhost_events.h b/include/uapi/linux/nvhost_events.h
index 1935f6edd..4655537f1 100644
--- a/include/uapi/linux/nvhost_events.h
+++ b/include/uapi/linux/nvhost_events.h
@@ -25,8 +25,26 @@ enum {
25 25
26#define NVHOST_EVENT_PROVIDER_NAME "nvhost" 26#define NVHOST_EVENT_PROVIDER_NAME "nvhost"
27 27
28/* Marks that the task is submitted to hardware */
29struct nvhost_task_submit {
30 /* Engine class ID */
31 u32 class_id;
32
33 /* Syncpoint ID */
34 u32 syncpt_id;
35
36 /* Threshold for task completion */
37 u32 syncpt_thresh;
38
39 /* PID */
40 u32 pid;
41
42 /* TID */
43 u32 tid;
44} __packed;
45
28/* Marks that the task is moving to execution */ 46/* Marks that the task is moving to execution */
29struct nvhost_task_start { 47struct nvhost_task_begin {
30 /* Engine class ID */ 48 /* Engine class ID */
31 u32 class_id; 49 u32 class_id;
32 50
@@ -50,18 +68,22 @@ struct nvhost_task_end {
50} __packed; 68} __packed;
51 69
52enum { 70enum {
53 /* struct nvhost_task_start */ 71 /* struct nvhost_task_submit */
54 NVHOST_TASK_START = 0, 72 NVHOST_TASK_SUBMIT = 0,
73
74 /* struct nvhost_task_begin */
75 NVHOST_TASK_BEGIN = 1,
55 76
56 /* struct nvhost_task_end */ 77 /* struct nvhost_task_end */
57 NVHOST_TASK_END = 1, 78 NVHOST_TASK_END = 2,
58 79
59 NVHOST_NUM_EVENT_TYPES = 2 80 NVHOST_NUM_EVENT_TYPES = 3
60}; 81};
61 82
62union nvhost_event_union { 83union nvhost_event_union {
63 struct nvhost_task_start task_start; 84 struct nvhost_task_begin task_begin;
64 struct nvhost_task_end task_end; 85 struct nvhost_task_end task_end;
86 struct nvhost_task_submit task_submit;
65}; 87};
66 88
67enum { 89enum {