From 8340d234d78a7d0f46c11a584de538148b78b7cb Mon Sep 17 00:00:00 2001 From: Joshua Bakita Date: Wed, 25 Sep 2024 15:58:37 -0400 Subject: 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. --- nvdebug_linux.h | 12 ------------ 1 file changed, 12 deletions(-) (limited to 'nvdebug_linux.h') 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) { // module. return (uintptr_t)pde_data(file_dentry(f)->d_parent->d_inode); } - -#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,6,0) -// Commit 643eb158a3 in nvgpu moved the mapped registers to the second entry -// of the gk20a struct (after a function pointer). This change was made as L4T -// was upgraded from Linux 4.9 to 5.10 (r32 -> r34+) -// Note that this is wrong if nvgpu was built without CONFIG_NVGPU_NON_FUSA -// i.e. if FUSA was enabled, this is wrong. -#define gk20a_regs(gk20a) (*(void**)((void*)gk20a + sizeof(void(*)(void)))) -#else -#include // For struct nvgpu_os_linux, which holds regs -#define gk20a_regs(gk20a) (container_of(gk20a, struct nvgpu_os_linux, g)->regs) -#endif -- cgit v1.2.2