mirror of
https://github.com/lemonade-sdk/mac_linuxgpu.git
synced 2026-11-22 23:57:31 -10:00
What a full userspace driver needs from the CS fixture device and the loopback transport: - The fixture reports what gfx_v12_0 reads from an R9700 (Navi 48, gfx1201): shader engine and array layout, CU bitmap, render backends, caches, clocks, firmware versions, and GB_ADDR_CONFIG through AMDGPU_INFO_READ_MMR_REG (the values of Mesa's gfx1201 profile). Without a read_register callback that query dereferenced NULL. - cs_fixture_model_driver_streams(): the software GPU follows chained IBs, executes DMA_DATA (CP DMA fills and copies) and driver RELEASE_MEM packets, counts dispatches without running them, and skips the register state, cache and event packets it does not model. Off by default, so the existing tests still abort on an unexpected packet. - cs_fixture_bar_memory() and lx_loopback_set_bar_memory(): the loopback maps VRAM through the aperture, and buffers whose pages are scattered, by gathering their ranges into one region with Mach VM, as the dext maps them through IOKit. - The loopback transport reports the fixture's PCI identity.
24 lines
923 B
C
24 lines
923 B
C
/* A libmlg_drm transport over the in-process Linux-file core
|
|
* (lx_loopback.c), for tests that run a libmlg_drm client against a
|
|
* fixture device. Shared by kernel-side and client-side translation
|
|
* units: no kernel types. */
|
|
#ifndef LX_LOOPBACK_H
|
|
#define LX_LOOPBACK_H
|
|
|
|
#include <stdint.h>
|
|
|
|
struct pci_dev;
|
|
struct mlg_transport;
|
|
|
|
/* Create the client's Linux process on @pdev's GPU and fill @out. */
|
|
int lx_loopback_transport(struct pci_dev *pdev, struct mlg_transport *out);
|
|
void lx_loopback_exit(void);
|
|
unsigned int lx_loopback_async_calls(void);
|
|
unsigned int lx_loopback_open_files(void);
|
|
/* Map BAR-backed mappings (VRAM through the aperture) as well: @fn returns
|
|
* the host memory behind @bytes at @offset of BAR @bar, or NULL. Without
|
|
* it such mappings fail with ENODEV. Ranges must be host-page aligned. */
|
|
void lx_loopback_set_bar_memory(void *(*fn)(uint32_t bar, uint64_t offset, uint64_t bytes));
|
|
|
|
#endif
|