diff options
| author | Joshua Bakita <bakitajoshua@gmail.com> | 2023-06-28 18:24:25 -0400 |
|---|---|---|
| committer | Joshua Bakita <bakitajoshua@gmail.com> | 2023-06-28 18:24:25 -0400 |
| commit | 01e6fac4d61fdd7fff5433942ec93fc2ea1e4df1 (patch) | |
| tree | 4ef34501728a087be24f4ba0af90f91486bf780b /include/os/linux/debug_cde.c | |
| parent | 306a03d18b305e4e573be3b2931978fa10679eb9 (diff) | |
Include nvgpu headers
These are needed to build on NVIDIA's Jetson boards for the time
being. Only a couple structs are required, so it should be fairly
easy to remove this dependency at some point in the future.
Diffstat (limited to 'include/os/linux/debug_cde.c')
| -rw-r--r-- | include/os/linux/debug_cde.c | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/include/os/linux/debug_cde.c b/include/os/linux/debug_cde.c new file mode 100644 index 0000000..f0afa6e --- /dev/null +++ b/include/os/linux/debug_cde.c | |||
| @@ -0,0 +1,53 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) 2017 NVIDIA Corporation. All rights reserved. | ||
| 3 | * | ||
| 4 | * This software is licensed under the terms of the GNU General Public | ||
| 5 | * License version 2, as published by the Free Software Foundation, and | ||
| 6 | * may be copied, distributed, and modified under those terms. | ||
| 7 | * | ||
| 8 | * This program is distributed in the hope that it will be useful, | ||
| 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 11 | * GNU General Public License for more details. | ||
| 12 | * | ||
| 13 | */ | ||
| 14 | |||
| 15 | #include "debug_cde.h" | ||
| 16 | #include "platform_gk20a.h" | ||
| 17 | #include "os_linux.h" | ||
| 18 | |||
| 19 | #include <linux/debugfs.h> | ||
| 20 | |||
| 21 | |||
| 22 | static ssize_t gk20a_cde_reload_write(struct file *file, | ||
| 23 | const char __user *userbuf, size_t count, loff_t *ppos) | ||
| 24 | { | ||
| 25 | struct nvgpu_os_linux *l = file->private_data; | ||
| 26 | gk20a_cde_reload(l); | ||
| 27 | return count; | ||
| 28 | } | ||
| 29 | |||
| 30 | static const struct file_operations gk20a_cde_reload_fops = { | ||
| 31 | .open = simple_open, | ||
| 32 | .write = gk20a_cde_reload_write, | ||
| 33 | }; | ||
| 34 | |||
| 35 | void gk20a_cde_debugfs_init(struct gk20a *g) | ||
| 36 | { | ||
| 37 | struct nvgpu_os_linux *l = nvgpu_os_linux_from_gk20a(g); | ||
| 38 | struct gk20a_platform *platform = dev_get_drvdata(dev_from_gk20a(g)); | ||
| 39 | |||
| 40 | if (!platform->has_cde) | ||
| 41 | return; | ||
| 42 | |||
| 43 | debugfs_create_u32("cde_parameter", S_IWUSR | S_IRUGO, | ||
| 44 | l->debugfs, &l->cde_app.shader_parameter); | ||
| 45 | debugfs_create_u32("cde_ctx_count", S_IWUSR | S_IRUGO, | ||
| 46 | l->debugfs, &l->cde_app.ctx_count); | ||
| 47 | debugfs_create_u32("cde_ctx_usecount", S_IWUSR | S_IRUGO, | ||
| 48 | l->debugfs, &l->cde_app.ctx_usecount); | ||
| 49 | debugfs_create_u32("cde_ctx_count_top", S_IWUSR | S_IRUGO, | ||
| 50 | l->debugfs, &l->cde_app.ctx_count_top); | ||
| 51 | debugfs_create_file("reload_cde_firmware", S_IWUSR, l->debugfs, | ||
| 52 | l, &gk20a_cde_reload_fops); | ||
| 53 | } | ||
