summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/include
diff options
context:
space:
mode:
authorDeepak Nibade <dnibade@nvidia.com>2017-05-24 12:06:53 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2017-06-08 09:37:15 -0400
commit2c9713e21c9ab93e7af45a4b9e76c1f378aab024 (patch)
tree198568ee0c55471db27b369819c1e8c906c2a6be /drivers/gpu/nvgpu/include
parent942029a433390f3385ed9d6fc35476bbf9eafd98 (diff)
gpu: nvgpu: add nvhost abstraction files
Add new abstraction file common/linux/nvhost.c for all nvhost APIs and operations and export them from header <nvgpu/nvhost.h> This file will be compiled only if config CONFIG_TEGRA_GK20A_NVHOST is set Define struct nvgpu_nvhost_dev in a separate private header nvhost_priv.h Jira NVGPU-29 Change-Id: I17e1f7836d4854feadff0c339bc093e78ba7f3eb Signed-off-by: Deepak Nibade <dnibade@nvidia.com> Reviewed-on: http://git-master/r/1489725 Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/include')
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/nvhost.h75
1 files changed, 75 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/include/nvgpu/nvhost.h b/drivers/gpu/nvgpu/include/nvgpu/nvhost.h
new file mode 100644
index 00000000..025061dc
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/nvhost.h
@@ -0,0 +1,75 @@
1/*
2 * Copyright (c) 2017, NVIDIA CORPORATION. All rights reserved.
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms and conditions of the GNU General Public License,
6 * version 2, as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope it will be useful, but WITHOUT
9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11 * more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17#ifndef __NVGPU_NVHOST_H__
18#define __NVGPU_NVHOST_H__
19
20#ifdef CONFIG_TEGRA_GK20A_NVHOST
21
22struct nvgpu_nvhost_dev;
23struct gk20a;
24struct sync_pt;
25struct sync_fence;
26struct timespec;
27
28int nvgpu_get_nvhost_dev(struct gk20a *g);
29void nvgpu_free_nvhost_dev(struct gk20a *g);
30
31int nvgpu_nvhost_module_busy_ext(struct nvgpu_nvhost_dev *nvhost_dev);
32void nvgpu_nvhost_module_idle_ext(struct nvgpu_nvhost_dev *nvhost_dev);
33
34void nvgpu_nvhost_debug_dump_device(struct nvgpu_nvhost_dev *nvhost_dev);
35
36int nvgpu_nvhost_syncpt_is_expired_ext(struct nvgpu_nvhost_dev *nvhost_dev,
37 u32 id, u32 thresh);
38int nvgpu_nvhost_syncpt_wait_timeout_ext(struct nvgpu_nvhost_dev *nvhost_dev,
39 u32 id, u32 thresh, u32 timeout, u32 *value, struct timespec *ts);
40
41u32 nvgpu_nvhost_syncpt_incr_max_ext(struct nvgpu_nvhost_dev *nvhost_dev,
42 u32 id, u32 incrs);
43void nvgpu_nvhost_syncpt_set_min_eq_max_ext(struct nvgpu_nvhost_dev *nvhost_dev,
44 u32 id);
45int nvgpu_nvhost_syncpt_read_ext_check(struct nvgpu_nvhost_dev *nvhost_dev,
46 u32 id, u32 *val);
47
48int nvgpu_nvhost_intr_register_notifier(struct nvgpu_nvhost_dev *nvhost_dev,
49 u32 id, u32 thresh, void (*callback)(void *, int), void *private_data);
50
51const char *nvgpu_nvhost_syncpt_get_name(struct nvgpu_nvhost_dev *nvhost_dev,
52 int id);
53bool nvgpu_nvhost_syncpt_is_valid_pt_ext(struct nvgpu_nvhost_dev *nvhost_dev,
54 u32 id);
55void nvgpu_nvhost_syncpt_put_ref_ext(struct nvgpu_nvhost_dev *nvhost_dev,
56 u32 id);
57u32 nvgpu_nvhost_get_syncpt_host_managed(struct nvgpu_nvhost_dev *nvhost_dev,
58 u32 param,
59 const char *syncpt_name);
60
61int nvgpu_nvhost_create_symlink(struct gk20a *g);
62void nvgpu_nvhost_remove_symlink(struct gk20a *g);
63
64#ifdef CONFIG_SYNC
65u32 nvgpu_nvhost_sync_pt_id(struct sync_pt *pt);
66u32 nvgpu_nvhost_sync_pt_thresh(struct sync_pt *pt);
67int nvgpu_nvhost_sync_num_pts(struct sync_fence *fence);
68
69struct sync_fence *nvgpu_nvhost_sync_fdget(int fd);
70struct sync_fence *nvgpu_nvhost_sync_create_fence(
71 struct nvgpu_nvhost_dev *nvhost_dev,
72 u32 id, u32 thresh, u32 num_pts, const char *name);
73#endif /* CONFIG_SYNC */
74#endif /* CONFIG_TEGRA_GK20A_NVHOST */
75#endif /* __NVGPU_NVHOST_H__ */