/* SPDX-License-Identifier: GPL-2.0 */ #ifndef _GSP_SEMA_SERVICE_H_ #define _GSP_SEMA_SERVICE_H_ /* * Emulated-GPU progress service: discovers the guest's GPU-VA -> guest-PA * mapping and applies the copy-engine semaphore releases found in mapped * pages, so that the guest's UVM progress waits complete. * * See gsp_sema_service.c for the full description. */ /* * A guest channel, registered when the driver allocates it. The service uses * the channel's GPFIFO + USERD to notice submissions as they happen (instead * of discovering the pushed work by scanning guest RAM) and to run the pushed * work promptly. * * All addresses are guest-physical except gpfifo_va, which is the GPU VA of * the channel's GPFIFO ring (translated through the discovered VA->PA map). */ struct sema_channel_desc { u32 h_object; u32 engine_type; u64 gpfifo_va; u32 gpfifo_entries; u64 userd_pa; /* NvA06FControl: GPGet @0x88, GPPut @0x8c */ u32 userd_as; /* NV_ADDR_SYSMEM(1) / NV_ADDR_FBMEM(2) */ u64 instance_pa; u64 notifier_pa; }; void gsp_sema_service_channel_add(const struct sema_channel_desc *desc); void gsp_sema_service_channel_del(u32 h_object); int gsp_sema_service_start(void); void gsp_sema_service_stop(void); int gsp_sema_service_probe(u64 gpu_va, u32 count); #endif /* _GSP_SEMA_SERVICE_H_ */