mirror of
https://github.com/lemonade-sdk/mac-amdgpu.git
synced 2026-11-23 04:29:26 -10:00
Correct firmware acknowledgements, GPU address translation, MES queue setup, SDMA and CP submission, and driver session teardown. Add runtime identity checks, host diagnostics, checked GART mapping lifetime, and reusable aligned aperture reservations. Record build 172 hardware acceptance and build 173 allocator validation. Add 19 regression suites covering packet layouts, firmware sequencing, command-ring reuse, mapping failure retention, and lifecycle behavior.
66 lines
2.4 KiB
Plaintext
66 lines
2.4 KiB
Plaintext
//
|
||
// MacAMDGPUUserClient.iig — Per-process IPC endpoint.
|
||
//
|
||
// Phase 1A surface (this commit):
|
||
// Ping — round-trip plumbing test
|
||
// GetIdentity — bus/dev/fn + VID/DID/class code
|
||
// GetBARInfo — per-BAR memoryIndex/size/type
|
||
// SetupInterrupts — allocate MSI-X vectors + IRQ shared page
|
||
// WaitInterrupt — async block until any enabled vector fires
|
||
// SetIRQMask — write irqEnabled bitmap (4×u64 = 256 bits)
|
||
// AllocateDMABuffer — single contiguous DMA buffer per client
|
||
// FreeDMABuffer
|
||
// ResetDevice — FLR → hot-reset fallback
|
||
// CopyClientMemoryForType — BAR0..5, DMABuffer, IRQState
|
||
//
|
||
// Reserved for follow-up commits / Phase 1B:
|
||
// Claim / Terminate — explicit PCI Open/Close
|
||
// MMIORead / MMIOWrite — slow path; ICD prefers BAR mmap
|
||
// ConfigRead / ConfigWrite — config space slow path
|
||
// submit_cs / wait_fence / alloc_bo — amdgpu UAPI
|
||
// DART iova region management — for GART page tables
|
||
//
|
||
|
||
#ifndef MacAMDGPUUserClient_h
|
||
#define MacAMDGPUUserClient_h
|
||
|
||
#include <Availability.h>
|
||
#include <DriverKit/IOUserClient.iig>
|
||
#include <DriverKit/IOInterruptDispatchSource.iig>
|
||
|
||
class MacAMDGPUUserClient: public IOUserClient
|
||
{
|
||
public:
|
||
virtual kern_return_t Start(IOService *provider) override;
|
||
virtual kern_return_t Stop(IOService *provider) override;
|
||
|
||
// Local completion after all interrupt callbacks have drained.
|
||
void FinishStop(IOService *provider) LOCALONLY;
|
||
|
||
virtual kern_return_t
|
||
ExternalMethod(uint64_t selector,
|
||
IOUserClientMethodArguments *arguments,
|
||
const IOUserClientMethodDispatch *dispatch,
|
||
OSObject *target,
|
||
void *reference) override;
|
||
|
||
virtual kern_return_t
|
||
CopyClientMemoryForType(uint64_t type,
|
||
uint64_t *options,
|
||
IOMemoryDescriptor **memory) override;
|
||
|
||
virtual void
|
||
AsyncCompletion(OSAction *action,
|
||
IOReturn status,
|
||
const IOUserClientAsyncArgumentsArray asyncData,
|
||
uint32_t asyncDataCount) override;
|
||
|
||
virtual void
|
||
InterruptOccurred(OSAction *action,
|
||
uint64_t count,
|
||
uint64_t time)
|
||
TYPE(IOInterruptDispatchSource::InterruptOccurred);
|
||
};
|
||
|
||
#endif /* MacAMDGPUUserClient_h */
|