diff options
| author | Arthur Hanson Rasmusson <arthur@vgpu.io> | 2026-09-13 19:18:21 -0400 |
|---|---|---|
| committer | Arthur Hanson Rasmusson <arthur@vgpu.io> | 2026-09-13 19:18:21 -0400 |
| commit | 7adef330df18691acabda9f5c988742f23a2917d (patch) | |
| tree | c115789b526840fbbec1056ab67b2a9a9d94f963 /kernel/gsp_rpc_client.h | |
| parent | 8e64754d9980d2423f1907ae184ec46e63e5ff7e (diff) | |
| download | open-iov-7adef330df18691acabda9f5c988742f23a2917d.tar.gz open-iov-7adef330df18691acabda9f5c988742f23a2917d.zip | |
Phase 3: RPC Handler Completion
- Enhanced gsp_rpc_client.c with proper emulation implementations:
- ALLOC/FREE: VRAM allocation tracking with host page allocation and DMA mapping
- MAP/UNMAP: GPU VA mapping management
- PIN/UNPIN: DMA address retrieval for pinned pages
- SCHEDULE/YIELD: Local workqueue-based scheduling
- NOTIFY: Callback registration for async events
- Added emulation function declarations to gsp_rpc_client.h
- Exported nv_vgpu_simple_mapping struct in memory.h for cross-file use
- Updated RPC handlers to use gsp_rpc_emulation_is_enabled() accessor
- All 12 RPC types now have functional emulation fallbacks
Diffstat (limited to 'kernel/gsp_rpc_client.h')
| -rw-r--r-- | kernel/gsp_rpc_client.h | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/kernel/gsp_rpc_client.h b/kernel/gsp_rpc_client.h index 64bfe5b..54c216e 100644 --- a/kernel/gsp_rpc_client.h +++ b/kernel/gsp_rpc_client.h @@ -314,4 +314,40 @@ int gsp_wpr_scratch_mutex_release(struct gsp_client *client, u32 wpr_id); void gsp_rpc_emulation_set(bool enable); bool gsp_rpc_emulation_is_enabled(void); +/* Emulation implementations */ +int gsp_rpc_alloc_emul(struct gsp_client *client, + u64 size, u64 alignment, u32 mem_type, + u32 flags, u64 addr_hint, u32 pid, + u64 *gpu_va, u64 *handle, u64 *actual_size); +int gsp_rpc_free_emul(struct gsp_client *client, u64 handle); +int gsp_rpc_map_emul(struct gsp_client *client, + u64 handle, u64 gpu_va, u64 size, + u32 prot, u32 flags, u64 offset, + u64 *mapped_va); +int gsp_rpc_unmap_emul(struct gsp_client *client, u64 handle, u64 gpu_va, u64 size); +int gsp_rpc_pin_emul(struct gsp_client *client, + u64 handle, u64 offset, u64 size, + u32 flags, u64 *dma_addr, u32 *num_pages); +int gsp_rpc_unpin_emul(struct gsp_client *client, u64 handle, u64 offset, u64 size); + +/* Notification */ +int gsp_rpc_notify_register(struct gsp_client *client, + u32 type, + void (*callback)(struct gsp_client *, + struct gsp_rpc_response *, + void *), + void *ctx); +void gsp_rpc_notify_unregister(struct gsp_client *client, u32 type); +void gsp_handle_notification(struct gsp_client *client, struct gsp_rpc_msg *msg); + +/* Client lifecycle */ +struct gsp_client *gsp_client_init(struct device *dev, phys_addr_t fw_base, phys_addr_t doorbell); +void gsp_client_fini(struct gsp_client *client); + +/* WPR Management */ +int gsp_wpr_write_mutex_acquire(struct gsp_client *client, u32 wpr_id); +int gsp_wpr_write_mutex_release(struct gsp_client *client, u32 wpr_id); +int gsp_wpr_scratch_mutex_acquire(struct gsp_client *client, u32 wpr_id); +int gsp_wpr_scratch_mutex_release(struct gsp_client *client, u32 wpr_id); + #endif /* _GSP_RPC_CLIENT_H_ */ |
