mirror of
https://github.com/QuixiAI/nvdriver.git
synced 2026-12-06 06:28:39 +00:00
Cherry-picked MIT-clean pieces from PR #25: - rmapi_node.c/.h: add nv_rs_rmapi_file_post() and report posted dataless OS events once in nv_rs_rmapi_poll() (EPOLLPRI | EPOLLIN, matching stock nvidia_poll). - rmapi/gpu.rs: add GpuFacts::is_ga10x(), allow GA10x in MMU v2 vaspace/video memory paths, add Turing/Ampere usermode window 0xc461/0xc561 (0xbb_0000), and RM_USER_SHARED_DATA (0xde). Co-authored-by: Kamil Skowron <1019893+Cinderella-Man@users.noreply.github.com>
32 lines
1.9 KiB
C
32 lines
1.9 KiB
C
/* SPDX-License-Identifier: MIT */
|
|
#ifndef NV_RS_RMAPI_NODE_H
|
|
#define NV_RS_RMAPI_NODE_H
|
|
struct device;
|
|
struct pci_dev;
|
|
struct nv_rs_gpu_owner;
|
|
/* RM API nodes of the Rust driver: the control node /dev/nvidia-rs-rmapi-ctl and one device
|
|
* node /dev/nvidia-rs-rmapi-gpu<minor> per listed GPU. They speak the escape protocol of the
|
|
* original's nodes as far as the implementation notes say; they do not use the original's
|
|
* names or major number. Process context only. */
|
|
int nv_rs_rmapi_node_init(void);
|
|
void nv_rs_rmapi_node_exit(void);
|
|
/* A PCI function this driver has bound becomes visible to NV_ESC_CARD_INFO and the
|
|
* probed-GPU controls and gets its device node. `boot0` is PMC_BOOT_0 as the probe read
|
|
* it. Returns the minor number assigned to it or a negative errno. */
|
|
int nv_rs_rmapi_node_gpu_add(struct pci_dev *pdev, u32 boot0);
|
|
/* Register access for the listed GPU: `read32(cookie, offset, &value)` reads one BAR0
|
|
* register. It is called under the node lock, only at the first open of the GPU's device
|
|
* node, for the read-only registers the Rust side names (the Jtag word 0x1373a0 and the
|
|
* display fuse word 0x21c04 of a GV100). `release(cookie)` is called once, outside the lock,
|
|
* when the GPU leaves the node (nv_rs_rmapi_node_gpu_remove or node exit). */
|
|
int nv_rs_rmapi_node_gpu_reader(struct pci_dev *pdev,
|
|
int (*read32)(void *cookie, u64 offset, u32 *value),
|
|
void (*release)(void *cookie), void *cookie);
|
|
int nv_rs_rmapi_node_gpu_runtime(struct pci_dev *pdev, struct nv_rs_gpu_owner *owner);
|
|
void nv_rs_rmapi_node_gpu_remove(struct pci_dev *pdev);
|
|
struct device *nv_rs_rmapi_gpu_device_get(u32 gpu_id);
|
|
void nv_rs_rmapi_file_post(u64 owner);
|
|
void nv_rs_rmapi_gpu_negotiate_dma(u32 gpu_id, unsigned int bits);
|
|
u32 nv_rs_rmapi_handle_rc_fault(u32 gpu_id, u64 inst_ptr, u64 fault_va, u32 xid_code);
|
|
#endif
|