diff options
author | Joshua Bakita <bakitajoshua@gmail.com> | 2024-09-25 15:58:37 -0400 |
---|---|---|
committer | Joshua Bakita <bakitajoshua@gmail.com> | 2024-09-25 15:58:37 -0400 |
commit | 8340d234d78a7d0f46c11a584de538148b78b7cb (patch) | |
tree | 4837d0debd711fbe7a5cd292c2606b8c1e5d50aa /nvdebug_linux.h | |
parent | e2fe4cb56e6252b9cf0b43c6180efbb20a168ce0 (diff) |
Remove dependency on Jetson (nvgpu) driver internals
For integrated (Jetson) GPUs:
- Directly retrieve and map GPU register region 0
- Directly check GPU power-on state before a register read/write
- Resume the GPU as needed for a register read/write
Most nvgpu APIs can now be called on TX2+ integrated GPUs without
first having to start some task on the GPU to make it non-suspended.
Tested on Jetson TX1, TX2, Xavier, and Orin.
Diffstat (limited to 'nvdebug_linux.h')
-rw-r--r-- | nvdebug_linux.h | 12 |
1 files changed, 0 insertions, 12 deletions
diff --git a/nvdebug_linux.h b/nvdebug_linux.h index 022d1cf..2ad4ce1 100644 --- a/nvdebug_linux.h +++ b/nvdebug_linux.h | |||
@@ -35,15 +35,3 @@ static inline int file2parentgpuidx(const struct file *f) { | |||
35 | // module. | 35 | // module. |
36 | return (uintptr_t)pde_data(file_dentry(f)->d_parent->d_inode); | 36 | return (uintptr_t)pde_data(file_dentry(f)->d_parent->d_inode); |
37 | } | 37 | } |
38 | |||
39 | #if LINUX_VERSION_CODE >= KERNEL_VERSION(5,6,0) | ||
40 | // Commit 643eb158a3 in nvgpu moved the mapped registers to the second entry | ||
41 | // of the gk20a struct (after a function pointer). This change was made as L4T | ||
42 | // was upgraded from Linux 4.9 to 5.10 (r32 -> r34+) | ||
43 | // Note that this is wrong if nvgpu was built without CONFIG_NVGPU_NON_FUSA | ||
44 | // i.e. if FUSA was enabled, this is wrong. | ||
45 | #define gk20a_regs(gk20a) (*(void**)((void*)gk20a + sizeof(void(*)(void)))) | ||
46 | #else | ||
47 | #include <os/linux/os_linux.h> // For struct nvgpu_os_linux, which holds regs | ||
48 | #define gk20a_regs(gk20a) (container_of(gk20a, struct nvgpu_os_linux, g)->regs) | ||
49 | #endif | ||